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:
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?
Am I going about this at all the correct way? Circuit design, value selection, etc?
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?
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.
simulate this circuit – Schematic created using CircuitLab