Go to Post STEM is the new cool, STEM is the new fun, but nobody said STEM is the new easy. - Taylor [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 01-03-2006, 22:29
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,186
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: How does your auto-aim work?

Quote:
Originally Posted by Rickertsen2
Why PI instead of PD or PID?
I've always thought it was a rule of thumb to use PI for position control and PD for velocity control, especially with the dead band on the victors.

In position control, you want to accurately stick to one position. (yeah, I know... duh... ) With just P control, the error can get so small that you are sending a output of 0 (-10 - 10 - victor dead band) to the motor control. You want the integral term to look at that error building up and over power it.

In velocity control, you want to change your output on the fly, and compensate for where you think you need to be. PD works fine.
  #2   Spotlight this post!  
Unread 01-03-2006, 22:58
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
Re: How does your auto-aim work?

Quote:
Originally Posted by Tom Bottiglieri
I've always thought it was a rule of thumb to use PI for position control and PD for velocity control, especially with the dead band on the victors.

In position control, you want to accurately stick to one position. (yeah, I know... duh... ) With just P control, the error can get so small that you are sending a output of 0 (-10 - 10 - victor dead band) to the motor control. You want the integral term to look at that error building up and over power it.

In velocity control, you want to change your output on the fly, and compensate for where you think you need to be. PD works fine.
Maybie i am mistaken, but it thought the opposite was true and you were suppsoed to use PD for position and PI for velocity/temperature. It seems to me that when controlling velocity, I would be very important because it ends up canceling out friction and other forces that would prevent P alone from reaching the setpoint. It seems like D is very important in a position control system because it makes the system stable. If you model a perfect frictionless system with a position P controller applying a force to a mass, the system will oscillate in a sinusiodal fashion. If you add D, it becomes stable. You make a good point though about I eliminating the steady state error.
In my PD code i have a minimum output signal that the controller is allowed to output so long as the controller is outside of its allowable tolerance. This minimum is just enough to overcome friction, the victor deadband etc.

Perhaps i should code in an I to my control loop.

Obviously PID is the ideal solution.
__________________
1139 Alumni

Last edited by Rickertsen2 : 01-03-2006 at 23:01.
  #3   Spotlight this post!  
Unread 01-03-2006, 23:04
Chriszuma's Avatar
Chriszuma Chriszuma is offline
Jack of all trades
AKA: Chris Hammond
FRC #0068 (Truck Town Thunder)
Team Role: Alumni
 
Join Date: Oct 2004
Rookie Year: 2005
Location: Clarkston, MI
Posts: 290
Chriszuma is just really niceChriszuma is just really niceChriszuma is just really niceChriszuma is just really nice
Send a message via AIM to Chriszuma
Re: How does your auto-aim work?

Quote:
Obviously PID is the ideal solution.
Yeah, if you don't mind losing your mind trying to tune it.
__________________
2006 T3 World Tour: Great Lakes - Waterloo - Palmetto - IRI
2006 Awards: Motorola Quality - RadioShack Innovation in Control

My website: http://zuma.phire.org/
Truck Town Thunder's website: http://trucktownthunder.com/
  #4   Spotlight this post!  
Unread 01-03-2006, 23:17
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
Re: How does your auto-aim work?

Quote:
Originally Posted by Chriszuma
Yeah, if you don't mind losing your mind trying to tune it.
true that
__________________
1139 Alumni
  #5   Spotlight this post!  
Unread 06-03-2006, 16:28
Don Reid Don Reid is offline
Registered User
#0997
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Corvallis, Oregon
Posts: 45
Don Reid will become famous soon enough
Re: How does your auto-aim work?

Our camera is bolted directly to the robot frame, no pan or tilt. It is in line with the cannon.
We mechanically align the camera to have the target at the center when the cannon shoots balls through the center of the goal from the desired position.

In use, when the driver requests it, the firmware uses a PID loop (sort of 2, for X & Y) to drive the robot until the center of the target is at the center of the camera.

We also have a custom dashboard program that shows the driver(s) where the camera sees the target. They use this to decide when to activate the auto method, or for manual aiming.
__________________
Don Reid
  #6   Spotlight this post!  
Unread 07-03-2006, 17:22
mogunus mogunus is offline
Registered User
AKA: Luciano DiFalcone
FRC #1350 (Rambots)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2003
Location: RI
Posts: 19
mogunus is an unknown quantity at this point
Re: How does your auto-aim work?

We use two cameras, each mounted on the pan/tilt servo, one on either side of the shooter, to "triangulate" the range to the target. Generally, the range estimate we get from that is accurate to within 5 inches. That gives us the x-vector that we need to plug in to the launch angle formula, given the constant Y-vector and the constant speed that we hold our shooter motors at.

This approach works well.
__________________
... one of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs.
-- Robert Firth
  #7   Spotlight this post!  
Unread 07-03-2006, 17:48
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Re: How does your auto-aim work?

We'll find out this weekend how (or whether) our auto-aim works.

We fix-mounted our camera such that at the base of the ramp, the target is at the top of the camera's field of view, and at half court, it is at the bottom. Based upon the Y position of the blob centroid, we calculate (actually lookup) the required shooter speed. We also have an auto-aim driving mode which uses the blob centroid's X position as input to a PID control loop to get and keep the robot pointed at the goal.
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
  #8   Spotlight this post!  
Unread 24-03-2006, 04:13
Ben Englert Ben Englert is offline
Registered User
FRC #1072
 
Join Date: Jan 2006
Location: San Jose CA
Posts: 40
Ben Englert has a spectacular aura aboutBen Englert has a spectacular aura aboutBen Englert has a spectacular aura about
Re: How does your auto-aim work?

Quote:
Originally Posted by mogunus
We use two cameras, each mounted on the pan/tilt servo, one on either side of the shooter, to "triangulate" the range to the target. Generally, the range estimate we get from that is accurate to within 5 inches. That gives us the x-vector that we need to plug in to the launch angle formula, given the constant Y-vector and the constant speed that we hold our shooter motors at.

This approach works well.
How do you hook up two cameras to the RC? Do you just use the program port for one, or have you put together some kind of multiplexer?
__________________
Before a match at SVR, 3/17/06
Tatsu: "Yo Englert, what's our autonomous mode?"
Me: "We'll find out, won't we."
Both: *maniacal laughter*
After the match's autonomous period ends:
Me: "Well, the basic control system still responds. That's always good."
Both: *further laughter*
  #9   Spotlight this post!  
Unread 25-03-2006, 23:18
Neo3One3 Neo3One3 is offline
Registered User
AKA: Nick
FRC #0175 (Buzz)
Team Role: Driver
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Enfield, CT
Posts: 21
Neo3One3 is a name known to allNeo3One3 is a name known to allNeo3One3 is a name known to allNeo3One3 is a name known to allNeo3One3 is a name known to allNeo3One3 is a name known to all
Re: How does your auto-aim work?

Well, for ours, we use two functions, one for pan and the other for tilt (obviously). For our tilt, we simply use a lookup table based on the camera's tilt servo position, and drive the motor to a certain pot reading accordingly. For our pan, we set a zero position for when the camera is centered to the turret, and the turret drives until that center is reached.

Mogunus, I was wondering what the reason was for having two cameras. Can't you simply get the distance to the goal from:
Distance to Wall = Height from Camera to Light / Tangent(Camera Angle)
and
Distance to Goal = Height from Camera to Light / Cosine(Camera Angle)
Maybe accuracy increases from two cameras, I'm not really sure.
__________________

Go Buzz!
  #10   Spotlight this post!  
Unread 26-03-2006, 00:08
lemoneasy lemoneasy is offline
Registered User
AKA: Evan Crawford
FRC #1334
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Oakville, Ontario
Posts: 21
lemoneasy is on a distinguished road
Re: How does your auto-aim work?

accuracy could increase with two cameras if you have a problem with it tracking through a few pwm positions in the tilt of the camera. If your out by center field, that makes a big difference in calculations, so you could use the average angle from both cameras to get a better reading, but it would be more efficient to just take the numbers from two loops and average.

For our bot, we had an auto-aim that was working perfectly, but when you get to competitions and the bright lights drown out the targets, its a lot more unreliable. 220 confidence to 20 more unreliable. It also is a pretty large target, but if your shooting from further away, its nice to have auto-aim.

We had a tilt and pan motors, each powered by relays, the pan was just a number based on the servo position of our camera it drove until the pot had the same number (after conversion, the pot was 16-bit). Same with the tilt, based on the distance to the wall, we found an angle, which was converted to a postition on the pot, and driven to it, as long as it was within the limits.

Thats about it, not overly complex, and with these large nets, aiming is pretty forgiving.
__________________
  #11   Spotlight this post!  
Unread 27-03-2006, 00:52
iamthetallpaul iamthetallpaul is offline
Registered User
FRC #1189
 
Join Date: Jan 2006
Location: Grosse Pointe
Posts: 13
iamthetallpaul is on a distinguished road
Re: How does your auto-aim work?

I wish I had had more experience to learn about PD, PID, and PI loops, this was my first and only year as our only programmer (any my only year on the team). Th last one graduated and left me with nothing.

I used a slightly modified version of Kevin's code. Instead of driving a pan servo based on the pan_error, pan_error is just added to or subtracted from 127 to drive the turret motor towards the center of the light. Actually slightly off center since the camer is mounted off center. Tilt is exactly the same and the hood is a lookup table.
  #12   Spotlight this post!  
Unread 27-03-2006, 01:20
sanddrag sanddrag is offline
On to my 16th year in FRC
FRC #0696 (Circuit Breakers)
Team Role: Teacher
 
Join Date: Jul 2002
Rookie Year: 2002
Location: Glendale, CA
Posts: 8,513
sanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond repute
Re: How does your auto-aim work?

I am not a programmer but I'll explain it to the best of my abilities. Our robot has azimuth and elevation control on the shooter. We have pots on both. The camera has it's own azimuth and elevation control (the one provided in the kit) using servos. The camera is mounted to the shooter azimuth but not the shooter elevation. When the aim button is pressed, the camera searches for the target. When the target is found, it locks on. Then, the "brains" say "okay, where are my camera's servos pointed right now?" and "where do my shooter's pots say it is pointed right now?" and "why the heck aren't they pointing the same way?" and "let's make them point the same way." This all happens in about half a second. That is a non-programmer's description of it. Anyway, because of our turret, we can be pushed around and still be locked onto the goal. At the SoCal regional, it worked so well we won the Radio Shack Innovation in Control Award for it. However, after we won that award, teams came up with autonomous modes (ramming) specifically against us. When they hit us hard, we remained dead locked on the target, but the balls in the feeder mechanism jammed, and we could not use our unjamming function until driver control mode. In one of our Saturday qualifying matches, we made some really long shots, from our low down shooter even with robots trying to block us because we could reposition and still be locked on or easily lock on again.

Also, on our feeder mechanism, we have a light sensor so when the light beam is broken, the motor stops until the "fire" button is pressed again. This allows indexed feeding and control of exactly how many balls we shoot.
__________________
Teacher/Engineer/Machinist - Team 696 Circuit Breakers, 2011 - Present
Mentor/Engineer/Machinist, Team 968 RAWC, 2007-2010
Technical Mentor, Team 696 Circuit Breakers, 2005-2007
Student Mechanical Leader and Driver, Team 696 Circuit Breakers, 2002-2004
  #13   Spotlight this post!  
Unread 28-03-2006, 23:19
Jeff K.'s Avatar
Jeff K. Jeff K. is offline
Hmm..now what?
FRC #1138 (Eagle Engineering)
Team Role: Alumni
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Chatsworth, California
Posts: 706
Jeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond repute
Send a message via AIM to Jeff K. Send a message via MSN to Jeff K.
Re: How does your auto-aim work?

Quote:
Originally Posted by sanddrag
At the SoCal regional, it worked so well we won the Radio Shack Innovation in Control Award for it. However, after we won that award, teams came up with autonomous modes (ramming) specifically against us. When they hit us hard, we remained dead locked on the target, but the balls in the feeder mechanism jammed, and we could not use our unjamming function until driver control mode.
Actually, I don't remember many teams aiming at you in autonomous after you guys won the award. And if anything, they had the "ramming" mode already on their bot from Thursday like we did.

Just my 2 cents..


Congrats on the award though. It definitely was a pretty neat design and looked nice too. David(Sanddrag), is your team going to the San Diego Lock In?

Last edited by Jeff K. : 28-03-2006 at 23:27.
  #14   Spotlight this post!  
Unread 28-03-2006, 23:25
sanddrag sanddrag is offline
On to my 16th year in FRC
FRC #0696 (Circuit Breakers)
Team Role: Teacher
 
Join Date: Jul 2002
Rookie Year: 2002
Location: Glendale, CA
Posts: 8,513
sanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond repute
Re: How does your auto-aim work?

Quote:
Originally Posted by Stonefan5271138
David, is your team going to the San Diego Lock In?
I would most certainly hope so. And hopefully with not only "Robot Man Jan" but also "Robot Man Jan B" Yes folks, two robots. If I have any say it in, it will happen. Will they be twins? Will they be different? Who knows. Find out May 20th.

I'm hoping for 5 balls in the center goal in autonomous. We'll see what happens.
__________________
Teacher/Engineer/Machinist - Team 696 Circuit Breakers, 2011 - Present
Mentor/Engineer/Machinist, Team 968 RAWC, 2007-2010
Technical Mentor, Team 696 Circuit Breakers, 2005-2007
Student Mechanical Leader and Driver, Team 696 Circuit Breakers, 2002-2004
  #15   Spotlight this post!  
Unread 27-03-2006, 14:09
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: How does your auto-aim work?

Quote:
Originally Posted by iamthetallpaul
I wish I had had more experience to learn about PD, PID, and PI loops, this was my first and only year as our only programmer (any my only year on the team). Th last one graduated and left me with nothing.

I used a slightly modified version of Kevin's code. Instead of driving a pan servo based on the pan_error, pan_error is just added to or subtracted from 127 to drive the turret motor towards the center of the light. Actually slightly off center since the camer is mounted off center. Tilt is exactly the same and the hood is a lookup table.
That's effectively P control, power output proportional to the error, with a gain of one (That is the output is the error times one, which is just the error). If you'd like a better explanation of P, I, and D contact me via PM and I'd be happy to help you out.

Our auto aim works similar to 696s but the camera is directly mounted to the shooter, our brain just goes "Where are we?" followed by" Where does the camera say we want to be?" and then using the error computed from that, runs through a P, I, and D formula with their own specific gains (some of them very low) set, then we run sanity checks on all the values to make sure they're sensible, add them up, check that (We're so paranoid ) before returning it from our aiming function, then, depending on mode it's either use to drive the Heads-Up display, the pan motor, or both.

Firing consists of three modes:

Manual - Camera feedback drives LED HUD on operators safety glasses, operator can start firing checklist at will, pan control is handled by a dial on controls representing absolute position, no auto-targeting.

Semi-Auto - Camera feedback drives pan motors to maintain targeting on goal, drives LED HUD on glasses, operator can start checklist at will, auto-targeting, no search. This mode is currently not implemented due to a few reliability issues.

Auto - Camera feedback drives pan motors to seek and maintain targeting with search algorithm, drives LED HUD on glasses, checklist constantly cycling and firing when completed, auto targeting and search within current field of view.

The checklist runs through a series of sensor checks to make sure the system is ready to take a shot:

1. Is there a ball in the firing mechanism? (Optical beam sensors)
2. Is the piston in ready position? (Reed switch)
3. Are the impeller wheels up to speed? (Tachometer/DC Motor from kit)
4. Do we have permission to fire? (Firing button still pressed/Auto fire mode)
5. Are we on target? (Camera/Overridden in manual mode)

We use manual mostly while in driver mode because our operator responds to changes faster than our conservative PID control (we slowed it down for system stability, working on improving that as well) whereas our autonomous mode, at least a few of them ;-) uses the camera based Automatic Mode to acquire a lock and score during autonomous. It worked pretty well, in the semifinals and quarterfinals of SBPLI we were rammed several times in autonomous, the turret corrected and continued scoring.

The heads-up display are two bright LEDs mounted so they're on the edge of our operators peripheral vision, they indicate to which side of the turret the target is on, in other words, which way to turn, both light when on target, neither light when the target is not visible to camera and they blink back and forth rapidly if communications with the camera fail.
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
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
What Artist Influence You? Koko Ed Chit-Chat 12 01-12-2006 11:33
Springs and Work sanddrag Math and Science 11 17-05-2005 18:35
(part II) We aim for the stars Ken Leung General Forum 6 03-05-2005 16:57
Who knows how the motors [I]really[/I] work? Wetzel Chit-Chat 5 13-02-2002 21:50
Does anyone on this board work at home depot? mnkysp6353 General Forum 2 30-12-2001 13:27


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

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