Go to Post we would all build robots to play "rock-paper-scissors" if FIRST told us to, cause it is just so freakin' much fun to build a robot until 2:30am every night for six weeks! - dlavery [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 23-01-2012, 15:49
JesseGR JesseGR is offline
Registered User
FRC #3539
 
Join Date: Jan 2012
Location: Michigan
Posts: 1
JesseGR is an unknown quantity at this point
Trajectory Calculator (W/ Drag)

Hello, my name is Jesse and I am a programmer from team 3539. In a few hours of downtime I had between our current projects, I applied a few physics formulas to a Java application and made a calculator that can accurately determine the path of an object when fired at an angle and a velocity, among other things.

http://img841.imageshack.us/img841/9954/77059684.png (Screenshot)
http://www.box.com/s/svmj0ln7vvzdh27pqckv (Download)

The ideal "Calculations per Second" setting is 5000, make sure you change it from the default of 5.

Enjoy.
  #2   Spotlight this post!  
Unread 23-01-2012, 18:02
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Trajectory Calculator (W/ Drag)

Quote:
Originally Posted by JesseGR View Post
applied a few physics formulas to a Java application and made a calculator that can accurately determine the path of an object when fired at an angle and a velocity
How do you know it is accurate? i.e. what test data did you use to validate your model?

  #3   Spotlight this post!  
Unread 23-01-2012, 18:07
SenorZ's Avatar
SenorZ SenorZ is offline
Physics Teacher
AKA: Tom Zook
FRC #4276 (Surf City Vikings)
Team Role: Teacher
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Huntington Beach, California
Posts: 937
SenorZ has a reputation beyond reputeSenorZ has a reputation beyond reputeSenorZ has a reputation beyond reputeSenorZ has a reputation beyond reputeSenorZ has a reputation beyond reputeSenorZ has a reputation beyond reputeSenorZ has a reputation beyond reputeSenorZ has a reputation beyond reputeSenorZ has a reputation beyond reputeSenorZ has a reputation beyond reputeSenorZ has a reputation beyond repute
Re: Trajectory Calculator (W/ Drag)

I can't seem to run this on my computer. Cannot find main class...?

Either way those curves don't look like there is any drag. Did you physically measure the air drag coefficient?
  #4   Spotlight this post!  
Unread 23-01-2012, 18:12
shuhao shuhao is offline
Registered User
FRC #4069 (Lo-Ellen Robotics)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Sudbury
Posts: 138
shuhao is an unknown quantity at this point
Re: Trajectory Calculator (W/ Drag)

Quote:
Originally Posted by Ether View Post
How do you know it is accurate? i.e. what test data did you use to validate your model?

Check it against mine?

I also wrote something about 2 weeks back. This one is in GNU Octave/Matlab

https://github.com/FRCTeam4069/Simul...sketball_sim.m
  #5   Spotlight this post!  
Unread 23-01-2012, 22:18
Lalaland1125 Lalaland1125 is offline
Registered User
AKA: Ethan Steinberg
FRC #2429
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2011
Location: La Canada
Posts: 29
Lalaland1125 is an unknown quantity at this point
Re: Trajectory Calculator (W/ Drag)

Our team started working on the same idea(manually integrate the drag + projectile formulas to calculate the projectile path)(http://ideone.com/aoChY, but we haven't quite gotten it to the level of completeness you did.


This is going to require a lot of testing to get the constants right though(and to see if it is accurate at all).

(Also, no offense, but I would heavily suggest for you to refactor your code. All of those functions with repeated code and the whole "god" class is going to make things hard to modify and debug later on)

Last edited by Lalaland1125 : 23-01-2012 at 22:36.
  #6   Spotlight this post!  
Unread 23-01-2012, 23:41
robokiller robokiller is offline
Registered User
AKA: Jaxon Weis
FRC #2757 (B.A.D.)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2008
Location: Florida
Posts: 29
robokiller is an unknown quantity at this point
Re: Trajectory Calculator (W/ Drag)

I really want to play with a couple of these programs but yours is not working on my computer
"could not find main class: Main program will exit"
__________________
-- Jaxon Weis
  #7   Spotlight this post!  
Unread 25-01-2012, 22:38
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Trajectory Calculator (W/ Drag)

Quote:
Originally Posted by shuhao View Post
Check it against mine? I also wrote something about 2 weeks back.
what test data did you use to validate your model?

  #8   Spotlight this post!  
Unread 25-01-2012, 22:58
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,586
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Trajectory Calculator (W/ Drag)

Quote:
Originally Posted by shuhao View Post
Check it against mine?

I also wrote something about 2 weeks back. This one is in GNU Octave/Matlab
Comparing a model to a model doesn't prove that either is correct. It only proves that they included similar factors, not that they included the correct factors (and factored them in correctly). The only way to validate a model is to compare it to actual test data.
  #9   Spotlight this post!  
Unread 26-01-2012, 00:01
shuhao shuhao is offline
Registered User
FRC #4069 (Lo-Ellen Robotics)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Sudbury
Posts: 138
shuhao is an unknown quantity at this point
Quote:
Originally Posted by Ether View Post
what test data did you use to validate your model?

I was making a joke .... cmon..
  #10   Spotlight this post!  
Unread 26-01-2012, 00:42
Ed Law's Avatar
Ed Law Ed Law is offline
Registered User
no team (formerly with 2834)
 
Join Date: Apr 2008
Rookie Year: 2009
Location: Foster City, CA, USA
Posts: 752
Ed Law has a reputation beyond reputeEd Law has a reputation beyond reputeEd Law has a reputation beyond reputeEd Law has a reputation beyond reputeEd Law has a reputation beyond reputeEd Law has a reputation beyond reputeEd Law has a reputation beyond reputeEd Law has a reputation beyond reputeEd Law has a reputation beyond reputeEd Law has a reputation beyond reputeEd Law has a reputation beyond repute
Re: Trajectory Calculator (W/ Drag)

Due to the relative light weight to the size of the ball this year, trajectory calculation this year cannot ignore air resistance and it also cannot ignore back spin for those who are using a single wheel. Back spin make the ball travel higher and further.

If you ignore air resistance or back spin and try to correlate to real test data by scaling the exit velocity, it would be meaningless. Adding air rsistance to your calculation would be an improvement because you have the shape constant to tune but you are still ignoring an important factor which is the back spin. The back spin is significant especially when you are shooting from far away.

I will be posting my trajectory calculator (in Excel) on our website soon. You can look at the calculator for 2008 and 2010.

We have not done tuning yet. Our robot will not be done for another 2 weeks.
__________________
Please don't call me Mr. Ed, I am not a talking horse.
  #11   Spotlight this post!  
Unread 01-02-2012, 22:49
gnunes gnunes is offline
Registered User
FRC #1391 (Metal Moose)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Westtown School
Posts: 57
gnunes has a spectacular aura aboutgnunes has a spectacular aura aboutgnunes has a spectacular aura about
Re: Trajectory Calculator (W/ Drag)

Here is a LabView trajectory calculator including the effects of drag and spin. You can adjust how much drag and how much spin (and whether it is back spin or top spin). You can also change which hoop you are aiming for and the height of your shooter exit point.

I've not tested it against any measurements, but the physics of spinning balls has been extensively studied, so it should at least be close. The biggest approximation is for the lift coefficient, where I have used a very simple model, and assumed that the spin does not slow during the flight. If you want to see what a complicated model for lift looks like, read the AJP paper referenced on the block diagram, where he develops an empirical model for spinning tennis balls...
Attached Files
File Type: vi Trajectory Calculator.vi (42.7 KB, 141 views)
  #12   Spotlight this post!  
Unread 14-02-2012, 19:30
Bendito's Avatar
Bendito Bendito is offline
Registered User
AKA: Benjamin LaRoche
FTC #7837 (The Thunder Colts)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Dorr, MI
Posts: 13
Bendito is an unknown quantity at this point
Re: Trajectory Calculator (W/ Drag)

Now, the real question is, how do we have this trajectory calculator solve for angle if the velocity is constant?
  #13   Spotlight this post!  
Unread 15-02-2012, 09:23
engunneer's Avatar
engunneer engunneer is offline
Alumni turned Mentor
AKA: Branden Gunn
FRC #4761
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1996
Location: Reading, MA
Posts: 868
engunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond repute
Re: Trajectory Calculator (W/ Drag)

Quote:
Originally Posted by Bendito View Post
Now, the real question is, how do we have this trajectory calculator solve for angle if the velocity is constant?
That part is really tricky. What I did in my calc (which does not do drag!) was to have it iterate the angle until the calculated path went through the target basket. I did this using Excel's goalseek function. Then you make a table of different ranges to shoot from, and graph it. Add a trendline to generate an approximate formula for that velocity (I used Order 3 polynomial to get a high R^2 value). That simplified formula is what you would integrate with your robot code if you wanted to automate the angle.
__________________
Student FRC23 (1996-1999), Mentor FRC246 (2000), Mentor FRC1318 (2007-2009), Mentor FRC93 (2011), Mentor FRC2151 (2012), Mentor FRC23 (2013), Mentor FRC4761 (2014-2017)
1998 - National Chairman's Award and Woodie Flowers Award (FRC23, Mike Bastoni ) | 2007 - PNW SF (488, 1595) | 2008 - Oregon RCA - Seattle #2 Seed, SF (488, 1696) | 2009 - Oregon #1 Seed, Winners (1983, 2635) - Seattle SF (945, 2865) - Galileo #2 Seed, SF (973, 25) | 2012 Midwest F (111, 71) | 2014 RIDE Winners (78, 125), Inspector - NEU #24, QF (3479, 3958) - NECMP #35 | 2015 Reading #11, SF (1058, 190), Inspector - RIDE #17, QF(4055, 5494), Inspector - NECMP #57 | 2016 Reading #4, SF (133, 4474), DCA, Inspector - Ride #22, SF (1735, 2067), Creativity, Inspector - NECMP #48, RCA - Archimedes
  #14   Spotlight this post!  
Unread 15-02-2012, 09:42
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Trajectory Calculator (W/ Drag)

Quote:
Originally Posted by engunneer View Post
That part is really tricky. What I did in my calc (which does not do drag!) was to have it iterate the angle until the calculated path went through the target basket. I did this using Excel's goalseek function.
It's not tricky if you're ignoring drag and magnus effect (backspin)1. There's an explicit closed-form solution. See the last two equations on page 2 of the attachment.


1 of course, ignoring drag and backspin is probably not a valid assumption for this case. see post#10.
Attached Files
File Type: pdf launch distance equations.pdf (16.9 KB, 119 views)

Last edited by Ether : 15-02-2012 at 09:47.
  #15   Spotlight this post!  
Unread 15-02-2012, 12:05
Bendito's Avatar
Bendito Bendito is offline
Registered User
AKA: Benjamin LaRoche
FTC #7837 (The Thunder Colts)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Dorr, MI
Posts: 13
Bendito is an unknown quantity at this point
Re: Trajectory Calculator (W/ Drag)

Yes, I already have vision tracking getting a distance, using trigonometry to find the base of the triangle (distance of launcher parallel to the floor to the hoops) from the hypotenuse (distance of vision target from camera) and the opposite side (the known height of the hoop) and running it through an equation found on wikipedia to find angles to hit a target point (x,y). It has not been tested on the robot, but the math and plotted trajectories it outputs look sound.



I am trying to incorporate drag into this, however, it seems incredibly complicated, based on the vi's mentioned earlier. Compensating for air resistance within a set range might practically be accomplished through adding an arbitrary number to the x and y in that equation based on trial and error. There are some good drag equations on this page, too, though.

http://en.wikipedia.org/wiki/Trajectory_of_a_projectile

Edit: Use regressions and plot out the real world values to find an equation? IE. A function of angle on the Y axis and how far it travels until contacting ground (possibly set at a particular height, such as the top hoop) on the X (or vice versa)

Last edited by Bendito : 15-02-2012 at 12:35. Reason: clarification
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


All times are GMT -5. The time now is 18: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