Go to Post If I find a student on my team who came through FIRST having learned nothing more then he wanted to go to MIT, I'll give my self a pat on the back and start counting down to kickoff. - Andy A. [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-02-2017, 17:58
arushshah1 arushshah1 is offline
Registered User
FRC #6203
 
Join Date: Mar 2016
Location: Hackensack, NJ
Posts: 15
arushshah1 is an unknown quantity at this point
PID Loop Constants

I was browsing through the WPILib guide on PID Subsystems and I came upon this sample code:

public class Wrist extends PIDSubsystem { // This system extends PIDSubsystem

Victor motor = RobotMap.wristMotor;
AnalogInput pot = RobotMap.wristPot();

public Wrist() {
super("Wrist", 2.0, 0.0, 0.0);// The constructor passes a name for the subsystem and the P, I and D constants that are used when computing the motor output
setAbsoluteTolerance(0.05);
getPIDController().setContinuous(false);
}

I'm not sure why the code is setting the I and D constants to 0. Is it to only make it a P loop? Are there any benefits of using only P over PID?
Reply With Quote
  #2   Spotlight this post!  
Unread 04-02-2017, 18:22
aryker's Avatar
aryker aryker is offline
Registered User
FRC #0868 (TechHOUNDS)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2008
Location: United States
Posts: 80
aryker will become famous soon enougharyker will become famous soon enough
Re: PID Loop Constants

You are correct, setting the I and D constants to zero makes it a P controller rather than a PID controller.

To answer your question, sometimes a P loop is all that is needed to get the system behaving the way you need it(although usually at least the D constant is also required in FRC robots). It's important to note that when you are tuning a PID controller, you typically start with the P value and leave the I and D at 0. For more information about tuning a PID controller, I'd recommend this Wikipedia article as a starting point. It's not the only way to tune a PID controller by any means, but it is the most widely used.
Reply With Quote
  #3   Spotlight this post!  
Unread 04-02-2017, 18:24
arushshah1 arushshah1 is offline
Registered User
FRC #6203
 
Join Date: Mar 2016
Location: Hackensack, NJ
Posts: 15
arushshah1 is an unknown quantity at this point
Re: PID Loop Constants

Great, thanks so much!
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 19:18.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi