I lessthanthree you.
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
  #31   Spotlight this post!  
Unread 10-01-2006, 14:05
seanwitte seanwitte is offline
Registered User
None #0116
Team Role: Engineer
 
Join Date: Nov 2002
Location: Herndon, VA
Posts: 378
seanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant future
Send a message via AIM to seanwitte
Re: Calculating Angle to fire at

Why so complicated? Build your shooter and iterate through the ranges, keeping track of the shooter launch angle and camera tilt servo position. Then all you have to do is look up the value for the shooter angle based on the camera tilt servo and forget about the range. You can use a joystick button to add a fixed offset to adjust in realtime if something changes on the field and it starts missing.

When I tested the camera code I could only get about 20' away before the trackable pixel area becomes too small. At 6" increments your lookup table is only 40 entries long.
  #32   Spotlight this post!  
Unread 10-01-2006, 15:15
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: Calculating Angle to fire at

I agree with Sean. With so many variables in the system the only sane way to approach this is by testing your shooter, and averaging the results for each angle or distance or launch velocity, then using a look up table for each distance (or angle)

and if possible, only allow your launcher to vary one setting (angle or launch velocity).

Rick had a good point. In the real world military pilots let the computer do all their magic, they pull the trigger, then they use a joystick to walk the rounds into the target.

Even an A10 warthog with its computer controlled targeting system cannot hit a target 1 mile away with the first round (bullet).

Last edited by KenWittlief : 10-01-2006 at 15:23.
  #33   Spotlight this post!  
Unread 10-01-2006, 16:44
varcsscotty varcsscotty is offline
Programmer
FRC #1571 (Braughtswurst)
 
Join Date: Oct 2005
Location: Gresham, Oregon
Posts: 41
varcsscotty is an unknown quantity at this point
Re: Calculating Angle to fire at

it's not the only way trust me....
__________________
"If you want the best, try the Wurst!"
  #34   Spotlight this post!  
Unread 11-01-2006, 20:24
X-Istence X-Istence is offline
Melt the RC controller!
AKA: Bert JW Regeer
no team
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Montville
Posts: 151
X-Istence will become famous soon enoughX-Istence will become famous soon enough
Send a message via AIM to X-Istence Send a message via MSN to X-Istence
Re: Calculating Angle to fire at

While I agree that a table lookup would be a lot easier, why not go all out this year, and use the CPU that was given to you, and calculate on the fly. I know that is what my team is doing. While a hash table would be fast, it would be less accurate, and we are personally looking for going for the perfect bullseye at least 60% of the time.
  #35   Spotlight this post!  
Unread 11-01-2006, 20:35
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: Calculating Angle to fire at

Quote:
Originally Posted by X-Istence
While I agree that a table lookup would be a lot easier, why not go all out this year, and use the CPU that was given to you, and calculate on the fly. I know that is what my team is doing. While a hash table would be fast, it would be less accurate, and we are personally looking for going for the perfect bullseye at least 60% of the time.
the reason for using a lookup table is something they don't tell you in college. The real world in not linear. There IS no equation for the trajectory of a foam ball through the air for different angles, launch velocities or distances.

You can come up with equations that approximate what the foam ball will do when you launch it from your robot, or you can test fire the mechanism several times, record the results, and know exactly what it will do as each variable in your system is changed.

No matter what equation you use, your going to have to test fire your launcher to get its actual parameters, so you have to go through the same procedure anyway.

but once you test fire your launcher over its range of settings, and measure the results, you now HAVE the answers to the equations you need to write. At that point why calculate the answers each time you fire the launcher? you already measured the results during testing.

besides, a lookup table in SW takes 2 or 3 simple instructions to execute. You add a variable to the table start address, and read the answer from that memory location.

Trig functions on a microprocessor can take hundreds of instruction cycles to calculate.

"everything should be as simple as possible, but not simpler" -Einstein

Last edited by KenWittlief : 11-01-2006 at 20:38.
  #36   Spotlight this post!  
Unread 11-01-2006, 20:45
Salik Syed Salik Syed is offline
Registered User
FRC #0701 (RoboVikes)
Team Role: Alumni
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Stanford CA.
Posts: 514
Salik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud of
Send a message via AIM to Salik Syed
Re: Calculating Angle to fire at

I think we may also end up using the same method... collecting real life data.
Calculating it is less accurate due all the real world factors that are out of control and too hard or random to factor in(friction, spin etc.)
__________________
Team 701
  #37   Spotlight this post!  
Unread 11-01-2006, 21:06
X-Istence X-Istence is offline
Melt the RC controller!
AKA: Bert JW Regeer
no team
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Montville
Posts: 151
X-Istence will become famous soon enoughX-Istence will become famous soon enough
Send a message via AIM to X-Istence Send a message via MSN to X-Istence
Re: Calculating Angle to fire at

Quote:
Originally Posted by KenWittlief
the reason for using a lookup table is something they don't tell you in college. The real world in not linear. There IS no equation for the trajectory of a foam ball through the air for different angles, launch velocities or distances.

You can come up with equations that approximate what the foam ball will do when you launch it from your robot, or you can test fire the mechanism several times, record the results, and know exactly what it will do as each variable in your system is changed.

No matter what equation you use, your going to have to test fire your launcher to get its actual parameters, so you have to go through the same procedure anyway.

but once you test fire your launcher over its range of settings, and measure the results, you now HAVE the answers to the equations you need to write. At that point why calculate the answers each time you fire the launcher? you already measured the results during testing.

besides, a lookup table in SW takes 2 or 3 simple instructions to execute. You add a variable to the table start address, and read the answer from that memory location.

Trig functions on a microprocessor can take hundreds of instruction cycles to calculate.

"everything should be as simple as possible, but not simpler" -Einstein
Ah, I knew I was missing something. I see why a lookup table would make more sense.
__________________
My Blog!
  #38   Spotlight this post!  
Unread 11-01-2006, 22:58
seanwitte seanwitte is offline
Registered User
None #0116
Team Role: Engineer
 
Join Date: Nov 2002
Location: Herndon, VA
Posts: 378
seanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant future
Send a message via AIM to seanwitte
Re: Calculating Angle to fire at

Quote:
Originally Posted by X-Istence
While I agree that a table lookup would be a lot easier, why not go all out this year, and use the CPU that was given to you, and calculate on the fly. I know that is what my team is doing. While a hash table would be fast, it would be less accurate, and we are personally looking for going for the perfect bullseye at least 60% of the time.
Theres nothing wrong with that approach, but time is a finite resource and it is not the hardest problem here. It seems to me there are two very difficult problems involved:

1) Build a contraption that consistently shoots the balls at roughly the same speed (and hopefully direction!)

2) Build a gimbal mount that can be quickly and accurately positioned to control the launch angle for the gizmo in part 1.

I think part 2 will be the deal breaker for most teams. Moving an appendage is one thing, but this requires tight tolerances to make it work.
  #39   Spotlight this post!  
Unread 11-01-2006, 23:57
David Brinza's Avatar
David Brinza David Brinza is offline
Lead Mentor, Lead Robot Inspector
FRC #0980 (ThunderBots)
Team Role: Mentor
 
Join Date: Feb 2003
Rookie Year: 2003
Location: Glendale, CA
Posts: 1,382
David Brinza has a reputation beyond reputeDavid Brinza has a reputation beyond reputeDavid Brinza has a reputation beyond reputeDavid Brinza has a reputation beyond reputeDavid Brinza has a reputation beyond reputeDavid Brinza has a reputation beyond reputeDavid Brinza has a reputation beyond reputeDavid Brinza has a reputation beyond reputeDavid Brinza has a reputation beyond reputeDavid Brinza has a reputation beyond reputeDavid Brinza has a reputation beyond repute
Re: Calculating Angle to fire at

Quote:
Originally Posted by seanwitte
Theres nothing wrong with that approach, but time is a finite resource and it is not the hardest problem here. It seems to me there are two very difficult problems involved:

1) Build a contraption that consistently shoots the balls at roughly the same speed (and hopefully direction!)

2) Build a gimbal mount that can be quickly and accurately positioned to control the launch angle for the gizmo in part 1.

I think part 2 will be the deal breaker for most teams. Moving an appendage is one thing, but this requires tight tolerances to make it work.
The KISS rule probably applies here (as in most things in life).

You need to understand the relative complexity of items #1 (consistent speed) vs. #2 (agile and accurate gimbal mechanism) and factor in the relative importance of 1 vs. 2. It seems to me that unless you plan to alter the launch angle based on the launch velocity on the current shot, #2 is not very important. If you shoot the ball at fixed angle and consistent speed, you should be able to deliver the ball in the proper height over a rather large range from the goal. I think that's the key in this game.

Hint: play around with the Excel spreadsheet I posted earlier in this thread, now attached below with a minor correction. I now divide by 8 in the drag factor parameter instead of multiplying by 0.128 (obviously I meant to multiply 0.125 in the original version...2% error - my bad!)
Attached Files
File Type: xls AimHigh_traj2.xls (78.0 KB, 100 views)
__________________
"There's never enough time to do it right, but always time to do it over."
2003 AZ: Semifinals, Motorola Quality; SoCal: Q-finals, Xerox Creativity; IRI: Q-finals
2004 AZ: Semifinals, GM Industrial Design; SoCal: Winners, Leadership in Controls; Championship: Galileo #2 seed, Q-finals; IRI: Champions
2005 AZ: #1 Seed, Xerox Creativity; SoCal: Finalist, RadioShack Controls; SVR: Winners, Delphi "Driving Tomorrow's Technologies"; Championship: Archimedes Semifinals; IRI: Finalist
2007 LA: Finalist; San Diego: Q-finals; CalGames: Finalist || 2008 San Diego: Q-finals; LA: Winners; CalGames: Finalist || 2009 LA: Semifinals; Las Vegas: Q-finals; IRI: #1 Seed, Finalist
2010 AZ: Motorola Quality; LA: Finalist || 2011 SD: Q-finals; LA: Q-finals || 2013 LA: Xerox Creativity, WFFA, Dean's List Finalist || 2014 IE: Q-finals, LA: Finalist, Dean's List Finalist
2016 Ventura: Q-finals, WFFA, Engineering Inspiration

Last edited by David Brinza : 12-01-2006 at 00:13. Reason: Attached revised Excel spreadsheet
  #40   Spotlight this post!  
Unread 12-01-2006, 13:49
Tatsu Tatsu is offline
Audiophile and Physicist.
AKA: Tatsu Hashimoto
FRC #1072 (Harker Robotics Team)
Team Role: Leadership
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Woodside
Posts: 49
Tatsu will become famous soon enough
Send a message via AIM to Tatsu
Re: Calculating Angle to fire at

if anyone uses mathematica, here's a notebook to generate ballistic lookup tables..

initial values are declared at the top, target height is deltah (3.5 ft or whatever) * ft-> meter conversion.

all values should be done in metric.. at the end, just display the contents (or export to CSV) and load em onto the bot.

I'm sure a few of you'll figgure out some more inventive uses..

<-- currently working on a 3-dimentional version.

No, I'm not a programmer.
Attached Files
File Type: zip Traj.zip (15.0 KB, 42 views)
  #41   Spotlight this post!  
Unread 12-01-2006, 14:18
Mark Pettit's Avatar
Mark Pettit Mark Pettit is offline
Addict
FRC #0991 (The Dukes)
Team Role: Coach
 
Join Date: Dec 2002
Rookie Year: 2001
Location: Phoenix, Arizona
Posts: 177
Mark Pettit is a name known to allMark Pettit is a name known to allMark Pettit is a name known to allMark Pettit is a name known to allMark Pettit is a name known to allMark Pettit is a name known to all
Re: Calculating Angle to fire at

Another variable to your equations might be the "plug" that these balls have on them. The plug must be a necessary part of the manufacturing process. It really makes them wobble if any spin is introduced.
__________________
Mark Pettit
Team #991 - The Dukes
Brophy College Preparatory
Phoenix, Arizona, USA
THE DUKES: Humans Competing In The Unlimited Class
  #42   Spotlight this post!  
Unread 12-01-2006, 19:20
BotLobsta BotLobsta is offline
Registered User
FRC #1477
 
Join Date: Jan 2006
Location: Texas
Posts: 4
BotLobsta is an unknown quantity at this point
Re: Calculating Angle to fire at

I added the equation that Matt came up with into my firing calculations to have a basic trajectory to test with, and I got the following error:
Error - section 'MATH_DATA' can not fit the section. Section 'MATH_DATA' length=0x00000014

I looked in the linker script and could not find that section, nor could I find mention of it anywhere else in any documentation. Any help?
  #43   Spotlight this post!  
Unread 12-01-2006, 21:47
Tatsu Tatsu is offline
Audiophile and Physicist.
AKA: Tatsu Hashimoto
FRC #1072 (Harker Robotics Team)
Team Role: Leadership
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Woodside
Posts: 49
Tatsu will become famous soon enough
Send a message via AIM to Tatsu
Re: Calculating Angle to fire at

those of you intending to use lookup tables, here's a lookup table for you to play around with..

its around 108kb, but you can trim it by deleting the first portion (the ball wont even go in)

first column, theta
second column {distance-to-goal,total-distance-traveled-till-ground,risidual error}

risidual error shouldn't matter unless you're seriously nitpicky, it'll give you a relative idea of how much error there is for each theta..
Attached Files
File Type: zip Ballistics.zip (44.2 KB, 66 views)
  #44   Spotlight this post!  
Unread 13-01-2006, 18:24
Korbin's Avatar
Korbin Korbin is offline
Registered User
FRC #1011 (CRUSH)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Tucson AZ
Posts: 36
Korbin is an unknown quantity at this point
Send a message via AIM to Korbin
Re: Calculating Angle to fire at

Quote:
Originally Posted by seanwitte
When I tested the camera code I could only get about 20' away before the trackable pixel area becomes too small. At 6" increments your lookup table is only 40 entries long.
was this tested using the four bulbs that came in the kit, or with all eight that will be used in competition?
  #45   Spotlight this post!  
Unread 13-01-2006, 19:51
Andrew Blair's Avatar
Andrew Blair Andrew Blair is offline
SAE Formula is FIRST with Gasoline.
FRC #0306 (CRT)
Team Role: Alumni
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Corry
Posts: 1,193
Andrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond repute
Send a message via AIM to Andrew Blair Send a message via Yahoo to Andrew Blair
Re: Calculating Angle to fire at

There are eight cathode included in the KOP. Two per box. But I also wonder if only four were used; we were considering it, though we used eight, and with eight, it is pretty bright. But we haven't tested yet.
__________________
Reading makes a full man, conference a ready man, and writing an exact man.
-Sir Francis Bacon

"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction."
-Albert Einstein
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
Viewing Angle of Camera Joe Johnson Technical Discussion 10 14-01-2005 14:11
Calc. Triangle Angle or Side Based on Ellipses? indieFan Math and Science 1 07-06-2004 21:25
Serious VCU Fire Joe Matt Chit-Chat 3 26-03-2004 19:04
PBASIC ARCTAN function Greg Ross Programming 14 11-05-2003 12:28
45 degree PVC angle fittings: which? archiver 2001 2 23-06-2002 22:53


All times are GMT -5. The time now is 15:35.

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