NeuroAgent

Proportional Rocket Guidance: Complete Guide

Learn how to create an effective rocket guidance algorithm in 3D space. Proportional navigation, implementation in simulator, and thrust vector control. Complete guide for engineers.

Question

How to create a missile guidance algorithm in an engineering simulator?

I’m developing an engineering simulator and have encountered the task of creating a guidance algorithm for a missile. The system includes a ground radar that provides global coordinates of the target. The missile is equipped with an angle sensor, thrust vector control, and a global coordinate sensor. The coordinates of both the missile and target can be positive or negative on all three axes (X, Y, Z).

What algorithm would allow the missile to effectively guide to the target in three-dimensional space while taking into account all the mentioned system components?

NeuroAgent

Proportional Navigation (PN) for Missile Guidance in 3D Space

Proportional Navigation (PN) is the most effective algorithm for missile guidance in three-dimensional space. Based on the principle of proportionality between the line-of-sight (LOS) angular rate and the guidance angular rate, this method ensures high interception accuracy of targets while considering all components of your system.

Contents

Mathematical Foundation of Proportional Navigation

Proportional Navigation is based on the following principle: the missile should maneuver with acceleration proportional to the line-of-sight angular rate between the missile and the target. The basic guidance equation is:

am=NVcλ˙a_m = N \cdot V_c \cdot \dot{\lambda}

where:

  • ama_m - required guidance acceleration
  • NN - navigation constant (typically 3-5)
  • VcV_c - closing velocity between missile and target
  • λ˙\dot{\lambda} - line-of-sight angular rate

In three-dimensional space, the line-of-sight is defined as:

λ=rr=rtrmrtrm\vec{\lambda} = \frac{\vec{r}}{|\vec{r}|} = \frac{\vec{r}_t - \vec{r}_m}{|\vec{r}_t - \vec{r}_m|}

where rt\vec{r}_t and rm\vec{r}_m are the position vectors of the target and missile respectively.

Important: In real systems, there are two main types of proportional navigation:

  • True Proportional Navigation (TPN) - acceleration is directed perpendicular to the line-of-sight
  • Pure Proportional Navigation (PPN) - acceleration is directed perpendicular to the missile’s velocity vector

3D Implementation of the Algorithm

For effective operation in 3D space, it’s necessary to use the Three Plane Approach, which was specifically developed to solve the problems of standard PN in three-dimensional space.

3D PN Algorithm:

  1. Calculate relative position vector:

    python
    r_vec = target_pos - missile_pos  # Vector from missile to target
    r_mag = np.linalg.norm(r_vec)     # Vector magnitude
    
  2. Calculate line-of-sight angular rate:

    python
    # Current line-of-sight
    los_current = r_vec / r_mag
    
    # Previous line-of-sight (from previous simulation step)
    los_previous = prev_los_vector
    
    # Angular rate (simple numerical method)
    los_rate = (los_current - los_previous) / dt
    
  3. Calculate closing velocity:

    python
    closing_velocity = -np.dot(relative_velocity, los_current)
    
  4. Calculate required acceleration:

    python
    required_acceleration = N * closing_velocity * los_rate
    

Three Plane Approach for 3D PN

According to research, standard PN has problems in 3D space when converting accelerations to Cartesian coordinates. The Three Plane Approach solves this problem:

  1. Decompose the acceleration vector into three planes (XY, XZ, YZ)
  2. Independent control in each plane
  3. Synthesis of the resulting acceleration vector
python
def three_plane_guidance(missile_pos, missile_vel, target_pos, target_vel, N=3.5):
    # Relative position and velocity vectors
    r_vec = target_pos - missile_pos
    v_rel = target_vel - missile_vel
    
    r_mag = np.linalg.norm(r_vec)
    if r_mag < 0.1:  # Avoid division by zero
        return np.zeros(3)
    
    # Line-of-sight
    los = r_vec / r_mag
    
    # Closing velocity
    closing_vel = -np.dot(v_rel, los)
    
    # Line-of-sight angular rate (vector form)
    los_rate_vec = np.cross(v_rel, los) / r_mag
    
    # Three-plane processing
    accel_xy = N * closing_vel * los_rate_vec[2]  # Acceleration in XY plane
    accel_xz = N * closing_vel * los_rate_vec[1]  # Acceleration in XZ plane
    accel_yz = N * closing_vel * los_rate_vec[0]  # Acceleration in YZ plane
    
    # Synthesize resulting acceleration
    required_accel = np.array([
        accel_xy + accel_xz,
        accel_xy + accel_yz,
        accel_xz + accel_yz
    ])
    
    return required_accel

Integration with Thrust Vector Control

Your system is equipped with thrust vector control (TVC), which requires a special approach to implementing the guidance algorithm.

TVC Modeling:

Thrust vector control allows generating forces and moments for controlling the missile without aerodynamic surfaces. The main equations are:

FTVC=TδTVC\vec{F}_{TVC} = \vec{T} \cdot \vec{\delta}_{TVC}

where:

  • FTVC\vec{F}_{TVC} - force from thrust vector control
  • T\vec{T} - engine thrust
  • δTVC\vec{\delta}_{TVC} - thrust vector deflection angle vector

PN with TVC Integration Algorithm:

  1. Convert required acceleration to TVC control signals:

    python
    def tvc_control(required_accel, missile_mass, max_thrust, max_deflection):
        # Required force
        required_force = required_accel * missile_mass
        
        # Limit by maximum thrust
        force_mag = np.linalg.norm(required_force)
        if force_mag > max_thrust:
            required_force = required_force * (max_thrust / force_mag)
        
        # Calculate thrust vector deflection
        deflection = required_force / max_thrust
        
        # Limit by maximum deflection
        deflection_mag = np.linalg.norm(deflection)
        if deflection_mag > max_deflection:
            deflection = deflection * (max_deflection / deflection_mag)
        
        return deflection
    
  2. Missile dynamics consideration:

    python
    def missile_dynamics(missile_state, tvc_deflection, dt):
        # missile_state = [pos, vel, attitude, angular_vel]
        pos, vel, attitude, angular_vel = missile_state
        
        # Convert TVC deflection to global coordinates
        global_deflection = rotate_vector(tvc_deflection, attitude)
        
        # Calculate forces
        thrust_force = max_thrust * global_deflection
        gravity_force = np.array([0, 0, -9.81 * missile_mass])
        
        # Total forces
        total_force = thrust_force + gravity_force
        
        # Integrate equations of motion
        accel = total_force / missile_mass
        new_vel = vel + accel * dt
        new_pos = pos + new_vel * dt
        
        return [new_pos, new_vel, attitude, angular_vel]
    

Practical Implementation in a Simulator

Simulator Structure:

  1. Main simulation loop:

    python
    def simulation_loop():
        missile_state = initialize_missile()
        target_state = initialize_target()
        radar_data = []
        
        while simulation_time < max_time:
            # Get radar data
            radar_measurement = get_radar_data(target_state)
            radar_data.append(radar_measurement)
            
            # Calculate guidance
            guidance_command = compute_guidance(
                missile_state, 
                radar_measurement,
                N=3.5
            )
            
            # Control missile
            tvc_command = tvc_control(
                guidance_command,
                missile_mass=100,
                max_thrust=5000,
                max_deflection=np.radians(30)
            )
            
            # Update missile state
            missile_state = update_missile(missile_state, tvc_command, dt)
            
            # Update target state
            target_state = update_target(target_state, dt)
            
            # Check termination conditions
            if check_termination(missile_state, target_state):
                break
    
  2. Angle sensor processing:

    python
    def angle_sensor_processing(missile_pos, target_pos, missile_attitude):
        # Vector from missile to target in global coordinates
        relative_pos = target_pos - missile_pos
        
        # Convert to missile coordinates
        relative_pos_body = rotate_vector(relative_pos, inverse_attitude(missile_attitude))
        
        # Calculate angles (azimuth, elevation, range)
        range_val = np.linalg.norm(relative_pos_body)
        azimuth = np.arctan2(relative_pos_body[1], relative_pos_body[0])
        elevation = np.arctan2(relative_pos_body[2], np.sqrt(relative_pos_body[0]**2 + relative_pos_body[1]**2))
        
        return azimuth, elevation, range_val
    

Integration with Global Coordinates:

Since your system uses global coordinates, it’s necessary to properly process coordinates of all axes:

python
def global_coordinate_system_guidance(missile_global_pos, missile_global_vel, 
                                    target_global_pos, target_global_vel):
    # All vectors are already in global coordinate system
    # Direct guidance calculation without transformations
    
    r_vec = target_global_pos - missile_global_pos
    v_rel = target_global_vel - missile_global_vel
    
    # Rest of the algorithm as in 3D PN above
    ...

Advanced Methods and Improvements

Augmented Proportional Navigation:

To account for target maneuvers, augmented PN is used:

am=NVcλ˙+atargeta_m = N \cdot V_c \cdot \dot{\lambda} + a_{target}

where atargeta_{target} is the estimated target acceleration.

Adaptive Navigation Gain:

python
def adaptive_navigation_gain(r_range, v_closing, N_base=3.5):
    # Adapt navigation constant based on conditions
    if r_range < 1000:  # Near zone
        return N_base * 1.5
    elif r_range < 5000:  # Medium zone
        return N_base
    else:  # Far zone
        return N_base * 0.8

Combined Guidance:

python
def combined_guidance(missile_state, target_state, phase):
    if phase == "midcourse":
        # Midcourse - inertial guidance
        return inertial_guidance(missile_state, target_state)
    elif phase == "terminal":
        # Terminal phase - proportional navigation
        return proportional_guidance(missile_state, target_state)

Testing and Validation

Test Scenarios:

  1. Static target:

    python
    def test_static_target():
        target_pos = np.array([10000, 0, 0])
        target_vel = np.zeros(3)
        
        # Run simulation
        results = run_simulation(target_pos, target_vel)
        
        # Check hit
        assert results['miss_distance'] < 1.0
    
  2. Maneuvering target:

    python
    def test_maneuvering_target():
        def target_motion(t):
            # Target performs evasive maneuver
            if t < 5:
                return np.array([10000, 0, 0]), np.zeros(3)
            else:
                return np.array([10000, 1000*np.sin(t), 0]), np.array([0, 1000*np.cos(t), 0])
        
        results = run_simulation_with_motion(target_motion)
        assert results['miss_distance'] < 5.0
    

Performance Metrics:

python
def performance_metrics(simulation_results):
    miss_distance = simulation_results['final_distance']
    time_to_intercept = simulation_results['flight_time']
    fuel_consumption = simulation_results['total_delta_v']
    
    return {
        'hit_ratio': miss_distance < 10.0,
        'intercept_time': time_to_intercept,
        'efficiency': fuel_consumption / time_to_intercept
    }

Trajectory Visualization:

python
def plot_3d_trajectory(missile_trajectory, target_trajectory):
    fig = plt.figure(figsize=(12, 8))
    ax = fig.add_subplot(111, projection='3d')
    
    # Missile trajectory
    ax.plot(missile_trajectory[:, 0], 
            missile_trajectory[:, 1], 
            missile_trajectory[:, 2], 
            'b-', label='Missile', linewidth=2)
    
    # Target trajectory
    ax.plot(target_trajectory[:, 0], 
            target_trajectory[:, 1], 
            target_trajectory[:, 2], 
            'r--', label='Target', linewidth=2)
    
    ax.set_xlabel('X (m)')
    ax.set_ylabel('Y (m)')
    ax.set_zlabel('Z (m)')
    ax.legend()
    ax.grid(True)
    
    plt.title('3D missile and target trajectories')
    plt.show()

Conclusion

  1. Proportional Navigation is the optimal choice for your system, providing effective target interception in 3D space.

  2. Three Plane Approach solves the problems of standard PN in three-dimensional space and ensures stable operation under any coordinate values.

  3. Integration with thrust vector control requires special conversion of required accelerations into control signals, considering thrust and deflection limitations.

  4. Adaptive methods and combined guidance improve system efficiency under various conditions and at different flight stages.

  5. Testing and validation are critically important to confirm the algorithm’s functionality and optimize it for your simulator’s specific requirements.

For practical implementation, it’s recommended to start with the basic 3D PN algorithm, then gradually add improvements and adaptations tailored to your system’s specifics.

Sources

  1. Missile Guidance using Proportional Navigation and Machine Learning - Comprehensive simulation model, consisting of full 6DOF missile and controls dynamics, 3D world and camera model
  2. Three Plane Approach for 3D True Proportional Navigation - The performance of TPA has been tested both visually and analytically via developed simulation environment
  3. GitHub - gedeschaines/propNav: A 3-DOF point mass kinematic model of an ideal proportional navigation guidance missile written entirely in Python 3
  4. Simulation of short range missile guidance using proportional navigation - This article develops 6-DOF mathematical model and an autopilot for PN guided missile
  5. Design of gain schedule fractional PID control for nonlinear thrust vector control missile with uncertainty - The equations of motion for nonlinear missile model with FPID and GSFPID are modelled mathematically
  6. Proportional navigation - Wikipedia - Proportional navigation dictates that the missile should accelerate at a rate proportional to the line of sight’s rotation rate
  7. Derivation of the Fundamental Missile Guidance Equations - The two most popular techniques are pure pursuit and proportional navigation
  8. Augmented proportional navigation guidance law using angular acceleration measurements - This form of the equation is identical to traditional augmented proportional navigation for the case when the interceptor can only accelerate perpendicular to the line-of-sight
  9. Modern Homing Missile Guidance Theory and Techniques - Johns Hopkins APL delivers critical contributions to address critical challenges
  10. The realization of the three dimensional guidance law using modified augmented proportional navigation - This paper deals with 3D missile guidance law and presents the general optimal solution