motorcontrol: target endpoint
Technically this is equivalent, but this is still correct if the timing is wrong (as it was in the previous concurrency issue)
@@ -316,9 +316,9 @@ void control_update(pbio_port_t port){
// Maneuver is complete, time wise
time_ref >= traject->t3 &&
// Position is within the lower tolerated bound ...
- count_ref - settings->count_tolerance <= count_now &&
+ traject->th3 - settings->count_tolerance <= count_now &&
// ... and the upper tolerated bound
- count_now <= count_ref + settings->count_tolerance &&
+ count_now <= traject->th3 + settings->count_tolerance &&
// And the motor stands still.
abs(rate_now) < settings->rate_tolerance
)
