Main Content

How To Control A Servo Using Grbl

GRBL is an arduino program for controlling each of the XYZ stepping motors on 3-axis machines such as 3D-printers and milling machines. [1]

If you study the predefined GRBL pin-outs in photo 2 you will see that none of the PWM (pulse width modulation) pins are available for controlling a servo.

This instructable explains how to:

free up a PWM servo pin by modifying GRBLversion 1.1f,
configure GRBL for coreXY plotters,
create a g-code calibration file using Inkscape 0.92,
insert the necessary pen-lift control codes using “GcodePostProcessor” [2],
configure your plotter settings and
send the modified g-code to your plotter.
The opening photo shows the results obtained when I ported GRBL to the CoreXY plotter described in https://www.instructables.com/id/CoreXY-CNC-Plott…

The video shows GRBL controlling a servo motor using the pen-lift code sequences generated by “GcodePostProcessor”. The solid blue line indicates when the servo arm should be up as the virtual pen traverses the letters ABC.”

Link to article