-
-
Notifications
You must be signed in to change notification settings - Fork 0
Migrate to Phoenix 6 #31
base: main
Are you sure you want to change the base?
Conversation
: InvertedValue.CounterClockwise_Positive; | ||
|
||
motorConfig.CurrentLimits.SupplyCurrentLimit = 15; | ||
motorConfig.CurrentLimits.SupplyCurrentLimit = 15; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line is identical to the one above
} else { | ||
motor.set(TalonFXControlMode.PercentOutput, 0); | ||
motor.set(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would prefer to do motor.disable()
for these cases
|
||
driveMotorConfigs.Slot0.kP = Config.SWERVE_DRIVE_KP; | ||
driveMotorConfigs.Slot0.kI = Config.SWERVE_DRIVE_KI; | ||
driveMotorConfigs.Slot0.kD = Config.SWERVE_DRIVE_KD; | ||
driveMotorConfigs.Slot0.kV = Config.SWERVE_DRIVE_KV; | ||
driveMotorConfigs.Slot0.kS = Config.SWERVE_DRIVE_KS; | ||
|
||
driveMotorConfigs.Feedback.FeedbackRemoteSensorID = encoder.getDeviceID(); | ||
driveMotorConfigs.Feedback.FeedbackSensorSource = FeedbackSensorSourceValue.FusedCANcoder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are probably supposed to set this on the steer motor, not the drive motor
@@ -67,7 +74,7 @@ public void startHoming() { | |||
|
|||
public void resetHoming() { | |||
homingState = HomingState.NOT_HOMED; | |||
motor.set(TalonFXControlMode.PercentOutput, 0); | |||
motor.set(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would prefer motor.disable()
. if you could actually do a project wide find and replace for these, that would be good
setAngle(Positions.STOWED.angle); | ||
homingState = HomingState.HOMED; | ||
} | ||
} else if (homingState == HomingState.HOMED) { | ||
motor.set(ControlMode.MotionMagic, goalAngle.getRotations() * 2048 * Config.WRIST_GEARING); | ||
motor.set(goalAngle.getRotations() * 2048 * Config.WRIST_GEARING); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a bug. you are
- converting for sensor units
- using a position to set a voltage
- applying gearing ratios in code
instead, we should be using a motion magic control request here
motor.set(TalonFXControlMode.PercentOutput, 0); | ||
motor.setSelectedSensorPosition( | ||
Config.WRIST_HOMED_ANGLE.getRotations() * 2048.0 * Config.WRIST_GEARING); | ||
// motor.disable(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be uncommented
|
||
if (Config.IS_DEVELOPMENT) { | ||
Logger.getInstance().recordOutput("Wrist/RawAngle", motor.getSelectedSensorPosition()); | ||
Logger.getInstance().recordOutput("Wrist/RawAngle", motor.getPosition().getValue()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this log, it's redundant with the other position/angle log
@@ -110,10 +125,9 @@ public void robotPeriodic() { | |||
Logger.getInstance().recordOutput("Wrist/GoalAngle", goalAngle.getDegrees()); | |||
Logger.getInstance().recordOutput("Wrist/Homing", homingState.toString()); | |||
|
|||
Logger.getInstance().recordOutput("Wrist/Voltage", motor.getMotorOutputVoltage()); | |||
Logger.getInstance().recordOutput("Wrist/Voltage", motor.getDutyCycle().getValue()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should rename this field to Wrist/DutyCycleOut
Closes #17
Closes #18
Closes #19
Closes #20
Closes #21