Go Down

Topic: GBRL with custom function (Read 540 times) previous topic - next topic



I would like to control two stepper motors with GBRL. I have to move the motors to a certain
position and after that position is arrived I need to switch two  relais on and off - after that
the motors should move to the next position.

The releays need to be on and off in a sequence and are connected on 2 digital pins

Relay 1 - on / 50 ms delay / off
Relay2 - on / 120 ms delay (this would be good if this could be variable) / off

Is this possible to solve with GBRL and GCode?

Thanks for the help


You could add a custom GCODE command to handle the relays, then
just send the right GCODE to GRBL (note the spelling, its pronounced gerbil)

There may already be enough stuff in there to accomplish this with minimal
changes - the place to ask is on the GRBL forum I think.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


If you are only using 2 steppers with GRBL then maybe use the Z axis drive pins to control the 2 relays.

The direction pin could be used to select which relay to activate ( a little bit of logic) and the step pulse to activate the desired relay. Move Z plus for one and move Z minus for the other. Just need to play with the amounts to move the Z axis (maybe might need to play with # of steps per m.m. in the GRBL settings for the Z axis)  to figure timing of ON time for the relay.

The step pin of course would need to be run thru a rc filter to filter out the pulses but once the move is done then the pin goes low.

Just one way to do it without doing any software changes.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131