Go to Post A quote from the Southern California Regional Visitors guide: "If you are having problems the FIRST thing to do is ask your neighbor for help" - ChrisH [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 15-05-2006, 21:46
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 746
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Re: Teams: How did you use your potentiometers this year?

Quote:
Originally Posted by Andrew Schuetze
I'm very curious as to what your PID loops controlled. Do I presume correctly turret position, launch angle, and ...

Our programming team decided to use a PID control method to keep the lookup table values we had calculated offline in check with our robot system.

In order to use a PID implementation, we needed some sort of feedback device. The gear tooth sensor provided in the 2006 kit of parts was our feedback sensor of choice to measure the velocity of the wheel. The velocity set point we determined would have to come from the camera by mounting the camera on a tilt servo. While the camera was instructed to seek out the green color of the illuminated light, software controls kept the camera tilt servo field of view (FOV) in the center. Once we acquired a center of target, we then knew the servo tilt pulse-width-modulation (PWM) value to make a reference of our tilt angle.

In order to prove our theories, a prototype team went to work right away building a wooden velocity wheel “rig”. A motor was mounted in a wooden chassis along with the gear tooth sensor. Because of our inexperience with PID control in the Innovation First controller, we had to understand the capabilities of the PIC microcontroller processing power and speed at which it could evaluate the gear tooth sensor to make a good closed-loop system. The first concern was that the gear tooth sensor would be wired and configured into the controller as a hardware interrupt. This sensor would interrupt the normal control loop of the controller thousands of times per second. Our first test comprised of a large tooth gear that would only induce about 200-300 interrupts per second. We found that this affected the resolution of the feedback system and made it very difficult to tune the PID. Low resolution meant our PID system responded “sluggish” no mater how hard we tried to perfect the tuning parameters. Tuning a system means adjusting the PID multipliers commonly known as Kp, Ki and Kd by adding in various amounts of these functions to get the system to behave the way you want. Our tuning method comprised of using National Instruments LabView Dashboard for a real time feedback process to see the response of the output based on our tuning parameters. In order to make quick on-the-fly adjustments, we built a PID tuning board out of three simple potentiometers. Each pot represented each value, Kp, Ki and Kd. The pots were wired to three of the analog ports on the Innovation First controller and software scaling replaced the tuning variables inside the code that was written.

Our final proto-type consisted of a very large gear with fine pitched teeth that induced about 1200-1400 interrupts per second and gave us the best tunablity of our PID system. Once we set a velocity in the software, the gear tooth sensor measured a scaled velocity value as feedback and the PID control kept the ball shooter wheel spinning at the desired velocity. Because our shooter mechanism would shoot 10 balls one right behind the other, this created a drag or velocity recovery on the ball shooter wheel. After each shot the velocity of the wheel would decrease. With the PID control system in place continuously in a closed-loop fashion, after each shot the gear tooth sensor would measure the velocity of the shooting wheel, if the velocity was below the desired set point, the controller would increase the speed of the shooting wheel to keep the ball shooting wheel at the desired speed to make the correct trajectory launch. Of course if the wheel was measured too fast, the controller slowed down the ball shooter wheel to keep the velocity at a maintained velocity.

Now that we had a workable PID system in place, we still need to input our PID system with the “set point” value. The set point was derived using basic trigonometry. The goal light was at a fixed height of approximately 10.5 feet. Because our camera was mounted at a known height, we calculated a distance using trigonometry by knowing the angle the camera is tilted to solve the distance from the light we are located.

The required ball velocity was solved offline using an Excel spreadsheet at certain angles. We called these angles our calibration angles. At each calibration angle we created a lookup table reference that we could code in the Innovation First controller. We then linearly interpolated points between our calibration angles to make up a 75 point or 75 angle lookup table. Each angle was assigned a velocity value depending on the angle of the camera, that velocity pointer was feed into the PID control loop to control the speed of the shooting wheel. This simplified the math the controller was required to execute and streamlined coding efficiency.

Basically the greater the camera tilt angle, the slower the velocity command was, the smaller the tilt angle, the faster the velocity command was, meaning the robot was deeper in the field.

Hope that helps.
Attached Thumbnails
Click image for larger version

Name:	trig.jpg
Views:	70
Size:	50.9 KB
ID:	4406  Click image for larger version

Name:	vel.jpg
Views:	62
Size:	96.7 KB
ID:	4407  
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
How many drive motors did you use (per side) this year? Billfred Motors 19 16-10-2004 20:27
How did you thank your engineers/mentors/sponsors this year? Bharat Nain Thanks and/or Congrats 15 01-08-2004 21:18
will your team use bumpers this year? Alex Cormier General Forum 7 30-01-2004 15:31
How did you learn how to use Inventor? Greg McCoy Inventor 26 24-05-2003 01:55


All times are GMT -5. The time now is 13:47.

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