Modeling embedded systems - Part 4: If prototypes aren’t possible
To model and create a prototype, you need a hardware prototyping platform. Prototyping platforms are composed primarily of commercial off-the-shelf components configured to meet the I/O specifications of the system and provide a quick, seamless way to connect the control model with real-world I/O, making it easier to test and iterate the design.
As shown in Figure 23, the controller design is tested in a real-time environment and connected to actual hardware. This provides excellent verification and validation feedback on the fidelity of the modeling effort and the resulting control design early in the design flow. Further refinements to the controller and hardware designs and requirements can be made prior to finishing the design of the production systems.

Figure 23 - The design V integrates simulated and real-world I/O to be most effective.
Beyond getting your system up and running before you have your final hardware, there are other reasons you should focus on getting to your prototype quickly. If you’re in an innovative space, prototypes allow you fail early and inexpensively. Real innovation always includes a risk of failure. Thomas Edison once joked, “We now know a thousand ways not to build a light bulb.” By building a prototype, you can quickly weed out the approaches that don’t work to focus on the ones that do.
Prototypes also help you technically to understand the problem. By developing a functional prototype sooner rather than later, you are forced to address both the foreseen and the unforeseen technical challenges of a device’s design. Then, you can apply those solutions to a more elegant system design and model as you move to developing the final deployed solution.
The prototype can also help resolve conflicts. The best engineers have strong opinions about how a given feature should be implemented. Inevitably, differences of opinion result in conflicts, and these conflicts can be difficult to resolve because both sides have only opinions, experience, and conjecture to refer to as evidence.
By taking advantage of a prototyping platform, you can quickly conduct several different implementations of the feature and benchmark the resulting performance to analyze the trade-offs of each approach. This can save time, but it also ensures that you make the correct design decisions.

Figure 24 - Integrating hardware in the loop with your embedded control system allows you to prototype sooner and results in higher quality designs.
Finally, prototypes can help you file patents more easily. Before 1880, all inventors had to present working models or prototypes of their inventions to the patent office as part of the patent application process. Today, the patent office uses the “first to invent rule,” which grants a patent to the first inventor who conceives and reduces the technology or invention to practice. Though no longer required, a prototype is still the best and safest way to demonstrate “reduction to practice.”
You have your prototype – now what?
If you can demonstrate or, better yet, put a prototype into the customer’s hands and get real feedback on the value of your innovation, the probability of business success greatly increases. This is especially important when you are working in an extremely innovative area where ‘proving it’ means progressing on your project.
Loccioni Group in Italy is one example of an innovative team that employs modeling, simulation, and iterative prototypes. Loccioni Group is considered a flag-bearer for Italian innovation because of its reputation for developing custom technical solutions to ensure quality, comfort, and safety. They focus primarily on two industries: automotive and electrical appliances.
Loccionio Group embraced “the genius of the and” in a recent embedded test system – the Mexus project - for measuring and charting the flow rate of diesel engine nozzles. This project originated from the need to measure the flow rate of diesel engine nozzles with a detailed quantification of the fuel injected during a single injection. The final product is an instrument used worldwide by injector manufacturers for end-of-line production tests. The goal was to provide a low-cost embedded product with better performance than any other instrument on the market.

Figure 25 - The injection chamber and its control system was modeled using modern graphical design tools.
Loccionio Group designed a reliable product capable of accurately determining the two fundamental parameters characterizing injectors: the flow rate injected for each shot and the chart of the instantaneous flow rate. The instrument provides the measurement of the fuel quantity injected in each single shot event up to a maximum of 10 events per revolution (also known as multi-injection). By simulating the engine operation at 3,000 rpm, the readout value injection for each revolution can be easily detected by the system, which provides the quantity of each fuel injection in real time.
The innovative aspect of this project is the calculus algorithm used in the solution. The system acquires different analog signals and processes them in real time, providing the user with reliable test results up to the injector functioning rate of 50 instantaneous values per second. The system is also able to determine how much fuel is dispensed in each injection. This information is significant for injector characterization because emissions regulations are becoming more restrictive. Consequently, it is important to provide manufacturers with more detailed information to gain high-level combustion, reducing either fuel consumption or the quantity of pollutant gas within the environment.
One critical element of the Mexus system is the injection chamber, the cylinder provided with control sensors and valves where the fuel is injected and the specific measurements are performed. The injection chamber and its control system were modeled with graphical design and simulation software. In this stage, simulations were also performed using the same graphical system design environment. During prototyping, the same computer was maintained through a data acquisition board that performed functional characterization and validation. This important development stage of the project highlighted the need for a more refined chamber injection model. This was determined by using system identification software as part of the same graphical system design tools, which made it possible to obtain the transfer function of the injection chamber and consequently design a suitable control algorithm.
To enable a large scale deployment, Loccionio Group needed a hardware device with failure-free technology that was capable of operating around the clock, offered a compact form factor, and was suitable for an industrial environment. They chose hardware that helped them make a quick shift from prototyping to deployment and ensured they met the sampling rate requirements and the real-time, deterministic control of the process.
The Mexus final product guarantees the highest reliability in test operations. The accuracy of the measurements is due to the introduction of innovative working methodologies that ensure test compliance with the most restrictive regulations. By employing modeling, simulation, prototyping and deployment techniques, Loccioni Group has provided the automotive world with an innovative product that delivers excellent test standards.
If you follow similar recommendations for your design, you will have a prototype and an embedded model. You can then optimize, refine, and test the system. When all your individual components and subsystems have been tested and validated, they are combined and tested together to ensure that the original design requirements are met.
In some cases, parameters in your controller are finely tuned during this phase to meet original design requirements. Although creating embedded models in your design process does not completely eliminate the need for testing, it offers several opportunities to reduce the amount of test that will be required prior to the release of the production system.
Modeling design technology is currently evolving to aid in automating the final testing process. Early tool providers in this space automatically generate test vectors and execute scripted sequences to verify both models and automatically generated code. Soon, these capabilities will extend to physical tests and scripting test sequences, including real-world I/O connections, needed to verify all behaviors of the control system.
Conclusion
Creating a model for your embedded system provides a time and cost-effective approach to the development of anything from simple to incredibly complex dynamic control systems, all based on a single model maintained in a tightly integrated software suite. Using modern modeling software tools you can design and perform initial validation in off-line simulation. These models then form the basis for all subsequent development stages. As we have seen, creating models for your embedded design provides numerous advantages over the traditional design approach.
Using this approach combined with hardware prototyping you reduce the risk of mistakes and shorten the development cycle by performing verification and validation testing throughout the development instead of only during the final testing stage. Design evaluations and predictions can be made much more quickly and reliably with a system model as a basis.
This iterative approach results in improved designs, both in terms of performance and reliability. The cost of resources is reduced because models can be reused by design teams, design stages, and various projects, and because of the reduced dependency on physical prototypes. Development errors and overhead can be reduced through the use of automatic code generation techniques. These advantages translate to more accurate and robust control designs, shorter time to market, and reduced design cost.
Part 1: Why model?
Part 2: Modeling examples
Part 3: Where to model?
Shelley Gretlein is the Director of Software Product Marketing at National Instruments. Currently focused on growing the application and success of graphical system design globally, Gretlein is responsible for the development strategy and worldwide evangelism of the LabVIEW software platform including LabVIEW Real-Time and LabVIEW FPGA. She joined National Instruments in 2000 and holds a bachelor’s degree in computer science and management systems as well as minors in Mathematics and French from the Missouri University of Science and Technology.
This article is based on material by Shelley Gretlein written for inclusion in “Software Engineering for embedded systems,” edited by Robert Oshana, to be published early in 2013 by Morgan Kaufmann, a division of Elsevier, Copyright 2013. Used by permission.


Loading comments... Write a comment