Help with pic based psu

Got a hardware problem? ask for help

Help with pic based psu

Postby lordrafa » February 22nd, 2017, 6:14 pm

Hello everyone this is the first message that I post in this forum. I have been reading this forum and the blog for a while and I find it really interesting what is in here, so maybe someone can help me.

I am trying to understand how the following power source works and I am getting a little bit confused.
Image

In the diagram I can see that there is 4 opamp, two to measure the voltage and current of the output and two to set this values.

I can more or less understand how the measure is done and also I understand that the other two are going to be controlled by the pic by pwm, however I don't understand the configuration of this opamps. Why do we have a capacitor on the loop, why the diodes son the output loop reversed, which one is the the transistor close to r3 and diodes d1 d2 job?
lordrafa
 
Posts: 4
Joined: February 22nd, 2017, 5:59 pm

Re: Help with pic based psu

Postby bandersnatch » February 23rd, 2017, 3:34 am

Hi,

I'm not a PSU expert & my analog theory is pretty rusty but I'll give it a go... ;^)
With any luck one of the analog cracks (kww ???) will confirm/correct my analysis.

IMHO Q1 is a constant-current source that always delivers 10ma.
This current either flows into the output transistors or is consumed (sunk) by the outputs of IC3A IC3D.
The more current consumed by the op-amps, the less current flows into the output transistors = lower output voltage/current.
This is why diodes D4 & D5 seem to be the wrong way around.
The op-amps function as current shunts and current must therefore flow into the output stages.

Op-amp inputs 2 & 13 provide an analog negative feedback loop for regulating (biasing) the steady-state output voltage/current
Op-amp inputs 12 & 3 allow the PIC to control the desired output voltage/current.
Although the PIC sends PWM signals, these are converted to "roughly equivalent" analog
levels by R29+C19 and R28+C20.

C14 & C15 implement a low-pass filter to ensure that any spikes are not passed to the output stage.
25V 1-microsecond spikes would not be a good idea when driving a 5V cmos circuit (!)

Apologies to the purists for the over-simplification. All feedback/corrections are welcome.

I hope this helps you somewhat.

STFB
bandersnatch
 
Posts: 148
Joined: September 17th, 2014, 12:06 pm

Re: Help with pic based psu

Postby lordrafa » February 23rd, 2017, 1:05 pm

bandersnatch wrote:Hi,

I'm not a PSU expert & my analog theory is pretty rusty but I'll give it a go... ;^)
With any luck one of the analog cracks (kww ???) will confirm/correct my analysis.

IMHO Q1 is a constant-current source that always delivers 10ma.
This current either flows into the output transistors or is consumed (sunk) by the outputs of IC3A IC3D.
The more current consumed by the op-amps, the less current flows into the output transistors = lower output voltage/current.
This is why diodes D4 & D5 seem to be the wrong way around.
The op-amps function as current shunts and current must therefore flow into the output stages.

Op-amp inputs 2 & 13 provide an analog negative feedback loop for regulating (biasing) the steady-state output voltage/current
Op-amp inputs 12 & 3 allow the PIC to control the desired output voltage/current.
Although the PIC sends PWM signals, these are converted to "roughly equivalent" analog
levels by R29+C19 and R28+C20.

C14 & C15 implement a low-pass filter to ensure that any spikes are not passed to the output stage.
25V 1-microsecond spikes would not be a good idea when driving a 5V cmos circuit (!)

Apologies to the purists for the over-simplification. All feedback/corrections are welcome.

I hope this helps you somewhat.

STFB


Thank you so much for your answer this make everything much more clear.

I didn't know that the op-amps could act as a sunk. Also I would need to read more about what is a current source because I never have seen this concept before.

I still a little bit confused about the supplied voltage to the op-amps, it looks quite hight and weird if I am not wrong it has a -1.2v on the negative and up to 30v on the positive. I find it hight because they are not directly connected to the output and they are not the source for the darlingtons. Also I would liked to know why not to drive directly the darlingtons with the output of the op-amps using it like a source rather than a sink but maybe this is more a design decision.

About D1 and D2 I have been reading about what they could be and I think that they could be there as a short circuit protection.

Anyway thank you so much for your help, I am more on the binary world of computer engineering and the analogical world looks like dark magic to me hehe.

I am thinking to assemble this PSU (replacing the PIC by other that allow me connect the LCD and use the TX/RX so I can communicate easily with an ESP8266 module), so if anyone else wants to add more info, I would be more than glad.
lordrafa
 
Posts: 4
Joined: February 22nd, 2017, 5:59 pm

Re: Help with pic based psu

Postby bandersnatch » February 23rd, 2017, 2:21 pm

Hi,

I suggest you first look for "standard" constant current PSU circuits.
Using 2 diodes to greate a standard collector-base voltage drop of 1.2 v is a standard trick in constant current supplies.

One thing you must remember is that the PIC 16F876A is a "programmable" device and
you will need an identically programmed PIC in order to duplicate this circuit.

Reading PICs is a task ranging from impossible to very difficult.
(state-machine analysis etc...)
You wil probably have to write your own code for the PIC, which is also not easy.

The circuit looks very nice and I can understand why you want to copy it but I suggest
you look for an "open source" 0-25V power supply circuit if you want to build your own PSU.
There are HEAPS of kool "smart-psu" projects out there with all the information that you will need.
The open source projects also provide the code you need for the PIC/microcontroller used.

Good luck!!

STFB
bandersnatch
 
Posts: 148
Joined: September 17th, 2014, 12:06 pm

Re: Help with pic based psu: Postscript

Postby bandersnatch » February 23rd, 2017, 3:02 pm

Hi again,

G$$gling for "lt1491cn psu circuit" will lead you to:

http://circuitdiagram.net/0-24vdc-digital-pic-power-supply.html

Where you can read more comments from other people about this circuit.
You will also see requests for the PIC code from other people but the DL links seem to be dead.
IMHO is this particular circuit is a "dead-end" unless you can find the PIC code...

If you really wanna build a 0-30V PSU then I suggest you first search hackaday for "power supply"
& see if anything looks good for you:

e.g. http://www.kerrywong.com/2013/12/02/a-digitally-controlled-dual-tracking-power-supply-ii/

or http://tuxgraphics.org/electronics/201005/bench-power-supply-v3.shtml
- has a detailed explanation & all the info you need.
etc....................

Otherwise G$$gle for "bench PSU project" & wade through the 1,000s of projects.

IMHO the most important factors are:
1/ Is the PSU the right one for your needs?
2/ Can you easily source all the parts in your country?
3/ Is ALL the project information actually available?
(ESPECIALLY the code for the PIC/microcontroller)
4/ What extra resources do you need for programming the "smart" components in the project?
- You may need to first build/buy a PIC/microcontroller programmer before building the actual PSU.

5/ It is often better to start with a simpler project that might not have all the features you want
but is easier to build....


It all depends on your motivation. If you simply need a bench PSU for a larger project then
you are better off buying one of the many PSU kitsets.
If you wanna have fun learning about PSUs then the extra effort will be worth it but
"smart" PSUs often have hidden extra work (e.g. PIC/microcontroller programming) that
can quickly become very challenging & frustrating

My personal approach is to take small steps, with each step providing the reward of
something that actually works. First copy someone else's project & then expand it to
suit your wishes...

OK, 'nuff said.
I wish you luck, whatever path U take ;^)))

STFB
bandersnatch
 
Posts: 148
Joined: September 17th, 2014, 12:06 pm

Re: Help with pic based psu

Postby lordrafa » February 25th, 2017, 10:54 am

Thanks bandersnatch for your comments.
In the web http://circuitdiagram.net/0-24vdc-digit ... upply.html there is a link where you can download a ZIP with all the info/source code to assemble this PSU. The code is write in C so port it to a most modern PIC should be relatively easy, since I have some experience with PIC/ESP8266 programming.

This power supply would cover all my need with the 24V/4A and has a really clear schematic that is why I have focused on this PSU. Also as part of this project I would like to learn how a PSU is build and know more in detail why each section has been of the PSU has been designed.

Thanks for the link that you have provided. There is a lot to take from there to learn more about how a PSU its build.

About the diodes in serial I can understand that in each diode there will be fall of 0.6v. I have read in some other page that you can build a short circuit protection for a current supply using this technique. Do you think that for this PSU, this is the case? would make sense since if the transistor Q1 stops to send current, I would suppose that the darlingtons would stop to work but I am not sure about this.

Also do you have any clue why the -1.2v in the op-amp?
lordrafa
 
Posts: 4
Joined: February 22nd, 2017, 5:59 pm

Re: Help with pic based psu

Postby bandersnatch » February 25th, 2017, 1:45 pm

Hi,

Re:
lordrafa wrote:In the web http://circuitdiagram.net/0-24vdc-digit ... Supply.html there is a link where you can download a ZIP with all the info/source code to assemble this PSU. The code is write in C so port it to a most modern PIC should be relatively easy, since I have some experience with PIC/ESP8266 programming.


Yeah I saw this link too but it seemed to be broken & I had no luck finding the source elsewhere.
I just wanted to make you aware of the fact that you will need the PIC code AND beg/borrow/build a PIC
programmer in order to duplicate this circuit.

lordrafa wrote:About the diodes in serial I can understand that in each diode there will be fall of 0.6v. I have read in some other page that you can build a short circuit protection for a current supply using this technique. Do you think that for this PSU, this is the case? would make sense since if the transistor Q1 stops to send current, I would suppose that the darlingtons would stop to work but I am not sure about this.

Hmmm.... I can understand your thinking but a short-circuit at the output (after the darlingtons) is not the same as a
short circuit at Q1. If we ignore the rest of the circuit, a short-circuit at the output will cause the darlingtons to
deliver the current corresponding to a base current of 10mA. I reckon that the short-circuit protection is provided by
the analog negative feedback loop driven by the voltage & current sensing ICs IC3B & IC3B.
If these ICs were only being used for providing te PIC with voltage & current measurements then they would
not also be connected to the inverting inputs of ICs IC3A & IC3D.
As previously mentioned, I am not an expert in the fine art of PSU design, so I could be wrong here...

lordrafa wrote:Also do you have any clue why the -1.2v in the op-amp?

Yeah, this seems a bit wierd to me too... (Any suggestions from the op-amp cracks????)
I would normally expect a balanced +-15V supply instead of +30V/-1.2V.
Seems strange, 'cos the datasheet says that it can also be used with a single-rail supply.

I am only guessing but I suspect that the -1.2V negative supply is used to compensate for the 0.6V
voltage drop across D4 & D5. If the outputs of the op-amps were only able to drop to 0V (GND)
then there would still be 0.6V present at the base of the darlingtons & the output might not switch off completely.
If the outputs of the op-amps are able to drop to -1.2V then the voltage at the the base of the darlingtons will
definitely be 0V (GND) or less & the output stage will definitely switch off.
This is only a guess and I would welcome feedback from anyone who knows better...

Good luck with your build & keep us posted with your progress ;^)

STFB
bandersnatch
 
Posts: 148
Joined: September 17th, 2014, 12:06 pm

Re: Help with pic based psu

Postby lordrafa » February 27th, 2017, 4:37 pm

bandersnatch wrote:Hi,

Re:
lordrafa wrote:In the web http://circuitdiagram.net/0-24vdc-digit ... Supply.html there is a link where you can download a ZIP with all the info/source code to assemble this PSU. The code is write in C so port it to a most modern PIC should be relatively easy, since I have some experience with PIC/ESP8266 programming.


Yeah I saw this link too but it seemed to be broken & I had no luck finding the source elsewhere.
I just wanted to make you aware of the fact that you will need the PIC code AND beg/borrow/build a PIC
programmer in order to duplicate this circuit.

lordrafa wrote:About the diodes in serial I can understand that in each diode there will be fall of 0.6v. I have read in some other page that you can build a short circuit protection for a current supply using this technique. Do you think that for this PSU, this is the case? would make sense since if the transistor Q1 stops to send current, I would suppose that the darlingtons would stop to work but I am not sure about this.

Hmmm.... I can understand your thinking but a short-circuit at the output (after the darlingtons) is not the same as a
short circuit at Q1. If we ignore the rest of the circuit, a short-circuit at the output will cause the darlingtons to
deliver the current corresponding to a base current of 10mA. I reckon that the short-circuit protection is provided by
the analog negative feedback loop driven by the voltage & current sensing ICs IC3B & IC3B.
If these ICs were only being used for providing te PIC with voltage & current measurements then they would
not also be connected to the inverting inputs of ICs IC3A & IC3D.
As previously mentioned, I am not an expert in the fine art of PSU design, so I could be wrong here...

lordrafa wrote:Also do you have any clue why the -1.2v in the op-amp?

Yeah, this seems a bit wierd to me too... (Any suggestions from the op-amp cracks????)
I would normally expect a balanced +-15V supply instead of +30V/-1.2V.
Seems strange, 'cos the datasheet says that it can also be used with a single-rail supply.

I am only guessing but I suspect that the -1.2V negative supply is used to compensate for the 0.6V
voltage drop across D4 & D5. If the outputs of the op-amps were only able to drop to 0V (GND)
then there would still be 0.6V present at the base of the darlingtons & the output might not switch off completely.
If the outputs of the op-amps are able to drop to -1.2V then the voltage at the the base of the darlingtons will
definitely be 0V (GND) or less & the output stage will definitely switch off.
This is only a guess and I would welcome feedback from anyone who knows better...

Good luck with your build & keep us posted with your progress ;^)

STFB


Thanks for your comments once more. This solves my doubts about the design. I will keep update with my progress.
lordrafa
 
Posts: 4
Joined: February 22nd, 2017, 5:59 pm


Return to Help me! Hardware

Who is online

Users browsing this forum: Bing [Bot] and 1 guest