To calibrate your CNC router with Arduino, you will require an assortment of many other components that include GRBL software, Arduino CNC shield, and of course the Arduino board. Assuming that you have a CNC router which you want to calibrate with Arduino, let me brief you on the software and hardware components you will need in the process.
- GRBL: It is an open source firmware that enables your router’s motion control. GRBL installation to the Arduino is an easy procedure. This combination helps to create a high-performance based CNC controller that the router can be calibrated with. The GRBL is a G-code converter that takes the input value in the form of G-code, giving the motion control output through the Arduino board. In simple words, GRBL converts G-code input to the machine’s (router’s) motor movement output.
- Arduino: As mentioned already above, you will need an Arduino board, typically an Atmega 328 Arduino Nano or UNO.
- Drivers: To drive the router’s stepper motors, you will require to have drives like DRV8825 or A4988 drivers.
- Arduino CNC Shield: This hardware is used to connect the stepper motor drivers to the Arduino board. This is, in fact, the most straightforward way to utilize all the pins of your Arduino to connect to everything on the router: its spindle, limit/homing switches, stepper motors, and more.
I have taken the instance of a CNC router to calibrate it with Arduino. But, the same principle applies to all the CNC machines, be it a laser cutter, milling machine, foam cutting machine, or others.
So, to calibrate your CNC router, firstly you need to install the GRBL software to the Arduino board for which a cross-platform application; Arduino Integrated Development Environment will be necessary. Next, you have to download and upload GRBL to Arduino. You can get it from github.com.
Note: Download the GRBL files as .ZIP file and then:
- Open grbl-master.zip file to extract all the files
- Open the Arduino IDE interface and follow the path: Sketch 》Include Library 》Add .ZIP Library
- Then add a new library to the interface
- Go to the extracted grbl-master folder. There you have to select the grbl folder and click to open the file
Next, you have to install GRBL on your Arduino Library. For that, follow:
- File > Examples > grbl > grblUpload
- A fresh sketch will appear which you have to upload to the Arduino
- Choose the Arduino board and it’s COM port, then click on upload and you are done
After GRBL installation your Arduino can now read the G-codes and control the CNC router accordingly. However, to transfer G-code to Arduino, a controller software (GRBL controller) will be needed which will command the Arduino what to do. Well, there are numerous GRBL controllers; both commercial and open source programs available for this purpose. But, I will suggest you to go with the open source program, like the Universal G-code Sender.
Similar to GRBL download, you need to download the zipped give of this controller software. Then navigate to bin 》any ugsplatfrom file. Since it is a Java based program, you need to pre-install JAVA Runtime Environment so as to run the controller program successfully.
Now access the controller to configure your CNC router or to GRBL parameters. To do that, you will need the UGS Setup Wizard. It facilitates you to calibrate your CNC router and is more convenient than typing the commands manually via Serial Monitor of Arduino IDE interface. Now you can change or monitor your router’s motors moving direction, set the motor rotation as required, and can easily adjust the steps/mm parameters as the wizard will calculate and tell you at what value the parameter should be updated to.