Polargraph Wall Draw Bot 2023
by JanosN4 in Circuits > Arduino
11161 Views, 205 Favorites, 0 Comments
Polargraph Wall Draw Bot 2023
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:
- Arduino IDE (1.8+)
- GRBL-Polargraph fork - firmware for the Arduino module
- Universal GCode Sender - to control and send g-codes to the Arduino module
- InkScape vector drawing program with G-Code plugin to create G-Code (optional)
Hardware - Mechanics
- Print and assemble the motor and mounts, see thingiverse model and page at https://www.thingiverse.com/thing:3440067
- 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
- Remember to order parts: screws, nuts, idler wheel
- For the motor you can use a 20T gear for GT2 belts
- My servo motor shaft was 22 mm, make sure to print the correct model
- Attach the motor mounts to the frame (or wall) with screws
- Print and assemble the Gondola
- Model: https://www.thingiverse.com/thing:16692
- 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
- Add some weights to the bottom: used batteries, coins
- Use a threaded insert or nut and an M4 screw to create a fastener system for the pen
- Insert a marker pen
- Use (several) servo extension cables to make sure you have enough wire between the gondola servo and the controller
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).
- 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
- 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
- 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-
- 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.
Firmware for Arduino
- Install Arduino IDE (1.8+)
- Get the GRBL fork source code from https://github.com/john4242/grbl-polargraph
- Copy the GRBL source code library:
- From the source tree\grbl
- To the arduino library folder, on windows this is User home\Documents\Arduino\libraries\grbl
- You should see files in that folder like config.h, cpu_map.h, etc.
- Restart Arduino IDE
- Open File -> Examples -> grbl -> grplUpload
- This will load the grbl upload sketch
- Make sure the board is configured, Tools -> Board
- Board: Arduino Nano
- Processor: Atmega328P - if you have a clone you might need (Old Bootloader)
- Port: COM6 - or whatever your port is
- Press upload, this will compile the source code and upload it to the Arduino Nano.
- 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.
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:
- Select the COM port, baud on top and press the Connect icon (to the left)
- This will connect and show you the GRBL version and current parameters
- Check parameters, especially $28, $29 (width of your board in millimeters, vertical home distance).
- Check the steps/millimeters settings ($100,$101)
- 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
- 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
- Try to move the gondola around using the Jog controls. Set Step size XY to 10 millimeters.
- When you press Y+ the gondola should move down
- If the gondola moves up, both motors need direction reversing
- If the gondola moves left or right, one motor direction needs reversing
- When you press X- the gondola should move left and right for X+
- Move the gondola somewhat down and optionally a bit left, then issue the "set home here" command in the Console window prompt
- G92 X0 Y0
- Load the sample gcode with the file open icon (top left in UGS)
- Once this is done, you will see the gcode appear (top middle in UGS) and the image preview (top right)
- Press "Play" icon on the top toolbar to start sending of the loaded gcode image. This will start the printing.
- Once it is finished, you can issue the "reset gcode offset to original" command in the console:
- G92.1
- 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)
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.