Digital Control of DC voltage output
Hi,
I've successfully built a flyback power supply to generate 24 Volts DC from 240 Volts AC.
It uses a 100R (current limiting) resistor and zener diodes in series with the opto coupler diode as suggested in the TOP249 datasheet.
I would like to control the output between around 22 Volts to 30 Volts digitally, in order to make a programmable battery charger. The processor could deliver a PWM signal to be used raw, or filtered to provide an analog output, or it could just deliver on/off output (i.e. state machine).
So far I've tried a 500Hz PWM signal with varying mark/space ratio to turn on an NPN transistor to short the 10 Volt Zener nearest the ground. I put a 470R resistor from the zener to collector to limit current. But the TOP249 is so fast that, if I'm drawing only a small current, it still holds the output voltage set by the Zener chain.
Somehow, I need to deliver a controlled voltage in place of the zener which will allow the current to flow to ground. This is probably really simple, but I can't get my head around it! Any suggestions gratefully received.
Adrian
Comments
Hi Traveler,
That's great, many thanks. I'm hoping to let the processor look after the control loop but I do need to make sure that the voltage output starts at 20 Volts and only goes above this when instructed by the microcontroller. I'm pretty sure I can see how to do this now.
Cheers
Adrian
Adrian -
Glad I could be of help.
Another thing did come into mind for your project. When you get to the point that you're doing your performance testing. Make sure that you're evaluating at multiple different output voltage, different load conditions, etc. This will be especially important for when you do your control loop analysis.
Let me know how your project turns out. It would be great to hear a follow up.
Regards,
The Traveler
Good points, thank you. The one thing I think I've worked out is that the speed with which the output voltage is altered is not so important, so the PWM signal can be well filtered. So far, I'm measuring current in and out of the battery using a MAX4081 high side current chip across a 5 mOhm resistor. For the Yuasa Lead Acid batteries I'm wanting to charge, the boost charge needs to be current limited (so the output voltage will climb from about 24 Volts to 29 Volts at which point it'll be voltage limited at 29 Volts until the current drops to around 4 to 500 milli amps, at which point it needs to be voltage controlled at 26.9 Volts for trickle charging. The reason for digital control is (1) easy firmware adaptation for other batteries and (2) logging the charge and discharge history to have a real knowledge of the battery condition - the only way to really know the condition of a sealed lead acid battery.
Probably, my biggest issue will be to squeeze 200 Watts from it (with or without a fan). I'm using a Myrra 74070 trafo to get me started but I suspect this be the weak point in the end. I'll certainly update this thread when I've succeeded, or more likely when I'm stuck again!
Cheers, Adrian
Adrian -
Since you're going to be adjusting the output voltage at a fairly slow rate, I would recommend keeping a fairly traditional control loop and then see if you can come up with a configuration where you can adjust the setpoint for the output voltage. This would allow you to use a much less expensive (and complicated) uC setup. You could then still use the uC for datalogging, different charging profiles, etc but you wouldn't be stuck with using a uC with dedicated DSP, high speed DACs, ADCs, etc.
For the transformer design, I would recommend using a prototype unit at first. With off the shelf units you don't have control over many of the construction details and the vendors can be intentionally vague about their different specs. They can swap components and vendors at will and won't notify you. With a custom unit, you'll know that it's built to your specs and you won't have to do nearly as much troubleshooting.
Once you get everything setup and working the way you want....*then* introduce the variable of an off-the-shelf transformer. If you think it's likely you'll end up using a unit from Myrra, have PI Expert create a design that gets you fairly close to the listed specs on the Myrra unit. You can do this by locking down specific parameters and then choose the option "Optimize with fixed parameters" in the menu bar.
I'm not sure if it will be of help or not but I've attached an older TopSwitch Design Note from PI. It has some different control loop topologies for implementing both CV and CC output characteristics. It might give you some ideas on different things to try.
Regards,
The Traveler
Many thanks again.
Adrian
Hi,
For anyone who is interested, I've attached a sketch to show how I'm now controlling the Voltage Output of a flyback power supply with an analog input. Starting with the power supply design shown on page 21 of the TOP242-250 datasheet (Figure 42, 70 Watt power supply). The output voltage is determined by the R6/(R4+R5+R6) resistor divider delivering 2.5 Volts to theTL431 controllable Zener.
In the modified design, the analog (or PWM for digital) control value above around 0.6 volts turns the transistor on - a simple emitter follower - and so long as the transistor gain is high, most of the current to maintain the emitter voltage at 0.6 volts (pn junction) volts below this value has to come via R4 which increases the output voltage in the ratio R4/Re. In other words, the transistor steals some of the current flowing in R4 which would otherwise flow through R6, so the voltage across R4 needs to be higher to maintain the current needed in R6 to trigger the Zener.
I hope someone finds this useful. Thanks again to "The Traveler" for pointing me in the right direction.
Adrian
Hi Adrian
Would it be possible to please send me your circuit?
Thanks
Wilhelm

You're going to need to ditch the Zeners and use something like a TL431 voltage reference circuit.
I'm guessing you're using a setup similar to Figure 43 in the TopSwitch-GX datasheet. You'll want to use something more like the the setup in Figure 42, except that instead of R4, R5 and R6, you could provide the TL431 ref pin voltage from your microcontroller. You would also need to have your microcontroller sample and monitor the output voltage of the power supply in order for this to work correctly. There would also be some logistics of handling startup and shutdown in the event the microcontroller shuts down unexpectedly.
Another option that might work better would be some kind of digital or analog variable resister used in place of R4, R5 and R6. This would allow your uC to set the output voltage and then let the TL431 fully handle the control loop overhead without requiring your uC to sample and analyze the output voltage fast enough to provide a stable control loop. This could also address startup and shutdown issues if you use a non-volatile digital potentiometer.
Regards,
The Traveler