Skip to content

Commit

Permalink
PIDArm Kcos and kp tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaP241 committed Nov 15, 2024
1 parent 190d5c4 commit f403649
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,19 @@ class ArmPIDTuner : CommandOpMode() {
armLeft = Motor(hardwareMap, ControlBoard.ARM_LEFT.deviceName, Motor.GoBILDA.RPM_435)
armRight = Motor(hardwareMap, ControlBoard.ARM_RIGHT.deviceName, Motor.GoBILDA.RPM_435)

armSubsystem = ArmSubsystem(armLeft, armRight)
armSubsystem = ArmSubsystem(armRight, armLeft)

InstantCommand({
armSubsystem.setpoint = Math.toRadians(target)
}).perpetually().schedule()

RunCommand({
telemetry.addData("Arm Angle: ", armSubsystem.armAngle)
telemetry.addData("Arm Angle: ", Math.toDegrees(armSubsystem.armAngle))
telemetry.addData("Setpoint: ", target)
})
telemetry.update()
}).perpetually().schedule()

register(armSubsystem)
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ArmSubsystem(
private val feedforward = ArmFeedforward(0.0, kCos, 0.0);

init {
armLeft.inverted = true
armRight.inverted = true
turnMotors.resetEncoder()
turnMotors.setZeroPowerBehavior(Motor.ZeroPowerBehavior.BRAKE)
}
Expand Down

0 comments on commit f403649

Please sign in to comment.