Alex's Linear Power Supply Build Log

It is usually a good idea for a closed feedback system to stay closed. :wink:

You do have the schematic don’t you?

The regulator is not controlled by the micro and disabling the output is of no consequence when the fuse is open.

As for sensing the open fuse I would simply have the output connected to an optoisolator to indicate fuse open status. Then the micro is isolated from the output and you don’t need to worry about surge currents etc when comparing the voltages. However, this may not work well for low (<2V) output voltages. In which case your current approach might be superior if well implemented.

Personally I would have the micro monitor the output current and when it exceeded the max threshold for a max period of time I would disable the output and indicate an overload before the fuse had a chance to open. In this case the fuse would only be for safety reasons.

[egg on face] My digital background is showing again. I am accustomed to using spiffy new power mosfets as switches and making transistors do the hot, sweaty work of linear regulation so I saw Q2 as a switch to remove power from the output if the voltage or current settings were ever exceeded and kept expecting to see a power transistor just beyond Vin. That was why I thought VFeedback might be only a digital input to the voltage regulating function of the micro, or to some other analog circuit also just beyond Vin. Now I understand some of what didn’t make sense before.

I can’t find any listings for 1F34AD but I did find one for FDA38N30 with a 312W max rating. I assume Q2 is a power mosfet designed to operate in the linear region without thermal runaway (current focusing?). And now I agree completely with 1.21Gigawatts about keeping VFeedback on the same side of the fuse as the device it is controlling. And I take it that Q4 is not an over current crowbar switch that shorts out the voltage feedback whenever the current is exceeded but actually modifies the output of U5B to lower the output voltage until the current drops back down to the limit setting? I still tend to think of them as switches and if you used them in a feedback setting like this they would oscillate until they found their resonant frequency. Still hard for me to think of them as only operating in linear mode under their safe operating area.

Which leads me back to one of the other concerns us digital guys try to avoid. With the direct feedback and only two 47uF caps to dampen things out, isn’t there some concern that this could start a high frequency oscillation in either voltage or current regulation mode? Especially with the two driver op amps being operated at full gain with no feedback? I am guessing that a small, high frequency cap from VFeedback and IFeedback to ground to short out a high frequency AC component and still allow the DC regulation to operate unchanged would help with that. Or is that just something the analog guys would tell us in class to scare us and keep us in line :grinning:?

One more feature I would suggest considering since you already have Vset, Iset, a rough estimate of Vin, and an LCD display is to compute the maximum power dissipation for (Vin - Vset) * Iset and compare that with your derated power rating given your heat sink and fan combination and warn the user if it might lead to overheating before the fans reach top speed. Might as well show off all those fancy things you have already included!

You might also want to recheck your equation:

Vfb = (R19 / (R12 + R20))*Voutput

The equation is wrong but you get the correct answer. :thinking:

From just over two weeks ago …

While operating as a voltage regulator the circuit tries to maintain Vfeedback according to Vset. But once Ifeedback reaches Iset the circuit starts to regulate the current by dropping the voltage. Of course this causes the voltage regulator part of the circuit to fight back as it tries to control the voltage. Not quite the way I would arrange that circuit.

MOSFETs are very linear devices which is what makes them suitable for amplifier applications.

But they do have feedback. It would be more apparent if you rearranged the circuit.

Some feedback compensation would probably be a good idea. You’ll notice a few posts back I did ask if he had done any transient response analysis, but we haven’t heard from him since. I wouldn’t expect the circuit to oscillate but there may very well be some ringing.

hey guys,

Sorry for not posting in a while, got called away fro work and had to do some traveling. definitely got the Vfeedback and Test outputs backwards! Same with the resistor divider equation. I have not been able to do any transient response tests of the circuit yet but as soon as i get back to my bench at home I’ll ding back into it.
I like the suggestion for the MAX6817 debounce IC I’ll probably give that a go.

I think I will take the suggestion of putting another ADC on instead of trying to use the on eon the micro. I did some looking and found a slightly cheaper ADC from Mouser as well that I think I will switch to, the MAX11612EUA.

Sounds like some good changes. The last time I had looked getting a 12bit AC with 6 or more channels in a single package cost more than using two 4 channel devices. But with the one you found the 11614 you get 8 channels for about the same price as two 4 channel 11612 devices. That makes it dealers choice to use two small ones that can be placed closer to their signal sources, or a single bigger one save a little board space.

1.21Gigawatts, I still don’t fully understand the mixing of the voltage control portion with the current control portion of the regulator drive. You said that there are other ways to do this. I was wondering if running both drive voltages into a single summing junction with diodes so that the one with the lower drive voltage would control the output drive voltage (higher if an inverting stage). That way they would operate symmetrically. If that approach works at all. It would need the non-regulating channel to go high so that it would not interfere with the other side. I guess that you would have to combine the anodes to the summing junction and cathodes to each drive voltage so that the one going high will be reverse biased and be isolated while the lower one will pull down the op amp input and set the drive level and output voltage of the regulator. Would a 100K resistor from Vin to the summing junction to keep it from floating lower value than the voltage/current limited drive signal be necessary?And there would still have a diode drop shifting things a bit. This would be so much easier in digital where a single compare statement and pick which one to send to the PWM or DAC output :stuck_out_tongue:.

To keep piling bells and whistles on, you already have VFeedback and IFeedback, you can have the micro compare them to see which is in control and indicate on the LCD which mode the power supply is in. There may be some cases that you want to stop the moment it switches to current limit and having that on the display could be helpful.

I guess Im Convinced! DAC’s on the way, and another encoder just to have the physical differentiation between voltage and current settings. Im going to do some research and see what DAC I want to use. The options and benefits seem to outweigh the 7$ a piece price tag for the analog pots I am using.:rofl:

I hope the next iteration goes well!

You might look at the MCP4728. It is a 12bit DAC with 4 channels out, I2C control, internal Vref with 2X output gain, on board EEPROM to hold power up defaults and I2C addressing, settling time of 6 micro seconds for under $2.50. There is no need for four channels out, only one is currently indicated, but it is always nice to have some expansion as long as the cost is low. Similar devices with only 1 channel are about half the price. And using the DAC instead of analog feedback, you can decrease the op amp count to one for the current sense and one to add a gain of around 3.66 to the DAC output to reach 15V gate drive, so adding the chip for the DAC should be balanced by reducing the op amp packages by one. And with Vset and Iset determined by digital control will free up to analog inputs to the ADC so only one package will be needed there.

The one concern with doing it all in digital is if the micro locks up and the load changes then the output regulation will be off. One approach is to put the output regulation in an independent, fast interrupt routine and also set the watchdog timer to shut everything down if the interrupt fails.

In the interrupt routine, read the ADC for the VFeedback and IFeedback, select which one is in control, write it out to the DAC, then reset the Watchdog timer. Since the Vset and Iset are determined by the software they don’t need to be measured as well. With the Watchdog timer set for 16msec if the micro locks up or something and misses 16 cycles of the interrupt, the watchdog timer trigger and will allow setting the DAC to zero and then shutting down to prevent runaway output.

The ADC converts in about 300 micro seconds and the DAC output settles in 6 micro seconds, so you would need to program one of the timers for around 1msec to leave slack time for the main program to run. You can even implement a PID in software in the interrupt loop to get rapid return to voltage with changing loads and still eliminate any oscillations. The ATMeage does not have much arithmetic capability so if you want to linearize the moset output or do a PID keep the calculations as simple as possible.

Reading the rotary encoders and writing information to the LCD, handling all the menus and sub-menus and pretty much all the other microcontroller operations can be done in the main code looping around indefinitely. Startup would program the DAC to zero as well as setting the EEPROM to output zero at power up, starting the mosfet gate control loop then setting up the watchdog timer. With Vset and Iset deterined by software, you can also change them as needed to prevent over heating. If the user is turning the current limit knob up too high you can lower Vset at the same time to compensate or do the same with Vset changing Iset.

The specs on the FDA38N30 make it look like the linear mode is not especially linear, and one possibility is to measure the current conduction of the FDA38N30 for the full range of gate voltage inputs and then work up on your computer a piece-wise linear correction factor to make the mosfet conductivity a flat, linear function of the digital gate control value generated in each interrupt loop above. However, the feedback process will correct for the non-linearity in the mosfet. The linearity of the power supply will be the combination of the ADC converter for Vfeedbck and IFeedback and the digitally generated Vset and Iset.

With the speed of the ADC allows about 1msec response to changes in the load. Not as quick as the analog circuit but not too slow. With a 1msec response time, a 30A surge would drain the two 47uF caps by about .350V. To get a smoother output under worst case conditions you would need to increase the size of the caps.

If all this sounds like too much, you can always stick with what you have now. It is mostly just a matter of personal preference and how much you need the extra features.

I’m not trying to “convince” you, it is your design you should do what you are comfortable with.

I think the second encoder is a good idea.

If you do go that route there are chips that have both the ADC and DAC in one package.

Only one? :thinking:

:astonished: Only a digital person would even say such a thing! There would be no point in measuring the transient response of such a power supply as it would be guaranteed to be abysmal by design.

Let’s not forget the time spent communicating with these devices over a serial bus.

It looks pretty linear to me between 1 and 10 amps, and even more so below 2.5 amps which is the limit in this case.

No, it’s mostly a matter of having a design that works vs one that doesn’t. :wink:

Actually, if he wants one for Vset and one for Iset, which I think is a very good idea, he either needs to setup some way to multiplex one or both of the rotary encoders to also operate the menus, change settings, etc. Having three encoders would allow instant change of voltage or current limit, even while navigating the menus and all the extra functions. Or you can use a single one with switch and LEDs to indicate voltage, current, or menu mode and use the push button to cycle through them. So three encoders reduces confusion, allows instant access to voltage and current controls, and reduce cases of changing the wrong one, especially when you are in a hurry.

Some how this has completely slipped past me. So I looked and found one that is rather like the micro pins, each of the 8 channels can be individually set to analog voltage out, analog in, digital out, digital in with I2C for about $7. That would be a possibility for this project.

Well, even I felt a little uncomfortable with the slow response time. In this case, at least 2 DAC channels for Vset and Iset, use the rest of the feedback as is except possibly use digital control to switch from voltage regulation to current regulation or back. That could simplify the control mixing without slowing the normal load current response time.

This is one for the digital guy. I left out the serial communication time for the second conversion because it is small compared to the conversion time (roughly 1/5th) and included the DAC output settling time just as information. Since the DAC is an output not an input, it can be set and then return from interrupt whereas the ADC conversions must complete before they can be read. The results of the first are read during the second conversion, the second adding the com time you mentioned but having little effect on the interrupt service time

At normal I2C speed of 400Khz the communication time would be around 1/5 the sample time, and I think you can start the second sampling while reading the first. This particular ADC chip has a high speed version of the I2C bus as an option. It is 3.4Mhz, about 9 times faster than the 400Khz.

2.5 amps. Some how I was always vague about the intended current range but I was thinking it was much larger. I was also trying to use figure 1 to derive the linearity, which has no reading below a gate voltage 5.5. Looking at figure 2 it is a log-linear with the response curving downward. Always hard to judge linearity on a log-linear so I eyeballed the numbers and replotted on linear-linear. There it curves upward more strongly. With only 2 points below 2.5 amps and none below 1 amp it still looks like it is not terribly linear. But the feedback system will take care of all of that so I raised a mote point earlier

i
So true! At least in software you KNOW that it will not work the very first time, but you can keep iterating until you get it to mostly work and you have slowed down on adding bells and whistles!

And it would seem that I still need to work on my remedial note reading for schematics, as well as basic circuitry.design.

Three now? :laughing:

I don’t know how you arrive at that figure. I haven’t looked into the exact command set of these ADC/DAC but, depending on the mode you are running the ADC in, you typically send at least a single byte command to begin a conversion. That’s 8 bits plus the start condition plus the acknowledge bit plus the stop condition, That’s 11 bits, at 400KHz that’s 27.5us. To read the results is another command plus reading 2 bytes per channel, plus start, stop and ack = 5 bytes/40 bits + 3 bits = 43 bits or 107.5us. Then writing the new data to the DACs will again take about 107.5us, that’s a total of 242.5us or ~81% of the conversion time.

Edit: The above is based on a two channel ADC instead of four so it should instead read:

… 2 bytes per channel, plus start, stop and ack = 9 bytes/72 bits + 3 bits = 75 bits or 187.5us. … that’s a total of 322.5us.

Ooops! I only counted one ack bit above when there is actually one per byte:
Start conversion: 27.5us
Read from ADC (4ch): 207.5us
Write to DAC (2ch): 117.5us
Total: 352.5us

Wonderful! If only the ATMega supported that.

From post 11:

Yes, Figure 2 titled “Transfer Characteristics” is a semi-log graph and, looking at the 25C plot, it curves slightly to the right, but it is also almost vertical so the log nature of the Y axis has less effect. Do the math, for Vgs of about 5.25V Id = 1A, Id=10A when Vgs is about 5.9V. Picking a point in the middle, Vgs=5.6V, to be linear Id would equal about 5.8A. Looks pretty close to me. But then, as you said, it is irrelevant.

Hey all,

Had to put the power supply to the side for a bit while i was away on work and waiting for parts to arrive. I got the boards back from JLC PCB and the quality is pretty good. I don’t have time yet to get the whole board assembled but I thought I would get the new power section up and running so I could do some load tests on the 5 volt rail.

The voltage is pretty solid throughout a wide input range as expected
5.11 volts with just the LED loading down the output at 2 mA or so. This drops to 4.99 Volts at the rated 500 mA and the switcher IC gets a bit on the warm side, but the diode I’m using is not exactly the correct one as per recommended in the data sheet so I think there is some loss there. I am still waiting on the correct diode as well as some of the digital components

1 Like

another note, here is a scope view of the transient turn on response of the output voltage. currently just running from a 12V input voltage. about 1.53 milliseconds rise time when power is applied.

I’m sure it’s cooler than the previous linear regulator, but I wouldn’t expect it to be too warm at 500 ma. I have a switcher bucking 24V down to 3V3 at close to 1 A and it barely gets warmer than ambient.

Care to post the schematic for your new board?

Sure, schematic is here.

Lab Bench Power SupplyV3.0.pdf (234.4 KB)

I see you have an input filter on your DC-DC converter. If that isn’t designed correctly it can do more harm than good. It might be interesting to put a scope on it and see how it is performing. A poorly designed input filter can cause the converter to be less efficient.

Also, I would use the output of the current control section (Q4) to instead drop VSET instead of pulling down the output of the voltage control section. As it is it might not be very stable at the current threshold as the voltage control section would continue to try to control the voltage.

I did some more looking into the board and aside from the budget wire you saw in the photo for the feedback wire, I think I was also using a blown catch diode. Checked it out with a meter and it looks pretty dead both ways. I re did the assembly with a nex converter as it seems I also killed it during the process. It looks pretty good now, almost no heat buildup at the converter and the as expected 2MHz switching frequency at the catch diode. The output voltage seems to collapse though as I go up above 400mA, down to 4.38V from the nominal 5.03V. I’m thinking its partly my layout not having large enough traces for the current path? I tried to use big copper pours for all of the converter layout though.


Uploaded one of the wrong photos.

As I mentioned above, check you input filter.

Looking at the input to the switcher and prior to the filter on the scope, I don’t see any oscillations or noise getting into or through the filter at those loads. I did however lower the inductor value from the 470uH i originally designed to a 100uH. I have populated the rest of the board and have started testing the rest of the digital components as well.