# Balistic Calculations

Hello!
This is a continuation of the project here: Ultrasonic Range Sensor - SparkFun Electronics
Ive located a laser range finder and now i am in need of instruction about the coding aspect.

I think the arduino can do this but i have no idea how!
Is there some library out there that can do this or do i just use basic math?

I have no idea what formulas to use as my 7 Honors math class is still teaching linear equations. (I'm Just 12)

Go here
http://hyperphysics.phy-astr.gsu.edu/hbase/traj.html#tra12
simple enough calculations for the arduino to handle.

Don't worry about the formulae at this point. First you need to get the Arduino talking to the rangefinder. When you're getting an accurate distance from it, then you'll need some math.

wildbill:
Don't worry about the formulae at this point. First you need to get the Arduino talking to the rangefinder. When you're getting an accurate distance from it, then you'll need some math.

I've all ready done that!

CrossRoads:
Go here
Trajectories
simple enough calculations for the arduino to handle.

Ok, I get the formula, but how do i implament it into arduino?

Find a way to enter the variables - keypad entry with LCD screen or similar to confirm data is correct, or via PC interface, then do the math.
To find the distance your object will go in a wind situation for example, you need to know the launch angle A and the launch speed V in meter/sec.
Gravity is 9.8 meters/(second^2)

(or velocity in feet/second and gravity as 32 ft/second^2)

Then the distance the object will travel in meters will be:

R = (V^2 x sin 2A)/g
R = (VV(sin(2*A)))/9.8

So i just type that in? It's THAT easy?

if my velocity were 5 then i would use
distance = (55(sin(2*angle)))/9.8;
Right?

well the Verify button thinks it's right!

what do i do if I'm calculating the angle and have distance and velocity?

Just read up more and i think i have it!

angle = sin((9.8distance)/(55))*(-1)

Please Be right!? =( =( =(

I think you mean "asin"

And take care if the angles are in degrees or radians, I think that the Arduino/gcc trigonometric's functions expects angles in radians.

CrossRoads:
Find a way to enter the variables - keypad entry with LCD screen or similar to confirm data is correct, or via PC interface, then do the math.
To find the distance your object will go in a wind situation for example, you need to know the launch angle A and the launch speed V in meter/sec.
Gravity is 9.8 meters/(second^2)

(or velocity in feet/second and gravity as 32 ft/second^2)

Then the distance the object will travel in meters will be:

R = (V^2 x sin 2A)/g
R = (VV(sin(2*A)))/9.8

That equation only works when the projectile lands at the same height as it is fired. The actual equation for landing at a different height from where it is fired is more complicated, touched upon at the "Where will it land?" section of the reference. You will find time of travel first and use x=v_x*t to get distance, if you know the vertical drop is y and initial speed is v_0 and launching angle is theta (or q). It's not something I expect all my college intro physics students will fully grasp. Plus, the consistency of your launcher firing the projectiles at a very consistent speed every launch is also important. I would do it by experimenting fixed target distance and find correct launch angle, then move target higher and find new angle. I'll for the moment not worry about target moving away or closer. The easier you do it the faster you get it working and then move for more difficult goals.

uhmmm this equation does not take into consideration air friction, right ?
which means it might be completely useless if you actually want to launch something

believe it or not but air friction has significant influence on stuff... especially if your projectiles are low density

kerimil:
uhmmm this equation does not take into consideration air friction, right ?
which means it might be completely useless if you actually want to launch something

believe it or not but air friction has significant influence on stuff... especially if your projectiles are low density

Maybe he is firing ballistics in a vacuum?

Also you would want something that accounts for wind speeds/direction and elevation differences to get a more accurate calculation if accuracy is even needed for what you are doing. The only thing that i can think of that requires that much accuracy is a military operations which I doubt you're doing.

kerimil:
uhmmm this equation does not take into consideration air friction, right ?
which means it might be completely useless if you actually want to launch something

believe it or not but air friction has significant influence on stuff... especially if your projectiles are low density

Air resistance has nothing to do with the motion if you're firing around 10m/s or less for a distance of a few meters. The OP didn't say how fast or how far but if you consider air resistance, there's only numerical solutions. My student borrowed my book

Yeah, then you need to solve differential equations numerically.

Or the next question is about how to include GPS in the missiles .... :~

Just strap on cellphones and have them phone back their position ...

and at the end send a textmessage "BOOM"

If you need a balistic caluculator to hit something that's just 10 meters away then you're overcomplicating stuff

The OP didn't say how fast or how far but if you consider air resistance, there's only numerical solutions. My student borrowed my book smiley

Yeah, then you need to solve differential equations numerically

Calculating that isn't all about calculating. The real problem is to know the exact cd value of your projectiles (mass and other stuff is easy to determine). Also if they're not stable in flight then you're pretty much you know what

The projectile is the most important part of your system. The gun just has to be relatively consistent (meaning it has to achieve more less the same muzzle velocity), but that's not something that can't be achieved.

If your system (the gun + projectile) isn't up to the job then it doesn't matter what equations you use or how good the code is.... since it will be no use anyway

Do you plan to use an off the shelf airgun or do you want to build one yourself ?

+If the former then you might as well use charigun (that's a free ballistic calculator for airguns - google it) and use to create a look up table (I guess that's what this thing is called)
+If the latter then you've got to make sure that the whole platform (gun + projectile) is accurate. Once that's done you can actually start looking for equations, approximations of the cd value for given shapes etc.

AWOL:
I think you mean "asin"

Do I ? not really sure.

kerimil:
uhmmm this equation does not take into consideration air friction, right ?

liudr:
That equation only works when the projectile lands at the same height as it is fired.

Yes. both will be adressed in V2

Senso:
And take care if the angles are in degrees or radians, I think that the Arduino/gcc trigonometric's functions expects angles in radians.

Hadn't thought of that. I'll get right on it.