Skip to content

Commit 1ecd06a

Browse files
committed
try the new encoders (need to zero)
1 parent 357f4a0 commit 1ecd06a

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/main/java/frc/robot/subsystems/carriage/Arm.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ public class Arm extends ArmAbsoluteTemplate {
1515
public static class Constants {
1616
public static final double MAX_POSITION = 215;
1717
public static final double MIN_POSITION = 45;
18-
public static final double OFFSET = Math.PI;
18+
// public static final double OFFSET = Math.PI;
19+
public static final double OFFSET = 0;
1920
}
2021

2122
private static SparkMaxEx motor = SparkMaxEx.create(17)
@@ -33,7 +34,7 @@ public static class Constants {
3334

3435
private static final AbsoluteDutyEncoderRIO encoder = AbsoluteDutyEncoderRIO.create(0)
3536
.withDirection(EncoderDirection.Forward)
36-
.withZeroOffset(0.0574237)
37+
.withZeroOffset(-0.953304) // 5.989784902362448 RAD
3738
.withRange(1);
3839

3940
public Arm(boolean isEnabled) {

src/main/java/frc/robot/subsystems/carriage/Pivot.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ public class Pivot extends ArmAbsoluteTemplate {
1515
public static class Constants {
1616
public static final double MAX_POSITION = 246;//200
1717
public static final double MIN_POSITION = 100;//100
18-
public static final double OFFSET = Math.PI;
18+
// public static final double OFFSET = Math.PI;
19+
public static final double OFFSET = 0;
1920
}
2021

2122
private static SparkMaxEx motor = SparkMaxEx.create(27)
@@ -26,9 +27,9 @@ public static class Constants {
2627
.withIsEnabled(true)
2728
.withSupplyCurrentLimit(50);
2829

29-
private static AbsoluteDutyEncoderRIO encoder = AbsoluteDutyEncoderRIO.create(1)
30+
private static AbsoluteDutyEncoderRIO encoder = AbsoluteDutyEncoderRIO.create(2)
3031
.withDirection(EncoderDirection.Forward)
31-
.withZeroOffset(0)
32+
.withZeroOffset(-0.017564) // 0.11036038276843468 RAD
3233
.withRange(1);
3334
// .withSubsystemBase("pivot", Carriage.class.getSimpleName());
3435

0 commit comments

Comments
 (0)