|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#1
|
|||
|
|||
|
How do you Tune the PID Values?
Hi I am on a second year frc team from New York. We have been trying to program an autonomous program in java using motor encoders and a PID controller to move forward a specific distance. However, in order to uses the PID controller we need the proportionality, integral, and differential constants, and we do not know how to find them. We tried using the smart dashboard but nothing shows up in the window to edit. If someone could give us some help it would be greatly appreciated. Thanks!
|
|
#2
|
|||
|
|||
|
Re: How do you Tune the PID Values?
Quote:
This link shows the PIDSubsystem showing up in LiveWindow and allowing you to edit all the PID controller values but we don't seem to be able to get this to work. http://wpilib.screenstepslive.com/s/...manual-id=7932 For the original poster, when we put the robot into teleop mode and made the SmartDashboard editable we were able to right-click the PIDSubsystem and select PID editor. This looked like it would allow you to edit the PID constants at least. This was after using SmartDashboard.putData() to send the PIDSubsystem to the SmartDashboard. |
|
#3
|
|||
|
|||
|
Re: How do you Tune the PID Values?
I was able to get the PID controller in livewindow using this line in the OI:
Code:
LiveWindow.addActuator("drivetrain", "Drivetrain", Robot.drivetrain.getPIDController());
EDIT: This is for test mode, I don't know about getting it in teleop. |
|
#4
|
||||
|
||||
|
Re: How do you Tune the PID Values?
For teleop, just do this:
Code:
SmartDashboard.putData("PID Controller",controller);
Also, in terms of actual tuning techniques, here's the procedure I use:
In general, P makes approach faster, but can cause larger oscillations; D causes oscillations to converge, but slows approach; and I can correct for steady-state error and causes faster approach, but can lead to intense oscillations if set too high (search "integral windup" for more details). |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|