Drawing Robot Board (Polargraph Plotter)
by MertArduino in Circuits > Arduino
9230 Views, 162 Favorites, 0 Comments
Drawing Robot Board (Polargraph Plotter)
Hi friends! I will show you how to build and use a plotter to draw vector or polar plotter images in this project. A polar graph machine uses two centered coordinates to generate drawings using a pen suspended on belts attached to two pulleys above the drawing surface. I will start this project by first printing the necessary 3D parts and building the structure of the plotter, and then I will continue with the electronics and software part later in the project.
3D Parts and Building the Structure
3D models are printed in medium-quality without support. Screw types are M3 but sizes may vary, use only those that are compatible in your workshop. Bearings were used purely for weight purposes, you can use suitable bearings or bolt nuts for gondolas and belts. If the whiteboard frame is made of aluminum, you can fix the motor holders with glue instead of screws. In the shared images and video, the motor holder and the Gondola assembly are shown step by step.
- Dry Erase White Board, 24 x 18-inch - https://amzn.to/3wRoXY9
- GT2 Timing Belt Pulley 16 Teeth 5mm Bore - https://amzn.to/3X30UA1
- GT2 Timing Belt 6mm Width - https://amzn.to/3x3XTVw
- 28BYJ-48 ULN2003 5V Stepper Motor - https://amzn.to/3KuDNa2
- 624ZZ Ball Bearing 4mm x 13mm x 5mm - https://amzn.to/3xdhen4
- 3D Printer - https://amzn.to/3yUe2gB
- PLA Filament 1.75mm Purple - https://amzn.to/4e8tR3r
- MG90s Servo Motor - https://amzn.to/4ebNZBO
Electronics - Printed Circuit Board
Now we come to the electronic part of the project, due to the large size of the source code we will use an Arduino UNO board based on Atmega328P and a ULN2003 motor driver for the stepper motors. You can build the circuit on a breadboard, but I prefer to design a printed circuit board for a more professional prototype.
I share my printed circuit board designs as open source on PCBWay's project sharing page, where you can easily order the printed circuit boards I use in my projects, both assembled and empty PCBs. You can choose PCBWay for low-budget and high-quality printed circuit boards.
Let's continue the project by soldering the components used in the printed circuit board, all the necessary components are listed below. You can also find all the details of the PCB by visiting the PCBWay link.
- Atmega328P-PU Microcontroller DIP28 - https://amzn.to/3V50JBH
- CH340G SOP-16 USB to Serial Adapter IC - https://amzn.to/3Vpc7tt
- Electrolytic Capacitors Kit (10uF 16V) - https://amzn.to/4e7wiDl
- Multilayer Ceramic Capacitor Kit (22pF, 10nF, 100nF) - https://amzn.to/456I0dB
- JST-XH Connector Kit (XH-5A) - https://amzn.to/3KuXAGw
- 2.54mm Male and Female Pin Header Kit - https://amzn.to/3yMxGva
- 5mm LED Light Emitting Diode - https://amzn.to/3VbMta2
- Carbon Film Resistors (220, 1K, 10K) - https://amzn.to/3Voxhb0
- Screw Terminal Block Connector (5mm 2 Pin) - https://amzn.to/3X7uwMr
- USB Type B Female Port 4-Pin - https://amzn.to/4b318ut
- Crystal Oscillator Kit (16MHz, 12MHz) - https://amzn.to/4bLKwbw
- Soldering Iron Kit - https://amzn.to/4aPQRl3
Stepper Motor Testing and Final Touches
After soldering, I checked that the circuit board was working smoothly by uploading a simple stepper motor code at this stage. Then we continue the project by mounting the circuit board on the panel. Our panel is almost ready, but first I printed 4 legs using a 3D printer and assembled them to make the panel stand. I added a few more nuts to both belts and bearings to the gondola to make the pen more stable.
Pen Down and Pen Up
At this stage, I add a paperclip to the servo motor arm to control the pen. The paperclip was used to adjust the servo motor arm to the appropriate length, you can come up with different solutions if you want. Then I load a simple servo motor code to get the minimum and maximum angle of the servo arm, so we get the required angle range for the pen to touch the panel surface up and down. Finally, I attached a drawing sheet to the panel surface.
Downloads
Programming (Side of Arduino IDE)
Download the Arduino IDE 1.8.5
In the source code section, first download and install the previous version of the Arduino IDE 1-8-5. Polargraph code is more stable and without errors in this version. When you first run the Arduino code editor, you will see that the Sketchbook section is still empty. First, go to the preferences, keep your Sketchbook location in mind, and then exit the code editor.
Download the Polargraph Code Bundle
Then download the Polargraph Bundle ZIP file containing the source code. Since ZIP files are not supported here, I had to add them to PCBWay's project page. You can also access the original code files by going directly to GitHub, but I have revised the Arduino code according to the hardware used in this project and I have shared the revised version with you.
Follow the Steps
- Copy the Arduino libraries inside it, go to your Sketchbook location, and paste them into the Arduino libraries folder.
- Then go back to the shared source code folder and copy and paste the Arduino Polar Graph Server folder into the Arduino folder in your Sketchbook location.
- When you re-open the Arduino code editor, you will see the Polar Graph Server code in the Sketchbook section.
- Open the Polar Graph server code, the important point here is that I have updated the “Configuration” section according to the current project components and shared the updated code with you. I do not recommend making changes, but you can update the stepper motor direction pins if your motors move in the opposite direction.
- Now we can upload the code to the board, select the board type (Arduino UNO) and the port it is connected to, and then press the upload button.
- Once the upload is complete, open the Serial Monitor and update the Baud Rate (57600) to see if the code is executing correctly, if everything is okay you will get a “READY” message as shown on the screen.
That's it for the Arduino source code, now let's move on to the Polar Graph software.
Programming (Side of Processing IDE)
The Processing editor is required to run the Polar Graph software. Go to Processing and download version 2-2-1, then move the downloaded Processing folder to your “My Documents” location and run Processing, you will be given a message to “Create a Sketchbook folder”, and click “Done” to complete the installation. When the editor opens you will again see that the Sketchbook section is empty, go to properties find your Sketchbook location, and exit the editor.
- Go to the shared source code folder and copy the Processing libraries, then go to Processing's Sketchbook location and paste them into the libraries folder.
- Turn to the shared source code folder and copy the Polar Graph controller folder, then paste it into your Processing Sketchbook location.
- Run the Processing editor, go to the Sketchbook section, and open the Polar Graph code.
You don't need to make any changes, just run the code, you may get a warning message, but after giving the necessary permissions the Polar Graph software will run.
Polargraph Software and Draw Vector
Polargraph opens with default properties and contains three main elements in the interface. The control panel with all buttons on the far left, the middle part, the gray rectangle representing the machine itself, and the command queue on the right side of the machine. You can zoom in and out of the machine surface using the scroll wheel of the mouse and you can “grab” and move the machine surface using the middle mouse button.
The setup section is used to define the machine configuration. I'm uploading my already-defined setup file for this project, and I've shared this configuration file with you. As you can see, when I uploaded the file, the dimensions of the machine and the page area changed.
There is a Home Point on the machine, this represents the starting point of the pen. This is also the starting point of the page. The Page and Home position of the project is approximately 120 millimeters. To find this value, place a horizontal line between the two motor gears and a vertical line 120 millimeters down from the midpoint of this line, the point where the vertical line ends is where you will place the pen. After placing the pen and updating the value, don't forget to press the Center Page and Center Home point buttons.
Here we update the Servo motor angles we obtained earlier for pen down and pen up movement. Then we make the serial connection of the board. If the connection is successful, you will see that the Connection message turns green and the machine is ready. Then I start the command queue by clicking on it so that every change I make will be sent to the machine directly. Now, to test that the servo positions are working correctly, I first send the lift range to the machine, then press the Test Lift Range button and observe that the servo motor and pen movement are working correctly. If you have built a different machine, you can update the required values via these buttons. If you make changes, send the machine settings to the machine and save your settings.
We are in the Input section, the purple circle on the screen symbolizes the pen, the point where the pen is located is defined to the machine by pressing the Set Home and Set Pen Position buttons.
If you want to test that the motors are moving in the correct direction, you can use the Move Pen to Point button. By selecting the point on the page surface where you want the pen to move, you can observe the motor and pen movements.
Using the Return to Home button, you can move the pen back to the Home point. This will confirm that the pen has correctly reached the home point.
The machine is working correctly and properly on the hardware side. Now let's look at the drawing side, you can upload an image file and enter Polargraph settings to create Polargraph images. However, creating a Polargraph image is a bit complicated and requires some knowledge. For now, I will show you how to create a vector drawing.
Load the image with the Load Vector button, then move the image to the drawing area with the Move Vector button. Adjust the image size with the Resize Vector button, then select the drawing area with the Select Area button and define the drawing area with the Set Frame to Area tool. Finally, click the Draw Vector button, and when you look at the command queue, you will see that the drawing has started. We have come to the end of another project, I hope it was a useful Instructables for you. Thanks for reading.