Skip to content

SwerveModule drive motor has jittery velocity setpoints #93

@mjansen4857

Description

@mjansen4857

There seems to be some severe jitter in swerve module drive velocity setpoints introduced by various SwerveRequests. We tested ApplyRobotSpeeds and FieldCentric and they both introduced the same jitter. The jitter is in the setpoint itself, not just the output of the motor, which we see by logging the drive motor's getClosedLoopReference() signal.

We have verified that this jitter is not introduced by our code or a poorly tuned PID controller with the following testing:

  1. Set the drivetrain control to ApplyChassisSpeeds or FieldCentric with static, zeroed speeds.
  2. Notice jitter in drive motor both audibly and through logging the closed loop reference
  3. Set the drivetrain control to a custom swerve request that applies NeutralOut to rotation motors and VelocityTorqueCurrentFOC with velocity 0 to drive motors.
  4. Notice no jitter in drive motors at all

Our exact setup is Mk4i modules with L2 ratio, KrakenX60s running torque current output for both drive and steer which are set to Velocity and Position control respectively. Using java, latest firmware and Phoenix. I'll be happy to provide further information if needed.

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