uStepper S-lite
|
This is the uStepper S-lite Arduino library, providing software functions for the different features of the uStepper S-lite board.
The library uses both timer one and timer three in order to function properly, meaning that unless the user of this library can accept the loss of some functionality, these two timers are unavailable and the registers associated with these timers should not be reconfigured.
Timer one is used for sampling the encoder in order to provide the ability to keep track of both the current speed and the angle moved since the board was reset (or a new home position was configured). Also the drop-in features missed step detection and correction is done in this timer.
Timer three is used to calculate the stepper acceleration algorithm.
The library is tested with Arduino IDE 1.8.12
The acceleration profile implemented in this library is a second order profile, meaning that the stepper will accelerate with a constant acceleration, the velocity will follow a linear function and the position will look like an S-curve (it will follow a linear function at top speed and a second order function during acceleration and deceleration). As a result, the position of the stepper motor will have continous and differentiable first and second derivatives.
The second order acceleration profile can be illustrated as follows (Source):
From the above picture it can be seen how the motor moves with this second order acceleration profile. The postion is depicted as orange, velocity as red and the acceleration as green.
(C) 2020 uStepper ApS
www.ustepper.com
admin istr ation @ust epper .com
The code contained in this file is released under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
The code in this library is provided without warranty of any kind - use at own risk!
neither uStepper ApS nor the author, can be held responsible for any damage
caused by the use of the code contained in this library !