Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

2D Missile Guidance System

  1. Dec 30, 2009 #1
    Hey all,

    This is a bit of a broad subject so I'm not sure which section it best applies to, but here it is anyway.

    I'm working on a massively over-engineered version of the original Asteroids game. How over-engineered? Well the problem I have right now is desigining and implementing a guidance system that will be used for missiles targeting asteroids, and aliens targeting the player. It will later be extended to navigating around obstructions via a series of waypoints.

    I have an algorithm that finds the point of intersection of asteroid and missile, but I don't have an accurate enough method for calculating the duration of flight (to get the point accurately).

    Asteroids have a velocity vector with a constant magnitude and angle.

    Missiles have:
    • A velocity vector with a variable magnitude and angle.
    • An intial rotation based on the rotation of the ship. Variable name: rotate
    • A fixed rate of acceleration.
    • A maximum speed of rotation.

    When fired, the goal of the missile is to align its velocity angle with the angle between the missile and the target point. I have a function called theta which returns the difference between these two angles.
    When theta is:
    • Positive: The target is off to the right of the missile.
    • Negative: The target is off to the left of the missile.
    • Zero: The target is dead ahead of the missile.
    The range of angles is from -179 to 180 degrees.
    In the game, an angle of 0 degrees (missile rotate) is facing right.

    The problem I'm having at the moment is that my current commands tell the missile to rotate right or left based on theta, and as a result the missile tends to fishtail around the line of intersection and often ends up overshooting the target point.

    What I need is an algorithm/equation to stabilise the missile's angle by "dampening" the velocity vector to theta=0 in as short a time as the thrust and rotation of the missile will allow. Once the missile has the right angle it will pass right through the target point.

    The missile can only apply an acceleration in the direction of rotation.

    Once I have an accurate hit on a point I can calculate the number of steps to reach that target, either by simulating the path before actually launching it, or with an equation, apply a function to determine the length of the path (possibly less expensive processwise).

    Any ideas?
    Thanks :-)
     
  2. jcsd
  3. Dec 31, 2009 #2

    A.T.

    User Avatar
    Science Advisor

    Having variable missile speed and finite turinig speed makes it difficult to compute the interception path.

    Controling the missile via rotation & linear acceleration forward only, makes it even more difficult to follow the interception path, even if you knew it exactly.
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook