The algorithms followed for the nonlinear controller are based on the case study for a Nonlinear Aircraft-Performance Simulation by Dr. David K. Schmidt in his Modern Flight Dynamics textbook, but expanded to build nonlinear guidance systems for any airborne vehicle using the wind frame. The fangs.GuidanceSystem has a baked-in default state estimator utilizing ideal equations of motion, but the user is encouraged to provide their own state solution at each time step using their own state solver or states and rates of their aircraft if this set of algorithms is used for real flight.
Version notes: v2.0.0
- This version added changes to the API to allow the user to input an "absolute" command: Flyover waypoint, Groundspeed, Altitude
- This adds the capability for the user to designate mission-related commands.
Version notes: v2.0.1
- Bug hunting
Version notes: v2.1.0
- Attempted stall prevention.
This system target assignment algorithms, and future implementation will include tracking of multiple airborne agents operating in a team, e.g., drone swarms. The tracking functions utilized in this system will be nothing more than wrappers for the Command & control (C2) of Autonomous Random finite set- (RFS-) Based Swarms (CARBS) developed by the Laboratory for Autonomy, GNC, and Estimation Research (LAGER) at the University of Alabama (UA). The target assignment algorithms currently in use in this system are the:
- Hungarian assignment algorithm
- {TBD}
Version notes: v0.1.0
- First roll-out of the ATAMS package.
- Still needs a ton of development but is useable as-is for the ANGST application.
- Only includes assignment algorithms.
- Does not include any agent tracking.
- Suggested roll to v1.0.0 once agent tracking is implemented.
Saved simulations used in the development of these algorithms and for academic work are found in the saved_simulations directory. The basic algorithm is as follows:
- To use the guidance system, first you must create a FixedWingVehicle object class found via from vehicle.FixedWingVehicle import FixedWingVehicle. The class documentation will tell you which parameters are required; any other is optional.
- Next, initiate an object of the FANGS.GuidanceSystem class, passing the FixedWingVehicle object, required transfer function parameters, and initial conditions. You may also specify the time of object creation (this could be launch time or when the guidance system is "turned on"). If desired, the integration step time can also be set here--the default value is dt=0.01. Each update to the state parameters will give the user the opportunity to specify a step time if required (for instance, if the guidance system is being used on physical hardware and the time between calculations is not exactly 0.01 seconds).
- Commanding the agent:
- The user may set a command trajectory at any time using the setCommandTrajectory() function of the FANGS.GuidanceSystem object. If no command trajectory is set, the aircraft will continue along the trajectory defined in the initial conditions. A trajectory is defined as an ATC-style set of commands: velocity, flight-path angle (glideslope), and heading.
- The user may set a flyover waypoint at any time using the setCommandFlyover() function of the FANGS.GuidanceSystem object. This will put the aircraft into a flyover state: at each time step, the aircraft will calculate the required trajectory to meet the flyover conditions (groundspeed, altitude, latitude/longitude) until it is sufficiently within range of the target at which point the aircraft will revert back to a trajectory state and maintain heading, airspeed, and glideslope.
- The user may give a swarm of drones a set of flyover waypoints using ATAMS. To do this, the user must first create a matrix of all agent states (latitude, longitude, altitude, groundspeed, heading, and flight path angle). The ATAMS.assignments.assignAgentsToTargets() function will ingest the current agent states and desired flyover waypoints and, using the Hungarian algorithm, calculate the assignment set which has the lowest overall cost. The ATAMS.assignments.assignAgentsToTargets() function will then assign each waypoint as a flyover command automatically, invisible to the user.
- At each time step, the user must run the getGuidanceCommands() function of the FANGS.GuidanceSystem object for the drone to create its internal set of commands to meet the required guidance system user inputs.
- At each time step, after running getGuidanceCommands(), the user must run the updateSystemState() function of the FANGS.GuidanceSystem object. This function will progress the aircraft's state one time step forward, using either the user-specified dt parameter to the function or, if no dt is given by the user, using the FixedWingVehicle default dt value, which is the same as the FANGS.GuidanceSystem object default dt value. At this step, the user may supply any, all, or none of the required state parameter values; if any required parameter is not supplied it will be estimated using the FANGS.GuidanceSystem default ideal equations of motion (EOM).
- Repeat steps 3, 4, and 5 until the aircraft simulation is complete.
- After running the FANGS.GuidanceSystem, you can save your guidance object's state to a .pkl binary file by running utils.save_obj() and passing the FANGS.GuidanceSystem object with a save-to filepath. This step will allow you to analyze saved simulations in the future without re-running the simulation, potentially saving a lot of time. Many of the required analysis tools, such as plotting states and tracks, can be found in the utils.py package.