Skip to content

[Feature] Make motor rotation sensor reset optional #389

Closed

Description

@laurensvalk

Is your feature request related to a problem? Please describe.
When building robots with gears, the absolute angle feature cannot really be used. Instead, you usually have to run some initialization routine to reset the mechanism, to make your own "absolute" zero point.

It would be nice if you needed to run this only once after boot, instead of every time a program starts.

Describe the solution you'd like
When you initialize a motor, we implicitly call reset_angle(), so that it resets to the angle of the absolute marker. We could make this optional. Then the angle offset would be unchanged between programs.

Proposed API: Add a reset_angle keyword argument to the Motor class init, and let it default to True so it is fully backwards compatible.

Activity

  1. laurensvalk commented on Jul 13, 2021

    @laurensvalk
    MemberAuthor

    I've been using this in practice for some time, and it's really useful. I think it's worth committing.

    A second potential benefit is that you can diagnose problems in a new REPL or something like port view, if we ever have that feature.

    In the long run, we should be able to cut the implementation size a bit by not having to pass the argument all the way down, but we can look at this when we overhaul the way we deal with ports in general.

  2. laurensvalk commented on Jul 16, 2021

    @laurensvalk
    MemberAuthor

    Already implemented via pybricks/pybricks-micropython@4d6d172, so closing.

  3. added theissue type on Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: motors

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions