Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…Code2024 into sofie-arm
  • Loading branch information
BrandonS09 committed Mar 6, 2024
2 parents 43acf02 + ddf7573 commit 0b5d292
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 @@ -103,7 +103,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 @@ -174,12 +174,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 @@ -257,4 +251,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 0b5d292

Please sign in to comment.