Go Down

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

pixelcrash

Hello

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

MarkT

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 won't respond to messages, use the forum please ]

justone

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