I want to do a on-board-in-loop test. From simulink I want to send data via serial to ATmega 128, which will generate a PWM at 4kHz. This PWM will pass through a low-pass-filter so that the voltage across the capacitor will give the mean value of the PWM as output. This mean will be read by a data acquisition card (DAQ card) by simulink thus completing the loop.
The DAQ can read a maximum of 10V.
The low pass filter is simulating acuator dynamics, which has some settling time after application of PWM (settling time - time required for the voltage across it it to become 99% of mean of applied voltage)
The problem: The low pass filter has a ripple voltage.
Ripple voltage: voltage by which the final output of the low pass filter will oscillate about the mean of the PWM which is given at input. This ripple voltage is basically noise.
The ripple voltage comes to be of the order of the order of 1e-3V if the RC ratio is about 1e-3.
In the beginning of the simulation, the mean of the PWM voltages from my ATmega are about 1V. It then keeps decreasing till it becomes really low, of the order of 1e-5V(by keeping a really low duty cycle). I need to capture this entire range(the DAQ is capable).So I will need to amplify the PWM.
My question: Will a non-inverting OPAMP be able to do it? Asking this as an OPAMP has a slew rate (0.5V/microsecond). So will it be hampered when the PWM signal goes from LOW to HIGH or HIGH to LOW? If you can suggest any other way to achieve this, that would also help.
Edit 1: If I keep the RC product of the low pass filter as 40, I get a ripple voltage as low as 1e-6V. But is it advisable to build such a filter?
Website used for filter simulation: http://sim.okawa-denshi.jp/en/PWMtool.php
Edit 2: I want the settling time of the low pass filter to be around 400ms.