HALUI: pause/resume program following edges of an input
13 Sep 2022 22:07 #251852
by Guglielmi
HALUI: pause/resume program following edges of an input was created by Guglielmi
Hello guys,
I would like to pause/resume program in case the water cooling stop working (or over-temperature).
I designed a small pcb with arduino that handle water flux and temperature and provides an output
connected to an input of my RPI with LinuxCNC.
I wrote this very basic HAL configuration and it seems working fine:
It works but however I have some doubts because I did not found specific explanation about behavior of
this kind of interface.
Questions:
- my code based on the input state, keep pause or resume high. Could this configuration interfering with pause button on hmi (axis)
or for example tool change?
- it seems not a problem when program is not running.. but it's correct to keep resume high always (when cooling works fine)?
The best way to handle these inputs in my opinion would be with edges: positive edge of input --> pause, falling edge of input --> resume.
I this case if the cooling works fine ever, nothing is set and I can't see issues... but the code I wrote it doesn't work:
Basically with edges of my input nothing happen, cnc still running the program.
How is the best behavior of command to emulate like the button pressed in case of cooling error and resume then error is
not present any nore?
Thanks in advance
Andrea
I would like to pause/resume program in case the water cooling stop working (or over-temperature).
I designed a small pcb with arduino that handle water flux and temperature and provides an output
connected to an input of my RPI with LinuxCNC.
I wrote this very basic HAL configuration and it seems working fine:
# External Program Pause/Resume Button
loadrt not count=1
addf not.0 servo-thread
net prg_pause halui.program.pause not.0.in <= hal_gpio.pin-18-in
net prg_resume halui.program.resume <= not.0.out
It works but however I have some doubts because I did not found specific explanation about behavior of
this kind of interface.
Questions:
- my code based on the input state, keep pause or resume high. Could this configuration interfering with pause button on hmi (axis)
or for example tool change?
- it seems not a problem when program is not running.. but it's correct to keep resume high always (when cooling works fine)?
The best way to handle these inputs in my opinion would be with edges: positive edge of input --> pause, falling edge of input --> resume.
I this case if the cooling works fine ever, nothing is set and I can't see issues... but the code I wrote it doesn't work:
loadrt not count=1
addf not.0 servo-thread
net prg_pause halui.program.pause not.0.in <= hal_gpio.pin-18-in
loadrt edge count=2
addf edge.0 servo-thread
addf edge.1 servo-thread
net edge_pause edge.0.in not.0.in <= hal_gpio.pin-18-in
net edge_resume edge.1.in <= not.0.out
net prg_pause halui.program.pause <= edge.0.out
net prg_resume halui.program.resume <= edge.1.out
Basically with edges of my input nothing happen, cnc still running the program.
How is the best behavior of command to emulate like the button pressed in case of cooling error and resume then error is
not present any nore?
Thanks in advance
Andrea
Please Log in or Create an account to join the conversation.
- tommylight
- Online
- Moderator
Less
More
- Posts: 19208
- Thank you received: 6437
13 Sep 2022 22:26 #251853
by tommylight
Replied by tommylight on topic HALUI: pause/resume program following edges of an input
There are pins named:
motion.feed-hold
motion.feed-inhibit
iocontrol.0.lube_level
Probably should do exactly what you need without the added logic.
motion.feed-hold
motion.feed-inhibit
iocontrol.0.lube_level
Probably should do exactly what you need without the added logic.
Please Log in or Create an account to join the conversation.
14 Sep 2022 12:42 #251894
by Guglielmi
Replied by Guglielmi on topic HALUI: pause/resume program following edges of an input
Many thanks!
I saw already motion.feed-hold and I remember it was working, halting motors.. yes, most probably it's the right way.
This evening I will change, test and report the feedback!
I abuse of your patient for another related question: motion.feed-hold will halt also the spindle? I'm asking because right now
the spindle is handled manually (start/stop through panel key of inverter) but next step will be connect it with modbus..
I'm curious to know if this command will consider also spindle automatically or I have to write some logic beside
(anyhow I hope to find a solution.. I'm sure to be able with forum help! ).
I saw already motion.feed-hold and I remember it was working, halting motors.. yes, most probably it's the right way.
This evening I will change, test and report the feedback!
I abuse of your patient for another related question: motion.feed-hold will halt also the spindle? I'm asking because right now
the spindle is handled manually (start/stop through panel key of inverter) but next step will be connect it with modbus..
I'm curious to know if this command will consider also spindle automatically or I have to write some logic beside
(anyhow I hope to find a solution.. I'm sure to be able with forum help! ).
Please Log in or Create an account to join the conversation.
26 Sep 2022 13:39 #252766
by andypugh
Replied by andypugh on topic HALUI: pause/resume program following edges of an input
No, the spindle will continue to run if feed-hold is set true.
I think that halui.abort and halui.program.stop will stop everything, but will also make it difficult to restart from where the problem occurred.
I think that halui.abort and halui.program.stop will stop everything, but will also make it difficult to restart from where the problem occurred.
Please Log in or Create an account to join the conversation.
Time to create page: 0.350 seconds