PWM Input and VDC Output Voltage Linear Relationship

Status
Not open for further replies.

samk

New Member
Hello everyone, I am trying to have a linear relationship between the PWM input at 40kHZ and output DC voltage. The Linear equation should be something like this (Voltage= PWM*25 ). Where PWM is the values between 1 and 256. I have implemented the circuit by use of the LM358 opamp, 25VDC input, an inverter circuit, and a transformer. Within the circuit, i have included the PWM test values and the output voltages expected. The challenge is as I increase the PWM towards the maximum (24.9 uS) , the linearity aspect disappears, and i have to change the transformer to get the expected voltage. This then messes up the previous PWM test levels' results. I would appreciate if anyone was able to advise me on how to get a good linear relationship. I have also tried using variable feedback resistors on the opamp, but it doesn't help. Can a demultiplexer be used to select different gains (feedback resistors) according to PWM levels, if so , how can that be implemented?
Regards
 

Attachments

  • PWM_INPUT,_DC_OUTPUT[1].asc
    4.2 KB · Views: 365
  • LM358[1].asy
    956 bytes · Views: 357
  • LM358.SUB
    2.9 KB · Views: 359
The datasheet for the lousy old LM358 shows that it has slew rate trouble with sinewaves above 10kHz and you are trying to use it with pulses at 40kHz. Use a better and newer TLE2141 single opamp that works well up to above 400kHz so it can pass 40kHz pulses. The TLE2141 inputs work all the way down to ground like an LM358.
 
Thank you for the reply, i will have a look at the Op-Amps prescribed. i will see if i have better linearity.
Regards
 
think there is also a problem at the input low pass filter stage, when i put the 24.908 u PWM level, the voltage does not conform to the linear expected voltage after filtration. thats a source for the lack of linearity. Could anyone have an idea how to improve this part.
 
Why does your circuit have a lowpass filter? It cuts away most of the input pulses.
 
i meant to use the filter to convert the PWM signal to an analog DC voltage. or is there anything i can substitute with
 
Hello all, i still have a simple problem that i cant seem to get rid off. The low pass filter that converts 3.3 V, 40kHZ PWM into DC voltage does not seem to be linear from 90 % onwards. Could anyone please guide me on what i can do to have linearity at the PWM Conversion stage.. I used a simple RC circuit to filter the PWM as seen in the image of the circuit. Hello all, i still have a simple problem that i cant seem to get rid off. The low pass filter that converts 3.3 V, 40kHZ PWM into DC voltage does not seem to be linear from 90 % onwards. Could anyone please guide me on what i can do to have linearity at the PWM Conversion stage.. I used a simple RC circuit to filter the PWM as seen in the image of the circuit.
 
The low pass filter that converts 3.3 V, 40kHZ PWM into DC voltage does not seem to be linear from 90 % onwards.
Please post a schematic. With values. Or at least post the values. I have designed ICs that have several different types of PWMs. I find them extremely linear. (depends on that the load looks like) I need to know what IC is driving the RC. Many micros have IO pins that pull down well but do not pull up well. If the RC is feeding a amplifier I need to know about that also.
 
Every capacitor charged by a simple resistor works like that!
 

Attachments

  • PWM filter capacitor charging voltage.png
    45.1 KB · Views: 342
Not certain what "linear" is. Duty cycle to voltage is very good.
SPICE is perfect but V1 in real life is not and can not drive a 500 ohm load. Try changing to 5k or 50k and reducing the cap.
The B-E of Q3 is not compensated for. Try the feed back at the Emitter or better yet at DC_output. (add voltage divider)
 
Hello Ron, i plan to use a 3.3 V Push-Pull type of CMOS that can sink 2mA at 0.8V. I am not so farmiliar with the exact specification, as a i am still new to this field, and this is my first project
 
He is not making a real circuit. Instead he is making a "perfect" simulation that has zero source resistance.
 
i am using the simulation as a guide for the circuit that i want to make later... I could not start with the circuit first as i wasnt sure how to compute the parameters.
 
The values that I am attempting to get from the circuit are as follows:
INPUT PWM(uS) -------- EXPECTED DC OUTPUT(V)
2.4415 -------- 590
5.371 -------- 1294
6.34775 -------- 1529
9.082 -------- 2188
11.81625 -------- 2847
24.908 -------- 5900

I dont have any schematic yet, as i have just started the projects, the only thing provided is the information as per the table above. So i came up with the Spice simulation as a start point, as i am still new in this field, and i aim to improve the schematic first then try it on a real circuit.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…