You could give a margin say 20.0 when near to max velocity and set it as accelerating if the actual speed is within this margin