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

Drive module target & velocity value use very different scales #69

Open
jamesdooley4 opened this issue Mar 24, 2023 · 2 comments
Open

Comments

@jamesdooley4
Copy link
Member

Looking at the logs, the reported 'actual velocity' values are from -223 to 216, but the 'target' values are between exactly -4.420 and 4.420. To make them easily comparable when tuning PIDF, they should report with the same scale

frontLeftActualVelocityPublisher.set(
moduleDriveMotors[0].getVelocity() / DRIVE_VELOCITY_COEFFICIENT);

frontLeftTargetVelocityPublisher.set(states[0].speedMetersPerSecond);

@jamesdooley4
Copy link
Member Author

FYI that the REV docs say "Get the velocity of the motor. This returns the native units of 'RPM' by default, and can be changed by a scale factor using setVelocityConversionFactor()."

@TAKBS2412
Copy link
Contributor

That makes sense, since I remember seeing "actual velocity" values of ~250-260, which is around 60 times as much as 4.420.

Interestingly, we have a conversion from rps to rpm for setting the velocity, but not getting it from the Spark MAX:


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants