Tuning and Comments

This commit is contained in:
ryan123rudder
2020-02-10 19:21:10 -07:00
parent 6fbbca937c
commit 82ebcef450
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ public final class Constants {
public static final int SHOOTER_SLOT_IDX = 0;
public static final int SHOOTER_PID_LOOP_IDX = 1;
public static final int SHOOTER_TIMEOUT_MS = 30;
public static final Gains SHOOTER_GAINS = new Gains(0.425, 0.0005, 13, 0.05, 0, 1.0);
public static final Gains SHOOTER_GAINS = new Gains(0.4, 0.0005, 13, 0.05, 0, 1.0);
public static final double ENCODER_TICKS_PER_REV = 2048;
}
@@ -25,7 +25,7 @@ public class Shooter extends SubsystemBase {
double velP;
/**
* Creates a new Shooter.
* Creates a new Shooter subsystem.
*/
public Shooter() {
m_shooterFalcon.configFactoryDefault();
@@ -80,10 +80,10 @@ public class Shooter extends SubsystemBase {
//if (runSpeed > targetVel) {runSpeed = targetVel;}
SmartDashboard.putNumber("shoot", actualVel);
runSpeed = runSpeed/targetVel; //Convert to percent
if (actualVel < targetVel - 1000){
if (actualVel < targetVel - 1000){ //PID Based on ramp up amount
m_shooterFalcon.set(TalonFXControlMode.PercentOutput, runSpeed);
}
else{
else{ //PID Based on targetVel
m_shooterFalcon.set(TalonFXControlMode.Velocity, targetVel); //Init PID
}
}