PWM to Voltage

KeithRB

Senior Member
I am designing a model train controller using an LMD18200. One of the outputs from the LMD18200 is a motor current monitor a 377 uA/A signal from the switch FET's.

I can put the proper resistor there to convert the current to a voltage, but what is a good way to convert this pwm signal to a DC voltage that the ADC can read?

The switching will be about 25 - 30 kHz or so.

KRB
 

BeanieBots

Moderator
Feed the PWM signal into a series resistor and then a capacitor to 0v.
For 30kHz, the resistor should be about 33k and the cap about 10uF.
If you want a faster response, use a second stage and you can reduce the total amount of capacitance for the same amount of ripple.
 

KeithRB

Senior Member
Feed the PWM signal into a series resistor and then a capacitor to 0v.
For 30kHz, the resistor should be about 33k and the cap about 10uF.
If you want a faster response, use a second stage and you can reduce the total amount of capacitance for the same amount of ripple.
Thanks, I will check that out. I like the idea of a two pole filter to lower the response time.
 

KeithRB

Senior Member
I poked around a bit and found the MAX132 integrating A/D which should respond to the average of the voltage. (Adds to the cost, but should increase the speed a bit...)

Are there any other integrating AD's with serial output?
 

geoff07

Senior Member
Seems a bit complicated (and very expensive) if all you want to do is average the pulses and read the average on an adc pin. BBs solution uses two components, almost no real estate, and costs pence. Given the warning in the datasheet, you might need a second resistor to provide a dc current path to earth and take the cap from the centre tap between them, but it will still cost pence.
 

KeithRB

Senior Member
Seems a bit complicated (and very expensive) if all you want to do is average the pulses and read the average on an adc pin. BBs solution uses two components, almost no real estate, and costs pence. Given the warning in the datasheet, you might need a second resistor to provide a dc current path to earth and take the cap from the centre tap between them, but it will still cost pence.
The main problem was his long time constant of about 3 seconds. I ran a simulation and found that a 33K ohm with .01 uF works fine and responds in 1 - 2 ms, though I am sure the ripple is greater. I know the AD was over kill, but it was more a way to play with something new in the circuit.
 
Top