I am looking to track the position of a linear actuator using accumulated time. The actuator has a 4.25" stroke with a speed of 2"/second. It should take 2125ms to move from end to end but some variation is introduced when under load. The actuator is freewheeling at each end so it can be mechanically home when reaching either end of its mechanical limits by running it an extra amount of time to ensure you at truly at the physical end of motion. I am looking to be able to move the actuator to ten positions along its length by tracking time to each position. When the actuator is moving TO (but not FROM) either P1 or P10 an extra time would be added to ensure we reach the actual physical endstop.
Looking for some advice on what the best programming approach would be to track time in a manner like this. I have the rest of the project under control with switch input, power output, GPS control and logic for the when to move to which position really just need some programming help to simplify the best way to track and calculate time between positions and how to add in the extra homing time when reaching an endstop.
Edit: I should say the arduino will be controlling the power to the actuator following a GPS speed control loop and user input from a up/down switch. The up/down momentary switch would tell the arduino to move the actuator to the next preset position.