my ideas in action
Lab power supply with PIC microcontroller (3)
November 3, 2013Posted by on
I have some updates regarding my project.
First of all, I have a limited time to work on this project. So it is normal to take such long time to develop it.
Second I do not want to jump too fast in “making” phase and I prefer to go slowly step by step to get a good result.
So, I was worried about the stability of my previous schematic. So after a few hours on spice simulation I understand what was the problem. Well, the main issue is that the voltage loop contained 3 low frequency poles.
One is the opamp itself that has a dominant pole at ~10Hz ( see MCP6022 spec), this cannot be avoided since any opamp will have a pole approx in this range.
The second is the output node. The main issue with this pole is that is moving with the load ( R and C) and since this is a lab power supply it will always be different.So what I decided to do is to use a small output capacitance of 1-10uF and to use a dummy load of approx 10mA. This will force the output NPN ( 2N3055) to have a minimum current even if there is no load. The main reason is that when the current is very small in the 2N3055 transistor the predriver ( BC139) will have almost no current. So the gain drops dramatically and the loop become unstable.
The other pole is at the gate of the predriver NPN . this is a “design” fault since the internal node should not affect the functionality.
So I decided to change the loop architecture and to use a intermediate amplifier with of gain of approx 5. The intermediate amplifier is made with Q4 and Q9 and the gain ratio is set by R24+R9 and R18. I chooses a gain of 5 since this gives me a opamp output voltage range between 1.3V and 4.5V for a output voltage of 0 to 21V. Also this intermediate opamp has a high poles and do not require any compensation. Also since the gain of the amplifier set the voltage range at the output of the opamp this give me the ability to use a non Rain-to-rail output OPA. But I will keep the MCP6022 since the offset is very low and the input is rail-to-rail.
The other changes are the fact that I eliminated the resistor to SUP24V that was feeding the base of the predriver NPN. Also I swap the opamp inputs ( intermediate amplifier has positive polarity) and I added a 100-330nF capacitor over the opamp. This compensation capacitor is necessary since I noticed that the loop may become unstable in certain conditions ( when load is changing). I need such a small value ( in the hundreds range) since the opamp will amplify the effect of this capacity ( miller effect) and the pole generated is very low.
So the new version of the schematic is here : LabPicPowerSupply_v3_SCH
There are other minor changes :
- removed reset PIC switch
- removed capacitors from DAC output
- changed the positions of some PIC IO’s
- added protection for the input of the opamps that measure the load current ( anti-parallel diodes)
- added the buffer before ADC voltage measurement ( VMON). before this buffer was inside the voltage loop.
- the ILIM protection is made by changing the voltage reference ( output of the DAC)
- small changes in the components value
- not use the MJ3001
I made a real test of this new architecture . I used a simple breadboard and I noticed that the stability is OK . I did not had a full test under all conditions since the 2N3055 was not on the heatsink but even like that it was capable to deliver 1A at 18V output for few seconds, this means 18W !!. I had to stop it after few seconds since the 2N3055 became too hot.
The dummy output load I made it with the BF254B device. It was the easiest and I had laying around some devices. It can be made is many different ways but in my case I do not need accuracy.
There are some aspects that I noticed also. The predriver transistor BD139 can dissipate some power. This depend on the gain current (Hfe) of the 2N3055. My transistor had a gain of 35 at Ic=1mA so this means that trough BD139 will flow approx 30mA in the worst case. If this is happening when the output voltage is at 0V ( hard short of the lab supply terminals) then this means that the predriver will dissipate 30mA*24V = 0.72W. It may not seem too much but the datasheet show that this can bring the BD139 temperature to ~75degC above the air temperature. If the air surrounding the device is at 30C this give a junction temperature of 100C. It is high for my taste !!! so a heatsink is mandatory !
The other issue that I noted is that 5V regulator also need a heatsink. The current consumed may reach 50mA and the power dissipated can be 1W. In this conditions LM7805 can go to 65C above the air temperature. And this is continuous and not a “error condition” like in the case of BD139. So a heatsink is really necessary. Some may argue that is not bad to use them without heatsink since this is a tolerable temperature and many Chinese manufacturers do it… well it is my design and I do not want to risk.
I made also a layout tentative. It was not easy but at least I have a workable PCB. I still need to double-check the connection of each device to be sure that it is the correct package and the footprint is matching the actual component that I have. I hope to finish this step soon so that I can start the real manufacturing of the PCB and then component soldering.
Here are all the files for version 3 (KICAD schematic and PCB)
schematic : LabPicPowerSupply_v3_SCH
BOM list : LabPicPowerSupply_v3_BOM
PCB layout : LabPicSupply_v3_PCB