Skip to content

Current Swerve Module class is calculating torque and current incorrectly #121

Description

@Niosocket11

Smart current limit for drive motors is currently being calculated from this equation:
currentLimitAmps = neoFreeCurrentAmps + 2*motorTorqueLimitNewtonMeters / neoStallTorqueNewtonMeters * (neoStallCurrentAmps-neoFreeCurrentAmps);
The issue with this equation is that it assumes that the drive motor is a Neo which was earlier not a problem but now it is as we are not always using NEOs for drive but also NEO Vortex. I would suggest adding a MotorConfig to the SwerveConfig for both turn and drive to be able to more deterministically get values for the right motor type.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

invalidThis doesn't seem right

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions