Package frc.robot
Class Constants.TurretConstants
java.lang.Object
frc.robot.Constants.TurretConstants
- Enclosing class:
- Constants
Constants used to configure the turret.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AngularAccelerationThe acceleration and deceleration rates during the beginning and end of motion.static final intThe CAN ID for the encoder CANdi.static final AngularVelocityThe peak/cruising velocity of the motion.static final Velocity<AngularAccelerationUnit>Jerk (derivative of acceleration).static final AngleThe highest angle the turret can rotate to.static final AngleThe lowest angle the turret can rotate to.static final CurrentThe higher current limit for the motor.static final CurrentThe lower current limit for the motor.static final TimeThe time to supply theMOTOR_CURRENT_HIGHER_LIMITfor before switching to theMOTOR_CURRENT_LOWER_LIMIT.static final doubleThe ratio of motor turns to mechanism rotations.static final doubleThe number of teeth on the gear on the turret motor and primary encoder.static final intThe CAN ID for the turret motor.static final InvertedValueThe direction of the motor.static final NeutralModeValueThe neutral mode for the motor.static final CurrentThe stator current limit of the motor.static final doubleThe number of primary encoder rotations per motor rotation.static final doubleThe number of teeth on the lower pinion gear.static final doubleThe number of teeth on the pinion gear, interfacing with the main turret gear.static final AngleThe offset from zero of the absolute encoder.static final doubleThe number of encoder rotations per mechanism rotation for the primary encoder.static final doubleThe number of teeth on the secondary encoder's gear.static final AngleThe offset from zero of the absolute encoder.static final doubleThe number of encoder rotations per mechanism rotation for the secondary encoder.How close does the Turret have to be to its setpoint to be counted as being there.static final Anglethe tolerance for turret encoders to consider values the same, increase if its returning null, as that means there is too much slop in the systemstatic final doubleThe number of teeth on the main turret gear.static final doubleThe PID kA for the turret closed loop controller.static final doubleThe PID kD for the turret closed loop controller.static final doubleThe PID kI for the turret closed loop controller.static final doubleThe PID kP for the turret closed loop controller.static final doubleThe PID kS for the turret closed loop controller.static final doubleThe PID kV for the turret closed loop controller.static final Transform3dThe turret's offset from the center of the robot (drivetrain pose).static final doublethe total span of the encoders tracking range, can be found by finding the lcm of the encoder ratios -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
MOTOR_ID
public static final int MOTOR_IDThe CAN ID for the turret motor.- See Also:
-
CANDI_ID
public static final int CANDI_IDThe CAN ID for the encoder CANdi.- See Also:
-
TURRET_OFFSET
The turret's offset from the center of the robot (drivetrain pose). -
TURRET_GEAR_TEETH
public static final double TURRET_GEAR_TEETHThe number of teeth on the main turret gear.- See Also:
-
PINION_UPPER_TEETH
public static final double PINION_UPPER_TEETHThe number of teeth on the pinion gear, interfacing with the main turret gear.- See Also:
-
PINION_LOWER_TEETH
public static final double PINION_LOWER_TEETHThe number of teeth on the lower pinion gear. This is 1:1 with the upper pinion gear.- See Also:
-
MOTOR_GEAR_TEETH
public static final double MOTOR_GEAR_TEETHThe number of teeth on the gear on the turret motor and primary encoder.- See Also:
-
SECONDARY_ENCODER_GEAR_TEETH
public static final double SECONDARY_ENCODER_GEAR_TEETHThe number of teeth on the secondary encoder's gear.- See Also:
-
MOTOR_GEAR_RATIO
public static final double MOTOR_GEAR_RATIOThe ratio of motor turns to mechanism rotations. -
MOTOR_TO_PRIMARY_ENCODER_RATIO
public static final double MOTOR_TO_PRIMARY_ENCODER_RATIOThe number of primary encoder rotations per motor rotation.- See Also:
-
PRIMARY_ENCODER_RATIO
public static final double PRIMARY_ENCODER_RATIOThe number of encoder rotations per mechanism rotation for the primary encoder.- See Also:
-
SECONDARY_ENCODER_RATIO
public static final double SECONDARY_ENCODER_RATIOThe number of encoder rotations per mechanism rotation for the secondary encoder.- See Also:
-
TURRET_SPAN
public static final double TURRET_SPANthe total span of the encoders tracking range, can be found by finding the lcm of the encoder ratios- See Also:
-
TURRET_ENCODER_TOLERANCE
the tolerance for turret encoders to consider values the same, increase if its returning null, as that means there is too much slop in the system -
PRIMARY_ENCODER_OFFSET
The offset from zero of the absolute encoder. This is in mechanism rotations. -
SECONDARY_ENCODER_OFFSET
The offset from zero of the absolute encoder. This is in mechanism rotations. -
MOTOR_NEUTRAL_MODE
The neutral mode for the motor. -
MOTOR_INVERTED
The direction of the motor. -
MOTOR_CURRENT_HIGHER_LIMIT
The higher current limit for the motor. Helps get the motor started before switching to theMOTOR_CURRENT_LOWER_LIMIT. -
MOTOR_CURRENT_LOWER_LIMIT
The lower current limit for the motor. -
MOTOR_CURRENT_LOWER_TIME
The time to supply theMOTOR_CURRENT_HIGHER_LIMITfor before switching to theMOTOR_CURRENT_LOWER_LIMIT. -
MOTOR_STATOR_CURRENT_LIMIT
The stator current limit of the motor. This limits the current to the windings, which should help prevent burnout. -
TURRET_KP
public static final double TURRET_KPThe PID kP for the turret closed loop controller.- See Also:
-
TURRET_KI
public static final double TURRET_KIThe PID kI for the turret closed loop controller.- See Also:
-
TURRET_KD
public static final double TURRET_KDThe PID kD for the turret closed loop controller.- See Also:
-
TURRET_KS
public static final double TURRET_KSThe PID kS for the turret closed loop controller.- See Also:
-
TURRET_KV
public static final double TURRET_KVThe PID kV for the turret closed loop controller.- See Also:
-
TURRET_KA
public static final double TURRET_KAThe PID kA for the turret closed loop controller.- See Also:
-
CRUISE_VELOCITY
The peak/cruising velocity of the motion. -
ACCELERATION
The acceleration and deceleration rates during the beginning and end of motion. -
JERK
Jerk (derivative of acceleration). -
MINIMUM_ANGLE
The lowest angle the turret can rotate to. -
MAXIMUM_ANGLE
The highest angle the turret can rotate to. -
SETPOINT_THRESHOLD
How close does the Turret have to be to its setpoint to be counted as being there.
-
-
Constructor Details
-
TurretConstants
public TurretConstants()
-