Best way to inhibit MPG with external switch
- Clive S
- Offline
- Platinum Member
Less
More
- Posts: 2244
- Thank you received: 478
10 Dec 2018 12:33 - 10 Dec 2018 15:07 #122135
by Clive S
Best way to inhibit MPG with external switch was created by Clive S
Using PathPilot with mesa 7i85 for spindle encoder and mpg's
I have 3 Mpg's for x,y & z I find these very handy for using the mill manually.
I would like to inhibit the MPG's with an external switch just for X & Y. I am doing it at the present by just switching the 5V supply to the mpg. Trouble with this is that the switching on an off results in a small movement of the axis.
What is the better way to do this in software with an external switch.
I have 3 Mpg's for x,y & z I find these very handy for using the mill manually.
I would like to inhibit the MPG's with an external switch just for X & Y. I am doing it at the present by just switching the 5V supply to the mpg. Trouble with this is that the switching on an off results in a small movement of the axis.
What is the better way to do this in software with an external switch.
Last edit: 10 Dec 2018 15:07 by Clive S. Reason: changed 7i77 to 7i85
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17999
- Thank you received: 4843
10 Dec 2018 14:53 #122138
by PCW
Replied by PCW on topic Best way to inhibit MPG with external switch
You can do this with motions "axis.N.jog-enable" pins
These are no doubt already connected in your current hal files
so you would need to add some logic (like an "and2" component)
to factor in the external switch pin state to the existing jog enable logic
These are no doubt already connected in your current hal files
so you would need to add some logic (like an "and2" component)
to factor in the external switch pin state to the existing jog enable logic
The following user(s) said Thank You: Clive S
Please Log in or Create an account to join the conversation.
- Clive S
- Offline
- Platinum Member
Less
More
- Posts: 2244
- Thank you received: 478
10 Dec 2018 15:18 #122141
by Clive S
Replied by Clive S on topic Best way to inhibit MPG with external switch
PCW Thanks for the help. I have attached the hal and custom mpg files.
What I am trying to achieve is just to disable the mpg's (as they are when using mdi) But in manual mode to turn then on and off.
Could anybody show me a sample of code to do this
What I am trying to achieve is just to disable the mpg's (as they are when using mdi) But in manual mode to turn then on and off.
Could anybody show me a sample of code to do this
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17999
- Thank you received: 4843
10 Dec 2018 15:35 #122143
by PCW
Replied by PCW on topic Best way to inhibit MPG with external switch
Its looks like currently you have the jog enable connected so that either MDI mode or the Shuttle express buttons enable jogging (this seems odd):
loadrt or2 names=xen,yen,zen
addf xen servo-thread
addf yen servo-thread
addf zen servo-thread
net sxp.xen-button => xen.in0
net sxp.yen-button => yen.in0
net sxp.zen-button => zen.in0
net jog-mode <= halui.mode.is-manual
net jog-mode => xen.in1
net jog-mode => yen.in1
net jog-mode => zen.in1
net xen-out xen.out => axis.0.jog-enable
net yen-out yen.out => axis.1.jog-enable
net zen-out zen.out => axis.2.jog-enable
Are you using the Shuttle Express?
loadrt or2 names=xen,yen,zen
addf xen servo-thread
addf yen servo-thread
addf zen servo-thread
net sxp.xen-button => xen.in0
net sxp.yen-button => yen.in0
net sxp.zen-button => zen.in0
net jog-mode <= halui.mode.is-manual
net jog-mode => xen.in1
net jog-mode => yen.in1
net jog-mode => zen.in1
net xen-out xen.out => axis.0.jog-enable
net yen-out yen.out => axis.1.jog-enable
net zen-out zen.out => axis.2.jog-enable
Are you using the Shuttle Express?
Please Log in or Create an account to join the conversation.
- Clive S
- Offline
- Platinum Member
Less
More
- Posts: 2244
- Thank you received: 478
10 Dec 2018 15:45 - 10 Dec 2018 15:47 #122144
by Clive S
Replied by Clive S on topic Best way to inhibit MPG with external switch
Yes thee shuttle is still connected and seem to work fine.
But there is a slight problem in that moving from mdi to manual to be able to use the mpg I have to either touch one of the key board jog keys (any of them) or touch one of the shuttle keys. Then the mpg works fine until I move back to mdi.
I have been living with that.
Thanks for the help.
But there is a slight problem in that moving from mdi to manual to be able to use the mpg I have to either touch one of the key board jog keys (any of them) or touch one of the shuttle keys. Then the mpg works fine until I move back to mdi.
I have been living with that.
Thanks for the help.
Last edit: 10 Dec 2018 15:47 by Clive S. Reason: added file
Please Log in or Create an account to join the conversation.
- rodw
- Offline
- Platinum Member
Less
More
- Posts: 10840
- Thank you received: 3578
10 Dec 2018 21:29 - 10 Dec 2018 21:30 #122158
by rodw
Replied by rodw on topic Best way to inhibit MPG with external switch
With my pendant, there is a safety button (momentary switch) which must be held down to enable the MPG output. The pendant triggers a relay in the control panel when this safety is pressed.
I connected it to halui.mode.is-teleop. This means when I press the safety button to use the MPG, the correct mode is selected whenever I go to jog the machine from the pendant.
I connected it to halui.mode.is-teleop. This means when I press the safety button to use the MPG, the correct mode is selected whenever I go to jog the machine from the pendant.
Last edit: 10 Dec 2018 21:30 by rodw.
The following user(s) said Thank You: Clive S
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17999
- Thank you received: 4843
10 Dec 2018 23:58 #122177
by PCW
Replied by PCW on topic Best way to inhibit MPG with external switch
a quick sketch:
add the and2 components
loadrt and2 names=xengate,yengate,zengate
addf xengate servo-thread
addf yengate servo-thread
addf zengate servo-thread
change these nets so your existing or-ed enables go through the newly added and gates:
net xen-out xen.out => xengate.in0
net yen-out yen.out => yengate.in0
net zen-out zen.out => yengate.in0
add a net for the hardware switch enable (replace someIOBit with the desired hardware pin)
net jog-en-sw <= someIOBit => xengate.in1 yengate.in1 zengate.in1
now jog enable comes from the and gate outputs:
net gated-xen-out xengate.out axis.0.jog-enable
net gated-xen-out xengate.out axis.0.jog-enable
net gated-xen-out xengate.out axis.0.jog-enable
add the and2 components
loadrt and2 names=xengate,yengate,zengate
addf xengate servo-thread
addf yengate servo-thread
addf zengate servo-thread
change these nets so your existing or-ed enables go through the newly added and gates:
net xen-out xen.out => xengate.in0
net yen-out yen.out => yengate.in0
net zen-out zen.out => yengate.in0
add a net for the hardware switch enable (replace someIOBit with the desired hardware pin)
net jog-en-sw <= someIOBit => xengate.in1 yengate.in1 zengate.in1
now jog enable comes from the and gate outputs:
net gated-xen-out xengate.out axis.0.jog-enable
net gated-xen-out xengate.out axis.0.jog-enable
net gated-xen-out xengate.out axis.0.jog-enable
The following user(s) said Thank You: Clive S
Please Log in or Create an account to join the conversation.
Time to create page: 0.058 seconds