Hello friends, In this post I’ll give a detail tutorial on how we can attached Servo to GRBL CNC shield and how we can generate Z axis servo friendly G-code by using MIGRBL inkscake extension.
In this way we can build a GRBL based CNC pen plotter machine or CNC drawing machine.
GRLB is the open source firmware freely available for every one, GRBL is used as firmware for CNC machine.
GRBL CNC Shield is used as controller for CNC machine, GRBL shield and GRBL firmware is very best for 3 axis stepper CNC machine.
But when we choose GRBL to build 2.5 axis CNC machines like pen plotter or CNC drawing machine we face a problem that there is not any provision to connect Servo to GRBL CNC shield.
Also default GRBL firmware also not have any facility to control servo motor for Z axis, but we have a hack version of GRBL version which support servo control.
Apart from all of this we also need one software which can convert our design into Z axis servo friendly G-code, For this we have a tool called MIGRBL INKSCAPE EXTENTION.
So below is the solution for how to use Z – azix servo with GRBL CNC shield
List of software and firmware to download
- MIGRBL Firmware (Normal GRBL does’t work download this only)
- Inkscape software 0.48.5 version
- MIGRBL inkscpae extention
As soon as you download all the above tools simply follow the below steps.
1. Uploading MIGRBL to Arduino
First of all unzip the downloaded file.
Now open the MIGRBL folder go to exmple>grblUpload>grblUpload.ino
double click on grblUpload.ino to open the code just simply compile and upload the code to arduino.
Be sure you have selected the correct port and board.
please delete if you already have any previous GRBL folder in Document>arduino>library folder.
Please note that GRBL will only work with arduino uno.
In this way GRBL firmware is successfully uploaded to arduino, next we will see how to connect servo motor to GRBL CNC shield.
2. Connecting Servo motor to GRBL CNC shield
Simply connect the 5V & GND wire of servo motor to 5V and GND pin on CNC shield.
PWM signal wire of servo motor need to connect at Z+ pin GRBL CNC shield.
In this way our wiring for GRBL CNC shield & servo motor.
If you notice a problem like arduino get reset when servo moves so give external 5V DC supply to servo motor.
3. Installing MIGRBL extension in Inkscape software
First of install the download inkscape version 0.48.5 software
Now download the MIGRBL Inkscape extension unzip the downloaded file
open the MIGRBL Inkscape extension folder copy all the four files.
Now got to C:\Program Files (x86)\Inkscape\share\extensions and paste here all the four files.
now open the inkscape software got to extension tab you will see here
MI GRBL Z-Axis servo controller this means the extension is installed successfully.
In any case you can’t find the extension at place or you get any error in g-code generation simply download this extension folder and replace with you existing extension folder with this
4. How to generate G-code
All process of installation is done now its time to generate G-code
- Open the Inkscape software
- Go to the file>Document properties
- Set the units to mm
- Set width and height of your plotting area and close the tab
- Now draw the design or drag and drop the image of your choice (If you have drawn something itself in inkscape skip to step 12)
- Now select the image and go to the path>trace bitmap
- Click ok and close the tab
- Now hold click on the image and drag the mouse
- A black and white image will separate from the original image
- Now delete the original image
- Drag the black and white image in center of the frame
- Again goto path>object to path
- Now go to Extensions tab and selec MI GRBL Z-Axis servo controller
- Change the values if needed
- Click on apply to generate the G-code
- Default location where you find the generated G code is C:\Users\Public
- Servo up: Servo up G-code
- Servo down: Servo down G-code (if servo move in opposite direction swip the M5 and M3 )
- X axis speed: speed of X axis
- Y axis speed: speed of Y axis
- Angle for servo: set the value how much you need to up servo in angle 0 to 180
- Delay: Servo up down delay keep it unchanged
- Directory: the location where G-code file generate
- Filename: default file name
- Live preview: check to see live coordinates in inkscape
Example of GRBL CNC Shield + Z Axis servo MIGRBL
I hope you find this tutorial helpful for your project, if you have any question please ask in comment box.