Drawing Robot Board (Polargraph Plotter)

by MertArduino in Circuits > Arduino

6879 Views, 131 Favorites, 0 Comments

Drawing Robot Board (Polargraph Plotter)

Drawing Robot

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

Ekran Resmi 2024-05-31 08.29.21.png
Ekran Resmi 2024-05-31 08.31.24.png
Ekran Resmi 2024-05-31 08.31.36.png
Ekran Resmi 2024-05-31 08.31.55.png
Ekran Resmi 2024-05-31 08.32.25.png
Ekran Resmi 2024-05-31 08.32.38.png
Ekran Resmi 2024-05-31 08.34.26.png
Ekran Resmi 2024-05-31 08.34.55.png
Ekran Resmi 2024-05-31 08.35.26.png
Ekran Resmi 2024-05-31 08.36.18.png
Ekran Resmi 2024-05-31 08.37.13.png
Ekran Resmi 2024-05-31 08.37.31.png
Ekran Resmi 2024-06-03 00.30.49.png
Ekran Resmi 2024-06-03 00.31.14.png
Ekran Resmi 2024-06-03 00.31.33.png
Ekran Resmi 2024-06-03 00.32.23.png
Ekran Resmi 2024-06-03 00.32.44.png
Ekran Resmi 2024-06-05 12.01.21.png

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.

Electronics - Printed Circuit Board

Ekran Resmi 2024-06-05 12.03.19.png
Ekran Resmi 2024-06-03 00.35.12.png
Ekran Resmi 2024-06-03 00.33.40.png
Ekran Resmi 2024-05-31 11.36.35.png
Ekran Resmi 2024-06-03 00.33.55.png
Ekran Resmi 2024-06-03 00.34.47.png
Ekran Resmi 2024-05-31 11.49.34.png
Ekran Resmi 2024-05-31 11.50.00.png

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.


Stepper Motor Testing and Final Touches

Ekran Resmi 2024-05-31 11.51.35.png
Ekran Resmi 2024-06-05 12.03.58.png
Ekran Resmi 2024-06-05 12.04.29.png
Ekran Resmi 2024-06-05 12.05.17.png
Ekran Resmi 2024-06-05 12.06.12.png
Ekran Resmi 2024-06-05 12.06.26.png
Ekran Resmi 2024-06-05 12.07.27.png

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

Ekran Resmi 2024-06-03 00.37.27.png
Ekran Resmi 2024-06-03 00.37.41.png
Ekran Resmi 2024-06-03 00.37.58.png
Ekran Resmi 2024-06-03 00.38.21.png
Ekran Resmi 2024-06-05 12.41.24.png
Ekran Resmi 2024-06-03 00.38.41.png
Ekran Resmi 2024-06-05 12.42.00.png

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.

Programming (Side of Arduino IDE)

Ekran Resmi 2024-06-03 00.40.16.png
Ekran Resmi 2024-06-05 13.13.43.png
Ekran Resmi 2024-06-05 13.14.11.png
Ekran Resmi 2024-06-05 13.15.00.png
Ekran Resmi 2024-06-05 13.15.58.png
Ekran Resmi 2024-06-05 13.16.30.png
Ekran Resmi 2024-06-05 13.17.15.png
Ekran Resmi 2024-06-05 13.17.49.png
Ekran Resmi 2024-06-05 13.18.43.png
Ekran Resmi 2024-06-05 13.19.23.png
Ekran Resmi 2024-06-05 13.20.08.png
Ekran Resmi 2024-06-03 00.41.08.png
Ekran Resmi 2024-06-03 00.41.43.png

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)

Ekran Resmi 2024-06-05 13.21.26.png
Ekran Resmi 2024-06-05 13.21.53.png
Ekran Resmi 2024-06-05 13.22.27.png
Ekran Resmi 2024-06-05 13.23.09.png
Ekran Resmi 2024-06-05 13.24.22.png
Ekran Resmi 2024-06-05 13.24.43.png
Ekran Resmi 2024-06-05 13.25.12.png
Ekran Resmi 2024-06-05 13.25.43.png
Ekran Resmi 2024-06-05 13.26.16.png
Ekran Resmi 2024-06-05 13.26.47.png
Ekran Resmi 2024-06-05 13.27.28.png
Ekran Resmi 2024-06-05 13.27.54.png
Ekran Resmi 2024-06-05 13.28.47.png
Ekran Resmi 2024-06-05 13.29.40.png

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

Ekran Resmi 2024-05-31 08.25.21.png
Ekran Resmi 2024-06-05 13.30.11.png
Ekran Resmi 2024-06-05 13.30.41.png
Ekran Resmi 2024-06-05 13.31.06.png
Ekran Resmi 2024-06-05 14.03.15.png
Ekran Resmi 2024-06-03 00.43.25.png

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.