GRBL-HAL can I Mix Stepper & Servos

I’ve read through a log of servo related questions and they all seem to speak about controlling servo motors with M-codes.

I am scoping out a project that involves a robot that has several axes powered by steppers plus several other axes powered by RC PWM/PPM type servos. I want to use a CNC g-code interpreter to control the robot motion. Ideally I want to control all axes with G codes not mix G & M codes. Is this possible with GRBL-HAL software architecture?

I’m only asking about software capabilities. I don’t care about limitations of off the shelf carrier boards or breakout boards I will design my own carrier board and to use the Pi Pico as a microcontroller.

Very grateful for any feedback on these questions.

You will probably need to ask that in a grbl-hal forum, specifically the PicoCNC forum if you want a pico-powered controller.

I know that FluidNC can be configured with servos ‘mapped’ to axes. Maybe grbl-hal can do the same.

grblHal does offer experimental RC servo control, see GitHub - grblHAL/Plugins_misc: Assorted small plugins

Alternatively, you can repurpose the PWM output intended for spindle RPM control (M3S). Source code modification is needed, though.

1 Like

It might have been done already but I would think that an Arduino could be coded up to convert Step and Direction signals into servo positioning. With this setup you don’t need to change anything in GRBL but setting the number of axes you have and the pin numbers for Step and Direction.

Something like for every step pulse you increment the servo position until you hit some max position at which point there’s no more movement or you can trigger an end-stop trigger. Switch direction and the sero position is decremented.

Surprisingly I found nothing in my google searches on doing this. Everything found was related to adding 1 servo to the spindle ouput pwm.

@doughl I reckon that was done in FluidNC, but I am unaware of that in GRBL.