mit-drl / e-vent

MIT Project: A low cost emergency ventilator controller
39 stars 31 forks source link

Feature/bang bang control #59

Closed teddyort closed 4 years ago

teddyort commented 4 years ago

Fixes the issue with the timing moves to arrive by setting the max velocity to desired average velocity. (Which always arrives late.)

Instead, "Bang-Bang" control is now used to plan a constant acceleration during the first half of a move and then the same magnitude constant deceleration during the second half, to arrive at the desired time.

Note: In the event this would require excessive speed, the triangular speed profile will be "flattened" into a trapezoid with height "VEL_MAX" currently set to 1800 clicks/s.