19 ms·
This is not linear interpolation or a PD controller. This is an exponentially weighted moving average (AKA, a Kalman filter where your model is that the data is
by jovial_cavalier 4y ago
This is not linear interpolation or a PD controller. This is an exponentially weighted moving average (AKA, a Kalman filter where your model is that the data is constant).
https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average https://en.wikipedia.org/wiki/Moving_average#Exponential_mov...
https://en.wikipedia.org/wiki/EWMA_chart https://en.wikipedia.org/wiki/EWMA_chart (note the formula for z_i)
- creata 4y ago> AKA, a Kalman filter where your model is that the data is constant This feels like nuking a mosquito.
- jovial_cavalier 4y agoYeah, a little. I just think it's interesting. I was working on a problem with a friend, where I implemented a solution as a Kalman filter, with the models "TBD", just leaving them as constant. He implemented it in parallel as EWMA, and it was a bit of a shock to me when the behavior was identical. I did a little reading after, and there seems to be a closer relationship between the two filters than I previously had thought: https://stats.stackexchange.com/questions/16458/what-is-the-difference-between-kalman-filter-and-moving-average https://stats.stackexchange.com/questions/16458/what-is-the-...
- jesse__ 4y agoNot trying to be controversial, but I'm curious why you make the claim this is not a PD controller; I thought this is basically a canonical example of one. Could you shed some light on the specific reason this does not qualify as a PD controller, and maybe what you'd change to make it into one?
- jovial_cavalier 4y agoA PD controller has a proportional term and a derivative term, and independent parameters for each (per axis). This has one error term, and one parameter. If you think of the position as the variable being controlled, then it's just a "D" controller. If you think of the velocity as the variable being controlled, then it's just a "P" controller. But unless I'm experiencing some massive confusion, you can't think of it as a PD controller. Edit: I think I can see why you might think this is a PD controller. You can see that there's no overshoot or ringing, so you think to yourself that there must be a damping term. But the difference is that there is no plant process here! We can just decrease the error. That's why you will never get overshoot or ringing. In summary, it's a one pole filter on an error function, not a controller.
- jesse__ 4y agoI was thinking more in terms of behavioral characteristics, as your edit suggests. In my mind, a strictly 'P' controller should produce an oscillation, which the example did not. I then surmised it 'hides' the 'D' part of the equation by modulating the error down each step. Strictly speaking, it seems like your summary is more accurate, and I'm still not quite sure if my way of looking at it is skewed, or completely broken.