|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
PIDController Issues
Hello, this year our team decided to try and implement the PIDController to regulate the speed at which our shooter is running.
I have a simple code for just the shooter (VictorSP in PWM 4) and the AMT103-V encoder (in DIO 0 & 1). I have been able to get input from the encoder and run the motor manually, but I haven't been able to get the PIDController to actually turn on the motor. Here is a screenshot of the smartdashboard output: ![]() I was wondering if anyone here on ChiefDelphi had any ideas on how to get the motor to run, the code can be found here: https://github.com/FRCTeam2501/2017-.../src/Robot.cpp |
|
#2
|
||||||
|
||||||
|
Re: PIDController Issues
How did you choose your P and D values?
|
|
#3
|
||||
|
||||
|
Re: PIDController Issues
We just threw random numbers in, we have tried larger P and D values but it didn't effect it at all.
|
|
#4
|
|||
|
|||
|
Re: PIDController Issues
It may be helpful to use the SmartDashboard to actually update your PID values on the fly so that you can easily see what they should be.
If you add a line to your OperatorControl main while loop that says something like shooterPID.setPID(SmartDashboard.getNumber("P: "), SmartDashboard.getNumber("I: "), SmartDashboard.getNumber("D: ")) (convert that from Java to C of course), then you can just type in new values to test with. You can do the same thing with your SetPoint. Instead of hard coding it like you did, just pull the value from SmartDashboard. e.g. shooterPID.SetSetpoint(SmartDashboard.getNumber("S etpoint: ") (again, converting to C syntax) Then you can try a larger P value easily to see if that's the issue. And try a zero D to start with. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|