13.07.2015 Views

An Integrated, Modular Simulation System for Education ... - Cal Poly

An Integrated, Modular Simulation System for Education ... - Cal Poly

An Integrated, Modular Simulation System for Education ... - Cal Poly

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Simulink environment, and Mathworks’ versions of the RK4 integrator. The output fromthe RTW generated code matched all of the other versions of the same code with thesame 0.5% variation between the new RK4 integrator and the Mathworks RK4 integrator,verifying the batch mode.<strong>Modular</strong> StructureConversion of the various functions required to create a simulation has reducedthe total number of lines of code that require maintenance. There is one copy of each ofthe input, output, hardware, graphics, and flight models to keep track of. RTW creates asimulation using the same S-function code tied to the icon in the Simulink diagram ratherthan having a separate copy <strong>for</strong> each simulator as would be the case with stand alonesimulations. Since the RTW autocoder requires c source code <strong>for</strong> any of the S-functionsthe functions are provided as open code to allow future researchers at <strong>Cal</strong> <strong>Poly</strong> toupdate and modify the existing functions, or use them as templates to create newfunctions to expand the capabilities of the system.Adding new functions to the PhEagle II system only requires that the functionsuse the S-function IO template. All other inputs and outputs requirements of the functionare labeled in the Simulink environment S-block. To make the block more intuitive, aMask can be put over the block allowing an icon of the functions use to be applied.Including Existing IO FunctionsAll existing IO functions that were available as source code from PhEagle I wereconverted from c++ code to c code. A new data structure was created that is compatiblewith c. Error trapping that was originally part of a complex set of c++ classes wereincorporated into the functions as stand alone code. Only program code that was activelybeing used was incorporated in the S-functions. While c code is less powerful than c++,42

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!