Skip to content

Commit

Permalink
turns off pid if arm overshoots
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonS09 committed Mar 5, 2024
1 parent 9d00521 commit 0157dcd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/carlmontrobotics/subsystems/Arm.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private void driveArm() {
armFeedVolts = armFeed.calculate(getCurrentArmGoal().position, 0);
}
armPIDMaster.setReference(setPoint.position, CANSparkBase.ControlType.kVelocity, 0, armFeedVolts);
if (armAtSetpoint()){
if (armAtSetpoint() || getArmPos() > setPoint.position){
armPIDMaster.setIZone(Double.POSITIVE_INFINITY);//turns off pid once it reaches the setpoint
}
else {
Expand Down

0 comments on commit 0157dcd

Please sign in to comment.