need a smarter rule than this simple combinatorial logic for controlling the ATC

More
27 Jun 2019 11:14 - 27 Jun 2019 11:27 #137989 by JetForMe
I thought I was being so clever:
# spindle-open-collet-out = spindle-zero-speed-in && program-idle && pressure-ok-in && (program-open-collet || spindle-button-press-in)

setp lut5.1.function 0x80808000

net spindle-zero-speed-in => lut5.1.in-0
net program-idle => lut5.1.in-1
net pressure-ok-in => lut5.1.in-2
net program-open-collet => lut5.1.in-3
net spindle-button-in => lut5.1.in-4

net spindle-open-collet-out <= lut5.1.out

But my `program-open-collet` is controlled by M64 P2. If you issue M64 P2 while the spindle is spinning, then stop the spindle, the collet is immediately opened and the tool holder falls out.

What I really want is for a button press or M64 P2 to have no effect unless the first three signals are asserted. That is, once the first three signals are asserted, the button must be released and pressed again, or M64 P2 must be issued again, before it'll open the collet.

Similarly, I have this rule for my spindle: `spindle-inhibit = !spindle-temp-ok-in || !spindle-collet-locked-in || !pressure-ok-in`, but that allows for M3 to be issued while, say, the collet is not locked, then as soon as you insert a tool, the spindle starts up (I had mentioned this in a previous post). What I really want is to prevent M3/M4 from taking effect if certain conditions aren't met. It's not enough to set spindle-inhibit or halui.spindle.0.stop when conditions go bad; I need the M3/M4 to not take effect at all if

What's the best way to go about that in the HAL? Or must I write my own tool change component? In truth, I don't want a program or the user via MDI to be able to issue M64 P2, only to initiate a tool change. The suggestion someone had for me earlier, to write a gcode routine to handle the tool change, doesn't seem to be the best way to go.

One possible solution is to react to a rising edge, rather than a level. Is there a way to do that?

Suggestions? Thanks!
Last edit: 27 Jun 2019 11:27 by JetForMe.

Please Log in or Create an account to join the conversation.

More
27 Jun 2019 12:51 #137994 by PCW
The edge, flipflop, or oneshot components might be of use here
The following user(s) said Thank You: JetForMe

Please Log in or Create an account to join the conversation.

More
27 Jun 2019 20:45 #138031 by JetForMe
Ah! I had found the flipflop, but didn't see the edge or oneshot.

Is there any way to have gcodes get permission before they can execute? I think I'd like to stop program execution (a program or an MDI line) if, for example, M3/M4 are issued and certain conditions aren't met.

Please Log in or Create an account to join the conversation.

More
27 Jun 2019 20:49 - 27 Jun 2019 21:18 #138032 by PCW
Last edit: 27 Jun 2019 21:18 by PCW.

Please Log in or Create an account to join the conversation.

Time to create page: 0.088 seconds
Powered by Kunena Forum