Go to Post I'm all for an aggressive game, but lets not crack each others lexan. - Molten [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 14-08-2006, 10:05
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Lightbulb Two variable PID? I know someone's done it =)...

My team hasn't done it, but I'm SURE someone out there has:

A PID loop that controls BOTH velocity and position. Basically it allows you to say "I want to move 33 feet forward, and do it at 6 fps."

The PID loop manages both the acceleration to the target speed, keeps track of the distance travelled, and decelerates and corrects as you approach your target distance.

Surprisingly, I did a search on CD, and didn't come up with much, although I probably missed something .

Overviews, explanations, even code snippets would be much appreciated!

-Shawn T. Lim
  #2   Spotlight this post!  
Unread 14-08-2006, 10:51
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: Two variable PID? I know someone's done it =)...

sure, there are many systems that have PID loops on more than one parameter.

Think of it this way, PID loops are used to hold a system parameter at a desired level or output

you could have a PID loop on position, and tell your robot "move forward 6 feet, move back 9 feet" and a separate loop that controls speed.

In this case the position loop would invoke the speed loop. When its told to move forward it would set the speed in the forward direction. The 6 ft/S would be the upper limit of velocity.
  #3   Spotlight this post!  
Unread 14-08-2006, 12:25
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Two variable PID? I know someone's done it =)...

Quote:
Originally Posted by KenWittlief
In this case the position loop would invoke the speed loop. When its told to move forward it would set the speed in the forward direction. The 6 ft/S would be the upper limit of velocity.
That's almost exactly how the Katapult (TechnoKats 2006) autonomous drive PID was designed to work. There is a "speed limit" imposed on the output from the position control routine.
  #4   Spotlight this post!  
Unread 14-08-2006, 18:46
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,488
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: Two variable PID? I know someone's done it =)...

Quote:
Originally Posted by SlimBoJones
My team hasn't done it, but I'm SURE someone out there has:

A PID loop that controls BOTH velocity and position. Basically it allows you to say "I want to move 33 feet forward, and do it at 6 fps."

The PID loop manages both the acceleration to the target speed, keeps track of the distance travelled, and decelerates and corrects as you approach your target distance.

Surprisingly, I did a search on CD, and didn't come up with much, although I probably missed something .

Overviews, explanations, even code snippets would be much appreciated!

-Shawn T. Lim

If you really want to control multiple parameters simultaneously, the best solution is to use a state space control algorithm. I would recommend doing a web search on "state space control" or "full state feedback".

A good example of trying to control position and velocity with state space methods is shown here (from my alma mater, nonetheless).
__________________
-
An ounce of perception is worth a pound of obscure.

Last edited by Chris Hibner : 14-08-2006 at 18:54.
  #5   Spotlight this post!  
Unread 29-08-2006, 00:31
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Two variable PID? I know someone's done it =)...

Miss Daisy has done this for 2 years now.

It's actually not a 2 variable PID problem; it's two 1 variable PID problems.

A velocity control loop looks like this:

Velocity Command --> Velocity PID Controller--> Motor Output (with encoder counts/cycle looping back to the PID controller)

A traditional position control loop looks like this:

Position Command --> Position PID Controller --> Motor Output (with encoder counts looping back to the PID controller)

However, the problem with position command directly affecting a motor output is that (1) motors are rarely linear in response, which is what you want for an ideal PID control system, and (2) there is no guarantee that multiple motors will get to the same position in the same amound of time.

The easiest solution? Instead of generating a motor output from your position loop, generate a velocity command. The velocity controller will ensure that it reaches that speed, and it's response will be more linear, making tuning much easier. Your combined controller would look like this:

Position Command --> Position PID Controller --> Velocity Command --> Velocity PID Controller --> Motor Output (with encoder counts looping to position controller and encoder counts/cycle looping to velocity controller)

This makes user/autonomous code highly redundant: use the same velocity loop in both modes, but in user get the velocity command from the joystick position, and in autonomous get the velocity command from the position control loop (with setpoints generated by dead reckoning, sensors, etc.).

If you need help with how to code this, let me know, but this should get you started.
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
PID shadowops06 Programming 5 16-06-2006 22:48
Putting two and two together... Andy Grady General Forum 13 08-01-2004 18:29
Anyone know the animation winners? (I know team 191,who else archiver 2001 3 24-06-2002 03:24
someone's making a robot that can pull 4 goals! Anton Abaya Rumor Mill 18 12-02-2002 21:10
Looks like someone's been busy... Carolyn Duncan Chit-Chat 27 03-08-2001 21:41


All times are GMT -5. The time now is 09:44.

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