Auto halt and resume on power fluctuations

More
4 years 3 weeks ago #253711 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

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

More
4 years 3 weeks ago #253715 by rodw
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?
The following user(s) said Thank You: my1987toyota

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

More
4 years 3 weeks ago #253721 by my1987toyota
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.

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

More
4 years 3 weeks ago #253725 by cakeslob
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.
The following user(s) said Thank You: dashy81

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

More
4 years 3 weeks ago #253727 by dashy81
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.

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

More
4 years 3 weeks ago #253739 by chris@cnc
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

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

Time to create page: 0.076 seconds
Powered by Kunena Forum