Skip to content

Instantly share code, notes, and snippets.

@devyte
devyte / AccelLimiter.h
Last active September 24, 2020 23:08
Stepper accel limiter
class AccelLimiter
{
public:
int accel; // unit is Hz/s, i.e.: pulses/s2, always positive
int maxAccel; //this is the physical limitation. A frequency change above this value between consecutive updates is not allowed. Always positive.
AccelLimiter(int accel, int maxAccel)
: accel(accel), maxAccel(maxAccel)
{
}