support icon indicating copy to clipboard operation
support copied to clipboard

[Feature] Adjust default imu stationary thresholds

Open laurensvalk opened this issue 2 years ago • 6 comments

I made some tests with the two Prime Hubs I have available.

I think the accelaration threashold can be completely left out. This is the one that is most sensible to vibrations and shock. Trampling on the ground or tapping the table will trigger it, even if you set relatively high values. I don't think it is neccesary to check this value at all. Theoreticalle the gyro can be calibrated anyway no matter what force values the robot it is experiencing as it is only the rotation that matters.

For the gyro I think a setting of about 5 will be ok. With this setting it is impossible to trigger steady when holding thy robot in the hand or when the robot is driving around on the table. With a setting of 10 it is possible the robot will sometimes go to steady state when doing a very calm straight drive.

Originally posted by @Kermit647 in https://github.com/pybricks/support/discussions/1080#discussioncomment-6121826

laurensvalk avatar Jun 08 '23 13:06 laurensvalk

It would certainly be good to adjust them. I was at a busy event recently and couldn't get the calibration to pass in some conditions.

laurensvalk avatar Jun 08 '23 13:06 laurensvalk

For the gyro I think a setting of about 5 will be ok.

Done!

I think the accelaration threashold can be completely left out.

I have now set this to 2500 deg/s^2, which should make it less susceptible to vibrations.

It will still register a knock on the table, which is more or less intended when it comes to stationary detection.

What do you think?

laurensvalk avatar Jul 06 '23 09:07 laurensvalk

@scatwang and @DrTom: This is where we introduced the relaxed thresholds.

I think you have found in https://github.com/pybricks/support/issues/1840 and https://github.com/pybricks/support/issues/1687 that the current defaults are not sensitive enough. So 1.5 deg/s was too strict and 5 deg/s was too lax. I suppose that means we could consider 3 deg/s.

Maybe it was mainly the acceleration threshold that was too sensitive in noisy FLL/WRO environments, so maybe we should leave that at this high 2500 value.

laurensvalk avatar Sep 19 '24 08:09 laurensvalk

We'll also want to update both in the documentation. https://github.com/pybricks/pybricks-micropython/commit/880927757bb2bd6715fc1b44ee9966d6df5665b8 was also not documented.

laurensvalk avatar Sep 19 '24 08:09 laurensvalk

The fix is available for testing using these instructions to try the latest version

Please re-open if you experience any further issues or inconsistencies. Thank you!

laurensvalk avatar Sep 24 '24 14:09 laurensvalk

We'll also want to update both in the documentation. pybricks/pybricks-micropython@8809277 was also not documented.

This was closed by GitHub action but the documentation hasn't been updated yet, so re-opening.

laurensvalk avatar Oct 29 '24 08:10 laurensvalk