10. Mechanical Design, machine Design¶
Drawing CNC machine¶
Hero Shot¶
Assignements requirements¶
group assignment
- design a machine that includes mechanism+actuation+automation+application
- build the mechanical parts and operate it manually
- document the group project and your individual contribution
Step 1: Gather Components¶
You will need the following components:
- Arduino board: Typically an Arduino Uno.
- CNC shield: A shield that fits on the Arduino and allows for easy connection of stepper motor drivers.
- Stepper motors: NEMA 17 or NEMA 23 motors are common choices.
- Stepper motor drivers: A4988 or DRV8825 drivers.
- Power supply: A power supply that matches the voltage and current requirements of your motors and drivers.
- Frame: Aluminum profiles, wood, or any sturdy material for the frame.
- Linear motion components: Bearings, lead screws, or belts and pulleys.
- End stops or limit switches: To define the working area limits.
- Spindle or tool: For a CNC router, you’ll need a spindle or Dremel tool.
- Wires and connectors: For electrical connections.
- Miscellaneous: Screws, nuts, bolts, and other hardware.
Step 2: Detailed Wiring¶
-
Connect the Motors to the Drivers:
-
Y-Axis Motors:
- For two Y-axis motors, you will likely run them in parallel or use two separate drivers.
- If using separate drivers, connect each Y-axis motor to its own driver on the CNC shield.
- Ensure the correct wiring sequence (A+, A-, B+, B-) from the motor to the driver.
-
X-Axis and Z-Axis Motors:
- Connect the X-axis motor to its respective driver on the CNC shield.
- Connect the Z-axis motor to its driver on the CNC shield.
-
-
Connect the Power Supply:
- Connect the power supply to the CNC shield. Ensure the voltage matches the requirements of your stepper motor drivers (typically 12V or 24V).
- Positive (red wire) goes to the
VCC
terminal and negative (black wire) goes to theGND
terminal.
-
Connect End Stops or Limit Switches:
- Attach end stops or limit switches at the ends of the X, Y, and Z axes.
- Connect the switches to the corresponding pins on the CNC shield (usually labeled X-min, Y-min, Z-min, etc.).
- Configure them as normally open (NO) or normally closed (NC) based on your preference and GRBL settings.
-
Connect the Pen Holder (Z-Axis):
- Wire the stepper motor for the Z-axis to the corresponding driver on the CNC shield.
- If using a servo for pen lifting, connect the servo control wire to an available PWM pin on the CNC shield and power it accordingly.
Step 3: Software and Calibration¶
-
Install Arduino IDE:
- Download and install the Arduino IDE.
-
Install GRBL Firmware:
- Download the GRBL firmware from the GRBL GitHub repository.
- Open the Arduino IDE, go to
Sketch
>Include Library
>Add .ZIP Library
, and select the GRBL .zip file you downloaded. - Open the GRBL example sketch by going to
File
>Examples
>grbl
>grblUpload
. - Connect your Arduino to your computer via USB, select the correct board and port under
Tools
, and upload the sketch.
-
Install G-Code Sender Software:
- Download and install Universal G-code Sender (UGS) from UGS Platform.
- Connect to your Arduino by selecting the correct COM port and baud rate (usually 115200).
Step 4: Calibration¶
-
Calibrate Steps per Millimeter:
- Open UGS and connect to your Arduino.
- Use the console to enter
$$
to display current GRBL settings. - Adjust steps per millimeter settings ($100, $101, $102 for X, Y, Z respectively) using the command
$100=value
, wherevalue
is calculated based on your lead screw pitch or belt/pulley ratio. - Measure the actual movement and adjust until the movement matches the expected distance.
-
Set End Stops and Homing:
- Enable hard limits with
$21=1
(to enable limit switches). - Enable homing cycle with
$22=1
. - Adjust homing direction and speed settings ($23, $24, $25) as needed for your machine.
- Enable hard limits with
Step 5: Running Your First Drawing¶
-
Prepare a G-Code File:
- Use software like Inkscape with the
Gcodetools
plugin to convert your drawing into G-code. - Open Inkscape, create or import your drawing.
- Use the
Gcodetools
extension to generate the G-code. Save the file with a.gcode
extension.
- Use software like Inkscape with the
-
Load the G-Code File:
- Open UGS and connect to your Arduino.
- Load your G-code file by clicking
File
>Open
and selecting your.gcode
file.
-
Secure the Drawing Medium and Set Zero Position:
- Place the paper or drawing surface on the machine bed and secure it.
- Manually move the pen holder to the starting position (usually the bottom-left corner of the drawing area).
- Set this position as the zero point by clicking
Reset Zero
in UGS.
-
Start the Drawing:
- Begin the drawing by clicking
Send
in UGS. - Monitor the machine to ensure it runs smoothly and the pen accurately follows the G-code path.
- Begin the drawing by clicking
Additional Tips¶
- Fine-tuning: Adjust pen pressure and Z-axis movement to ensure clean lines without damaging the paper.
- Software Settings: Configure your G-code generator settings to match the dimensions and capabilities of your machine.
- Troubleshooting: If the machine doesn’t move correctly, recheck wiring and GRBL settings.
By following these detailed steps, you should be able to build and operate your Arduino-based drawing machine with two Y-axes, one X-axis, and a Z-axis for the pen holder. Happy building!
Last update:
July 2, 2024