OK, you're absolutely right, a switching supply is the answer to all of the problems caused by the "creeping load current" issue caused by first one, then two Allegro chips. I should have suggested it a long time ago, when it became clear that this wasn't going to be a design that could be kept simple.
If we use one with a high input voltage rating, we can change the unregulated rail back to 48V, and use a relay with a 48V coil, which draws half the current of a 24V relay. Also, a switching converter multiplies the current as it divides the voltage, so if the 5V part of the circuit needs 30 mA maximum (which it does), the load on a 48V rail is a lot less - under 4 mA!
Buck converters are regulated, so it will replace the 78x05 completely.
And I found the PERFECT device! The Texas Instruments TPS54062 (
http://www.digikey.com/product-detail/en/TPS54062DGKR/296-28780-1-ND/2666522). It's cheap (USD 2.53), operates from up to 60V, includes the switching MOSFET and a synchronous rectifier, and is rated for 50 mA output. Unfortunately it comes in a tiny SMT package that will be difficult to hand-solder, and it needs a few support components, but it solves so many problems that it's definitely worth it.
The data sheet has lots of guidance on component choices and advice on PCB layout, which is important. There's also information on the undervoltage lockout (UVLO) feature. We will need to use this feature to prevent the device from starting up too quickly. In a switching supply, assuming 100% efficiency, output power is equal to input power. Power is the product of voltage and current. If you think carefully about it, you can see that for a given output power, the input current is inversely proportional to the input voltage.
It's only because the input voltage is 48V that the input current is so low. If the regulator tried to start up at a much lower voltage, it would draw too much current, and the circuit would "stall", to use a mechanical analogy. So the TPS54062 needs to wait until its input voltage is fairly high - say, 35~40V - before it tries to start up. This can be done using a two-resistor voltage divider feeding the UVLO pin.
So recalculating the maximum current budget (these calculations supersede post #97):
13 mA (Allegro chip #1 max operating current) at 5V
+ 13 mA (Allegro chip #2 max operating current) at 5V
+ 1 mA (MCU and misc) at 5V
+ 2 mA (power LED) at 5V
= 29 mA at 5V
× 5V (to convert to a power figure)
= 145 mW
/ 0.8 (assuming 80% efficiency in the TPS54062, which is conservative)
= 181 mW
/ 48V (to convert back to a current figure)
= 3.8 mA on V48 rail
+ 0.1 mA (TPS54062 max quiescent current) on V48 rail
+ 9.3 mA (relay coil maximum current, from 5760 ohms - 10% at 48V) on V48 rail
= 13.2 mA maximum load on the V48 rail.
That large reduction in maximum load current on the V48 rail allows us to reduce the input capacitor, C1, from 2.2 µF ±10% to 1.0 µF ±10%.
With this change, we need to recalculate the power dissipation in D5, the zener diode, whose voltage will now be about 48V. Under worst case conditions (high mains input voltage, C1 = 1.0 µF + 10%, relay OFF, minimal regulator load (2 mA)), it's about 1.6 watts! This is a problem, and I think the solution is to use several zeners in series. For example, using four 12V zeners, each zener will dissipate 0.4W maximum while the relay is OFF.
I've run out of time to work on this message. Could you have a look on Digikey for SMT 12V zeners rated for 1W or somewhat higher, download the data sheets and do a thermal analysis assuming 400 mW dissipation in each of four zeners? And tell me what you think.
Summary of design changes:
- Change the input capacitor C1 from 2.2 µF to 1.0 µF (±10% tolerance);
- Change the name of the V24 rail to V48;
- Change D5 from a single 27V zener to four 12V zeners in series (details to be confirmed);
- Change the relay coil voltage from 24V to 48V;
- Replace the 78x05 with a TPS54062;
- Add undervoltage lockout to TPS54062 so it doesn't start too soon;
- Move the power LED to the 5V rail (change the series resistor for 2 mA current from 5V);
- Reduce C2 from 220 µF to 100 µF and increase its rated voltage to at least 63V