Skip to content

Commit

Permalink
adjust kP+retraction multiplier
Browse files Browse the repository at this point in the history
  • Loading branch information
pserb committed Dec 2, 2022
1 parent bf0bbe3 commit c81a0e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hardware/SlidesMotors.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class SlidesMotors extends Mechanism {
public static double MAX_ACCEL = 20;
public static double RETRACTION_MULTIPLIER = 0.2;

public static double kP = 0;
public static double kP = 0.1;
public static double kI = 0;
public static double kD = 0;
public static double kF = 0;
Expand All @@ -40,7 +40,7 @@ public void init(HardwareMap hwMap) {
leftSlideMotor = new MotionProfiledDcMotor(hwMap, "leftSlideMotor");
leftSlideMotor.setWheelConstants(WHEEL_RADIUS, GEAR_RATIO, TICKS_PER_REV);
leftSlideMotor.setMotionConstraints(MAX_VEL, MAX_ACCEL);
leftSlideMotor.setRetractionMultiplier(0.2);
leftSlideMotor.setRetractionMultiplier(RETRACTION_MULTIPLIER);
leftSlideMotor.setPIDCoefficients(kP, kI, kD, kF);
leftSlideMotor.setTargetPosition(0);
// TODO: uncomment to reverse motor direction
Expand All @@ -49,11 +49,11 @@ public void init(HardwareMap hwMap) {
rightSlideMotor = new MotionProfiledDcMotor(hwMap, "rightSlideMotor");
rightSlideMotor.setWheelConstants(WHEEL_RADIUS, GEAR_RATIO, TICKS_PER_REV);
rightSlideMotor.setMotionConstraints(MAX_VEL, MAX_ACCEL);
rightSlideMotor.setRetractionMultiplier(0.2);
rightSlideMotor.setRetractionMultiplier(RETRACTION_MULTIPLIER);
rightSlideMotor.setPIDCoefficients(kP, kI, kD, kF);
rightSlideMotor.setTargetPosition(0);
// TODO: uncomment to reverse motor direction
// rightSlideMotor.setDirection(DcMotorSimple.Direction.REVERSE);
rightSlideMotor.setDirection(DcMotorSimple.Direction.REVERSE);
}

public void rest() {
Expand Down

0 comments on commit c81a0e2

Please sign in to comment.