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 https://www.instructables.com/id/CNC-Dual-Arm-Plo...
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 https://www.instructables.com/id/CNC-Dual-Arm-Plot...
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.
Advantages
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
Disadvantages
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.
[1]
An alternate circuit using 6 volt stepper motors and EasyDriver controllers set to 8 times micro-stepping is shown in instructable https://www.instructables.com/id/CNC-Dual-Arm-Plo...
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
Attachments
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.
[1]
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.
[1]
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.
Notes
The code is identical to that used in https://www.instructables.com/id/CNC-Dual-Arm-Plo... 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.
Code update 15 September 2021
The attached file "CNC_drawing_arm_v3.1.ino" contains a minor bugfix.
The data type in code lines 896 and 897 has been changed from int() to long().
Thank you leo_nuñez for noticing this.
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 https://www.instructables.com/id/CNC-Gcode-Sender... 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
Notes
- 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.
[1]
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 https://www.instructables.com/id/CNC-Robot-Plotte...
Image outlines may also be generated using https://www.instructables.com/id/CNC-Edge-Detecti... 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.
Click here to view my other instructables.