Design is the process of defining the software architecture and interfaces, and developing the detailed functions and operations which satisfy the requirements. In Model-Based Design models are used to describe the design rather than traditional design documents.
Artifacts developed in the requirements phase such as the executable specification are directly leveraged as a starting point for the initial design, thereby reducing translation errors and accelerating development. Design documents are generating using the model as a source. Desktop simulation and rapid prototyping are used to quickly iterate the design and verify it performs as desired to meet requirements in both simulated and real world conditions.
Choose architecture and component technology early
Model architecture and the technology used to encapsulate components within the design impact a number of areas including simulation performance, code-generation speed, code efficiency, the configuration and change review process, and maintainability. The merits of component technologies such as Model Reference, "atomic" subsystems, and libraries should be evaluated early on in the design process to derive a model architecture that meets current needs and is scalable. For example, Model Reference should be used for components that need to be independently verified outside the model they reside in or when there is a need to generate the same reusable function in software.
Establish and enforce design standards
Modeling environments offer a great deal of flexibility while at the same time providing extensive libraries of design patterns to solve common problems. If not managed carefully, models can quickly become unreadable and inefficient, thus becoming less effective for communicating design information, for simulation, and for code generation.
A solution is to put design standards in place to assure the model is "production feasible," easily understood, and avoids common design errors before moving it to the next design phase. Start with applying industry standards such the MAAB (MathWorks Automotive Advisory Board) Style Guide which can be enforced through a set of automated checks.
If a safety critical workflow is required, then modeling rules for IEC 61508 or DO-178B should also be considered. Use automated checks to ensure the design is feasible, making the implementation more efficient. The standards and automated checks are based on cumulative industry experience and should be weighed heavily.
Put a process in place to facilitate reusability
Design with reusability in mind. Reusability is aided by having a process with dedicated resources to both simplify and improve the flexibility of a design. Such a process is common sense, but only a small fraction of companies have it, and those that do are the top performers [Ref. 5]. These top performing companies, identified by their success in hitting a variety of engineering target goals, integrated the preparation and verification of designs for reuse into their processes. Their organizations were also more likely to dedicate resources to simplifying designs for reuse.
A couple of strategies can be used to facilitate reusability in Model-Based Design:
Avoid over designing
- Separate target characteristics such as data types and device drivers from the design model. This separation can be done with proper architecture and using a separate data dictionary to define target specific types.
- Use Model Reference to encapsulate reusable components to facilitate verification and enforce context independent boundaries.
Complex designs can be quickly developed using Model-Based Design. There are often a number of different ways to model the same functionality. Dedicate some effort to reviewing models to identify ways to simplify design patterns which can improve both readability and performance. For example:
Develop a plant model with “trend correct” behavior
- Use state machines only if a chart output is a function of an internal state not just an input. If an output is a function of only inputs, then a flow chart will be a better representation.
- Review the C language construct guide to understand how to efficiently represent common C constructs in the modeling domain.
- Make commonly used design patterns available by establishing a library to share among other design team members.
Plant models are critical for conducting early and continuous verification from initial concept to production implementation. It is possible to build plant models of various levels of fidelity. Typically increased fidelity implies additional development effort. A model that reproduces the approximate behavior of the real system in simulation is called a "trend correct" model. A plant model with trend correct behavior can be used for confirming that a controller model behaves as intended or for regression testing when the controller is changed.
Such a model utilizes empirical data mixed with physical laws. Limited in complexity, the plant model provides approximate behavior between controller output and input (feedback), and can generally be developed with modest resources. Often trend correct models are developed by the engineers developing control strategies.
Set objectives upfront for utilizing a plant model
Organizations that have successfully deployed Model-Based Design have generally followed the path of starting with trend correct behavioral models and over time evolving models to become more predictive. This approach provides the immediate benefit of having the capability to verify the control strategies correct behavior and continued refinement of the plant model in support for controller development.
More predictive capability is required when the plant model is to be used to validate a control strategy. A high fidelity predictive model has the potential to reduce or eliminate expensive test cycles using prototype vehicles. However, the development time and technical expertise required and the resulting simulation speed should be carefully planned.
As the plant model becomes more predictive, the model and its validation procedure become more complex. It is often necessary to involve an expert with more detailed knowledge of the plant being modeled. Often this expertise is found in the portion of the organization responsible for design of the physical mechanism. The expert should work closely with the intended user of the model to insure the model contains the appropriate level of detail.
5. J.B. Dabney, “Return on Investment of Independent Verification and Validation Study Preliminary Phase 2B Report.” Fairmont, W.V.: NASA IV&V Facility,2003
Material in this article was first presented in SAE Paper Number 2010-01-0935.