Build your own Arduino-based CNC pen plotter

 Hello guys this blog post provides a complete guide regarding CNC pen plotters using Arduino.

Let’s begin with what a CNC plotter is.

CNC stands for computer numerical control. A CNC plotter machine is used to create 2-D, and 3-D images on a plain surface using a 2-D printing mechanism and microcontroller. In order to draw a desired image or piece of text, the Arduino CNC plotter moves its components in accordance with the instructions it receives.

This is a simple Arduino-based CNC pen plotter that is used to draw anything and everything you want! It is based on the design program that was input into their controller unit.

 

List of Components required

1.     Arduino UNO

2.     CNC shield

3.     a4998 driver

4.     Stepper motors

5.     Servo motor

6.     rods

7.     carbon tubes

8.     6mm rods

9.     Timing belt

10. Linear Bearing 6mm

11. Linear Bearing 12mm

12. NEMA17 stepper brackets

You can use Robu's 3d printing service to print the structure if you don't have a 3d printer:- https://robu.in/product/3d-printing-


    How to assemble?

   Take the two 3D-printed End plates. These plates are as shown in the image below.

                                END plate

We required four Linear Bearings of 12mm. Insert these bearings into the gantry, two from each side.

                                      Gantry

Next, grab two 12mm-diameter carbon tubes that are 500mm long. This tube should be inserted into the two holes in the center of the gantry.

Insert two metal rods into one end plate. These rods are smooth and specially manufactured for CNC application. Mount the gantry assembly on these rods. Apply for the End plate on another side. Now the gantry will slide on metal rods.

Now, take the slider and insert two 12mm bearings. Insert this slider on carbon tubes. Fixed the arm ends at the end of the carbon tube using bolts.

                                        Slider

Place two pulleys at the arm end and one pulley at the slider using bolts. 

ARM End 

This Arm end is attached to a carbon rod. After this part insert four pulleys in the gantry. So, it looks like as shown in the image below.


Attach a NEMA17 mounting bracket to each end plate using nuts and bolts. Attach a stepper motor to each NEMA17 mounting bracket using four bolts. Also, apply the pulley to each motor shaft.

Next, Continue to put the timing belts. The timing belt's path is shown image below. Between the two 12mm support tubes, the timing belt passes.



Now we can continue with assembling the pen holding mechanism. This mechanism required one fixed part and one sliding part.

Pen Holding Mechanism

 

     Fixed part                                                           Sliding part    

                                                     

Insert the four linear bearings into this sliding part and attach the servo motor. Also secured the pen holder part right next to the servo.



Attach the stepper motor to the fixed part. Then the lifter is simply attached to the shaft of the stepper.

Next, we connect the sliding part and fixed part together. The servo wire must first be threaded through a hole in the fixed portion, and then the 6mm rods must be inserted from the top, passing through the bearings and the hole in the fixed part. The sliding part should be pushed downward by a spring that is inserted between the fixed and sliding parts of the rod as it is being installed.

Next, we can assemble this pen holder mechanism using a pen-lift bracket that goes on the slider part of the machine.

                                        Pen lift bracket

The assembled plotter looks like the image shown below.



With this, the mechanical part is completed, and we may proceed to attach the electronics.

We are using an Arduino Uno board in combination with a CNC shield.

 Arduino CNC Shield board as a driver expansion board can be utilized for CNC, 3D printers, and engraving machines. There are four slots in all, and each one can drive an A4988 stepper motor.

Now our CNC pen plotter is completed.

The only thing left is to transform it into a true CNC machine. To accomplish this, we need to install firmware on the Arduino that will allow us to control the CNC machine's motion, as well as a control program that will allow us to transmit G-codes to the machine and instruct it on what to do.

Next, download and install this GRBL firmware into the library folder of our Arduino IDE,

The open-source GRBL firmware is the most often used option for DIY CNC machines. However, we need a modified version of it for this pen plotter so that it can manage the servo motor.

Circuit Diagram



Installing GRBL

In order to plot an image, we need to install a g-code (graphics-code) interpreter called GRBL. Perform the following steps to install a core XY version of GRBL onto your Arduino UNO R3.

  •   Grbl_Pen_Servo-master.zip” can be downloaded from           https://github.com/bdring/Grbl Pen Servo 
  •   Expand the zip file.
  •   Find the "grbl" folder and copy it to the " C:\...\Arduino\libraries " folder.
  •   Edit code in the library file "config.h" to read #define COREXY, as seen in the image, to activate the Core XY mode. Make use of a text editor like Notepad++. a word processor is not.
  • pen the Arduino IDE (Integrated Development Environment)
  •  selecting "File | Open" and Go to the “C:\...\Arduino\libraries\grbl\examples\grblUpload” folder.
  •   Afterward, click "Open" after selecting "grblUpload.ino."
  •   Next, compile the code and upload it to your Arduino.
  •  Now GRBL is installed on your Arduino.



·         Configuring GRBL

Once we download and install this GRBL firmware into the library folder of our Arduino IDE, we also need to overwrite GRBL’s default configuration file.

When your Arduino Serial Monitor is opened at 115200 baud, the Image, as shown below, is displayed.

By entering $$ in the text box at the top of your Serial Monitor screen and selecting "Send," you can view your GRBL settings at any time.

In the Serial Monitor text box, enter $110=6000 and press "Send."

Simply enter $$ and click "Send" to see the change.

Now your plotter is completely compatible with Inkscape g-code.

“Inkscape” may be downloaded from https://inkscape.org/ 



 

Plotting an Image

A text editor like Notepad++ can read any g-code file, independent of file extension.

Files with the extensions *.gcode, *.nc, *.ngc, and even *.txt are common.

Before we can plot, we need something to draw.

 


 


 

The g-code commands listed below are contained in this file:



We now require a method of transmitting this file to our plotter. For this download and install the UGS (Universal Gcode Sender) Classic version from https://winder.github.io/ugs_website/download/

1.     Place your paper under the plotter.

2.     Open a connection to your Arduino by running UGS.

3.     "Check" the "Enable Keyboard Movement" option.

4.     "XY step size" should be set at 10 mm.

5.     "Feed rate" should be set to 1000 mm/minute.

6.     To move the pen, click the +X, -X, +Y, and -Y buttons.

7.     Click "Reset Zero" when the pen is above the lower-left corner of your page.

8.     "Enable Keyboard Movement" should be unchecked.

       The plotter is going to come back here.

Now is the time to plot.

1.     "Universal Gcode Sender" will now start.

2.     The lower-left corner of your page with the pen in that place.

3.     Set the communication speed to 115200 bauds and input the COM port connected to your plotter.

4.     Then "Browse" for the "square.txt" g-code file by clicking "Open."

5.     Eventually, a screen will appear once you click "Open" and "Visualize."

6.     The yellow virtual pen and your plotter should both begin moving as you press "Send."

 

We hope you enjoyed our blog about Arduino-based CNC pen plotters. It's a great way of being able to add your own personal flair to your project. In this blog, we hope we were able to give you the information you need to start your projects. To explore more, you can refer YouTube video https://www.youtube.com/watch?v=ectCcHeMzoA. If you have any questions, kindly comment below. 

Thank you for reading, we would love to hear from you!

Comments

Popular posts from this blog

3D Printer Parts: Beginner Guide