Best way to inhibit MPG with external switch

More
7 years 10 months ago #122135 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.

Please Log in to join the conversation.

More
7 years 10 months ago #122138 by PCW
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

Please Log in to join the conversation.

More
7 years 10 months ago #122141 by Clive S
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

Attachment not found

Attachment not found

Please Log in to join the conversation.

More
7 years 10 months ago #122143 by PCW
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?

Please Log in to join the conversation.

More
7 years 10 months ago #122144 by Clive S
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.

Attachment not found

Please Log in to join the conversation.

More
7 years 10 months ago #122158 by rodw
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.

Please Log in to join the conversation.

More
7 years 10 months ago #122177 by PCW
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

Please Log in to join the conversation.

Time to create page: 0.091 seconds
Powered by Kunena Forum