Page 1 of 1
Macro- relay on/off
Posted:
Sun Nov 18, 2018 4:13 pm
by Mario Soto
Hello,
Is it possible to write a macro that would automatically turn on a relay when the z-axis is moving down and off on the up?
Thank you.
Mario
Re: Macro- relay on/off
Posted:
Sun Nov 18, 2018 7:40 pm
by extent
You could just wire your relay to the direction pin of the z axis stepper driver output
Re: Macro- relay on/off
Posted:
Sun Nov 18, 2018 9:24 pm
by ger21
The direction pin doesn't tell you if it's moving or not, just whichever way it moved last.
Re: Macro- relay on/off
Posted:
Mon Nov 19, 2018 4:20 am
by extent
true, but there is no tri-state in "on or off". If you need two relays, on for up and on for down you would need to work out something else, depends on the application.
Re: Macro- relay on/off
Posted:
Mon Nov 19, 2018 2:05 pm
by Mario Soto
Thank you for the replies. I did not explain correctly in my question. The relay has to stay on until the z changes direction. In other words, the z going down triggers a pneumatic cylinder and stays activated, then releases it when the z moves upward.
Thank you.
Re: Macro- relay on/off
Posted:
Mon Nov 19, 2018 3:16 pm
by Mario Soto
Would the relay say active when the z is at the bottom but not moving and then go off when it starts to go up?
Re: Macro- relay on/off
Posted:
Mon Nov 19, 2018 7:16 pm
by Mario Soto
Great! Thank you very much. But you're assuming I'm smart and I'm not! I put the macro in the macro folder. The pin for the breakout board to activate the relay is pin 3 so I take it I would change to 2 in the macro to 3? Do I need to put the macro number in the program? I always used Mach3 and am now changing over to this software. Thank you again.
Re: Macro- relay on/off
Posted:
Mon Nov 19, 2018 9:33 pm
by Mario Soto
Yes, indeed it does stay on til reversed. ( 07) So now how do we get it to do this when the program is running?
Sorry I did not see the 9091 I will try it next
Re: Macro- relay on/off
Posted:
Mon Nov 19, 2018 10:02 pm
by Mario Soto
Yes, I think that's it! I'll give it a try on the machine.
Thank you very much!