Skip to content

Commit

Permalink
wrapped arm pids
Browse files Browse the repository at this point in the history
  • Loading branch information
stwiggy committed Mar 3, 2024
1 parent 9dc6e76 commit 987a02d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/java/org/carlmontrobotics/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public static final class Arm {
public static final double POS_TOLERANCE_RAD = 0;
public static final double VEL_TOLERANCE_RAD_P_SEC = 0;
public static final int MAX_VOLTAGE = 12;
public static final double ENCODER_OFFSET_RAD = 0;

//TODO: finish understand why this is broken public static final Measure<Angle> INTAKE_ANGLE = Degrees.to(-1);

Expand Down
12 changes: 11 additions & 1 deletion src/main/java/org/carlmontrobotics/subsystems/Arm.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,20 @@ public Arm() {
armPID2.setI(kI);
armPID2.setD(kD);

//armEncoder1.setZeroOffset(offsetRad);
armEncoder.setZeroOffset(ENCODER_OFFSET_RAD);

//armPID.setTolerance(posToleranceRad, velToleranceRadPSec);

armPID1.setFeedbackDevice(armMotorMaster.getAbsoluteEncoder(SparkAbsoluteEncoder.Type.kDutyCycle));
armPID1.setPositionPIDWrappingEnabled(true);
armPID1.setPositionPIDWrappingMinInput(ARM_LOWER_LIMIT_RAD);
armPID1.setPositionPIDWrappingMaxInput(ARM_UPPER_LIMIT_RAD);
//two PIDs?
armPID2.setFeedbackDevice(armMotorFollower.getEncoder());
armPID2.setPositionPIDWrappingEnabled(true);
armPID2.setPositionPIDWrappingMinInput(ARM_LOWER_LIMIT_RAD);
armPID2.setPositionPIDWrappingMaxInput(ARM_UPPER_LIMIT_RAD);

SmartDashboard.putData("Arm", this);


Expand Down

0 comments on commit 987a02d

Please sign in to comment.