Phunlet-safe homing missile prototype

Discuss scenes and videos made with Algodoo.

Phunlet-safe homing missile prototype

Postby RA2lover » Sun Nov 29, 2009 7:20 pm

just a techdemo of it. again

Rating: rated 6.7
Filesize: 29.61 kB
Comments: 9
Ratings: 5
download


old version
Rating: rated 6.5
Filesize: 42.97 kB
Comments: 7
Ratings: 4
download


i'll continue its work, this time with moving targets.
Last edited by RA2lover on Wed Dec 16, 2009 7:52 pm, edited 2 times in total.
Jrv wrote:
TC42 wrote:Quite honestly, I didn't think anyone on 4chan has that good a use of grammar, spelling, usage, mechanics, ect.
But I've never been there, so I may be wrong.


GTFO newfgt
User avatar
RA2lover
 
Posts: 607
Joined: Mon Aug 31, 2009 8:43 pm
Location: Brazil

Re: Phunlet-safe homing missile prototype

Postby KarateBrot » Sun Nov 29, 2009 8:33 pm

The quadrant change can be fixed easily but I use another formula to calculate the angle.

Code: Select all
angle = math.acos(e.normal(0)); e.normal(1) < 0 ? {angle = 2*math.pi - angle} : {}

The result will be a value in radians from 0 to 2*Pi. If you want to use it in your rocket type (-1)*e.normal instead of e.normal because of the position of the laser (it's backwards. e.normal will be pointing to the left which results in 180°). So (-1)*e.normal will correct it and turn e.normal to the right.

Now for calculating the difference between angle and targetangle you have to add a little code to fix the leak between the lower and upper right quadrant.
Code: Select all
anglediff = angle - targetangle;
anglediff > math.pi ? {anglediff = anglediff - 2*math.pi} : {anglediff < (-1)*math.pi ? {anglediff = anglediff + 2*math.pi} : {}}


This will give you perfect angles and angle differences without any leaks or random spinning.

I made an example for it:
Rating: rated 5
Filesize: 21.01 kB
Comments: 3
Ratings: 1
download
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Phunlet-safe homing missile prototype

Postby RA2lover » Sun Nov 29, 2009 9:22 pm

Scene edited. again. added (not-so)simple shaped charge warhead. it originally had tracers, but it lags too much when adding them(96 new entities requires a little too much computing power)
Jrv wrote:
TC42 wrote:Quite honestly, I didn't think anyone on 4chan has that good a use of grammar, spelling, usage, mechanics, ect.
But I've never been there, so I may be wrong.


GTFO newfgt
User avatar
RA2lover
 
Posts: 607
Joined: Mon Aug 31, 2009 8:43 pm
Location: Brazil

Re: Phunlet-safe homing missile prototype

Postby KarateBrot » Mon Nov 30, 2009 11:04 pm

you could also try another thing that came to my mind in august when I was thinking about a missile guidance system for v2.0 of my Javelin project:
Instead of calculating the angle of the rocket try to calculate the velocity angle of your rocket. Until now the rocket misses the target if it moves or has to turn too much. With the velocity angle instead of the position angle the missile will correct the direction of movement until velocity angle and target angle are the same so it will (nearly) hit the target (if everything I thought about is working)

Edit:
Hmm... maybe won't work when I think about it again but it's worth a try.

Edit2:
I made a missile guidance formula that's exactly doing that. Now that I'm much more experienced in physics and after deriving a stable mathematical model (it's convergent) I can say my guess from two years ago was right :D

lol just edited this old post because I'm bored. no one will notice it anyway
Last edited by KarateBrot on Mon Dec 05, 2011 11:01 am, edited 1 time in total.
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Phunlet-safe homing missile prototype

Postby RA2lover » Tue Dec 01, 2009 2:21 am

worked worse after trying a polar projection(source = missile pos, distance = vel, angle = vel angle) as the point 2 for the angle(P1 = horizon, P3 = target)used for aiming the missile - especially when vel is greater than distance :mrgreen:(which is what i think you wanted to say) , but i'll look into that later.
Jrv wrote:
TC42 wrote:Quite honestly, I didn't think anyone on 4chan has that good a use of grammar, spelling, usage, mechanics, ect.
But I've never been there, so I may be wrong.


GTFO newfgt
User avatar
RA2lover
 
Posts: 607
Joined: Mon Aug 31, 2009 8:43 pm
Location: Brazil

Re: Phunlet-safe homing missile prototype

Postby RA2lover » Wed Dec 16, 2009 7:50 pm

made another part of the puzzle to be solved. next step is to mantain its accuracy when attacking moving targets, by predicting where it will be after some time.

Rating: rated 6.7
Filesize: 29.61 kB
Comments: 9
Ratings: 5
download
Jrv wrote:
TC42 wrote:Quite honestly, I didn't think anyone on 4chan has that good a use of grammar, spelling, usage, mechanics, ect.
But I've never been there, so I may be wrong.


GTFO newfgt
User avatar
RA2lover
 
Posts: 607
Joined: Mon Aug 31, 2009 8:43 pm
Location: Brazil

Re: Phunlet-safe homing missile prototype

Postby KarateBrot » Wed Dec 16, 2009 8:39 pm

it's not aiming at moving objects correctly?
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Phunlet-safe homing missile prototype

Postby RA2lover » Wed Dec 16, 2009 8:54 pm

it's still able to aim at movingobjects, hovewer with limited accuracy, as i didn't add the target position projection yet
Jrv wrote:
TC42 wrote:Quite honestly, I didn't think anyone on 4chan has that good a use of grammar, spelling, usage, mechanics, ect.
But I've never been there, so I may be wrong.


GTFO newfgt
User avatar
RA2lover
 
Posts: 607
Joined: Mon Aug 31, 2009 8:43 pm
Location: Brazil

Re: Phunlet-safe homing missile prototype

Postby KarateBrot » Thu Dec 17, 2009 4:07 am

Image

I just made this formula. It calculates the position the rocket has to aim at. It's for stationary and also moving targets. I'm not sure if it's 100% precise because in real life it wouldn't. But because algodoo calculates with finite small time steps and not infinite small time steps I'm pretty sure it's the exact formula.

Edit:
I have to extend the formula. Δt is not the time between two simulation steps. It could be but that's not what I wanted. It would only calculate where the target will be relative to the rocket in the next calculation. I need a bit more time.

Edit2:
It works just fine with a new Δt. It hits the target every time. And accuracy can still be improved by taking acceleration into account which is the next step.

- - - - -

P_aim: The position the rocket has to aim at (Target position projection)
P_t: Position of the target
v_t: velocity of the target
v_o: velocity of your rocket
Δt: time between two calculations
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany


Return to Scenes

Who is online

Users browsing this forum: No registered users and 6 guests