PWM Input and DC Voltage Output Linear Relationship

ronsimpson

Joined Oct 7, 2019
4,709
Made some changes because I do not like the way it was working.
Speed up the oscillator. Now at 22khz. Put diodes across transistors because of a large reverse voltage at low frequency.
Changed the output to full wave. Then added a second stage to get 2x more voltage. Look at the voltages at C3, C1, C2, C4=350v, 700v, 1050v, 1400.
1577673615173.png
 

Attachments

Thread Starter

tispo

Joined Aug 26, 2019
36
Made some changes because I do not like the way it was working.
Speed up the oscillator. Now at 22khz. Put diodes across transistors because of a large reverse voltage at low frequency.
Changed the output to full wave. Then added a second stage to get 2x more voltage. Look at the voltages at C3, C1, C2, C4=350v, 700v, 1050v, 1400.
View attachment 195593
Thank you so much Ron ,, i appreciate your help and advice this far, i will look at it as advised.
Regards
 

Thread Starter

tispo

Joined Aug 26, 2019
36
Hey All
I altered circuit as advised and also added a feedback at the Emitter of the BJT. However, the DC output is not very linear, is there a way i can put the Feedback at the Output so that it can control the Opamp? Could one connect through an AZ431 Reference IC or how exactly to connect it?Modified Circuit.PNG
 
Last edited:

ronsimpson

Joined Oct 7, 2019
4,709
Do you know if the voltage at C5 is linear? I worry that your are using "uS" to voltage not duty cycle to voltage.
There is a table of "input PWM (uS) Expected voltage" Where did these numbers come from?

---edited---

I got tricked.
Here is a part of your first attached file. Time=25uS. I wanted 50% so I should get 2.5V but I got a lower voltage.
The Tr and Tf are 1uS each so the low time is 2uS short of what I thought they would be. So I am getting different numbers compared to my calculator. (apparently the default Tr and Tf is 1uS)
1577768598512.png
 
Last edited:

Thread Starter

tispo

Joined Aug 26, 2019
36
1577774141032.png

Hi Ron...This is the filtered voltage at C5. The X axis is the uS and the Y axis is the filtered voltage. I can try a plot for the PWM voltage instead and the filtered voltage. The uS are test areas that the converter must meet in terms of the output voltage. in terms of PWM these values are as follows:
PWM (1 to 256) ------------ Expected Voltage
25 ---------------------------600
55----------------------------1300
64.89-------------------------1530
93----------------------------2188
121---------------------------2847
255---------------------------5850

So, in a nutshell, the converter ought to meet these voltages at the said PWMs. So i converted the PWM into uS to match the 40kHz with highest PWM being represented by 25uS.
About the PWM period, i also saw from the simulator that there is rise and fall time that i had not inserted when i defined the voltages. So is this a source of some of the errors?
 

Thread Starter

tispo

Joined Aug 26, 2019
36
1577776428371.png
As sen the voltage at C5 is linear, the Xaxis is the PWM average voltage, and the Y axis is the Filtered Voltage
 

Thread Starter

tispo

Joined Aug 26, 2019
36
i have also tried the simulation with a Rail to Rail Op-Amp in AD8656, because i thought theLM358 could not function well above 10kHz but i still get some nonlinear voltages ... This is the symbol and lib file for the opamp
 

Attachments

Sensacell

Joined Jun 19, 2012
3,786
Your inverter might not start up if you ramp the input voltage up slowly from zero.

It needs a little kick to start, that's why I suggest driving the inverter transistors from another oscillator that always has power - constantly running.
No worries about startup then.
 

Thread Starter

tispo

Joined Aug 26, 2019
36
Your inverter might not start up if you ramp the input voltage up slowly from zero.

It needs a little kick to start, that's why I suggest driving the inverter transistors from another oscillator that always has power - constantly running.
No worries about startup then.
Sensacell
thanks for the reply, i will power them independently as advised. Is the voltage to the base a normal DC voltage or a pulse?
 

Sensacell

Joined Jun 19, 2012
3,786
See the attached image.

It's a free-running oscillator driving the transistors separately.

In your case, the transformer center tap is connected to your variable voltage, the oscillator part just sees a constant DC supply.
Even when the input to the inverter is super low or off- the bases are still driven hard.push pull.png
 

MrAl

Joined Jun 17, 2014
13,722
Hi,

Where do you first notice the non linearity?
Is it at the output of the inverter or at the output of the op amp?
See if the output of the op amp is doing what you expect it to do.
Remember the gain of a non inverting stage is G+1 not just G and G+1 strictly speaking is not linear although it is a straight line (and that might be good enough though).
 

ronsimpson

Joined Oct 7, 2019
4,709
About the PWM period, i also saw from the simulator that there is rise and fall time that i had not inserted when i defined the voltages. So is this a source of some of the errors?
I tried to show in #24 that there was a error because of Tr & Tf. Try setting the times from " " to "1n".
 

Thread Starter

tispo

Joined Aug 26, 2019
36
See the attached image.

It's a free-running oscillator driving the transistors separately.

In your case, the transformer center tap is connected to your variable voltage, the oscillator part just sees a constant DC supply.
Even when the input to the inverter is super low or off- the bases are still driven hard.View attachment 195704
Hi
thanks for the tip, i will surely look into it . i now understand how i can power the bases.
Regards
 

Thread Starter

tispo

Joined Aug 26, 2019
36
Hi,

Where do you first notice the non linearity?
Is it at the output of the inverter or at the output of the op amp?
See if the output of the op amp is doing what you expect it to do.
Remember the gain of a non inverting stage is G+1 not just G and G+1 strictly speaking is not linear although it is a straight line (and that might be good enough though).
1577925586064.png
1577925611268.png

Hi
The non-linearity started slightly at the Opamp output as seen in the first chart, but was magnified in the Emitter of the BJT as seen in the subsequent chart
 

Thread Starter

tispo

Joined Aug 26, 2019
36
I tried to show in #24 that there was a error because of Tr & Tf. Try setting the times from " " to "1n".
Hi Ron
Thanks for the reply, but wont setting to "1n" change my frequency operation from the required 40kHz?

Did this years ago. I think you can brake open the center tap of L2/L4 and insert your transistor-Emitter.
View attachment 195733
Thank you Ron, i will also give it a try
 

Thread Starter

tispo

Joined Aug 26, 2019
36
Hello All, in case i wanted to feedback the opamp from the HV DC output, what resistor divider network is most appropriate to use?
 

Sensacell

Joined Jun 19, 2012
3,786
Hello All, in case i wanted to feedback the opamp from the HV DC output, what resistor divider network is most appropriate to use?

First, decide how much current whatever monitors this divided voltage needs- this is the opamp input bias current in this case.
Maybe 35 nA for an LM358, use 1000X this current, 35uA- this dilutes the bias current error down to 0.1% and is reasonable based on your power output.

Choose the full scale voltage 5V? lower divider R = 5/.000035 = 142.8K

Then the top one, 5895 V / .000035 = 168.4 Meg.
You want to use a string of lower value resistors to get there- 5KV is too much for one resistor.
Add a pot to the lower R to calibrate the thing.
 

Thread Starter

tispo

Joined Aug 26, 2019
36
First, decide how much current whatever monitors this divided voltage needs- this is the opamp input bias current in this case.
Maybe 35 nA for an LM358, use 1000X this current, 35uA- this dilutes the bias current error down to 0.1% and is reasonable based on your power output.

Choose the full scale voltage 5V? lower divider R = 5/.000035 = 142.8K

Then the top one, 5895 V / .000035 = 168.4 Meg.
You want to use a string of lower value resistors to get there- 5KV is too much for one resistor.
Add a pot to the lower R to calibrate the thing.
thank you this is so much clearer now
 
Top