how to add a delay to machine on/off button

More
10 years 3 weeks ago #81297 by b2unit
I made a connection on 'machine on/off button' to 'servo on' signal and 'servo brake' signal which controls each relay switches.
when I click machine on/off button(on) servo brake(on) signal and servo on(on) signal react simultaneously.
but in a real world servo brake(on) signal is a bit slower than servo on(on) signal..so there's little movement with some sound..
what i want is..
when I click machine on/off button( on) servo on(on) signal go first and then servo brake(off) signal in turn.
and
when I click machine on/off button(off) servo brake(on) signal go first and then servo on(off) signal in turn.

how can I add delay to hal pin connection?

thanks,
Byoungil Choi

Please Log in to join the conversation.

More
10 years 3 weeks ago #81300 by Rick G

Please Log in to join the conversation.

More
10 years 3 weeks ago #81303 by b2unit
I read the manual,
if you dont mind can i have some similar example which is use timedelay component for halpin?

Please Log in to join the conversation.

More
10 years 3 weeks ago #81307 by Rick G

Please Log in to join the conversation.

More
10 years 4 days ago #82126 by b2unit
=========
loadrt timedelay count=1

addf timedelay.0 servo-thread

setp timedelay.0.on-delay 0.1
setp timedelay.0.off-delay 0

#for Z axis servo-on & servo-brake time delay
#hm2_5i25.0.7i76.0.0.output-02 : servo on signal for relay
#hm2_5i25.0.7i76.0.0.output-01 : servo brake signal for relay

net machine-is-enabled => hm2_5i25.0.stepgen.04.enable hm2_5i25.0.7i76.0.0.output-02 timedelay.0.in
net delay_sig timedelay.0.out => hm2_5i25.0.7i76.0.0.output-01
=========

it's working and can eliminate the Z axis flinch action when I click Turn the machine on/off button for machine on action.
but still have the flinch action when I click Turn the machine on/off button for machine off action.
machine-is-enabled is true or false as one..
there's no seperate pin for machine off action as I know..

what I want is the process below

when I click the machine on/off button for machine on(solved)
1. servo-on
2. servo-brake release(I delayed it with the timedelay component)

when I click the machine on/off button for machine off
1. servo-brake lock
2. servo-on off

Is this available? if it is please let me know.

Please Log in to join the conversation.

More
10 years 3 days ago #82140 by Todd Zuercher
I think you are on the right track, but I think you need to use 2 time delays, one set with a delay on (and 0 off), the other with a delay off (and 0 on).
Code:
loadrt timedelay count=2 addf timedelay.0 servo-thread addf timedelay.1 servo-thread setp timedelay.0.on-delay 0.1 setp timedelay.0.off-delay 0 setp timedelay.1.on-delay 0 setp timedelay.1.off-delay 0.1 #for Z axis servo-on & servo-brake time delay #hm2_5i25.0.7i76.0.0.output-02 : servo on signal for relay #hm2_5i25.0.7i76.0.0.output-01 : servo brake signal for relay net machine-is-enabled => timedelay.0.in => timedelay.1.in net delay0_sig timedelay.0.out => hm2_5i25.0.7i76.0.0.output-01 net delay1_sig timedelay.1.out => hm2_5i25.0.stepgen.04.enable => hm2_5i25.0.7i76.0.0.output-02

Please Log in to join the conversation.

More
10 years 3 days ago #82166 by b2unit
you are so genius!!
I was so stupid..

THANK YOU!

Please Log in to join the conversation.

More
10 years 2 days ago #82183 by Todd Zuercher
No, you're not. You were just looking at it from the wrong angle.

Please Log in to join the conversation.

More
5 years 9 months ago #195438 by Thods1222
Hello all, I know this is an old thread but I am looking to do something similar with my cincinnati retrofit. I am running 7i92h with 7i71 for my output card and 7i77 for my servo interface card. I used the code above and modified it for my cards and pins but it was not liking the stepgen line. Also I am running linuxcnc 2.8.

Please Log in to join the conversation.

More
5 years 9 months ago #195440 by andypugh
Can you describe exactly what you want to do (and, possibly more importantly, why)
Then we can either modify this answer to suit you, or tell you a better way to do it.

Please Log in to join the conversation.

Time to create page: 0.273 seconds
Powered by Kunena Forum