Skip to content

Commit

Permalink
correct Izone
Browse files Browse the repository at this point in the history
  • Loading branch information
FriedLongJohns committed Mar 6, 2024
1 parent 5a37fa4 commit ddf7573
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/main/java/org/carlmontrobotics/subsystems/Arm.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public Arm() {
armPIDMaster.setPositionPIDWrappingEnabled(true);
armPIDMaster.setPositionPIDWrappingMinInput(LOWER_ANGLE_LIMIT_RAD);
armPIDMaster.setPositionPIDWrappingMaxInput(UPPER_ANGLE_LIMIT_RAD);
// two PIDs?
armPIDMaster.setIZone(IZONE)

SmartDashboard.putData("Arm", this);

Expand Down Expand Up @@ -176,12 +176,6 @@ private void driveArm() {
armFeedVolts = armFeed.calculate(getCurrentArmGoal().position, 0);
}
armPIDMaster.setReference(setpoint.position, CANSparkBase.ControlType.kPosition, 0, armFeedVolts);
if (armAtSetpoint() || getArmPos() > setpoint.position) {
armPIDMaster.setIZone(Double.POSITIVE_INFINITY);// turns off pid once it reaches the setpoint
} else {
armPIDMaster.setIZone(IZONE);
}

}

public void setArmTarget(double targetPos) {
Expand Down Expand Up @@ -259,4 +253,4 @@ public double getArmClampedGoal(double goal) {
return MathUtil.clamp(MathUtil.inputModulus(goal, ARM_DISCONT_RAD, ARM_DISCONT_RAD + 2 * Math.PI),
LOWER_ANGLE_LIMIT_RAD, UPPER_ANGLE_LIMIT_RAD);
}
}
}

0 comments on commit ddf7573

Please sign in to comment.