[ad_1]
Good afternoon guys,
is the formula for the commanded acceleration required to hit the target,
where N is the proportionality constant, λ’ is the change in line of sight and V is the closing velocity.
Data I natively have:
[x,y,z] position of both missile and target;
[vx,vy,vz] velocity vector of both missile and target;
[x,y,z] vector which points from missile to target and opposite;
This is set by me but still: maximum speed of missile.
Data I can get with some calculations:
Vertical angle between missile and target (and opposite) ;
Horizontal angle between missile and target (and the other way around).
That’s the reference system of the game:
-
λ’ or the derivative with respect to time of the Line of Sight it’s a concept I really didn’t understand… its unit should be, in theory, Hz or (s^-1) since m/s^2 = λ’ * m/s -> λ’ = 1/s
-
V should be pretty easy to calculate: V = v(missile) – v(target) OR
Vx = (v(missile) – v(target)) * cos (x0y)
Vy = (v(missile) – v(target)) * sin (y0z)
Vz = (v(missile) – v(target)) * cos (y0z) - N well it’s a scalar number, usually 3.
The computed acceleration will then be passed to a RK4 integrator which will move the interceptor towards its target.
To steer the missile, I will simply change its velocity vector at every update (every 1/60th of a second) and its orientation accordingly. For example: if the missile has a velocity of [0,100,0], he’s going 100 m/s due y+ axis. If at the next frame it should slightly turn right, then he’ll be going to have a velocity of [10,99,0] and so on.
That’s the only thing left to finish off my little thesis and unfortunately I’m stuck here. In the meantime, thank you very much!
Here‘s a video I made, but it doesn’t still actually use the Proportional Navigation law: it checks if the missile is “aligned” to its target and eventually correct its route.
That’s my actual code: pastebin
That’s what i’ve come up with but sadly doesn’t work as expected:
params ["_n","_missile","_target"];
private "_a";
_vm = velocity _missile;
_rm = getPosASLVisual _missile;
_vt = velocity _target;
_rt = getPosASLVisual _target;
_vr = _vt vectorDiff _vm;
_r = _rt vectorDiff _rm;
_omega = (_r vectorCrossProduct _vr) vectorMultiply (1/(_r vectorDotProduct _r));
_a = (_vr vectorCrossProduct _omega) vectorMultiply _n;
_a
Similar questions:
Finding the components of Proportional Navigation in 2D
[ad_2]