Skip to content

ExpansionHubPidConstants is too generic #8773

@zachwaffle4

Description

@zachwaffle4

Currently the ExpansionHubPidConstants class contains three feedback constants (kP, kI, kD), three feedforward constants (kS, kV, kA), and a continuous input status, minimum, and maximum. The ExpansionHubMotor class contains two instances of the pid constants class, one for position, and one for velocity, that are each separately modifiable. These values are published over NT to the topic /rhsp/{expansion hub usb}/motor{port}/pid/{type}/{constant} (where {type} is either position or velocity).

However, using velocity feedforward for position is mathematically incorrect, and continuous input makes no sense for velocity feedback.

Thus I think there should be two separate constants classes:

  1. ExpansionHubPositionConstants that contains kP, kI, kD, kS, continuous, continuousMin, and continuousMax constants and
  2. ExpansionHubVelocityConstants that contains kP, kI, kD, kS, kV, kA constants

This will also require a change to the expansion hub service, as the different constants classes will be publishing different things over NT now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    20272027 targettype: bugSomething isn't working.type: featureBrand new functionality, features, pages, workflows, endpoints, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions