Go to Post a Victor is a Victor is a Victor. - Billfred [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 11-02-2012, 10:59
EthanPieper EthanPieper is offline
Registered User
FRC #4095
 
Join Date: Jan 2012
Location: Milwaukee Pius
Posts: 5
EthanPieper is an unknown quantity at this point
Ball launching math (with pictures!)

So here at team #4095 camp we have finished going through the math that goes along with firing the ball at different angles so that it can be programmed much easier. And yes, like I promised, there are pictures of the math! :D

Setting everything up

I'm assuming you can tell that that is in fact a right triangle, not at all to scale, but it does what we want it to. But here are all of the variables:
Y = The height from the ground to the top of the rim of the hoop.
Yo = Initial height, where the ball leaves the shooter.
Θ = The angle that the ball leaves at when shot at the hoop (projectile).
dc (camDist) = The distance of the camera (c) to the bottom of the highest reflective tape.
Θc = Angle of the camera to the line parallel to the ground.
d adjusted (hoopDist) = The distance from shooter to the boards that the hoop is on, minus the distance to the center of the hoop.

Finding Y

g = Acceleration by gravity, 9.8 m/s/s or 32.2 ft/s/s.
v = Velocity of the ball.
You can see the math here, and in the next step we'll break it apart a bit more.

Finding more Y

Top left: Yo is subtracted over to the other side of the equations. TAN is split into SINΘ over COSΘ, then 1-COSΘ over COSΘ (yay trigonometric identities!).
Bottom left: Excluding the subtraction of gd^2/2(vCOSΘ)^2, we move d into the numerator.
Bottom right: This part is distributed into separate fractions.

Now we have this

Self explanatory. If you don't know, \ just means that I am continuing the equation on the next line.

Ha, I can only use five images. Continued next. (I'm sorry about the double post, but you leave me no choice delphi).

Last edited by EthanPieper : 11-02-2012 at 11:15. Reason: Accuracy
  #2   Spotlight this post!  
Unread 11-02-2012, 11:00
EthanPieper EthanPieper is offline
Registered User
FRC #4095
 
Join Date: Jan 2012
Location: Milwaukee Pius
Posts: 5
EthanPieper is an unknown quantity at this point
Continued...

Making some constants

Just for easier use. Also as an aside, now looking back on this J doesn't seem necessary because (Y - Yo) is already contained in parenthesis so it shouldn't matter if it get's changed into a constant or not.

Quadratic equation time!

We now have put this equation into where we can take it and put it into the quadratic equation.

And for ease

We just use the variables that we defined earlier just so that transitioning it into code will be easier.

Important stuff [READ]: If you take only the part under the square root sign, you can find out if it will reach the hoop or not. If it is less than zero, than it will not reach it, but if it is greater than zero it will reach it.

Hope this helps you if you're stuck. Also if you see a miscalculation please don't hesitate to call us out on it!

Last edited by EthanPieper : 11-02-2012 at 11:19.
  #3   Spotlight this post!  
Unread 11-02-2012, 12:46
EthanPieper EthanPieper is offline
Registered User
FRC #4095
 
Join Date: Jan 2012
Location: Milwaukee Pius
Posts: 5
EthanPieper is an unknown quantity at this point
Re: Ball launching math (with pictures!)

/me slams face on table.

We apologize our equation is wrong. We'll get up more information once we figure this out.
  #4   Spotlight this post!  
Unread 11-02-2012, 13:14
moc601 moc601 is offline
Registered User
FRC #0601 (Baybots)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Hampton Bays, NY
Posts: 18
moc601 is an unknown quantity at this point
Programming with registry data

Where can I find some information on how to define set and retrieve registry values in Labview.
I'm attempting to change the constant strings in begin, teleop and disable and getting undefined references to the registry.
  #5   Spotlight this post!  
Unread 11-02-2012, 14:55
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
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: Ball launching math (with pictures!)

Quote:
Originally Posted by EthanPieper View Post
We apologize our equation is wrong. We'll get up more information once we figure this out.
See attachment:

Last edited by Ether : 16-02-2012 at 13:12.
  #6   Spotlight this post!  
Unread 11-02-2012, 16:53
Chiller Chiller is offline
Registered User
AKA: Connor Christie
FRC #4095 (RoXI Robotics)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Wisconsin
Posts: 118
Chiller is on a distinguished road
Re: Ball launching math (with pictures!)

This is what we NOW use!
http://en.wikipedia.org/wiki/Trajectory_of_a_projectile
  #7   Spotlight this post!  
Unread 11-02-2012, 20:54
seg9585's Avatar
seg9585 seg9585 is offline
Registered User
AKA: Eric
FRC #4276 (Surf City Vikings)
Team Role: Engineer
 
Join Date: Feb 2006
Rookie Year: 2001
Location: Boeing (Seal Beach, CA)
Posts: 520
seg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond repute
Re: Ball launching math (with pictures!)

Not to overcomplicate things, but a (acceleration of ball) is not a constant "g", but a summation of acceleration due to gravity, Drag, and Lift.

Change in gravity is a function of Y.

Acceleration due to drag is a function of velocity where a_d = .5*rho*V^2*Cd / M_ball (rho = air density (function of temperature), Cd = drag coefficient for spherical ball, M_ball = ball mass)

Acceleration due to lift is a function of ball spin where a_l = 16/3*pi^2*R^3*alpha*rho*V
(alpha is spin rate in radians/sec, R is ball radius), perpendicular to the spin axis

Sum the forces together in 3 dimensions to get the actual "a" in your equation, but calculating the final position would require iteration or an ODE solver.

Maybe this could be a good student summer post-build season project
__________________
My FIRST legacy:

Team 204 Student 2001, 2002 (Voorhees, NJ)
Team 1493 College Mentor 2006 - 2008 (Troy, NY)
Team 2150 Intern/Professional Mentor 2007, 2009 (Palos Verdes)
Team 4123 Lead Engineering Mentor 2012 (Bellflower, CA)
Team 4276 Engineering Mentor 2012-2016 (Huntington Beach, CA)
  #8   Spotlight this post!  
Unread 11-02-2012, 20:58
MrForbes's Avatar
MrForbes MrForbes is offline
Registered User
AKA: Jim
FRC #1726 (N.E.R.D.S.)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Sierra Vista AZ
Posts: 6,033
MrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond repute
Re: Ball launching math (with pictures!)

We're working with the "shoot the ball with a nice flat trajectory" equation, hoping we don't have to adjust anything as long as we're on the key....
  #9   Spotlight this post!  
Unread 11-02-2012, 21:37
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
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: Ball launching math (with pictures!)

Quote:
Originally Posted by seg9585 View Post
Not to overcomplicate things, but a (acceleration of ball) is not a constant "g", but a summation of acceleration due to gravity, Drag, and Lift.
Yes, that's been discussed at great length here on CD.

There's a paper here that someone posted a link to a few weeks ago which discusses the effects of air friction and magnus effect, and concluded that it would be reasonable to ignore them.

I don't know whether or not I agree with that conclusion, but I suspect that even if those effects were included, other factors such as variations in ball mass, size, compressibility, surface texture, and location of center-of-mass relative to center-of-volume, and air currents and atmospheric pressure would play a role... not to mention the effect of variations from shot-to-shot in the launcher itself.

Bottom line: in this application, equations are useful for getting a ballpark estimate.

Quote:
Change in gravity is a function of Y.
You weren't seriously suggesting changing "g" with height of the ball should be considered, were you? I didn't see a smiley face at the end of that.

Quote:
calculating the final position would require iteration or an ODE solver.
With air friction and magnus included, the DE would be non-linear, and it's unlikely that an ODE solver could find a closed-form solution. The only way to solve would be numerical ("iteration", most likely rk4).

Quote:
Maybe this could be a good student summer post-build season project
I think there have been a couple of attempts already that have been posted here.
  #10   Spotlight this post!  
Unread 11-02-2012, 21:53
xhawaii808's Avatar
xhawaii808 xhawaii808 is offline
Registered User
no team
 
Join Date: Jan 2012
Rookie Year: 2020
Location: not there
Posts: 6
xhawaii808 can only hope to improve
Re: Ball launching math (with pictures!)

Very good but this is more accurate y = e^(−x²)+(z2-z3)^2 = 4(z3-z1)(z1-z2) sin^2 alpha/2 if z1,z2,z3
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 01: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