Disable cycle start / run button until conditions are met?

More
06 Jun 2023 05:08 #272997 by pseudo
Hi all, I've searched for a while but can't find any info on how to do this, if there's a resource I missed please link me.

On my machine I have a few sensors for whether the operator has folded some fixtures away and I'd like to allow the machine to be on/jogging enabled etc but prevent starting a job if the sensors report that the fixtures are still out. How would I do this?

Basically I'd like to disable the start button until sensors A, B, and C report ok.

 

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

More
06 Jun 2023 09:32 #272999 by rodw
You can either physically add your sensors to your estop chain or you can build your estop chain in software with the estop-latch component. 

There is an example in the forum here under hal examples of using estop-latch but it only uses 1 estop but chaining them together is the way to solve this. 

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

More
06 Jun 2023 11:19 #273007 by pseudo
Sorry, I should've been clearer; I don't want to estop the machine, i want the user to be able to jog the machine around and do all the normal manual things, I only want to disable starting an NC file.

It's more than just fixtures (it's about 7 sensors), it's also stuff like whether the door is shut - the user may need to move the machine with the door open, but shouldn't be able to start a job with the door open.

How would I do that?

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

More
06 Jun 2023 12:02 #273009 by tommylight
On the phone so might wana double check this.
LinuxCNC has pins for
mode.is.auto
mode.is.manual
mode.is.mdi
Or similar, also has state pins, but Rod knows that much better.
Basicaly you would just need it to not go into auto mode, the rest seems ok from your explanation.

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

More
06 Jun 2023 17:54 #273018 by HansU
Hmm I only could imagine to play with the homed state. So unhome the machine if one of the sensors A,B or C is not ok, otherwise home the machine. Not ideal but I have no better idea.
 

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

More
06 Jun 2023 18:30 #273024 by Aciera
Maybe you could link your fixture sensors to the estop chain in hal to have them trigger an estop UNLESS mode-is.manual is true.

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

More
06 Jun 2023 18:32 #273025 by chris@cnc
I think there are two options.
Hardware solution:
Use a separate push button for cycle start and connect all your sensors in line with it.

Software solution:
Write a custom comp like this not4 example and connect with halui.program.stop. If one of your sensor goes, off stop the program. To install this comp save file not4.comp in your folder and run
sudo halcompile --install not4.comp
and for the docs
​​​​​​​
sudo halcompile --install-doc not4.comp
now you can see in
​​​​​​​
man not4
the man page for how to use it or take the not4.hal file example.
Attachments:

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

More
06 Jun 2023 18:55 #273027 by HansU

Maybe you could link your fixture sensors to the estop chain in hal to have them trigger an estop UNLESS mode-is.manual is true.

That's what Rod suggested and he doesn't want.

@Chris
I also thought about to immediately stop the program when one of the sensors is not ok.
But the start button would be clickable in this case.


Instead of compiling not4, this could be also done with lut5 linuxcnc.org/docs/2.9/html/man/man9/lut5.9.html

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

More
06 Jun 2023 19:58 #273032 by chris@cnc
I look at lut5 several times but get a headache with this feature. too much for a mechanic's mind.

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

More
07 Jun 2023 00:33 #273048 by MaHa
This problem is more tricky than expected.
If you are using logic with personality=0x1207  (7 input for sensor, 'or' and 'nor' output)
loadrt logic personality=0x1207
addf logic.0 servo-thread

net the sensors to logic.0.in-0n

net the output as
net inhbt logic.0.or
net inhbt spindle.0.inhibit
net inhbt motion.feed-inhibit
net p_stop logic.0.nor halui.program.stop

It will inhibit spindle and feed, if a program is started, nothing happens. The dangerous about that, when all the sensors are released, the machine starts running, But it doesn't, because the 'nor' output is linked to 'halui.program.stop'  and will stop any started - and movement inhibited program.

 

 
 
Attachments:

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

Moderators: newbynobiHansU
Time to create page: 0.168 seconds
Powered by Kunena Forum