I am taking torque readings from strain gauges on an actuator and trying to filter the signal to look usable. I have already put in place a median filter that reduces sporadic spikes.
When I have the actuator locked, I can set its power (through PWM duty cycle) to different values and see the torque readings accordingly. In such a situation, I have 0.1Nm of noise. This is acceptable.
However, when I leave the motor unconstrained, and set it to turn at different speeds (again, set it to different powers through PWM duty cycle), I get high noise on the torque sensor readings that seems to have a direct relation with the speed of the motor.
In this image, you can see the readings while the motor goes from fast to slow in 4 quite obvious steps:
(Obviously, since the motor is free running, the torque readings are (should be) a constant 0.)
My question is, how can I filter this data during the operation of the motor? Offline processing is out of the question, and I imagine the filter window can't be too large (as it produces a large latency in reading the current torque value), but perhaps that's inevitable?
I thought about a low pass filter, naturally, which would work great for high speeds of the motor, where the noise frequency is quite high, but as the motor slows down, I would essentially have to look at seconds of history to be able to filter out that low frequency noise, which is just too high to be useful for feedback control.