Peter Nachtwey
Member
I found this link on another site
http://www.holoborodko.com/pavel/?page_id=245
In the past I have posted examples of how to use the Savitzky-Golay filter to estimate velocities and accelerations. Apparently Pavel Holoborodko has found a better method for smoothing first derivatives or velocities and this method is simple enough to work on a PLC.
The main difference between what I showed and what Pavel has done is that I estimated the velocity at the current time whereas Paval's method has a delay but if the application is already using 10 points to compute a smoothed value then expanding it to 11 points and using 5 points on either side of a mid point is not that big of a change. If the sample time is 10 milliseconds that would be a constant 50 millisecond lag which is more than fast enough for HMI displays.
It is also interesting to see Pavel explain the central difference method and the Savitzky-Golay method and compare them. What I like about Pavel is that he searchs for a better way and can simulate the results for comparison.
We use the Savitsky-Golay smoothing when displaying graphical data. The ripples that Pavel talks about are sometime seen in the velocity profiles and are artifacts of the filtering.
http://www.holoborodko.com/pavel/?page_id=245
In the past I have posted examples of how to use the Savitzky-Golay filter to estimate velocities and accelerations. Apparently Pavel Holoborodko has found a better method for smoothing first derivatives or velocities and this method is simple enough to work on a PLC.
The main difference between what I showed and what Pavel has done is that I estimated the velocity at the current time whereas Paval's method has a delay but if the application is already using 10 points to compute a smoothed value then expanding it to 11 points and using 5 points on either side of a mid point is not that big of a change. If the sample time is 10 milliseconds that would be a constant 50 millisecond lag which is more than fast enough for HMI displays.
It is also interesting to see Pavel explain the central difference method and the Savitzky-Golay method and compare them. What I like about Pavel is that he searchs for a better way and can simulate the results for comparison.
We use the Savitsky-Golay smoothing when displaying graphical data. The ripples that Pavel talks about are sometime seen in the velocity profiles and are artifacts of the filtering.