public static final double CALIBRATING_CURRENT_LIMITS = 10.0;
public static final double CALIBRATING_CURRENT_THRESHOLD = 9.0;
- /**Current */
++ /** Current limit for normal operation */
+ public static final double NORMAL_CURRENT_LIMIT = 100.0;
+
public static final double ROLLER_MOI_KG_M_SQ = 0.5 * 0.020 * 0.020; // 0.5kg roller, 20mm radius for now
public static final double ROLLER_GEARING = 2.0;
public static final double CARRIAGE_MASS_KG = 3.0;
motorGoalRotations = MathUtil.clamp(motorGoalRotations, Units.degreesToRotations(TurretConstants.MIN_ANGLE) * TurretConstants.GEAR_RATIO, Units.degreesToRotations(TurretConstants.MAX_ANGLE) * TurretConstants.GEAR_RATIO);
// Multiply goal velocity by kV
- double robotTurnCompensation = goalVelocityRadPerSec * TurretConstants.FEEDFORWARD_KV;
+ double robotTurnCompensation = goalVelocityRadPerSec * TurretConstants.FEEDFORWARD_KV * TurretConstants.GEAR_RATIO;
if(calibrating){
- // motor.set(0.05);
+ motor.set(0.05);
boolean calibrated = Math.abs(motor.getStatorCurrent().getValueAsDouble()) >= TurretConstants.CALIBRATION_CURRENT_THRESHOLD;
if(calibrationDebouncer.calculate(calibrated)){
stopCalibrating();
public static final double EXTRAPOLATION_TIME_CONSTANT = 0.06;
- public static final double FEEDFORWARD_KV = 0.185;
+ public static final double FEEDFORWARD_KV = 0.06;
- public static final double NORMAL_CURRENT_LIMIT = 40.0; // A
+ public static final double NORMAL_CURRENT_LIMIT = 25.0; // A
public static final double CALIBRATION_CURRENT_LIMIT = 10.0; // A
public static final double CALIBRATION_CURRENT_THRESHOLD = 9.0; // A
package frc.robot.util.TrenchAssist;
--import org.littletonrobotics.junction.Logger;
--
import edu.wpi.first.math.controller.PIDController;
--import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.math.geometry.Translation2d;
import edu.wpi.first.math.kinematics.ChassisSpeeds;