Hello! I am trying to use a Rev Through Bore Absolute Encoder for my Arm’s encoder. Currently, the “zeroed” posistion is when the arm is parallel to the ground. However, the arm can go below this, which causes the Absolute Encoder to read a positive number, which is not good. Is there a way to have negative Absolute Encoder values in Rev’s Hardware Client and/or a way to fix this in WPILib Java?
Position Factor: 6.2831854820251465 (rad)
Velocity Factor: 0.10471975803375244 (rad/sec)
Zero Offset: 1.6548365 (should be in radians)
Here is the command that moves my arm in my code:
//TODO: Do I need to add an offset to the setpoint?
public void moveArm(double setpoint) {
double FFvoltage = m_armFeedforward.calculate(setpoint, 0);
// Leave pidSlot at 0
m_armPIDController.setReference(setpoint, CANSparkMax.ControlType.kPosition, 0, FFvoltage,
SparkPIDController.ArbFFUnits.kVoltage);
}
Thanks for your help