Go to Post Engineering is a fabulous background for many careers. - dtengineering [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
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 05-02-2014, 17:52
hades948 hades948 is offline
Registered User
FRC #3591
 
Join Date: Feb 2014
Location: Ohio
Posts: 2
hades948 is an unknown quantity at this point
PID Help

Our programming team has been working hard with the PID portion of the robot. However, we have not been able to get it working. We are using four USDigital E8P encoders, and four CANJaguars (one for each wheel), as well as four mecanum wheels. When the robot is activated with a P, I, and D value of anything > 0 the robot trys to go every direction at the same time. We need to know how to fix this, or just a detailed discription of how to use these encoders with CANJaguars to get the PID working.

Thanks for any help you can offer!
Reply With Quote
  #2   Spotlight this post!  
Unread 05-02-2014, 19:42
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: PID Help

The first thing to check is the sign of everything.

Are you doing PID on the jaguar or on the cRio?

First, make sure that a positive value for motor results in a positive change (We usually define positive as forward, right, up, right-turn). If not, invert it after the PID control.

Second, make sure a positive change in the sensor results in a positive change in the sensor signal. If you roll it in the positive direction, do your counts and go up and velocities positive? If not, invert it before the PID control.

Then, you can try running PID control. If the direction is wrong, the control loop will compensate in the wrong direction, and since it keeps getting further from the target, it will keep compensating further in the wrong direction until it hits the limits of its authority.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
Reply With Quote
  #3   Spotlight this post!  
Unread 06-02-2014, 10:42
gpetilli gpetilli is offline
Registered User
FRC #1559
 
Join Date: Jan 2009
Location: Victor, NY
Posts: 285
gpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to all
Re: PID Help

All robots have the issue that the motors on opposite sides need to be driven inverse from each other. Some teams reverse the motor leads, but if you use encoders (which are not as easy to invert) it is much easier to invert (typically the right side) in software.

The Jaguars use a VELOCITY PID algorithm that is best tuned by starting with the I term small (say 0.01) and raise it slowly until it becomes unstable. Then increase the P term to make it more stable.

I am attaching a spreadsheet that we use for initial estimates of the PID values. The ones you want to use are the last two columns labeled JagI and JagP. We typically tell the jaguar that the encoder lines is the number of ticks per inch (not ticks per rev) so the reported speed is in inches per second, not RPM. If you want RPM, the values in the table need to be scaled.
Attached Files
File Type: xlsx Drivetrain_Model_KOP2014.xlsx (342.4 KB, 21 views)
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 18:21.

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