Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Variable voltage power supply using arduino

Status
Not open for further replies.

vivek1410patel

Newbie level 3
Joined
Mar 17, 2016
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
43
I want to design a variable voltage power supply with output 3.3 V to 33 V and 0-2 A. I am going to use TOP-271EG for making the flyback circuit (the circuit available in its data-sheet).
I am thinking of making it variable by giving the reference voltage of TL431 through an arduino(instead of voltage divider). I will set the appropriate voltage by checking the voltage of the voltage divider.

Will this work correctly?
Please let me know if this may be wrong or there is a better way to do this.
 

The best way is to actually change the reference voltage into the error amplifier, but with the TL431, the ref voltage is not accessible, so you will need to use an opamp instead of tl431, and then use the "true" type 3 compensation technique and equation given in page 471 of basso's book on control of switch mode power supplys.

I suppose you can do it with the tl431, but you will have to make yourself a current source, and pour (variable)current through the lower divider resistor to change your vout, and this is not as easy/intuitive.

iLL post you a variable vout flyback sim soon. in the free ltspice.

- - - Updated - - -

Here attached is the flyback 3.3-33vout and 0-2A.

It is for 85-265vac mains input
it runs in the free ltspice, just change .txt to .asc, open it, hit the running man icon to run it.

- - - Updated - - -

by the way, for 66w max, I would use the TOP268EG...dont be tempted to use a lower rds(on) part because you'll just get more switching losses, and switching losses are the biggest fet loss with offline smps flybacks.
Did you actually see a "variable vout" flyback application note on the power integrations website?.....I don't think there is one on there?.....I am not saying its not possible, but as said before, it needs the current source to pour current through the lower divider resistor.
 

Attachments

  • Flyback _3.3-33vout _0-2A.pdf
    20.2 KB · Views: 133
  • FLYBACK DESIGN _DCM _33V 2A.zip
    6.1 KB · Views: 98
  • Flyback _3.3-33VOUT _0-2A.TXT
    8.4 KB · Views: 67
Last edited by a moderator:
I was going to work this way: Take the voltage given by the voltage divider as input to the arduino board, apply some formula and then give some appropriate voltage to TL431 as reference through the arduino ( to change its threshold). Will this not work?

Also, can you point out where is the error amplifier in the circuit made using topswitch ?
I dont have TL1243. I only have Topswitch, so can you suggest me a circuit using that?

Also, in your design, you have used voltage supplies to bias the opamp and the IC. I am not allowed to use any other source, but only make use of the input that i have (230 V AC converted to 310 V DC using bridge rectifier).
 

I made the input source a DC source so that the simulation would run quicker. Its not too bad because as you know it is DC after the mains rectifier bridge.

I was going to work this way: Take the voltage given by the voltage divider as input to the arduino board, apply some formula and then give some appropriate voltage to TL431 as reference through the arduino ( to change its threshold). Will this not work?

I doubt the DAC on the arduino would have the resolution to do that. Not only that but in all that processing you would need to know how it affects the poles and zeros of the feedback loop. Its far easier to do it the way suggested.

As discussed you don’t have access to the internal reference of the TL431 and the only realistic way to do it (if TL431 is used) is to make a current source and 'pour' current (variable) through the lower divider resistor. That’s not actually too difficult to do, I will get a schematic together for you.

I presume you have need a 5V supply for the arduino, so you could just use that to bias an op amp with.

Also, can you point out where is the error amplifier in the circuit made using topswitch ?
I dont have TL1243. I only have Topswitch, so can you suggest me a circuit using that?

In any topswitch circuit seen on the power integrations website, the TL431 always acts as the error amplifier..there is no error amplifier in the topswitch device itself.
You must use either TL431 , or an opamp.

- - - Updated - - -

right I see what you mean, you meant "LT1243".....forget about that, that's just the one in the simulator but it controls a flyback in the same kind of way as topswitch.
 

The attached shows you how to get variable vout with the TL431…actually I used the TLV431 because you need to go down to 3.3V.
This version is not finished , and needs you to adjust the resistor values to get your wanted vout range.
Simulation runs in ltspice (free download from linear.com)

Also attached is the TLV431 symbol file and subcircuit file, which you need to drop into the relevant files in the LTC route folder if you wish to run the simulation.
 

Attachments

  • Flyback _Variable vout with TLV431.TXT
    8.7 KB · Views: 54
  • Flyback _Variable vout with TLV431.pdf
    20.5 KB · Views: 102
  • TLV431 spice model.zip
    834 bytes · Views: 80

anyway, you can see from above that the solution of post#2 , is far better than the solution in post#5.

You cannot really "drive" the reference pin of the tl431. That pin gets regulated to be 2.5v by the action of the opamp inside the tl431.

If you want to drive something with the arduino. then you would have to make the arduino drive the opto diode, and have control software in the arduino which sucesfully did that and did it with the right gain and phase margin for the power supply.
That is a challenging task, there are many superb softys that cant do that. However, then again there is on/off type control which is simpler and could be done from the arduino....but I do not know if your setup can tolerate the disadvantages of on/off type control.
 

So, as i understand, i can use TOP271EG instead of LT1243. My doubt is that I dont have voltage sources V1 (for the IC) and V3 ( for the opamp). Now TOP271EG doesn't have any pin for Vcc and so V1 might not be required. But how do i power the opamp that controls Tl431 ?

Also, i have to bring in arduino somewhere. I have to make a programmable voltage supply. The arduino serially communicates with a gui on a computer and so arduino wont require a power source. The user sets the output voltage on the computer and that is communicated to the arduino. I have to bring this output on the circuit. How do i do this?
 

OK...heres the gotcha......topswitch is usually supplied by a bias winding on the transformer...that bias winding is linked to the secondary, in terms of volts-per-turn.....now, when you change your vout, an unfortunate consequence is that the bias winding voltage changes…..so that is your problem, you cant supply topswitch with a bias winding……

However, the saving grace is that you can supply the topswitch with a buck converter using LNK302…

The thing is, its best for you to still have a bias winding so you can use it for output overvoltage protection.

Anyway, the only thing left, as you said, is the supply for the opamp on the secondary side. It cant be done with an extra secondary winding as that would float about too much as you change the main secondary voltage.

You also have a big range of secondary voltage, from 3.3 to 33v.

So I am afraid there are only two ways to get your secondary side opamp supply..
1…Use another mini flyback based on the TNYswitch family
2…Use a secondary side sepic converter which takes in the 3.3 to 33v as in input and gives you 5v or so at the output.

I am sure the PI Expert software will actually design the tnyswitch flyback and the lnk302 buck converter for you.

- - - Updated - - -

Anyway, regarding the topswitch.....you will supply if from the output of the lnk302 buck converter...so just pretend that the lnk302 output is the bias winding and connect the opto collector to it....then feed the opto emitter to the topswitch control pin. (in topswitch, the control pin is both the control input and the supply input)

- - - Updated - - -

by the way, your feedback loop will be a true type three type feedback loop, and this is fully derived and done for you...the problem is that its not on the power integrations website....but its in a book by Dr Basso..and that book costs £86. ("designing control loops for linear and switching power supplies")
Yes, Dr Basso, (one of the greatest SMPS writers in the world), has seen how popular topswitch is, and likes to write about it in his latest book..in fact, he devotes an entire chapter to the topswitch feedback loop.
 

Well, i only have the TOPSWITCH271. I dont have much time and so i cannot go to buy a LNK302. Please suggest me some easier way if possible.
 

only other way i can think is to have topswitch output at say 40v, and then have a buck converter on the output or sepic, to give you the 33v to 3.3v variation.

Probably best use sepic, as you dont need a high side switch.
Any current mode controller like ucc38c42 will be ok.

Again, the way to vary the output voltage is to vary the ref voltage into the external eror amplifier of the sepic.
 

Actually sepic would be good, as you could have the topswitch output at say 18v, and then it would easily be able to reach to either 3.3v or 33v from there via the sepic....and whats more, because the actual topswitch output would be unchanging, you could have the bias winding, and do a standard pi expert design for yourself. (if you wanted).

So will you be ok having the sepic on the output.
Another mini sepic can supply the arduino its 5v
 

Here is the sepic that you can use to get the 3.3v to 33vdc if you wanted to. Its input voltage is 35vdc. The ltspice sim is also attached of it.
Just vary the reference voltage on the external error amplifier as before to change vout.
 

Attachments

  • SEPIC _3.3V to 33Vout.pdf
    18.1 KB · Views: 99
  • SEPIC _3.3V to 33V.txt
    7.1 KB · Views: 35
  • sepic 3.3v to 33vout.zip
    2.8 KB · Views: 75

If the topswitch can self-supply from the high voltage rail, then you could just use the circuit of post# 5 and forget about the bias winding.
You could then get your arduino and opam 5v rail from a sepic converter which fed off the variable vout of the topswitch.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top