
11-01-2006, 21:06
|
|
Melt the RC controller!
AKA: Bert JW Regeer
no team
Team Role: Alumni
|
|
Join Date: Jan 2006
Rookie Year: 2006
Location: Montville
Posts: 151
|
|
|
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.
|