Modeling & optimization of projectile motion and simulation using FlightGear

Contents

Team

Motivation

The goal of this project was to further the study of projectile motion. Essentially, the well-known 2 Degree-Of-Freedom (DOF) point-mass system was extended to gain more insight into the effects of wind resistance/drag forces, lift forces and the Coriolis effect on a body.

To aid in visualizing the model simulations, output was sent to FlightGear, a powerful flight simulation software package.

Finally, the models were used to solve a simple ballistics problem: determining the initial conditions necessary to hit a specified target.

Proposal/Requirements

The equations governing the motion of a projectile were to be modeled using causal block diagrams in MATLAB's Simulink software. MATLAB's scripting environment was to be used to implement the optimization algorithms.

The modeling data was then to be fed into FlightGear to visualize the data.

Design/Models

Dynamics Models

Optimization algorithms

Given the models that plot the trajectory of a projectile given a set of model parameters, determining those necessary for the projectile to reach a specified target was achieved by using a root-finding method. Given the initial impulse force and direction, an script was written to measure the distance between the projectile and target after running a simulation, and this distance, or error, was used as input into the bisection root-finding method. The algorithm assumes a root, i.e. a point in the function where f(x) = 0, is between two supplied intervals, and iteratively halves the search interval until the root is found or the search space is small (see figure). In this fashion, the optimal initial direction was able to be found.

Bisection Method
Figure illustrating the bisection method halving
the search space until the root/zero crossing is found

Equipped with an algorithm giving the angle needed to hit a target given a certain initial force, the issue of minimizing this force was investigated. If one were to plot the distribution of force vs. angle required to hit a target, an inverse-square distribution would result (see figures). A minimization algorithm was therefore used to determine the minimum force in the distribution, specifically MATLAB's built-in fminbnd function. It determines a function's local minimum given a search interval. It's algorithm is "based on golden section search and parabolic interpolation" (see http://www.mathworks.com/access/helpdesk/help/techdoc/ref/fminbnd.html for more details).


Figure depicts distribution of force vectors
capable of hitting a target.

FlightGear simulations

In order to simulate projectile trajectories in flightGear, the typical XYZ position specified in a body frame must be translated to geodetic coordinates. This function was accomplished via the use of MATLAB's Flat Earth to LLA block. See here for more details: http://www.mathworks.com/access/helpdesk/help/toolbox/aeroblks/flatearthtolla.html

Implementation

Source files

Models

2DOF Projectile motion
Launched projectile 2DoF
MATLAB launched_ball_simple.mdl Causal Block Diagram

Here, as well as in all further models, the input force is modeled as an impulse force - an infinitesimally large force applied for an infinitesimally small time period. Given that the intent was to analyze projectile motion, an impulse was the most appropriate choice of force.

Parameters:

Blocks:

2DOF Projectile motion with logarithmic wind resistance
A slightly more complex iteration of the previous model was also implemented to study the response of the system due to a varying wind-resistance force:

Launched projectile
MATLAB launched_ball.mdl Causal Block Diagram

Above, a crude wind shear is modeled by causing R to vary logarithmically in y.
Additional Parameters:
3DOF Projectile motion:
3DOF Launched projectile
MATLAB launched_ball_3D.mdl Causal Block Diagram

Parameters:

3DOF Projectile motion with drag effects
3DOF projectile motion with drag
MATLAB launched_ball_drag_3D.mdl Causal Block Diagram

With the addition of drag effects, a non-linear model had to be employed, as specified in the design section. Note that the velocity output signal is routed through the drag blocks and squared, then added to the output. This technique was also used in subsequent models to allow modeling of non-linear components.

Parameters:

Blocks:

3DOF Projectile motion with drag, Coriolis effects:
3DOF projectile motion with drag, Coriolis effects
MATLAB launched_ball_drag_3D_coriolis.mdl Causal Block Diagram

Coriolis subsystem
Coriolis effect subsystem

Additional Parameters:

4DOF Projectile motion with drag, Coriolis, lift effects
4DOF Projectile motion with drag, Coriolis, lift effects
MATLAB launched_ball_drag_4DOF_coriolis_simple_lift.mdl Causal Block Diagram

Lift sub system
Lift effects subsystem

Additional Parameters:

Additional Blocks

FlightGear Simulation:

2 Degree of Freedom simulation model
2 DOF simulation model
MATLAB launched_ball_w_flightgear_sim_2D.mdl Causal Block Diagram

Parameters:

Blocks:

4 Degree of Freedom simulation model
4 DOF simulation model
MATLAB launched_ball_w_flightgear_sim_3D.mdl Causal Block Diagram

Parameters as previously specified

Blocks:

Experiments & Results

2 DOF systems

2 DOF projectile impulse responses

Parameters:

3 & 4 DOF Systems:

Experiments compared to headwind-type wind shear:

3 Degree of freedom systems

3 Degree of freedom systems - X-Z view 3 Degree of freedom systems - X-Y view

Parameters:

Experiments compared to crosswind-type wind shear:

3 Degree of freedom systems - with crosswind

3 Degree of freedom systems - with crosswind - X-Z view3 Degree of freedom systems - with crosswind - X-Y view

Parameters:

Optimization experiments:

Optimization of 2DOF launched ball model

The above plot illustrates the solution to finding the optimal projectile launch direction. In black is the solution trajectory. The target location is marked by the red crosshair. The bisection method's progress is demonstrated by the blue trajectories.

Script command:
launched_ball_opt_angle(m, g, R, target_x, target_y, Fi_init, t, TOL, theta_min, theta_max, interm_plots)
For full argument descriptions, see launched_ball_opt_angle.m

Script command for above plot:
launched_ball_opt_angle(10, 9.8, 0, 1500, 100, 1500, 0:.1:30, 1E-7,0,pi/2, true)

Optimizing force & angle

The above plot ilustrates the solution to the minimization problem, where the black trajectories depict the intermediate solutions found by the minimization algorithm, and the blue line represents the optimal force & direction trajectory. The target is marked by the red crosshair.

Script command:
launched_ball_opt(m, g, R, target_coords, t, TOL, theta_min, theta_max, force_range, interm_plots)
For full argument descriptions, see launched_ball_opt.m

Script command for above plot:
launched_ball_opt(10, 9.8, 0, [1200 0], 0:.1:20, 1E-7, 0, pi/2, [1100, 1200], true)

FlightGear simulations:

Conclusions

The dynamics models employed where able to provide a qualitative description of the behaviour of projectiles in different environments. For true quantitative descriptions, more complex equations of motion would have to be employed. Improvements could be made in modelling the fluid/body interactions, lift and induced drag forces, and atmospheric conditions.

Nevertheless, the proposed models and experiment results provide motivation for further investigations.

References

Clancy, L. J. (1975). Aerodynamics. Toronto, ON: Copp Clark Publishing Company.

Coriolis Acceleration, http://scienceworld.wolfram.com/physics/CoriolisAcceleration.html

Lift Coefficient, http://scienceworld.wolfram.com/physics/LiftCoefficient.html

Laplace Transform, http://mathworld.wolfram.com/LaplaceTransform.html

fminbnd, http://www.mathworks.com/access/helpdesk/help/techdoc/ref/fminbnd.html

Flat Earth to LLA, http://www.mathworks.com/access/helpdesk/help/toolbox/aeroblks/flatearthtolla.html

COESA Atmosphere Model, http://www.mathworks.com/access/helpdesk/help/toolbox/aeroblks/coesaatmospheremodel.html

Wind Shear Model, http://www.mathworks.com/access/helpdesk/help/toolbox/aeroblks/windshearmodel.html

Working with the Flight Simulator Interface, http://www.mathworks.com/access/helpdesk/help/toolbox/aeroblks/f3-19546.html

Presentation

Modeling simple aerospace dynamics using CBDs.pptx