Go to Post Since this thread doesn't seem to have quite enough numbers yet, here are some more. - William Frost [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

 
Closed Thread
Thread Tools Rating: Thread Rating: 20 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 16-02-2015, 16:50
Pramizle Pramizle is offline
Registered User
FRC #3145
 
Join Date: Jan 2015
Location: United States
Posts: 5
Pramizle is an unknown quantity at this point
PID Control of a Jaguar

We are trying to use a PID loop on our robot to set an elevator-like mechanism at a certain height. We are using an encoder to gain the feedback of where the elevator is sitting. Our primary build mentor has told us that their should be a way to set a maximum and minimum speed of the motor and then the PID loop will just control the acceleration/deceleration. However, we cannot find any place to do this. We have checked the WPI Library files and ReadTheDocs to no avail. If anybody has any experience with this that would be great.
  #2   Spotlight this post!  
Unread 16-02-2015, 17:36
Ethan_P Ethan_P is offline
Registered User
FRC #1895 (Lambda Corps)
Team Role: Leadership
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Virginia
Posts: 3
Ethan_P is an unknown quantity at this point
Re: PID Control of a Jaguar

If your elevator is its own subsystem, instead of extending Subsystem, you can extend PIDSubsystem. In the constructor, call the PIDSubsystem constructor (super(double p, double i, double d); ), giving it the three coefficients. After that, you can create properties, if you want to change the defaults, such as (setOutputRange(-1.0.1.0); ), and (setAbsoluteTolerance(0.1); ). You want to read the java docs for all of the methods of PIDSubsystem. Last, you need to create methods (public void usePIDOutput(double value){}) and (public double returnPIDInput() {}) in the curly brackets of usePIDOutput assign you motor(s) the argument 'value', and in returnPIDInput, you would return an number, such as the encoder value.
  #3   Spotlight this post!  
Unread 16-02-2015, 18:14
gbear605's Avatar
gbear605 gbear605 is offline
Scarebear
FRC #1768 (Nashoba Robotics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2014
Location: United States
Posts: 35
gbear605 is an unknown quantity at this point
Re: PID Control of a Jaguar

I'm assuming that you can do most of creating the PID loop, and only need help with the specific setting minimum and maximum speeds. If this is the case, you'll need to run the following method in the constructor of the Subsystem, where "pid" is the PID Controller.
Code:
pid.setOutputRange(minimumOutput, maximumOutput);
If you're using a PID Subsystem, you would just call setOutputRange in the constructor of the class.
Closed Thread


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 21:05.

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