I am making analog speedo and rpm gauge for both a bike and a car using x27.168 stepper motors and AX1201728SG motor driver. I have encountered quite a problem with showing data that is not constantly updated (or at least as often as would be needed for stepper movement to be smooth).
Because data is coming at intervals that are quite long, steppers rush to next value, then they have to wait for next value to come in when they start moving again. That makes movement look jerky. The library I am using for this (SwitecX12 by Guy Carpenter) supports acceleration/decelleration table, but tweaking this to be too slow would make the needle less responsive when it has to travel larger distance. Its also not practical as I cant hope to cover all cases. I need to somehow take into consideration when next value is expected to arrive and time the movement of stepper to this, so that it reaches its goal at about the time next value is available. But here's when complicated part comes in: if next value is further down, then stepper must not stop at current value as that would again look as a jerk but must continue, adjusting speed only slightly over period of time unnoticeable to human eye
I need some advice on how this is usually done. If I try displaying my data on real car gauges its exactly as I want it to be, so there must be some kind of algorithm behind it. Is there any known algorithm/way of doing this, any implementation, anything that would help me with making this?
Help is much appreciated! Thanks!