Introduction: Polargraph Wall Draw Bot 2023

About: I am a software developer, but I like to hack around with Arduino, ESP and Raspberry Pi stuff. I think it's a great invention that enables beginners and intermediate level people to get involved and start crea…

Polargraphs (XY vertical plotters, draw bots) were trending in 2016-2018 but projects stopped after and software and hardware was not improved anymore, so it became harder to gather all the materials and instructions to build one. 3D printing and components was also less available at that time.

This instructable collects one recent example on how to build the polargraph. Instead of going with the Arduino polargraph code and polargraph Processing PC software (which only runs in Processing v2 and not v4) my solution was to fork and modify GRBL (CNC printer) Arduino firmware to add polargraph motor control support and for the hardware I went with the most readily available and affordable components.

Some parts have to be 3D printed in this instruction, as they are not too many you could ask a friend or a service if you don't have a 3D printer -- though much more recommended to get one, it's worth it for tinkering projects.

Since there was no readily usable GRBL version, I created my own fork: https://github.com/john4242/grbl-polargraph

Supplies

For the physical hardware parts:

  • Motor mounts with motor and 20T gear
  • 3D model: [Polargraph / Vertical Plotter Spring Tensioned Motor Mount] ( https://www.thingiverse.com/thing:3440067 )
  • Motor: NEMA17 1.8 degree motor, example: "Nema 17 Stepper Motor 44Ncm 1.7A 38mm 12V 4-wire w/ 1m Cable for CNC 3D Printer"
  • M4x16, M4x12 screws and nuts, spring
  • 20T (20 tooth GT2) gear
  • 623-RS or 623-ZZ bearings
  • Wood screws for mounting
  • Gondola with servo motor and pen
  • Kritzlerbot Polargraph (printable) https://www.thingiverse.com/thing:16692
  • SG90 servo, example item: "Mini SG90 Micro Servo Motor 9G RC Robot Arm Helicopter Airplane Remote Control"
  • Servo extension cables
  • Belt (GT2)
  • Example item: "GT2 6mm Timing Belt and 20 Teeth 5mm Bore Pulleys Prusa Reprap 3D printer part"

Electronics:

  • Arduino Nano (mini USB connector)
  • 12V Power supply unit (barrel), 2A minimum, 3A recommended
  • CNC Shield V4
  • 2 x Stepper motor driver modules A4988

Software:

Step 1: Hardware - Mechanics

  1. Print and assemble the motor and mounts, see thingiverse model and page at https://www.thingiverse.com/thing:3440067
  2. While you could get away with a simpler motor mount and a counter-balance, I fully recommend going with this design as you won't need a counterbalance and it is less likely to slip and skip steps
  3. Remember to order parts: screws, nuts, idler wheel
  4. For the motor you can use a 20T gear for GT2 belts
  5. My servo motor shaft was 22 mm, make sure to print the correct model
  6. Attach the motor mounts to the frame (or wall) with screws
  7. Print and assemble the Gondola
  8. Model: https://www.thingiverse.com/thing:16692
  9. Mount the SG90 servo motor. You might want to extend the servo arm to be longer, either melt plastic, add a wire or find a model
  10. Add some weights to the bottom: used batteries, coins
  11. Use a threaded insert or nut and an M4 screw to create a fastener system for the pen
  12. Insert a marker pen
  13. Use (several) servo extension cables to make sure you have enough wire between the gondola servo and the controller

Step 2: Hardware - Electronics

I have chosen the CNC shield v4 as it was cheaply available and it needs (almost) no soldering. Because there are design problems with the board it does need some fixing, which means soldering a wire and removing the MS1/2/3 jumpers. Soldering a wire will set the MS1/2/3 inputs for the A4988 driver module. A good description of issues and how to fix the board: How-to-Use-the-CNC-V4-Board-despite-Its-quirks (Instructables)

  • Make sure to remove all those jumpers! (3 jumpers next to each other in a group, all three groups under the driver modules)!
  • Solder all 3 adjacent pins (for each group), those go to the MS1/MS2/MS3 in the modules
  • Use a multimeter to check there is no short circuit between +5V and GND

If you don't want to solder things can still work, but without microstepping. Microstepping divides each stepper motor step into 16 micro-steps, so you get more resolution. When using a 20T gear, you will have to set 80 steps/millimeter (if using microstepping) or 5 steps/millimeter (if you didn't choose to solder).

  1. Assemble the CNC board, Arduino Nano and CNC shield v4. Make sure to plug in the A4988 driver modules the right way! You only need X and Y axis modules
  2. Plug in the 4-wire connectors for the X and Y stepper motors. If the motor direction is wrong, you can just turn the connector around 180 degrees
  3. To connect the servo, connect the cables as on the picture, make sure the red wire goes to a +5V pin, the brown to a GND and the servo signal (yellow) to Z-
  4. Your servo cable could have different colors, in that case make sure to identify which one is which

You don't have to use CNC shield v4, you could do similar wiring yourself on a breadboard or use another controller board, just make sure the pin connections are the same (see image with pin connections)

You might need to adjust the A4988 servo driver board motor current with the small potentiometer, there are instructions on how to do this.

Step 3: Firmware for Arduino

  1. Install Arduino IDE (1.8+)
  2. Get the GRBL fork source code from https://github.com/john4242/grbl-polargraph
  3. Copy the GRBL source code library:
  4. From the source tree\grbl
  5. To the arduino library folder, on windows this is User home\Documents\Arduino\libraries\grbl
  6. You should see files in that folder like config.h, cpu_map.h, etc.
  7. Restart Arduino IDE
  8. Open File -> Examples -> grbl -> grplUpload
  9. This will load the grbl upload sketch
  10. Make sure the board is configured, Tools -> Board
  11. Board: Arduino Nano
  12. Processor: Atmega328P - if you have a clone you might need (Old Bootloader)
  13. Port: COM6 - or whatever your port is
  14. Press upload, this will compile the source code and upload it to the Arduino Nano.
  15. You are done. You can optionally open the Arduino Serial Console (icon/menu), make sure speed is set to 115200 and you should see the boot up text: "Grbl" appearing.

Step 4: Software - Universal GCode Sender

Download UGS from: https://winder.github.io/ugs_website/

Once the firmware is uploaded and the 12V power supply is plugged in as well as the USB to the PC, you can start Universal GCode Sender (from bin\ugsplatform64.exe - on Windows)

There are some sample g-code files in the grbl fork source tree:

  • sample_print_gcodes/hamburger_complex.gcode - Complex hamburger gcode file
  • sample_print_gcodes/hamburger_simple.gcode - Simple hamburger gcode file

Quickstart guide to UGS:

  1. Select the COM port, baud on top and press the Connect icon (to the left)
  2. This will connect and show you the GRBL version and current parameters
  3. Check parameters, especially $28, $29 (width of your board in millimeters, vertical home distance).
  4. Check the steps/millimeters settings ($100,$101)
  5. If (some of the) motors are going the wrong way when you move around (Y+/Y-) then you can either turn the cable connected to the CNC board or use $3 to invert directions
  6. Make sure the Gondola is in the middle top position (home position), adjust belts manually. On my printer this is X=370 (mm), Y=60 (mm), but this varies. X is always half of the width distance ($28), Y is $29
  7. Try to move the gondola around using the Jog controls. Set Step size XY to 10 millimeters.
  8. When you press Y+ the gondola should move down
  9. If the gondola moves up, both motors need direction reversing
  10. If the gondola moves left or right, one motor direction needs reversing
  11. When you press X- the gondola should move left and right for X+
  12. Move the gondola somewhat down and optionally a bit left, then issue the "set home here" command in the Console window prompt
  13. G92 X0 Y0
  14. Load the sample gcode with the file open icon (top left in UGS)
  15. Once this is done, you will see the gcode appear (top middle in UGS) and the image preview (top right)
  16. Press "Play" icon on the top toolbar to start sending of the loaded gcode image. This will start the printing.
  17. Once it is finished, you can issue the "reset gcode offset to original" command in the console:
  18. G92.1
  19. Now you can move around more and print more, but remember to always send the home (G92 X0 Y0) and then reset it (G92.1) when finished.

Configuration of GRBL parameters

  • Connect to the cnc module from Universal G-Code Sender with the appropriate port (eg. COM6). In the console window on the bottom:
  • Enter $$ to list all parameters stored in EEPROM
  • Change the parameters if needed (see image)

Step 5: Software - Inkscape

Download Inkscape from https://inkscape.org/

Documentation on how to use Inkscape to Generate Gcode

  • Install GcodePlot plugin
  • Then to save an SVG file to G-code:
  • File > Save As, 3-axis gcode plotter...
  • Change any properies as needed. Make sure to set the Cutting settings -> Lift and Down commands to the pen up/pen down gcode values
  • You will need to edit the saved .gcode file manually to remove all lines before the first "M03 S310" because the previous lines would do positioning and homing, we don't need that.
  • Alternatively you can find the plugin python source code and comment out these lines so save doesn't generate them.