Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Jerky motor movement, especially on low speeds ? #366

Closed
Vinz1911 opened this issue Jun 6, 2021 · 9 comments
Closed

[Bug] Jerky motor movement, especially on low speeds ? #366

Vinz1911 opened this issue Jun 6, 2021 · 9 comments
Labels
software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime) topic: motors Issues involving motors

Comments

@Vinz1911
Copy link

Vinz1911 commented Jun 6, 2021

Describe the bug
I'm not sure if this is a "Bug" but I discovered a jerky motor movement on Technic Hub and on Spike/Inventor Hub. It looks Like that the motors are not linear turning, they frequently stutter. If I'm using Motor class only or drive base makes no difference. I discovered that also on higher speeds but on lower speeds you can see it much better.

I testet the original lego firmwares to check if this is a normal behavior but with the original firmwares the problem does not exists. I made two videos, one with the lego firmware and one with the latest Pybricks Firmware.

To reproduce
Steps to reproduce the behavior:
just create a motor instance in code and let them turn.

Expected behavior
same fluently linear turning like the original firmware

Screenshots
I created two videos, one with original fw and one with pybricks fw. I hope you can see what I mean.

Original.FW.mp4
Pybricks.FW.mp4
@Vinz1911 Vinz1911 added the triage Issues that have not been triaged yet label Jun 6, 2021
@laurensvalk laurensvalk added topic: motors Issues involving motors and removed triage Issues that have not been triaged yet labels Jun 6, 2021
@laurensvalk
Copy link
Member

Thanks for taking the time to investigate and report this!

I think we’ll have to improve the default settings a bit to make this better, especially for this motor type.

There are several settings that affect this, so I’ll have a look at trying to find the right balance, without making performance worse for other applications.

@Vinz1911
Copy link
Author

Vinz1911 commented Jun 6, 2021

Thank you for your fast reply. If possible it would be very very nice to get a bit more smoother motor movement :)

Thank you

@dlech dlech added the software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime) label Jun 8, 2021
laurensvalk added a commit to pybricks/pybricks-micropython that referenced this issue Sep 15, 2021
This reduces sensitivity to high inertial loads like free-spinning wheels.

See also:
pybricks/support#366
laurensvalk added a commit to pybricks/pybricks-micropython that referenced this issue Sep 28, 2021
Under some conditions (pybricks/support#366), motor performance is improved by lowering the observer feedback gain. This makes the estimated speed signal respond less aggressively to motor position updates by relying a bit more on the model than the sensor.

But this has averse affects for other cases, such as under high loads. Since the model is not aware of loads, high feedback duty cycle signals make it drift away from the real motor. Here, we'd rather have higher gains.

This commit introduces three observer gains for small, medium, and high estimation errors, which provides the right balance for a broader spectrum of applications.

All gains are stored in a single parameter to save space on the hubs.
@laurensvalk
Copy link
Member

This should be a bit better now. Would you mind trying this with the latest build?

Technic Hub firmware. Other hubs.

@Vinz1911
Copy link
Author

Hi Laurens, sounds great. I will try it now :)

@Vinz1911
Copy link
Author

Works great. The movement is much smoother now. 👍

@laurensvalk
Copy link
Member

Thanks for testing so quickly. I'll close this one then.

Feel free to open new issues for motor aspects when you run into them.

laurensvalk added a commit to pybricks/pybricks-micropython that referenced this issue Feb 17, 2023
Reduces stutter on motors with freely moving encoders in the shafts.

See pybricks/support#366
@laurensvalk
Copy link
Member

VID_20230306_150618.mp4

@laurensvalk
Copy link
Member

Some more work has been done here. Should be even better now, see above.

@Vinz1911
Copy link
Author

Vinz1911 commented Mar 6, 2023

Hey @laurensvalk 👋🏻

I tried it and seems to work very well, great job 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime) topic: motors Issues involving motors
Projects
None yet
Development

No branches or pull requests

3 participants