Control design for PWM converter

In summary: A by plugging in the values from the Ifwd graph and solving for Vfwd.In summary, Hubert is trying to use the LED current and LED forward voltage to identify the LED die temperature. He will need to measure Vfwd at 1.4A to calibrate the LED.
  • #36
@Baluncore,

ok thank you. I will look at it and get back to you. Thank you for the help so far.
here is the INA210.sub model
* Begin INA210
*****************************************************************************
.SUBCKT INA210 IN+ IN- V+ GND OUT REF
XDP6 GND IN- D_Z26V
XDP5 GND IN+ D_Z26V
R4 INp IN+ 4.9999875K
R3 INm IN- 5.0000125K TC=1.5U
XU1 IN- IN+ GND INp OUT V+ INm INA21Xopa
XDP4 GND REF D_DIS1PN0_52
XDP3 REF V+ D_DIS1PN0_52
XDP2 GND OUT D_DIS1PN0_52
XDP1 OUT V+ D_DIS1PN0_52
R2 REF INp 1.0000025MEG
R1 OUT INm 999.9975K TC=1.5U
.ENDS
*
 
Engineering news on Phys.org
  • #37
@Baluncore
here are my results:
A)Temperature sensor
Vsupply(V) Rset(ohm) Iset (uA) temp (degree)
2,50 226 0 0
2,5 226 321,438 25
2,5 226 396,95 95

B) Tempco current source
Vsupply(V) R1(ohm) R2(ohm)Iset (uA) temp (degree)
2,50 226 0 0
2,5 226 321,438 25
2,5 226 396,95 95
 
  • #38
@Baluncore
sorry about that, here are the correct results

here are my results:
A)Temperature sensor
Vsupply(V) Rset(ohm) Iset (uA) temp (degree)
2,50 226 0 0
2,5 226 321,438 25
2,5 226 396,95 95

B) Tempco current source
Vsupply(V) R1(ohm) R2(ohm) Iset (uA) temp (degree)
2,5 380 3800 359,81 25
2,5 380 3800 368,25 95
2,5 380 3800 368,74 100
2,5 380 3800 371,58 125
 
  • #39
Re: (A)Temperature sensor.
For 1uA / 1°K I would expect a current of about 273.15uA at 0°C, you give it as zero.
321.438uA at 25°C ? should that not be about 273°K + 25°C = 298.15uA
396,95uA at 95°C ? should that not be about 273°K + 95°C = 368.15uA
I think you are not using the right transistor areas in your LM334 model.
Please post the LM334.sub model you are now using.

Re: (B)Zero TempCo sink.
I know that R2 should be a little less than 10 * R1. You have not modeled the zero tempco circuit and trimmed it to zero tempco by adjusting R1 & R2.
But first let's fix the LM334.sub model (A)Temperature sensor.
 
  • #40
@Baluncore
I tried to change the model as you required

* Pin order: v+ v- R
.SUBCKT LM334 v+ v- R
Q4 N002 N001 v+ 0 pnp1
Q5 N003 N001 v+ 0 pnp1
Q6 R N001 v+ 0 pnp1 16
Q1 N003 N003 R 0 npn1 12
Q2 N002 N003 N004 0 npn1
Q3 N001 N002 R 0 npn1
C1 N002 N004 50p
R2 N004 v- 1
R8 v+ v- 1G
C2 v+ v- 10p
C3 N003 v- 1p
C4 R v- 1p
.model npn1 NPN(Is=1e-15 BF=200 TF=1e-9 Cjc=0.5e-12 Cje=1e-12 VAF=100 Rb=100 Re=5)
.model pnp1 PNP(Is=1e-15 BF=100 TF=1e-7 Cjc=0.5e-12 Cje=1e-12 VAF=100 Rb=100 Re=5)
.ENDS LM334

but got these values
Vsupply(V) Rset(ohm) Iset (uA) temp (degree)
2,50 226 0 0
2,5 226 300,427 25
2,5 226 370,963 95
2,5 226 376,053 100

therefore i kept my settings for the previous measurement
Q6 R N001 v+ 0 pnp1 14
Q1 N003 N003 R 0 npn1 14
 
  • #41
@Baluncore
may be i got it this time around
temperature sensor

some modification
Q6 R N001 v+ 0 pnp1 10.36
Q1 N003 N003 R 0 npn1 11


results
Vsupply(V) Rset(ohm) Iset (uA) temp (degree)
2.50 226 0 0
2,5 226 298.168 25
2,5 226 368.249 95
2,5 226 373.196 100
 
  • #42
@Baluncore,

here is an update for the Tempco current source for same model
Vsupply(V) R1 R2 Iset (uA) temp (degree)

2,50380 3.35k 0 0
2,5 380 3.35k 369.843 25
2,5 380 3.35k 368.361 95
2,5 380 3.35k 368.164 100

will be grateful to hear from you.
 
  • #43
The model you started with was the original written by Helmut Sennewald and posted on July 11th 2009. It became widespread because it was discussed in the open forums. The area of transistors Q1 and Q6 were both then set at 14, but that 14 in the data sheet is not actually the transistor area, it is a minimum specification for the ratio of Iset to Ibias.

Eventually the model was modified to fix the transistor area bug and posted on April 7th 2011, in the file archive of the yahoo group “LTspice”. (Hidden from google, you need to be a member), https://groups.yahoo.com/neo/groups/LTspice/search/files?query=LM334
LM334.sub 1KB Transistor size changed from 14-14 to 16-12 helmutsennewald Apr 7, 2011

This is now the current version of the LM134 / LM334.sub
* Selfmade model of the LM334 from National Semiconductor or ST
* Helmut Sennewald
*
* Pin order: v+ v- R
.SUBCKT LM334 v+ v- R
Q4 N002 N001 v+ 0 pnp1
Q5 N003 N001 v+ 0 pnp1
Q6 R N001 v+ 0 pnp1 16
Q1 N003 N003 R 0 npn1 12
Q2 N002 N003 N004 0 npn1
Q3 N001 N002 R 0 npn1
C1 N002 N004 50p
R2 N004 v- 1µ
R8 v+ v- 1G
C2 v+ v- 10p
C3 N003 v- 1p
C4 R v- 1p
.model npn1 NPN(Is=1e-15 BF=200 TF=1e-9 Cjc=0.5e-12 Cje=1e-12 VAF=100 Rb=100 Re=5)
.model pnp1 PNP(Is=1e-15 BF=100 TF=1e-7 Cjc=0.5e-12 Cje=1e-12 VAF=100 Rb=100 Re=5)
.ENDS

I had reality calibration problems with Helmut Sennewald's old 14-14 model for the LM134 / LM334. When I looked at the LM334 internal design I noticed that the area of Q6 determined the ratio of Iset to IQ2e, a ratio specified in the datasheet to be about 18. Then I needed to select a Q1 area to bring Iset close to the ideal 273.15uA with an Rset of 226 ohms, at a temp= 0°C to get 1uA / 1°K. I ended up with transistor areas of 15.75 and 11.75. Although by using areas of 15.75 and 11.75 it was possible to get a close to perfect 1uA / 1°K model with an Rset of 226 ohms, that was un-real because the 226 ohm resistor specified in the circuits was chosen from the real world E96 standard series of resistor values which has {…, 221, 226, 232, …}, not as the ideal value the circuit needs for Iset = 273.15uA. Also, the area of the transistors should be integer because the transistor mask pattern was originally simply duplicated to make several transistors in parallel. By using areas of 16 and 12 the model was very real and I then needed to find the ideal value of Rset to give 273.15uA at 0°C.

Rset is the magic number you need to find to a couple of decimal places. It is NOT exactly 226.00 ohms.
Once you have found that Rset closest to 226 I will know your model is working and you can then match the I95°C with the zero TempCo current sink.

Note: All this assumes that the NPN1 and PNP1 transistor models being used are realistic. There are also two hidden FETs, Q7 and Q8 being used to start the circuit. They source between 20nA and 200nA. They are not modeled here as the numerical spice model starts OK without them and the start bias currents do not appear to be significant to the model.
 
  • Like
Likes Hubert Tchio
  • #44
@Baluncore
here are today's result for the transistor areas of 10.36 and 11

A) Temp sensor
Rset= 226.03 @25°c, Iset= 298.15uA; @95°c, Iset=368.15uA, @105°c, Iset= 378.16uA

B)
R1= 381.9 ohms and R2 = 3329.3 ohms
@25°c, Iset=370.08uA, @95°c, Iset= 368.15uA @10°C, Iset = 367.71uA

These values change at different room temperature. Yesterday the results for the same settings had some little differences.

Please should we assume these values and proceed to the next level. This is taking too much time.
Thanks for your understanding

Best regards
Hubert
 
  • #45
Hubert Tchio said:
Please should we assume these values and proceed to the next level. This is taking too much time.
Thanks for your understanding
If you do not use the transistor areas of 12 and 16 then our models will not match and you will not be modelling the LM334.
Your zero TempCo circuit will not work when you build it because of the wrong model ratio of Iset to Ibias.
 
  • #46
ok, now is done for the transistor areas of 12 and 16

A) Sensor,
Rset = 227.73 ohms and Iset =
@25°C, 298.21uA; @95°C, 368.15uA; @ 105°C, 378.17°C

B)Tempco
R1= 380.29 ohms and R2 = 3313.86 ohms
imply Iset:
@25°C, 368.33uA; @95°C, 368.15uA; @105°C = 368.06uA
 
  • #47
That is a nice looking set of numbers now, well done.

See the attached schematic. By connecting the two modules you designed in series, between 0V and +5V, there will be a difference current that is blocked by D1 until the current changes direction and D1 starts to conduct at 95°C. As the temperature rises the difference rises until at 105°C it reaches 10uA. The 10uA will add 2.5V to the output because of R2 = 250k. The 2.5V voltage source, fakes the output from the 1NA210 when ILED = 1A. No LED current is then needed to satisfy the 2.5V input to the controller. The controller will always have an integrator input voltage of 2.5V.

Do you now understand how the difference current works? why it starts at 95°C? and why 250k is used?

The next step is to find an op-amp with low input bias current as your controller integrator and a fast comparator to generate the MOSFET gate drive signal. They need to run on 0V and +5 rails only, which should be no problem, see what you can find, I'll take a look also. The integrator has the 250k input circuit so input bias current must be less than about 100nA, but it does not need to be fast.
 

Attachments

  • temp_comp.jpg
    temp_comp.jpg
    40 KB · Views: 714
  • Like
Likes Hubert Tchio
  • #48
Thank you. I am glad i got some nice values.
I know understand the theory behind it. I must admit i have learned something.

for the integrator op amp:
OPA234 has a bias current of 25nA
LM6132 has a bias current close to 100nA

for a fast comparator:
LMH6622 has a speed of 50MHz, i am targeting 1Mhz switching frequency for the MOSFET

What do you think if I may ask?
 
  • #49
sorry know=now
 
  • #50
Hubert Tchio said:
What do you think if I may ask?
I think you have just demonstrated a fixative attention to detail and the ability to criticize your own language / design. Both those characteristics are essential in competent design engineers. You have realized the importance of understanding what you are trying to do and how you are doing it.

It is 6AM here so I will take a look at your component selections later this morning.
 
  • #51
The comparator and saw wave oscillator can use a Texas Instruments LMV7219 which is a 7-ns 5Volt Comparator with Rail-to-Rail Output. $2 each.
You only need a single op-amp.
Attached is the schematic showing comparator, saw wave generator and a higher current gate driver.
 

Attachments

  • all_bits.png
    all_bits.png
    62.9 KB · Views: 525
  • Like
Likes Hubert Tchio
  • #52
@Baluncore
Thank you so much, I must admit it has not been an easy affair.
Please I still count on you to complete this task. I have simulated your design but the LED current still stay high "closed to 4A" the reason why is not working. Please can you help?
I have tried many values for the resistor on the integrator, i have also reduced the reference voltage.

Here attached is the design and the simulation

Best regards
Hubert
 

Attachments

  • LED-driver.pdf
    162.4 KB · Views: 229
  • #53
Maybe you have the wrong control loop polarity ?
Follow the closed loop, is this sequence correct ?
If LED current rises.
INA210 Vout rises.
LM334s are disconnected.
Current flows into U73, C1-c, so V(U73)out falls.
U74 voltages rises.
Vgate rises.
MOSFET turns on.
D5 conducts.
LED current rises.

Does that appear to be a positive feedback loop ?
You need negative feedback to regulate so reverse the input connections to U74.
Does the circuit now work ?If you need to further diagnose the bug you may need to isolate where it is happening in the simulation. I would take the output from the INA210 and feed it along with the 2.5Vref directly to the final comparator, with comparator polarity correct for negative feedback.
 
  • Like
Likes Hubert Tchio
  • #54
Note: You are using a comparator with built-in hysteresis as an op-amp integrator. That will not work. You need to use an op-amp there.
 
  • Like
Likes Hubert Tchio
  • #55
@Baluncore,
thank you so much. I will look at it. Have a great weekend

Best regards
Hubert
 
  • #56
For the integrating op-amp you might consider an AD8615 which is a precision, 20 MHz, CMOS, Rail-to-Rail Input/Output Operational Amplifier. It has low bias current, (less than 1nA), and will run on a single 5V supply. Digikey sell them for about US$3.
 
  • Like
Likes Hubert Tchio
  • #57
@Baluncore
Thank you so much. The circuit is perfectly what I wish to have. I will then proceed to design the PCB.
sharing a grass of beer would have been a nice idea.
Once more thank you.

Best wishes
Hubert
 

Similar threads

  • General Engineering
Replies
2
Views
184
  • Mechanical Engineering
Replies
10
Views
1K
Replies
13
Views
5K
  • Electrical Engineering
Replies
32
Views
3K
Replies
2
Views
918
Replies
6
Views
571
  • Electrical Engineering
Replies
1
Views
729
Replies
9
Views
2K
Replies
5
Views
2K
  • Programming and Computer Science
Replies
7
Views
1K
Back
Top