By Paul Barnard
Engineers today are frequently challenged by the growing complexity and faster pace of innovation in today’s mechanical, electronic, and system designs. They must understand the interplay between various technical domains in order to develop innovative products on time and with high quality, especially in the design of hybrid electric vehicles, automotive body electronics, and aircraft flight controllers.
Traditional design methods begin with writing specifications in text, developing control algorithms in C or C++ by hand, and building prototypes. Mistakes in handwritten code are easy to make and difficult to detect during the early phases of the code development effort. Software algorithms and module interactions cannot be verified until all hardware, including electronic and mechanical systems, have been assembled.
When the code is finally implemented on the target processor with all hardware in place, problems may be identified that require substantial changes. Fixes to one module can cause issues for other modules and, when tested, uncover additional problems when it is part of a complete system.
Thus, a design might undergo many cycles of change and reverification, driving up engineering costs and playing havoc with delivery schedules. A table on page 51 summarizes the most common problems with traditional methods.
Model-Based Design Is Centric
Model-based design improves the process of designing complex integrated systems by providing a modeling platform for the complete system, including electromechanical components, control and signal processing algorithms, and the communications network.
The core concept of model-based design uses an executable system model as the basis for activities performed at the four different stages in the design process (see illustration below). The same system model can function as an executable specification, a way to design the system, a basis for code generation, and a means of continuous test and verification.
|Model-based design puts a system model at the center of the development process, from requirements capture to implementation and test. It is an executable specification that is continually refined throughout development.|
from the Model
An executable specification is a system-level specification — essentially a system model — that is executed to produce results proving that the specification is complete and correct. For example, instead of stating on paper that an automobile window has a one-touch open feature, we can build a system model where the window fully opens if the Up command is issued for at least 200 milliseconds.
An engineer working with an executable specification can examine a far wider range of inputs and outputs than those contained within a written specification by making changes to the model and evaluating whether the model meets the specification.
Because an executable specification is testable, it also uncovers errors much earlier on in the design process.
Design with Simulation
Using model-based design, engineers can quickly evaluate the performance of a wide range of integrated design concepts without the need for physical hardware. The simulation results provide a single truth that either meets the specs or doesn’t.
Perhaps the greatest benefit available to designers using model-based design is the ability to examine design tradeoffs across domains, where they study the impact on the entire system of changing a component in one domain.
For example, designers might want to look at the effects of using a different electric motor in conjunction with a new control strategy in a hybrid electric vehicle.
Implementation with Automatic Code Generation
The model can then be used to generate C code to run on the target control module or a prototype controller. The automatically generated code will match or surpass handwritten code with respect to execution speed and memory footprint while conforming to industry-standard requirements.
The code can quickly be regenerated, when needed, to run on a different target processor or converted from an intuitive floating-point implementation to a more memory-efficient fixed-point implementation.
Continuous Test and Verification
Once a model is obtained that accurately represents the system, it serves as a gold standard for developing tests. Designing and verifying tests on a computational model substantially reduces the cost and time required for design verification using actual hardware and also moves testing up to begin earlier in the process. By connecting the control module to a simulated plant, engineers can run the same test routines in a hardware-in-the-loop simulation to verify that the addition of real-time constraints has not uncovered any design flaws. As real hardware becomes available, it can be connected to the control module to replace parts of the plant model.
Engineers can now accurately describe and simulate nearly any complex product at whatever level of detail is required. Model-based design makes it possible to deliver higher product performance while reducing engineering costs. The end result is that more design alternatives can be evaluated and problems can be corrected earlier in the design process, reducing the time and cost required for development and enabling performance to be more highly optimized than with traditional methods.
Paul Barnard is the design automation marketing director at The MathWorks where he is responsible for the technical marketing of Simulink products. He has a B.S. in aerospace engineering from the University of Kansas and an M.S. in aeronautics and astronautics from Stanford.You can send an e-mail about this article to DE-Editors@deskeng.com.