Enable Z-axis Servo Functionality For GRBL | MI Inkscape Extension

Enable Z-axis Servo Functionality For GRBL | MI Inkscape Extension


Z-axis Servo For GRBL

Hello guys all of you have use GBRL firmware to build your CNC machine.

GRBL is the best and widely using firmware for DIY CNC Machines.

GRBL is works well when your CNC machine have Stepper motors on all three axis,

Like Stepper motor for X-axis, Y-axis & Z-axis in this case GRBL works fine without any doubt.

So what if you are building a pen plotter CNC machine or drawing machine which have a Servo motor on Z-axis to make pen UP  & DOWN.

In this case you need two things

  1. A GRBL firmware which supports functionality of Z-axis Servo motor.
  2.  A software to generate G-code which can able to generate code to run Servo of Z-axis


Software part


For first need here we have hack  GRBL so we can attached a servo motor to GRBL CNC Shield this version of GRBL I called “MI GRBL”

Click here to download “MI GRBL”

how to add MI GRBL into arduino library :-

click on the above link as soon as download complete copy the folder MIGRBL and past it at C:\Users\kccpc\Documents\Arduino\libraries



For our second need here is a Extension which can load in INKSCAPE software and easily easily to generate Z-axis servo friendly G-code.

Click here to download “MI Inkscape Extension”

how to add MI Inkscape Extension :-

Unzip the folder copy folder now go to

Inkscpae icon right click go to properties and click on open file location

now go to share > extension

past here the copied folder

Now open this folder copy all four file past then also in extension folder

G-code generating Extension is now added in Inkscape



Hardware part

There is not any dedicated pins for servo on shield, so the question raised where we have to connect a Z-axis servo motor at GRBL CNC shield

so first please take a look to the pin map of GRBL CNC shield





CNC – Shield v3 01 WIRING z axis servo


by referring above images we can know how to connect Servo with GRBL CNC Shield

  1. Servo motor signal wire is connected with +Z pin on cnc shield, Servo motor +ve wire is connected with VCC of CNC shield (+5v dc), Servo motor -ve wire is connected with GND of CNC shield.

so by following all the instruction given here one can able to build a CNC with Zaxis servo for pen UP & DOWN movement.

Some Examples of Z-axis servo BRBL based CNC  Machine




Low cost PCB on PCBWay - only $5 for 10 PCBs and FREE first order for new members

PCB Assembly service starts from $88 with Free shipping all around world + Free stencil 

PCBWay 2nd PCB Design Contest




Hobbiest Electrical DIY project passionate

5 thoughts on “Enable Z-axis Servo Functionality For GRBL | MI Inkscape Extension

  1. Hi, trnaks for your DIY.

    I am using dvd stepper motors, and the same shield as you do.

    The motors run at aprox. 0.24 Amp, 18º each step, 6 steps per milimeter.

    Should I short the same pins you did for microstepping?

    Thanks for your reply,


    1. No you no need to short any thing as you look in arduino code in some first couple of lines
      there is step = MICROSTEP (char STEP = MICROSTEP 😉
      it is already microstep

  2. I am getting this message when I try to save the gcode in the Extensions-> MI GRBL Z Axis -> Servo Controller -> .. After I set the Servo Up and Servo Down.

    Inkscape has received additional data from the script executed. The script did not return an error, but this may indicate the results will not be as expected.”

    Any reason why this could be ?

    A response would be appreciated.

  3. Im having a problem saving the gcode file using the MI GRBL Z AXIS Servo Controller. The extension was installed correctly. I can see it in the Extensions -> Pulldown menu, and when I try to create the external file… it fails with this message.

    I have Inkscape 0.92, Running on Mac OS High Sierra, and the extension for the Servo was from your link above.
    I have Python 2.7.10 running on my Mac.

    Any inputs would be appreciated.

    Traceback (most recent call last):
    File “servo.py”, line 3172, in
    File “/Applications/Inkscape.app/Contents/Resources/share/inkscape/extensions/inkex.py”, line 283, in affect
    File “servo.py”, line 3153, in effect
    File “servo.py”, line 2883, in get_info
    File “servo.py”, line 2864, in recursive_search
    File “servo.py”, line 2866, in recursive_search
    points = self.get_orientation_points(i)
    File “servo.py”, line 2906, in get_orientation_points
    r = re.match(r'(?i)\s*\(\s*(-?\s*\d*(?:,|\.)*\d*)\s*;\s*(-?\s*\d*(?:,|\.)*\d*)\s*;\s*(-?\s*\d*(?:,|\.)*\d*)\s*\)\s*’,node.text)
    File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py”, line 141, in match
    return _compile(pattern, flags).match(string)
    TypeError: expected string or buffer

    1. I also encountered that problem…This may help you… find mburakkalkan comment here below…


Leave a Reply

Your email address will not be published. Required fields are marked *

Enter Captcha Here : *

Reload Image