support icon indicating copy to clipboard operation
support copied to clipboard

[Feature] Change definition of stalled

Open laurensvalk opened this issue 2 years ago • 6 comments

Current implementation

Currently stalled is true if:

  1. The proportional part of PID exceeds the (configurable) limit and;
  2. The motor is stopped, i.e. speed below (configurable) limit and;
  3. it has been like this for some (configurable) time.

Suggested improvement: Drop condition 2

Stall detection is mostly used to detect over load in order to stop. We don't need to wait until we are physically stopped to test this.

Doing this makes the stall detection more sensitive, and it makes run_until_stalled work better. We can use a configurable torque limit (test 1 above) instead of a duty limit. This means you can run at any speed and still safely detect soft endpoints. With duty_limit today, this doesn't work because capping it at say 30% means you can't run fast.

I think it is still consistent with our current definition:

image

Drawbacks Maybe this is no longer called "stalled" this way, since it may not be fully stopped?

It would also raise the stall flag way sooner when running very fast. This is not technically an issue since all other maneuvers don't look at this flag but it is a bit odd.

Maybe loaded is a better term. Not sure if we need both though.

laurensvalk avatar May 11 '23 08:05 laurensvalk