Auto halt and resume on power fluctuations
- dashy81
- Offline
- Junior Member
Less
More
- Posts: 22
- Thank you received: 2
07 Oct 2022 19:32 #253711
by dashy81
Auto halt and resume on power fluctuations was created by dashy81
Hi,
I am coming from grbl world and a newbie to linuxcnc. By now have configured my mesa 7i96s card, 4 motors with stepconfig and my VFD. Things are working fine on bench.
In my area power interruptions happen a lot. So was looking for some inputs on how can linuxcnc detect power failure and halt the program. Later once power is back on then I should be able to resume functionality either by UI or through an external button.
I tried looking but could not find anything on these lines.
Considering linuxcnc is much advanced than grbl, my main reason to switch was that I can customize it as it's based on Linux.
If nothing is existing then I would like to get started on how can I write a small Linux application which detects power failure and sends a pause/halt command to the interpreter ... Hopefully that shall do what I need.
Please guide
CheersDashy
I am coming from grbl world and a newbie to linuxcnc. By now have configured my mesa 7i96s card, 4 motors with stepconfig and my VFD. Things are working fine on bench.
In my area power interruptions happen a lot. So was looking for some inputs on how can linuxcnc detect power failure and halt the program. Later once power is back on then I should be able to resume functionality either by UI or through an external button.
I tried looking but could not find anything on these lines.
Considering linuxcnc is much advanced than grbl, my main reason to switch was that I can customize it as it's based on Linux.
If nothing is existing then I would like to get started on how can I write a small Linux application which detects power failure and sends a pause/halt command to the interpreter ... Hopefully that shall do what I need.
Please guide
CheersDashy
Please Log in or Create an account to join the conversation.
- rodw
- Away
- Platinum Member
Less
More
- Posts: 10785
- Thank you received: 3552
07 Oct 2022 20:53 #253715
by rodw
Replied by rodw on topic Auto halt and resume on power fluctuations
This is probably a big ask. If you think about it, if a PC has power removed, it is terminal. With no power it can't save anything.
Usually this is managed at the operating system level.
Install a UPS and let it advise Linux of the power outage. Normally a UPS will tell the server when the batteries are almost flat to tell it to shut down. I'm not sure how this event could be used to shutdown Linuxcnc.
But what about power to the other hardware and most importantly power to the machine?
Usually this is managed at the operating system level.
Install a UPS and let it advise Linux of the power outage. Normally a UPS will tell the server when the batteries are almost flat to tell it to shut down. I'm not sure how this event could be used to shutdown Linuxcnc.
But what about power to the other hardware and most importantly power to the machine?
The following user(s) said Thank You: my1987toyota
Please Log in or Create an account to join the conversation.
- my1987toyota
- Offline
- Platinum Member
Less
More
- Posts: 825
- Thank you received: 335
07 Oct 2022 23:45 #253721
by my1987toyota
Replied by my1987toyota on topic Auto halt and resume on power fluctuations
I have pondered that question as well. Depending on power drawl one may get by with
just a decent UPS and a bigger battery. Anything more then 1KW and one would need about
200AH worth of battery and either a good battery charger and inverter or a whole house battery
backup / solar off grid type of setup. Either way that option can get expensive quick it just depends
on power requirements.
just a decent UPS and a bigger battery. Anything more then 1KW and one would need about
200AH worth of battery and either a good battery charger and inverter or a whole house battery
backup / solar off grid type of setup. Either way that option can get expensive quick it just depends
on power requirements.
Please Log in or Create an account to join the conversation.
- cakeslob
- Offline
- Platinum Member
Less
More
- Posts: 799
- Thank you received: 231
08 Oct 2022 01:56 #253725
by cakeslob
Replied by cakeslob on topic Auto halt and resume on power fluctuations
Are you trying to do something like 3d printers with UPS where they can recover from brownout or something?
I like the concept though. On most industrial machines Ive used, there is a signal sent when power input is unstable or low, and estops everything. That would probably be safer than halt/pause. You could hook that signal to the estop loop in hal or something. Would probably be similar to the way people do it with air pressure sensors.
I like the concept though. On most industrial machines Ive used, there is a signal sent when power input is unstable or low, and estops everything. That would probably be safer than halt/pause. You could hook that signal to the estop loop in hal or something. Would probably be similar to the way people do it with air pressure sensors.
The following user(s) said Thank You: dashy81
Please Log in or Create an account to join the conversation.
- dashy81
- Offline
- Junior Member
Less
More
- Posts: 22
- Thank you received: 2
08 Oct 2022 03:40 #253727
by dashy81
Replied by dashy81 on topic Auto halt and resume on power fluctuations
Thankyou all for your inputs...
That's exactly I want to do. Additional circuitry and maybe a small micro for sensing fluctuations on the mains. Once output signal is active all power to machine is off.
Pc and controller boards however will be on a power backup/ ups so I ll not loose state. But I need to have a way to halt the linuxcnc as soon as the output signal is active.
Is that feasible through hal ? Are there any examples to do it? I am using mesa 7i96s as controller.
That's exactly I want to do. Additional circuitry and maybe a small micro for sensing fluctuations on the mains. Once output signal is active all power to machine is off.
Pc and controller boards however will be on a power backup/ ups so I ll not loose state. But I need to have a way to halt the linuxcnc as soon as the output signal is active.
Is that feasible through hal ? Are there any examples to do it? I am using mesa 7i96s as controller.
Please Log in or Create an account to join the conversation.
- chris@cnc
- Offline
- Platinum Member
Less
More
- Posts: 529
- Thank you received: 139
08 Oct 2022 07:43 #253739
by chris@cnc
Replied by chris@cnc on topic Auto halt and resume on power fluctuations
Halui signals could be a good option in this case. Or advanced level is to do a subprogram and go into save position in some special event.
linuxcnc.org/docs/stable/html/hal/halui-examples.html
linuxcnc.org/docs/stable/html/gui/halui.html
linuxcnc.org/docs/stable/html/hal/halui-examples.html
linuxcnc.org/docs/stable/html/gui/halui.html
Please Log in or Create an account to join the conversation.
- cakeslob
- Offline
- Platinum Member
Less
More
- Posts: 799
- Thank you received: 231
08 Oct 2022 18:22 #253768
by cakeslob
Replied by cakeslob on topic Auto halt and resume on power fluctuations
Ive only ever looked into it from an airpressure sensor perspective, but it should be close to the same thing
Here are my resources for it
forum.linuxcnc.org/10-advanced-configura...efore-doing-anything
forum.linuxcnc.org/49-basic-configuratio...xternal-safety-relay
maybe this one
forum.linuxcnc.org/10-advanced-configura...-pressure-monitoring
Here are my resources for it
forum.linuxcnc.org/10-advanced-configura...efore-doing-anything
forum.linuxcnc.org/49-basic-configuratio...xternal-safety-relay
maybe this one
forum.linuxcnc.org/10-advanced-configura...-pressure-monitoring
Please Log in or Create an account to join the conversation.
- dashy81
- Offline
- Junior Member
Less
More
- Posts: 22
- Thank you received: 2
23 Apr 2023 13:48 #269684
by dashy81
Replied by dashy81 on topic Auto halt and resume on power fluctuations
Coming back to this topic after having visited a few Chinese cnc router shops. All of them seem to have ability to continue from where power fail occured and job stopped due to this. None of them are using any power backup.
About power backup a decent size online ups would cost me almost same amount as my home made router.
Someone who has tried pls suggest. I am willing to work out with any of you to have a solution.
In my opinion this must be a default feature for any cnc and linuxcnc shall be able to process the gcode and be able to do initial one time setup and skip through the already executed code. A simple parser can be used to mark each line executed and on continue option it shall be able to analyse the gcode modules and be able to do initial spindle, feed changes and directly start executing the line which are not marked as executed.
Pls suggest...
About power backup a decent size online ups would cost me almost same amount as my home made router.
Someone who has tried pls suggest. I am willing to work out with any of you to have a solution.
In my opinion this must be a default feature for any cnc and linuxcnc shall be able to process the gcode and be able to do initial one time setup and skip through the already executed code. A simple parser can be used to mark each line executed and on continue option it shall be able to analyse the gcode modules and be able to do initial spindle, feed changes and directly start executing the line which are not marked as executed.
Pls suggest...
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19463
- Thank you received: 6529
23 Apr 2023 14:47 #269689
by tommylight
Replied by tommylight on topic Auto halt and resume on power fluctuations
First, you need a UPS or a laptop so the PC can stay on, otherwise this does not work.
Then use a relay that closes contacts when there is power, wire one contact to LinuxCNC feed-hold so it stops when power goes off.
Note the gcode line it stoped, shut down and wait for power to come back.
LinuxCNC has a feature to save the joint position on power failure so you can always know where is stopped.
It also has "run from line" as long as that line is not an arc.
Marlin writes to SD every line it is executing, so it can continue easily.
-
We have ocasional power cuts, no UPS, nothing, just run from the line it stoped. On plenty of machines, so far never needed anything more.
Then use a relay that closes contacts when there is power, wire one contact to LinuxCNC feed-hold so it stops when power goes off.
Note the gcode line it stoped, shut down and wait for power to come back.
LinuxCNC has a feature to save the joint position on power failure so you can always know where is stopped.
It also has "run from line" as long as that line is not an arc.
Marlin writes to SD every line it is executing, so it can continue easily.
-
We have ocasional power cuts, no UPS, nothing, just run from the line it stoped. On plenty of machines, so far never needed anything more.
The following user(s) said Thank You: DPFlex
Please Log in or Create an account to join the conversation.
Time to create page: 0.065 seconds