X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F2017steamworks;a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fshooter%2FRunFlyWheelContinuous.java;fp=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fshooter%2FRunFlyWheelContinuous.java;h=047fad40885a8e2f5caad590004cab64493dc5bb;hp=ff4f65960c69a50ad6114e7993260aa131bee7ff;hb=e32379867a61eb104544b90d917b7ab48d704e25;hpb=5d967c5548cc4443b280b12aedfd8d1ad55b59e1 diff --git a/src/org/usfirst/frc/team3501/robot/commands/shooter/RunFlyWheelContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/shooter/RunFlyWheelContinuous.java index ff4f659..047fad4 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/shooter/RunFlyWheelContinuous.java +++ b/src/org/usfirst/frc/team3501/robot/commands/shooter/RunFlyWheelContinuous.java @@ -26,6 +26,7 @@ public class RunFlyWheelContinuous extends Command { private double wheelI; private double wheelD; private double target; + double shooterSpeed = 0; public RunFlyWheelContinuous() { this.wheelP = this.shooter.wheelP; @@ -33,10 +34,10 @@ public class RunFlyWheelContinuous extends Command { this.wheelD = this.shooter.wheelD; this.wheelController = new PIDController(this.wheelP, this.wheelI, this.wheelD); - this.wheelController.setDoneRange(0.5); + this.wheelController.setDoneRange(10); this.wheelController.setMaxOutput(1.0); this.wheelController.setMinDoneCycles(3); - this.target = this.shooter.getCurrentShootingSpeed(); + this.target = 2700; } @Override @@ -46,12 +47,14 @@ public class RunFlyWheelContinuous extends Command { @Override protected void execute() { - // double shooterSpeed = this.wheelController - // .calcPID(this.shooter.getShooterRPM()); - // - // this.shooter.setFlyWheelMotorVal(shooterSpeed); - System.out.println(shooter.getShooterRPM()); - this.shooter.setFlyWheelMotorVal(this.shooter.CURRENT_SHOOTING_SPEED); + double calculatedShooterIncrement = this.wheelController + .calcPID(this.shooter.getShooterRPM()); + shooterSpeed += calculatedShooterIncrement; + if (shooterSpeed > 1.0) + this.shooter.setFlyWheelMotorVal(1.0); + else + this.shooter.setFlyWheelMotorVal(shooterSpeed); + // this.shooter.setFlyWheelMotorVal(this.shooter.CURRENT_SHOOTING_SPEED); } @Override