Innovators at NASA's Armstrong Flight Research Center have developed a method for resolving algebraic loops that occur in closed-loop systems when using MathWorks® Simulink® modeling and simulation tools. This variable fidelity method improves accuracy and reduces runtime significantly for users of Simulink Coder™ applications. This Armstrong-derived method improves the Simulink Coder tool's ability to more efficiently and quickly generate C code based on algorithms modeled in the simulation tool. By replacing transfer functions that require high sampling rates with embedded function integration schemes, users can achieve continuous transfer function accuracy at almost no computational cost. The innovation also enables computationally intensive block diagrams to run faster in real time and satisfies Nyquist frequency requirements in models. Algebraic loops are resolved through fast sampling, making the innovation especially applicable to high speed systems with saturation limits, dead-bands, and other constraints that create fast dynamics.
- Accurate: Enables users to set variable inputs, though the overall model can autocode at the base sample rate, providing for variable fidelity at minimal cost
- Efficient: Facilitates autocoding for models that contain a nonlinear closed-loop system
- Fast: Enables a computationally intensive block diagram to run faster in real time, while maintaining accuracy
- Cost-Effective: Reduces prototyping costs by more efficiently and quickly creating C code based on Simulink Coder parameters
- Digital signal processing
- Communications systems
- Image and video processing
- Embedded systems
- Model-based design
- Control systems
How It Works
The innovation was designed to resolve algebraic loops in the Simulink Coder application, reduce simulation runtime, and at the same time achieve variable fidelity without changing base sampling rates. NASA engineers developed the method while working to autocode and run several different electrical system models for aircraft actuator dynamics on a single board processor. Problems occurred when the memory blocks required to reduce algebraic loops during system autocoding introduced a lag into the system that invalidated results. Conventional fixes (increasing sampling rate, introducing function generators) proved unworkable.
The Armstrong-derived software innovation is unique in that it uses embedded MATLAB® code to resolve algebraic loops introduced during autocoding, achieving higher accuracies while running at the lower base sample rate (see Figures 1 and 2.)
|Figure 1. Simplified system illustrates innovation
› View larger image
|Figure 2. Embedded Matlab function structure
› View larger image
Discrete transfer functions tend to attenuate signals before their continuous counterparts. This may be problematic for designers who would like to replicate the continuous transfer function attenuation or other behavior exactly. This method presents a workaround, allowing users to iterate between the base step size, which effectively increases the Nyquist frequency of discrete transfer functions, and allowing accuracy in discrete systems comparable to continuous systems. By bypassing the Simulink tool's complex methods for solving algebraic loops, designers can run computationally intensive systems at much faster rates while staying within the Simulink environment in order to accomplish autocoding and interact with all of the Simulink toolboxes. A demonstration model running at 100 kilohertz (kHz) with a base sample rate of 800 hertz (Hz) ran 13.4 times faster than an equivalent model solved using the Simulink tool.
Why It Is Better
Within Simulink, designers must resolve algebraic loops with memory blocks, which cause a time delay that can cause inaccuracies due to data sampling requirements. Workarounds such as function generators, rate transitions, atomic subsystems, and higher sampling rates are not successful for various reasons. When changing the sample rate, users sacrifice runtime. When changing the overall model, users may sacrifice accuracy. In either case, time is wasted in attempting to determine the best compromise. The Armstrong method is most useful for increasing the accuracy of systems that require a boost in sampling rate above the base rate.
MathWorks, Simulink, and MATLAB are registered trademarks, and Simulink Coder (formerly Real-Time Workshop®) is a trademark of The MathWorks, Inc.
This technology is part of NASA's Innovative Partnerships Office which seeks to transfer technology into and out of NASA to benefit the space program and U.S. industry. NASA invites companies to consider opportunities for partnership and usage of the Method for Resolving Algebraic Loops in Simulink with Variable Fidelity and Reduced Computational Time (DRC-009-027).
Technology Transfer Office
NASA's Armstrong Flight Research Center
PO Box 273, M/S 1100
Edwards, CA 93523-0273
Phone: (661) 276-3368