Skip to content

Commit

Permalink
fix big power draw when source intaking by defaulting to PID loop
Browse files Browse the repository at this point in the history
  • Loading branch information
2491NoMythic committed May 1, 2024
1 parent b2207b4 commit 4f193cb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/frc/robot/subsystems/ShooterSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ private static int updateIsReving(int revState, double targetSpeed, double speed
double revDownEn = -10;
double revDownDis = 2;
double difference = targetSpeed - speed;
SmartDashboard.putNumber("SHOOTER/desired speed difference", difference);
if (difference>revUpEn){
revState = 1;
} else if (difference<revDownEn && targetSpeed<10){
Expand All @@ -220,6 +221,8 @@ private static void updateMotor(TalonFX shooterMotor, int revState, double targe
shooterMotor.getConfigurator().apply(currentLimits);
if(targetSpeed == 0) {
shooterMotor.set(0);
} else if(targetSpeed<0) {
shooterMotor.setControl(new VelocityDutyCycle(targetSpeed).withSlot(0));
} else if (revState != 0) {
shooterMotor.set(revState);
} else {
Expand Down

0 comments on commit 4f193cb

Please sign in to comment.