This project propose you to build your own Arduino Mini CNC Plotter. For the X and Y axis, will use the steppers motors of two old CD or DVD players. We will use two L293D motor drivers. One for each X and Y axis. For the Z axis we will use a small servo motor (for example SG90) that moves a pen up and down. The Z axis will be hard to develop (for young Makers), so to simplify the project, i design all mechanical parts that you just need to print with a 3D printer.
You can develop your mini CNC Plotter directly from this post. You need to install the codebender plugin for your browser.
- 1 Step 1 : BOM
- 2 Step 2 : Prepare translation systems
- 3 Step 3 : Prepare stepper motors (X and Y axis)
- 4 Step 4 : Print 3D parts
- 5 Step 5 : Prepare the plywood structure
- 6 Step 6 : Prepare the circuit
- 7 Step 7 : Assembling the Mini CNC Plotter
- 8 Step 8 : Setup X and Y axis
- 9 Step 9 : Upload the CNC code into the Arduino
- 10 Step 10 : Install Processing or use gctrl.exe
- 11 Step 11 : Plot your first draw with gctrl
Step 1 : BOM
You can buy all components on internet or DIY store.
- 1x Arduino Uno
- 1x Breadboard 400 points
- 2x L293D motor drives
- 1x servo motor SG90
- 2 old CD/DVD players
- 2 wires 22AWG (yellow) 15cm (0.6 in)
- 2 wires 22AWG (green) 15cm (0.6 in)
- 2 wires 22AWG (red) 15cm (0.6 in)
- 2 wires 22AWG (white) 15cm (0.6 in)
- Some shrink tubing
- 1x plywood sheet 200 x 160mm (7.87 in x 6.3 in) for X Axis.Thickness : 10mm (0.39in) or 5mm plexiglass (0.2 in)
- 2x plywood sheet 150 x 50mm (5.91 in x 0.2 in) for Y Axis.
- 1x plexiglass plate (0.2 in) 76 x 76 mm (size of a post it, 3 x 3 in)
- 1x 3mm rod (0.12 in) x 80 mm (3.15 in)
- Glue gun
- 2x screw M2 or glue to fix servo
- 8x M4x35mm and nuts
- 1x screw M5x20mm and nut
Step 2 : Prepare translation systems
Dismantle the old DVD players to get the translation system with the stepper motor.
Step 3 : Prepare stepper motors (X and Y axis)
It’s better to sold the wires on the flexible connector. You may have problems if you sold directly on the stepper motor. If you can, try to use 4 different colors, one for each Pin. There is no identification on the engine but the connection is quite simple. The first wire corresponds to the first output of the L293D (usually) and so on.
Step 4 : Print 3D parts
|Mounting brackets (X axis)||4x|
|Z axis basis||1x|
|Pencil case (8mm diam.)||1x|
|Pencil anti-tilt ring||1x|
Step 5 : Prepare the plywood structure
Just cut the 3 parts (see the BOM for dimensions)
Step 6 : Prepare the circuit
The circuit is really easy as you can see bellow. One L293D for each axis and a servo motor for the Z-axis.
Step 7 : Assembling the Mini CNC Plotter
X and Y Axis
Use 4 spacers and 4 screws M4 x 30mm to assembling the X axis on the playwood (200 x 160mm). Do the same for the Y axis. Use the picture bellow to setup the position of elements. Finally attach the Y axis on the vertical uprights. The height is not important, we just need to adjust the position of the pen in its holder.
Use a glue gun to fix the drawing surface on the axis. To find the good position move the stepper motor to the max. position and fix it.
Pencil case (Z-axis)
Follow the drawing to assembly the pencil holder. Fix the servo motor with 2x M2 screws or glue.
Breadboard and Arduino
Use spacers to fix the breadboard.
Step 8 : Setup X and Y axis
Now, we can start programming ! First, we need to test if the X and Y axis are properly connected. After that, we will calibrate the stepper motors.
X axis test
X-Axis use the pins 8,9,10 and 11 by default. Start this program. If all is correct, the stepper motor must do 100 steps. Measure the distance and divide by 100 to obtain the X-Axis calibration value.
Y axis test
Do the same for the Y axis.
In case of problem
The main problems I encountered during the development of my plotter :
- The engine does not move: first check the wiring of the L293D. The IN and OUT Pins may be reversed.
- The direction of movement is reversed. Reverse Pins on the L293D.
- The engine never stops, do not go to the end or « jump ». There is probably an obstacle in its path. Check if one screw is not too long …
Step 9 : Upload the CNC code into the Arduino
Before uploading the CNC program, maybe you need to update the configuration
- penZUp : angle of the servo when the pen is Up
- penZDown : angle when the pen is Down (on the paper sheet)
- Pins : servo, X and Y axis
- Calibration values of the X and Y-axis
Warning: do not use the servo motor to press the pencil on the paper sheet. The force exerted by the actuator may be too strong and prevent movement of the axis X. The pen is pressed on the sheet by the spring.
Step 10 : Install Processing or use gctrl.exe
Last step before your first draw. We need to install a program that send gcode file to the Arduino controler.
If you are a Windows user you can directly use the compilated version of gctrl. You can download it here.
Step 11 : Plot your first draw with gctrl
Before making your first draw :
- Make sure the plot surface is at the origine.
- Check that nothing blocks the movement of the axes
- Place a sheet on the drawing area
gctrl is an efficient but basic program in the sense that it does not check the selected file. The plotter start just after the selection of the gcode file. So, be sure before validate. In case of problem, press « x » !
- Press « p » to choose the serial port.
- Press « h » to go at home position
- Press « g » to chose the gcode file
A short video (in french at the moment…be patient) that explains how to make your Mini CNC plotter.
I hope you find everything you need to make your Mini CNC Plotter. I hope I did not forget anything. Feel free to share your experience or add your tricks. Comments are there for.