Electronic – Lowpass Filter and Attenuator

adcfilterlow passpwmvoltage divider

I am designing a circuit to power a brushed DC motor. The motor will be given 24VDC, modulated with PWM. I would like to have an analog voltage sense capability for use with my Atmel ATmega328P @ 3.3 AVCC, with some room on top for a safety margin. This means I want both a voltage divider and a voltage averager (an RC filter).

As I have discovered (by reading Wikipedia), a filter is really a frequency-dependent voltage divider. If I know the frequency I will be using, I can design an RC lowpass filter—but instead of designing for 3 dB attenuation at \$f_c\$, I can design it for 10 dB attenuation at \$f_{PWM}\$. This is similar to this question, but I don't think I need R2, do I? See attached circuit diagram.

I calculated these values with the equation (from Wikipedia, again)

$$\frac{V_{out}(\omega)}{V_{in}(\omega)} = \frac{1}{ \sqrt{1+(\omega RC)^2} }$$

where

$$\frac{V_{out}(\omega)}{V_{in}(\omega)} = 0.1, ~~~ \omega = 2\pi 15625 = 98175 \text{ rad/s}$$

My questions:

  1. Is this necessary at all? My idea here is that the voltage across the motor will not be exactly the voltage I expect based on the PWM, due to varying loads and back-emf, etc, so I need to measure voltage to use in closed-circuit feedback. Is this incorrect?

  2. Am I going about this at all the correct way? Circuit design, value selection, etc?

  3. Obviously this would be Very Bad for the ADC at 100% duty cycle, as there would only be the 24V DC component and the voltage is not divided. The max I am planning on is 60% or so. Is this likely to cause issues?

  4. What advantages, if any, does Jeremiah Rose's circuit provide over this one, if the frequency is known and fixed? Besides the ADC protection at 100% duty cycle.

schematic

simulate this circuit – Schematic created using CircuitLab

Best Answer

Trying to answer my own questions:

  1. I haven't found out if this is necessary at all yet.

  2. Apparently I was not going about it the right way. The filter I designed attenuates the 15kHz portion of the voltage by 10 dB, but it does not attenuate the DC component and so the voltage at the ADC input is much larger than is permitted. As far as the DC component is concerned, this is only an averager, not a divider.

  3. See 2.

  4. The advantage to the circuit posted in the question I linked is: it actually does what I want it to.