Skip to content
This repository was archived by the owner on Oct 27, 2020. It is now read-only.
This repository was archived by the owner on Oct 27, 2020. It is now read-only.

REV Through Bore Encoder can easily overflow ExH firmware velocity counter #241

@Windwoes

Description

@Windwoes

According to REV's website, the Through Bore Encoder has:

Quadrature Resolution: 2048 Cycles per Revolution (8192 Counts per Revolution)

But, the Expansion Hub firmware stores velocity as 16-bit signed integers:

int16_t     motor0velocity_cps;  // counts per second
int16_t     motor1velocity_cps;
int16_t     motor2velocity_cps;
int16_t     motor3velocity_cps;

The maximum value for a signed 16-bit integer is +-32,768.

If we do 32768 / 8192 we find that the REV Through Bore encoder will overflow the velocity counter at 4RPS, which is only 240RPM!

The good news is that the position is stored as a 32-bit signed int, which isn't going to overflow in a 2:30 match.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions