How Can a PID Controller Improve Missile Guidance in a Game?

In summary, the conversation discusses the complexities of designing and implementing a guidance system for missiles in a game. The goal is to align the missile's angle with the target point, but this is made difficult by factors such as variable missile speed and finite turning speed. The speaker is looking for an algorithm or equation to stabilize the missile's angle and accurately hit the target point. They also mention considering the number of steps or using a function to calculate the path.
  • #1
tenpoints
1
0
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 :-)
 
Physics news on Phys.org
  • #2
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.
 
  • #3


I would suggest looking into using a Proportional-Integral-Derivative (PID) controller for your missile guidance system. This type of control system is commonly used in engineering and robotics to accurately control the movement of objects. It uses feedback from sensors to continuously adjust the control inputs (in this case, the missile's rotation and thrust) to minimize the difference between the desired angle and the actual angle. This would help stabilize the missile's angle and reduce overshooting.

Additionally, you may want to consider using a predictive algorithm to anticipate the movement of the target and adjust the missile's trajectory accordingly. This could help improve accuracy and reduce the need for constantly adjusting the missile's angle.

I would also recommend conducting simulations and testing different algorithms to find the most efficient and accurate solution for your specific game. Good luck with your project!
 

1. What is a 2D Missile Guidance System?

A 2D Missile Guidance System is a type of navigation system that is used to guide missiles towards their intended targets. It uses two-dimensional coordinates to determine the location and trajectory of the missile, and makes adjustments to its flight path to ensure it reaches its target.

2. How does a 2D Missile Guidance System work?

A 2D Missile Guidance System works by using sensors and algorithms to continuously calculate and adjust the missile's position and trajectory. The sensors gather data such as speed, altitude, and direction, and the algorithms use this information to make precise adjustments to the missile's flight path.

3. What are the benefits of using a 2D Missile Guidance System?

There are several benefits to using a 2D Missile Guidance System. It allows for precise targeting, reducing the risk of collateral damage. It also increases the chances of a successful hit on the intended target, making it more efficient and cost-effective. Additionally, it can be used in various weather conditions and is resistant to electronic interference.

4. What are the limitations of a 2D Missile Guidance System?

While a 2D Missile Guidance System is highly effective, it does have some limitations. It relies on the missile's ability to acquire and maintain a target lock, which can be challenging in certain situations. It is also limited to two-dimensional coordinates, which can make it less accurate in certain scenarios, such as navigating through complex terrain.

5. How is a 2D Missile Guidance System different from a 3D Missile Guidance System?

A 2D Missile Guidance System uses two-dimensional coordinates to navigate the missile, while a 3D Missile Guidance System uses three-dimensional coordinates. This means that a 3D system can account for altitude and elevation, which can make it more accurate in certain scenarios. However, a 2D system is typically more cost-effective and can still be highly precise when used correctly.

Similar threads

  • Introductory Physics Homework Help
Replies
4
Views
5K
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
Replies
6
Views
3K
  • Programming and Computer Science
Replies
1
Views
1K
Replies
5
Views
1K
  • Mechanics
Replies
20
Views
2K
Replies
4
Views
1K
Replies
3
Views
846
Back
Top