150 likes | 603 Views
PRODAS Presentation: C++ 6DOF Simulation Philip V. Hahn Dr. Robert Frederick. Overview. Desire: 6DOF modeling and simulation of Squib-Controlled Spinner Tools: PRODAS C++ CMD (C++ Model Developer) Simulation tool: provides a framework to run the simulation. References:
E N D
PRODAS Presentation: C++ 6DOF Simulation Philip V. Hahn Dr. Robert Frederick
Overview • Desire: 6DOF modeling and simulation of Squib-Controlled Spinner • Tools: • PRODAS • C++ • CMD (C++ Model Developer) • Simulation tool: provides a framework to run the simulation. • References: • “Modeling and Simulation of Aerospace Vehicle Dynamics”, Peter H. Zipfel. • CMD Manuel • Dr. Costello (via email and PowerPoint presentations)
Scenario • Gun-launched spinning projectile with squibs to provide lateral diversion • Threat: Rockets and mortars fired at close (2-8km) range • Intercept Zone: 0.5-1.5 km ( >= Mach 1.0 velocity at intercept)
Projectile Specification CG and CP shift during flight (as a function of Mach number)
By creating accessor functions, other classes can access values in this function without the risk of changing the value of the local variable (Encapsulation) Classes and Object Oriented Programming Class we are deriving from (Inheritance) Name of the class we are creating Constructor, used to set up initial conditions at object creation class Projectile : public Block { public: Projectile(string infile, Output *obj); void init(void); void update(void); void rpt(void); // accessor functions protected: }; Called once at start of simulation Called every iteration. Contains the differential equations we need to solve. Reporting function, used to control text output to console
Inputs • Aerodynamic coefficients are extracted from PRODAS PR3 file. • Search for “basicAeros” to find the aero coefficient table. • Implemented as 1-D text tables with linear interpolation. • Initial velocity, diameter, mass, roll rate, and moments of inertia: • appropriate windows in PRODAS. • Initial Elevation and Azimuth: • Elevation is implemented as theta • Azimuth – 90 is implemented as psi. • All inputs are located in a text file and extracted on program execution.
Aerodynamics Guidance Atmosphere Squib Quaternion Earth Airframe Diagram of Program Class Structure
Evolution of the code • Implementation of quaternions to replace Euler angles • Separation of competencies from functions into individual classes • Atmosphere • Aerodynamics • Earth model • Quaternions • Airframe (core differential equations) • Implementation of guidance class and squib class
Summary of Control Logic and Assumptions • Nominal Z and Y values are stored in a text table • We are assuming lateral thrusters, and thus we cannot influence Z. • We take the difference between our position and the value stored in the table • Transform the values to body coordinates using an inverted Direct Cosine Matrix • Convert from X and Y values in body coordinates to Phase and Magnitude • Wait for the following criteria to be met: • Proper timing (each squib has a dedicated time slot) • Miss distance > 2 meters • Phase is +/- 10 degrees of the direction we want to fire. • Once all three conditions are met, we fire the squib • Integration refines for the very short event. • Text table defines thrust curve shape • (Highly simplified … Dr. Costello can provide a more in-depth discussion)
Guidance results • Getting close to PRODAS GN+C • My problem is getting the “smear” to line up the same Coarse integration can cause us to miss the left side of our window and shift the thrust vector.
Future Work • Implementation of a “no-roll” frame • dp/dx=0, phi=constant, = spin angular velocity. • Refining Dr. Costello’s guidance module in my C++ Simulation • Has only been “working” for 3 days • My simulation increases the integration step once the squib fires, may be prudent to increase it earlier to avoid the smear problem (at a cost of time). • Explore drop-in replacements for the trajectory tracking module • Some form of predictive correction (proportional navigation?) • We have target trajectories for a mortar and rocket defined • Mortar/Rocket can be implemented as a class and “flown” in real time. • Adding in error sources • IMU class: guidance won’t have perfect knowledge of the state variables • Turning on the flight computer after the gun is launched • Using a magnetometer to detect gravity / orientation / rates
Additional Materials • PRODAS File • CMD Source Code • CMD Manual • Questions