Author Topic: Yet another uSupply clone  (Read 4517 times)

0 Members and 1 Guest are viewing this topic.

Offline BynunTopic starter

  • Newbie
  • Posts: 7
  • Country: gb
Yet another uSupply clone
« on: December 23, 2013, 01:21:02 am »
Been watching Dave's vlog for a few months now, catching up on the old episodes and though i'd try my hand at a copy of his uSupply but designed for higher voltage and current to make it a more general PSU for steppers and laser diodes. I belive i've got it about right but as i'm still one of those young players i thought i'd post it here in hopes that someone far wiser can give it a once over and point out any mistakes i've inevitably made :)

The main differences are the tracking preregulator uses the analog transistor method mentioned in another episode, i've tried reading up on it but it's still all greek to me so would like someone to just say yey or ney to that and, because i'm using voltages higher then the opamp can manage, i've returned to the original LT3080 voltage select system by using a resistance rather then driving it with an external voltage. At least thats the plan...

TIA
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: Yet another uSupply clone
« Reply #1 on: December 23, 2013, 09:08:38 pm »
ney :--

I see some problems with what you have.

ref: LT3080 data sheet http://cds.linear.com/docs/en/datasheet/30801fb.pdf

Data sheet page 1
Typical application Paralleling Regulators
looks like you almost copied this.

Note the output, 3.3V  2.2A with a iSet resistor of 165k

3.3V / 165k = 0.00002      20uA

Two Lt3080's in parallel with the iSet's connected = 20uA of current so that makes sense.

Your design has two 18k resistors(R13 & R21) in parallel {9k] in series with 1k (R16) for a total of 10k for the iSet resistor.
Transistor T4 can make this resistance less but can not increase the resistance.

0.00002 * 9k = 0.18 Volts
0.00002 * 1k = 0.02 Volts

0.00002 * 10k = 0.2 Volts

So your output is a max of 0.2 volts.

--------

You have added iSet cap C2 as 10uf.
Most of the examples have NO iSet cap and reading the data sheet it states

Quote
SET (Pin 4/Pin 4):
This pin is the input to the error amplifier and the regulation set point for the device. A fixed current of 10?A flows out of this pin through a single external resistor, which programs the output voltage of the device. Output voltage range is zero to the absolute maximum rated output voltage. Transient performance
can be improved by adding a small capacitor from the SET pin to ground.
Later in data sheet
Quote
If guardring techniques are used, this bootstraps any stray capacitance at the SET pin. Since the SET pin is a high impedance node, unwanted signals may couple into the SET pin and cause erratic behavior. This will be most noticeable when operating with minimum output capacitors at full load current. The easiest way to remedy this is to bypass the SET pin with a small amount of capacitance from SET to ground, 10pF to 20pF is sufficien

Data sheet page 2
Quote
ABSOLUTE MAXIMUM RATINGS
SET Pin Current (Note 7) ................. ±10m A
SET Pin Voltage (Relative to OUT)....... ±0.3V
Data Sheet page 3
Quote
Note 6:
Output noise is lowered by adding a small capacitor across the
voltage setting resistor. Adding this capacitor bypasses the voltage setting
resistor shot noise and reference current noise; output noise is then equal
to error amplifier noise (see the Applications Information section).
Note 7:
SET pin is clamped to the output with diodes. These diodes only
carry current under transient overloads

Your C2 is a nasty high current source/sink where the LT3080 really wants only resistance.

The LT3080 is CURRENT Based not VOLTAGE based! need to think more in current.

iSet normal current ....................  0.00001       10uA
iSet current protection limiter ......  0.01            10mA

That's a 1000 times greater then normal working current, a huge range.

Your have 0 to 24 volts output in one place and 0 to 25.6 volts in a second place

For the iSet pin, the resistance for two LM3080's in parallel would be

0V     = 0R0
2.56V = 128k
5v      = 250k
24V    = 1200k
25.6V = 1280k

If you were to remove C2 or get it in recommended range &
Change resistors  R13, R21 & R16 to allow max output voltage.
You will still have a problem with transistor T4.
T4's collector must = LT3080's OUT pin +-0.3V while not allowing much current in or out of the iSet pin. If you quickly change T4 to a lesser resistance, then the circuit is acting like the example on Page 16, adding shutdown. Note the second transistor that is pulling down the out pin at the same time the iSet pin is pulled down to keep in the +-0.3v range.

Your circuit has some parts that will discharge C3 on the output. If you lower resistance on Iset faster then this happens then you exceed the +-0.3V iSet max.
Note that what is connected to the output could make this faster or much slower.

C
 

Offline BynunTopic starter

  • Newbie
  • Posts: 7
  • Country: gb
Re: Yet another uSupply clone
« Reply #2 on: December 24, 2013, 06:43:21 pm »
Thanks for the reply.

I see the errors you mentioned, i originally made it based on the layout of Dave's original where he drove the set pin which is why i have the C2 cap and the 9k/1k voltage divider (10:1) to provide feedback to the opamp but now it's resistive it does need alot more changes then simply adding the transistor.
If i removed the voltage divider attached to the iSet pin and instead tapped into the Monitor line to provide feedback for the IC4B opamp while removing the C2 cap, would that allow the opampt to acuratly control the resistance accross T4 and in turn the output of the LT3080 or will it cause problems due to the second opamp in the LT3080? Also perhaps removing R23 to give the current limiting transitor T3 more control over T4 and adding the unused Opamp into the Monitor line to prevent the MPU from draing too much current from it and affecting the feedback?

I've included another image which better represents what i was aiming for.

I defined 24v as the highest voltage i would need it to output however, because of the control system, i was (in theory) able to output 25.6v which gave me the max voltage i wanted also, the output won't be changed much when in use at most small slow adjustments, so i'm not too concerned about rapid changes or the output cap discharging into the load as long as it's smooth and stable while in use.

I need to do alot more reading up on transistors, maybe theres an EEVBlog vid on it i missed...

Thanks again :)
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: Yet another uSupply clone
« Reply #3 on: December 26, 2013, 11:03:29 am »
Hi
When it comes to a bench or lab type power supply, you would do better trying to protect it from all the evil or stupid things you or I could do to the power supply. Some things you just can not protect the supply from with out adding more problems during use.
Any or all combinations of large or small  resistors caps inductors, batteries motors could be connected at times.
If your working with PWM you could go from almost no output current to the limit or more. This could be at a low freq all the way up to a very high freq.
You might have a switcher connected to the output with it's fast high current pulses.
 
It's just best to try to protect the supply and load from anything you can think of. So while the control system can try to add protection, you still need look to see if something will bypass that protection.

Go back to your corrected first drawing. Connecting LM3080 output in to iSet would work but add more output ripple and noise to what is a reference. It could cause an oscillation.

A couple of notes.
The data sheet I am reading says 2 LM3080 in parallel is max amp is 2.2A.

The mpu does not need to know any thing about volts & amps, really. To explain better, need to think in binary. You are using an 8 bit PWM. in binary this is 0 to FF in hex. 0 = 0% while FF = 100%. If you were dealing with +- things you might do 0 = -50% while FF = +50%. You are setting a %. The same is true with an ADC & DAC, setting or reading a %.  You find all of these with a different number of bits, and these days most are right bit aligned. If you left bit align the bits, things get easer. Burr Brown produced some chips that were left bit aligned. The more bits, the greater the expense, but done properly you could design for 16-bit chips and the use a chip with fewer bits just by changing the chip.
So the control loops used binary % for speed. Tried to use binary shifts in place of * and /, again for speed. Human conversion is very slow and kept out of control loops.
Back in the analog days a common circuit was a Gain & Span circuit. Span is the vertical position of a Scope while Gain is the Volts/div. So pin 3 & pin 5 of IC4 would be the start of a gain & span circuit. A good program had Gain & Span values for digital use while the analog also had a gain & span circuit. With this in mind picking 2.56v for a reference and  25.6 for output divider is just for human display and really only effects the right most digit of the human display.

The mpu would only use a conversion factor mainly for humans as that had to be done with slower math. If you look at most instruction sets you will find 4 instructions for 8-Bits.  Add, Add with carry, Sub & Sub with carry, these instructions allow for math in 8 bit chunks to huge bit sizes. The AVR has these instructions. For the old 8080/Z80 that had 64K bytes ram, that was ram size  - program size + 3 X byte size of number(c = a + b). So if 16 bits as an integer or % is not enough it's not real bad to use 24 or 32 bits as an integer or %, just need to stay away from the floats and limit the use of non binary * & /. 

So unless things match up perfect with the PWM, ADC & Dac bits, you will probably be using floating point when it comes to human values for reading and writing.   

-------
This change will give you a scaled voltage of what is at iSet. Will need to check for oscillations.

R13, R16 & R21 recompute the values. You need to reduce the current flow for these. The min total resistance for this divider must be greater then the iSet resistance at the max output voltage.  An iSet resistor of 1280k = 25.6V so a divider with this total resistance would work but leave no current for T4. Your Vref is 2.56V so  a divider for 25.6V & and 5ua should work fine.  This would be a divider that gets 1/4 of the iSet current and the rest is left for T4. Going lower like this is a trade of current for T4 and input problems for the divider sense opamp.

First problem  T4
When the LT3080 gets power, it will start powering up the output. Current will flow out iSet pin. The transistor connected to iSet should default to max on, as close to 0R0 as possible. This transistor needs to turn on by it self at power up. Not doing this could cause a voltage spike on the output. The catch is that the best current to use is what comes from iSet. For the rest of the circuit you need to check for this type of problem and use you 5v supply to bias things off at power up.
It takes time for the mpu to start and set up it's outputs so you want to make sure that if the mpu just powers up and nothing more this circuit is in safe mode with no output from LT3080. For the AVR I think this means that all outputs are high-Z. So I-adj & V-adj would be high-Z allowing R2 & R15 to pull that spot low.
 
Like wise just a mpu reset should start a transition to zero output. Same for a quick power off and back on.
Might change your thinking, instead of setting an output, you are allowing an output to happen.
See what you can come up for this.

Problem I-Limit
Remove this, It is not needed. An option is to change this to output ON/Off.

Current mode is any time the output gets to the set current before the set voltage. Voltage mode is any time the output gets to the set voltage before the set current. This will happen to fast for mpu control.
For this circuit, I-Mon & V-Mon are mainly for reporting to the human. Any connection between these and the PWM's must be done very carefully as that will form a feed back loop that could oscillate.
The LT3080 controls the output. Unless you have a really fast MPU, you should let the LT3080 do the voltage & output Control, The mpu sets the max voltage allowed by PWM via the V-Adj. Should probably rename this to be Max-V. The mpu should only change the PWM value when the OP changes it.
Like wise, The mpu sets the max current allowed by PWM via the I-Adj. Should probably rename this to be Max-I. The mpu should only change the PWM value when the OP changes it.
The circuit needs to pass a version of max-v directly to the LT3080 unless sensed current is greater then max-I.

Remember that if looking at the output only lowest value gets to LM3080. If both happens at same time, both should be saying the same thing.

High resistance dividers will probably need an opamp buffer.

Probably missed something,
Hope you had a merry christmas
C
 

Offline BynunTopic starter

  • Newbie
  • Posts: 7
  • Country: gb
Re: Yet another uSupply clone
« Reply #4 on: December 26, 2013, 11:26:17 pm »
Indeed, hope you had a good christmas too :) Alot to read there, i'll try and address everything...

Protection is always useful but this is intended as a basic home device, if i needed something better i would get myself proper bench supply. So even though protection would be nice, it's not a high priority for me, i really just need something better then a bunch of 317's thrown together.

Regarding your notes, i can see how linking the iSet to output could cause oscillation now you've pointed it out. Not sure how to assure prevention of that other then to place the loop back into the iSet line. Maybe returning to Dave's original system of driving the pin, but rather then supply the driving current from the opamp directly, it's supplied from the input rail and passed through a resistor/transistor voltage divider to ground?
The data sheet has 1.1A minimum but a typical of 1.4A, i know i should go by minimum but i figured that with a good heatsink and the input very close to output i could get away with it  ::)
I've not intended to give the mpu any feedback control over the output, only to set an ouput value and to display the true output. Because of this i went with maximum values that made the internal math easier when outputting a value via the 8bit PWM. These values are stored and manipulated in the mpu as intergers and decimal shifted in a simple manner when converting to text for display.

The bits in that next section i'm rereading for the 20th time until i understand them properly before commenting, but controlling the output seems to be my weak link here.
I-Limit i was never sure about, consider it gone and yes, Max-I and Max-V would make more sense.

I'll work on the design a bit more and probably go back to driving the pin as it seems the easier method then managing a resistance with decent feedback.

Thanks again for your time, i'm sure that response took a while to type :)
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: Yet another uSupply clone
« Reply #5 on: December 27, 2013, 05:40:14 am »
Bits
Will try to do better. This could make understanding things better or worse

Start with your PWM Outputs.
You set the PWM to 00 hex, the output is staying low all the time. After a while Max-I & Max-V will discharge those filter caps to 0V.
You set the PWM to FF hex, the output is staying high all the time. After a while Max-I & Max-V will charge those filter caps to a Voltage.
The PWM is the % between min voltage of the filter and max voltage of the filter.
Here it is 0V and some +volt value and is used to control a  voltage, but it could be the % of the power to heat your soldering iron. Here the ADC is reading Voltage and current but it could be Temp and fan speed. Like the PWM the ADC value is a % between -vref and +vref.


FF in hex is 1111 1111
00 in hex is 0000 0000
 half is 1000 0000
half of the below half is 01000000
What you have is binary power of two happening.

Now if you could change your thinking and say that a all ones value is as close to 100 % as you can get this just means that your output goes from 0V to 25.5V instead of 25.6V. doing this makes the binary actually match the real world.
Half is 1000 0000 and all the computing just got easer.
Each lesser bit is half the value of the one before. This is a binary fraction.

the avr has some 10 bit ADC's
max positive is 11 1111 1111
max negative is 00 0000 0000
With the closest to 100% thinking half is 10 0000 0000 and matches in binary

Now 10-bits will not fit in a byte so you have no choice but to use 16-bits for the speed with the ADC.
For math you will probably need to use more then 8 bits to compute PWM values.
You could make your life and the program easer if you just used 16-bits for the PWM value also and just shift it two bits to the right as you go to feed it to the PWM hardware. Costs you one instruction to do the shift and prevents a lot of conversions to and from 8-bits.
Now depending on what math is needed done, it may be even better to shift more to the left on both.
10-bits with no left shift will leave 6 bits to the left. If you use a signed integer then left most bit is the sign bit. So a 16 bit signed integer range is -32768 to +32767 but your ADC values go from 0 to 4095 and actually is the % from -vref to +vref.
With 1 of those bits you can get almost to 200% and with 5 bits thats almost 3200%
So again with just a change your thinking of that binary ADC value is makes things easer. Do you need to compute up to almost 3200%? Would it be nice to loose some of that huge % and gain some more on the fractional side.
here is a table
Left shift   almost max%  Added_range_on_frac_side
0  3200%
1 1600%  1/2
2 800%    1/4
3 400%    1/8
4 200%    1/16
5 100%    1/32
The trick in computer control loops is to not use floats and try to leave the to/from human out of the loop by computing in %. It really is just a thinking thing most of the time. 
One thing left out of most compilers is the idea of binary fractions. What exists works until the compiler increases the bit size of a value. The compiler will always add the additional bits to the left. At times you need some or all of the added bits on the right side, You will need to * or / by a binary power for this to happen.
And when going to/from human readable you need to handle the scale factor.

A left shift of one bit is like  X 2 while a right shift of one bit is a / 2. The avr has instructions for bit shifts like this and are very fast. Good compilers know this and will use shifts when it can for integers. If you X3 then have to add the original to the one left shifted copy. So it's best to try to use powers of 2.

bits Better?

Quick notes on last post.
Did you miss the iSet voltage divider that will work in the last?
High ohm dividers will probably need a buffer sense amp.

Many destroyed :M3080's by trying to drive a voltage in to iSet, there is a thread.
iSet is a current output that is also used as a voltage ref.

The big problem I see for iSet is to keep it from causing a pulse on the output on power up. I just noticed that your pre-reg on pin 5 has an ON/OFF that would be a big help in preventing this pulse.
For T4, two resistors in series supplying base pull up with the resisters connected to iSet and base of T4. The resistors turn T4 on to max which causes T4's collector to pull iSet low. A second T4 then pulls down on the junction of the two resistors to turn off base current turning off the first T4 in the process. The net result is less current used from iSet and the output will increase as will the voltage across the iSet divider. At max LM3080 output. the divider current and base bias current must be less than iSet current needed for that max output.
In simple terms at 25.6V output, The iSet resistor = 1280k. The iSet voltage divider resistance in parallel with the bias resistors must be greater then 1280K

Quote
Protection is always useful but this is intended as a basic home device, if i needed something better i would get myself proper bench supply. So even though protection would be nice, it's not a high priority for me, i really just need something better then a bunch of 317's thrown together.
If you want to use the LM3080, I would like you to get it working with out blowing a bunch of LM3080's in the process. The LM3080 is much better than 317's but takes a different thinking on iSet pin.

C
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf