Hi, I'm having occasional, random trouble with a power fail/restore setup in production units. The intended operation goes like this:
In operation, 50Hz transitions are detected, and used to hold off a power fail routine. If 3 are missed in sequence, then the device goes into power fail mode, and stores state in NVR. When power returns and 10 consecutive 50Hz transitions are detected, the state is restored from NVR and operation resumes.
The basics such as sufficient PSU holdup time have been thoroughly checked and are fine.
This seems logical and the system works fine on the test bench, but I have occasional instances of incorrect behaviour through power dips with devices in the field. Can anyone suggest any gotchas or good practice guidelines for PF/R mechanisms? TIA
Have you been able to simulate and actually see the failure mode in action?
What kind of "incorrect behaviour"? Just going into power failure mode when it shouldn't?, or are your settings getting corrupted and some sort of lock-up occurs?
Does the device sucessfully recover from this power failure mode and continue operation?
What scope do you have to fix the problem?, i.e. full redesign, mod, firmware only?
Detecting loss of mains power cycles doesn't strike me as the most reliable way to trigger a power down mode and store settings in NVR, it's usually done on the DC supply side when it starts to discharge. e.g. power supply monitor chip triggers an interrupt when the rail drops below a certain limit. External power-on reset chip ensures your system starts up normally again. But many factors involved in such choices of course...
Check out my Electronics Engineering Video Blog & Podcast:
Had a similar problem myself about 4 years back and the UPS was the only practical solution. UPS's are an excellent device, even if you arent using with a PC.
I have used them successfully with a microcontroller based design, where backup power is needed, the design needs important data saved, needs a process to finish before switch off, or needs to be shut down in an orderly manner.
In my case, The Eaton Powerware 5110 series was microcontroller (or anything) turned on/off simply by connecting the transistor side of a
4n28 optocoupler across the "power" button.
Mains Failure / battery backup in use / low battery can be monitored by using 4n28 optocouplers to "read" the status LED's in the UPS, and your software can then take appropriate action to do what has to be done. If you have one with an LCD display, interfacing could become a big problem.
Note that optocouplers (or relays) are necessary in this application as modern UPS pretty much always float at mains potential internally, even in the low voltage circuitry. Anyone trying this needs to be aware of this and take care. Also be aware that some model of UPS's "power" switches switch more current than an opto can handle, and also some UPS may not tolerate the voltage drop across a transistor without giving false "low battery" warnings.
If you have a UPS with a serial port interface (the 5110 is USB) and can work out the data codes used to monitor and activate it, it becomes easier (from a hardware perspective) to integrate into a microcontroller based design. (note, I have not tried this myself with a UPS, but it should be able to be made to work)
Maybe a setup like this is what the OP needs to look into to solve his problem.