17. Machine design¶
3-DOF Cam Slider¶
Finally, this week we actuated and automated our 3-DoF CamSlider; we made it through Arduino UNO + CNC Shield GRBL based and we had controlled the machine through Serial Port Monitor at first and than through GRBL Controller.
GRBL¶
GRBL is an open source embedded CNC controller written in optimized C that runs on Arduino; this firmware is written in highly optimized C utilizing every clever feature of the AVR-chips to achieve precise timing and asynchronous operation, even through many interfacing programs.
GRBL firmware¶
-
From GitHub we cloned the 0.9j version of GRBL.
git clone https://github.com/grbl/grbl.git
-
Form the Arduino IDE I uploaded Grbl Library as follows:
Sketch / Include Library / Add .ZIP Library
. Then select the Grbl folder inside the grbl-master folder, which only contains the source files and an example directory. -
searching firmware in
root / examples / grblUpload.ino
, open and upload it the firmware on the board.
So I used the Arduino Serial Monitor and set the baudrate to 115200, and I could check the right connection seeing this message:
Grbl 0.9j ['$' for help] ['$H'|'$X' to unlock]
GRBL settings¶
Typing $$ and pressing enter I saw $$ Grbl settings to calibrate and manage the system:
$0=10 (step pulse, usec) $1=255 (step idle delay, msec) $2=0 (step port invert mask:00000000) $3=0 (dir port invert mask:00000000) $4=0 (step enable invert, bool) $5=0 (limit pins invert, bool) $6=0 (probe pin invert, bool) $10=3 (status report mask:00000011) $11=0.010 (junction deviation, mm) $12=0.002 (arc tolerance, mm) $13=0 (report inches, bool) $20=0 (soft limits, bool) $21=0 (hard limits, bool) $22=1 (homing cycle, bool) $23=0 (homing dir invert mask:00000000) $24=25.000 (homing feed, mm/min) $25=500.000 (homing seek, mm/min) $26=250 (homing debounce, msec) $27=1.000 (homing pull-off, mm) $100=100.000 (x, step/mm) $101=250.000 (y, step/mm) $102=250.000 (z, step/mm) $110=500.000 (x max rate, mm/min) $111=500.000 (y max rate, mm/min) $112=500.000 (z max rate, mm/min) $120=10.000 (x accel, mm/sec^2) $121=10.000 (y accel, mm/sec^2) $122=10.000 (z accel, mm/sec^2) $130=200.000 (x max travel, mm) $131=200.000 (y max travel, mm) $132=200.000 (z max travel, mm) ok ok
As you can see from highlighted line, we’ve corrected step/mm to 100 for the correct corresponding movements of the X axes. Here you can find a link to the complete commands guide on GitHub project page.
Actuating the 3-DOF Cam Slider¶
BOM - Electronic parts¶
Description | Unit | Q.ty |
---|---|---|
Arduino UNO | Pcs | 1 |
CNC Shield - GRBL | Pcs | 1 |
A4988 driver | Pcs | 3 |
Heatsink | Pcs | 3 |
USB cable - serial conn. | Pcs | 1 |
PowerSupply 12V 2A | Pcs | 1 |
Stepper Motor - NEMA17 | Pcs | 3 |
- Put the CNC Shield on the Arduino UNO;
- Put each A4988 motor driver on the its socket on the CNC Shield;
- Connect each NEMA17 motor to the corresponding axes pinout of the driver;
- Connect USB cable to Arduino UNO and PC.
Automating through interfacing¶
- I downloaded GRBL Controller, one of the many GRBL interfacing programs;
- I opened it and I selected the respective GRBL-Arduino port and the same baud rate;
- And then I selected “Open” button and I started controlling the 3dof Cam Slider by the respective axes button of the interface.
You can check our 3dof Cam Slider working and all details on the Fab Lab Napoli page.