Introduction: CNC Drawing Arm

This instructable describes an A3 robotic drawing arm that doubles as a plotter.

The drawing arm has 2DOF (degrees of freedom) and is made from two stepper motors, a few GT2 timing-belts and pulleys, and some flat aluminium bars. An SG90 servo is used to raise and lower the pen.

The metal-work is simple ... all you require are a few twist drills and a hacksaw.

The plotter has an on-board interpreter that recognizes the g-code output from "Inkscape"

Providing you don't have any wobbly joints the resolution and accuracy of this plotter is excellent.

The opening photo shows the fully assembled arm. Next a source image is converted to a "sobel outline" [1]. Finally the gcode for the "sobel outline" is sent to the plotter [2]. The last photo shows the completed image.

Keep in mind that the final image has been magnified ... 1 image pixel equals 0.5mm !



Step 1: Theory

The drawing arm is a simplification of the dual arm plotter first described in

The calculations used in that plotter are shown in the first diagram.

How the drawing arm evolved

Belt drives were added to the dual-arm plotter to improve its resolution. These modifications are described in

The addition of belt drives allows the motor offsets to be the same. In doing so a "rhombus" is formed, as shown by the black construction lines in the remaining diagrams.

This project uses the following properties (there are more) of a rhombus:

  • adjacent angles about a diagonal are equal
  • the diagonals always cross at right-angles
  • the diagonals bisect each other
  • the opposite sides are parallel

Providing we keep the opposite sides parallel, we can move the motor 2 arms to the positions shown in blue.

We now have a robotic arm.

The calculations are not affected.


This plotter configuration has the following advantages over the above dual-arm plotters:

  • greater plotting area (no elbow conflicts with the opposite motor)
  • motor 2 shoulder arm is shorter
  • the pen-holder is simpler
  • no joint at the pen-holder


This plotter configuration has the following disadvantages over the above dual-arm plotters:

  • any motor 2 joint movement is magnified due to pantograph action.
  • there is more leverage on the shaft of motor2 due to the shaft-extender.

Step 2: Circuit Diagram

The above circuit shows two 12 volt stepper motors [1] connected to Big EasyDriver controllers set to 16 times micro-stepping.

Adjust each motor current, in turn, to 400mA by rotating the Big EasyDriver potentiometer while monitoring the current drain shown on the CPS-3205 power supply.


An alternate circuit using 6 volt stepper motors and EasyDriver controllers set to 8 times micro-stepping is shown in instructable

If you choose to use 6 volt steppers, the supply voltage must be reduced to 6 volts. You will also need to adjust the motor currents to 600mA and the following code definitions to:

#define STEPS_PER_DEG 6400/360

DELAY_MIN = 5000,

Step 3: Parts List

Step 4: Drilling Template

The main arms are made from 25mm x 3mm flat alumium bar'.

The 300mm tie bar can be narrower.

Each joint is sleeved with a tubular 3/16 inch spacer that is 6mm in length. The spacer is sandwiched in place by means to two 3mm washers and a 3mm nut and bolt.

The 6mm spacer must protrude slightly if the bars are to rotate freely when the 3mm nut and bolt is tightened. To achieve this simply reduce the thickness of one bar at each joint.

The drawing arm is made from 25mm x 1mm flexible aluminium bar. This allows the SG90 servo to raise the pen.

The pen holder is formed by making two bends in the 25mm x 1mm bar. The fold lines shown in the template are 20mm apart.

A 4mm nut and bolt is used to retain the pen in place. Finger pressure is all that is required.

The total "reach" of the arm is close to 600mm which is suitable for drawings up to A3 in size.

Step 5: Assembling the Arm

Photo1 shows the pen-lift and pen-holder assembly. Pen-lift is possible due to the flexibility of the 1mm thick aluminium arm. The pen is held in position by means of a finger-tight 4mm nut and bolt.

Photo 2 shows the arms cut and drilled to length [1]. The tubluar spacers that create a smooth low-friction joint are shown in this photo.

Photo 3 shows a birds-eye view of the assembled arm.


The two 3mm holes for attaching the 1mm thick drawing arm to the 3mm thick elbow are shown at 90 degree to the drilling template. Either way works but the template provides more clearance for the 3mm bolt heads.

Step 6: Position the Motors and Spindle

Create a drilling template for the motor holes. I used "masking tape" as shown in the first photo.

Draw a center-line at the top of the board then drill the corner holes for the motors. The holes shown in the second photo are spaced 10mm either side of the center-line and 10mm from the top edge of the base-board [1].

Drill clearance holes for each motor shaft.

Place a GT2-200 timing belt over both pulleys as shown in the second photo. Mark the position of the bolt on the center-line. Create a "spindle" by cutting the bolt to length with a hacksaw.

Drill a 6mm hole and elongate it towards the paper as shown in the third photo. Sliding the spindle towards the paper will tension BOTH timing-belts.

Mount the spindle by sandwiching the base-board between two nuts and two large flat-washers as shown in the last photo.


The base board should be large enough for a sheet of A3 paper plus about 230mm of clear board above the paper for the motors. If the motors are too close the elbows may make contact with the pulleys when the pen is at the top corners of the paper.

Step 7: Assemble the Plotter.

With the lower timing-belt in place place the drawing arm over the spindle as shown in the first photo.

Two flat washers separate the shoulder arms. There is an additional washer top and bottom to allow everything to rotate freely. A 6mm "drill collet" prevents the arms from falling off when the plotter is being transported.

A 5mm bore shaft extender is used to raise the second GT2-20 timing pulley to the same height as the top GT2-80 shoulder pulley. I used an old drill shank for the shaft extension but anything that is 5mm in diameter will do ... even a threaded bolt.

Step 8: Arduino Code

The .ino code for this plotter is attached.

Copy the contents of "CNC_drawing_arm.ino" to a new "sketch" and save it using the same name (less the .ino file extension). The file is now ready to be uploaded to your arduino.


The code is identical to that used in apart from the following definitions:

  • #define STEPS_PER_DEG 12800/360
  • #define NUDGE STEPS_PER_DEG/4
  • DELAY_MIN = 2500,

Code update 12 August 2017

The motor stepping algorithm has been improved in "CNC_drawing_arm_v2.ino".

Prior to this release the motors stepped alternately. Simultaneous stepping is now possible should that be required. This eliminates potential one-step errors which results in smoother lines.

Code update 16 August 2017

The method for creating test patterns has been improved in "CNC_drawing_arm_v3.ino".

Complex patterns and true circles are now possible. The code changes are detailed in the file header.

Step 9: Connecting Your PC

Apply 12 volts to the drawing arm [1].

Connect a USB cable between your PC and the Arduino.

Run a terminal emulation program such as and the above menu should appear on your screen.

The menu

The menu is not case sensitive. Typing :

  • MENU brings up the menu
  • G00 allows you to send the pen to a specific XY co-ordinate with the pen raised.
  • G01 allows you to send the pen to a specific XY co-ordinate with the pen lowered.
  • T1 allows you to position your pen over your 0,0 co-ordinate. Type 'E' to exit.
  • T2 allows you to scale your drawiing. For example "T2 S2.5" will scale your drawing 250%. The default scale is 100%. All pen moves use the drawing scale last set using this menu option.
  • T3 and T4 allow you to raise or lower the pen.
  • T5 draws an "ABC" test pattern.
  • T6 draws a "target".
  • T7 draws a set of radial lines


  • Some terminal emulation programs will display the "Xon" and "Xoff" handshake codes from the arduino as the numbers "17" and "19" rather than the small hollow squares shown above.
  • The micros() timer is used for stepping the motors which means that the maximum plot time, before the timer overflows, is 70 minutes.
  • Do NOT pause the plotter once plotting has commenced as the motors rely on the system time for stepping.


Apply 6 volts if you are using 6 volt 600mA motors

Step 10: Creating an Outline

Use Inkscape to generate the gcode for your images as shown in "Step 9" of instructable

Image outlines may also be generated using If you choose to use this method then use the attached "sobel_outline.pde", or "canny_outline.pde", code to create your outlines otherwise your images will be laterally inverted.

The reason for this is that Inkscape expects the co-ordinate (0,0) to be at the lower-left corner of the image, whereas Processing3 defines co-ordinate (0,0) to be at the top-left. The code changes are minor and appear in the "trace" section of each "pde" file.


lingib (author)2017-08-15

A minor code update, "CNC_drawing_arm_v3.ino", has been added to "Step 8".

Raw Inkscape g-code may now be used should you wish to create your own test patterns.

lingib (author)2017-08-11

A code update, "CNC_drawing_arm_v2.ino", has been added to "Step 8".

This update improves the stepping algorithm which results in smoother lines.

mr.incredible (author)2017-08-10

Awesome. The extra torque due to the extension one the one stepper could be mitigated with a couple bearings hard mounted to your frame. Once the slop is supported by bearings the length of shaft is no longer an issue.

lingib (author)mr.incredible2017-08-11

Thanks for your comment :)

In practice the torque on the shaft has not been an issue ... I just saw it as a disadvantage relative to the dual-arm versions at the time I wrote the article.

The main problem are the tiny "wiggles" due to the motor movements being magnified by the 300mm arms. Shorter arms would reduce this effect but would also reduce the plot area.

DejayRezme (author)2017-08-08

Wow that is an ingenious design for a robot arm! Maybe this could work for a 3D printer as well, with a tower moving the (reinforced) arm up and down.

lingib (author)DejayRezme2017-08-08

Thanks for the "RepRap Helios" reference ... the design is interesting.

hmyers1 (author)DejayRezme2017-08-08

hmmm, given Z-tower and one of those draw-3d pens you would avoid weight distortion at end of arm and solve the problem of cooling/solidification…maybe :)

DejayRezme (author)hmyers12017-08-08

You'd need to redesign the whole arm to have a additional beam above the linkage to provide stiffness. Using thicker carbon fiber rods this could be pretty stiff and lightweight.

hmyers1 (author)DejayRezme2017-08-08

Or perhaps move from flat stock to square/retangular tubing?

DejayRezme (author)hmyers12017-08-08

Yeah tubes not rods. And two of them separated by some height to give more stiffness and avoid slop.

lingib (author)DejayRezme2017-08-08

Thank you for your comment :)

Depending on what you want to print, a robotic arm may not give you the precision that you require as there is a hidden problem. The precision degrades with distance :(

Some calculations using my diagrams:

Let A=angle, D=distance, L=arm length=100mm, motor=1.8 degrees per step.

cos(A)=(D/2)/L) ................. ....................(1)

rearranging we get

D= 2*L*cos(A) ........................................(2)

Let's now calculate the change of distance (d) for a single step for three different start angles.

The required formula becomes:

d=2*L*cos(A) - 2*L*cos(A+1.8)

d=200(cos(A) - cos(A+1.8)) ................... (3)

Substituting for start angles of 20, 40, and 60 degrees we get:

20 degrees: d=200(cos(20)-cos(21.8)) = 2.24mm

40 degrees: d=4.11mm

60 degrees: d=5.48mm

These distances will be smaller when we use 16*microstepping and 4*belt drive but the non-linearity is cause for concern.

A cartesian XY system using a GT2 20-tooth pulley and a matching GT2 timing-belt offers better linearity, and higher resolution.

With this approach 1 motor revolution of 200 steps moves the timing-belt 20*2=40mm which equates to a CONSTANT distance of 40/200=0.2mm for each motor step. Microstepping would further improve this.

DejayRezme (author)lingib2017-08-08

Yeah, there is a theoretical maximum depending on gearing, print area and strength and speed of the motor.

I've also seen servo motors / DC motors with a magnetic rotary encoder being used. Not sure where the limits for precisions are for those. But it might help with these robot arms (for example the RepRap Helios is using an arm)

About This Instructable




Bio: 55+ years in electronics, computers, and teaching ... now retired.
More by lingib:CNC Drawing ArmCNC Dual Arm Plotter Version 2How to Cut & Fold Sheet Aluminium
Add instructable to: