car-engineer english version car-engineer version française

Teaching Model-Based Design at Politecnico di Torino


By Massimo Violante, Politecnico di Torino

In the region around Turin, Italy, there is strong demand for engineers with the skills and knowledge required to develop complex, high-integrity embedded software. The need is particularly acute among automotive companies, but it affects avionics and other industries, as well. Companies seek engineers who can deliver sophisticated software in compliance with safety standards such as ISO 26262 and DO-178B while adhering to stringent quality requirements and tight production deadlines.

To meet this demand, Politecnico di Torino has introduced Model-Based Software Design, a course for fifth-year students that combines lectures and practical exercises with seminars conducted by local industry experts. Using MATLAB®, Simulink®, Stateflow®, and Embedded Coder™, students learn how to manage the growing complexity of today’s embedded systems by designing and simulating an executable model; rigorously validating, testing, and debugging it; and generating code for an embedded target. By fostering collaboration and knowledge-sharing between academia and industry, the course is helping prepare the students for the engineering challenges they will face in their future jobs.

Course Goals

The course was introduced a year ago to cover topics not fully addressed by the computer, electronic, and mechatronic engineering curricula, and to better prepare students for engineering careers in local industries, primarily the automotive industry.

It is said repeatedly that there is a shortage of skilled engineers who can apply Model-Based Design to embedded systems development. Companies see the value in using this approach, but have limited time and resources to train engineers in-house. In developing the course, the goal was thus to prepare students to step into these in-demand roles and be productive immediately. Because the course would clearly benefit local area industries, many companies agreed to support the course by sending engineers to conduct seminars and presentations on their work.

The first time it was offered, Model-Based Software Design became the most popular of the 14 elective courses open to computer, electrical, and mechatronics students in their final year at Politecnico di Torino. Of approximately 200 engineering students 73 enrolled, reflecting a strong motivation among the students to develop expertise in this discipline. To date, 107 students have already enrolled in the second session of the course. The 46% increase in enrollment year-over-year is a further indicator of the strong interest the course has generated.

Teaching Modeling, Simulation, and Code Generation

The course begins with a series of lectures on using modeling and simulation as the core of a development process for embedded software. The factors motivating companies to take this approach are explained, including rapid growth in the complexity of the systems under development, time-to-market pressures, and the high cost of defects found late in development.

Next, a description is done of how Model-Based Design with MATLAB and Simulink enables engineers to model complete systems, validate the system specification and functionality via simulation, and automatically generate test cases and embedded code.

Most students have used MATLAB and Simulink in earlier controls classes or other coursework, so they come up to speed quickly on the practical exercises.

In one exercise, the students use Model-Based Design to build a parking assist system. The system includes a proximity sensor, control software running on a Cypress programmable system on a chip (PSoC® 5, donated to Politecnico di Torino by the Cypress University Alliance), and an array of LEDs that light up when the proximity sensor approaches an obstacle.

The control software is developed entirely in Simulink and Stateflow using state charts and a truth table.

Mathworks Statfelow chart and truth table

After simulating and verifying their designs, the students use Embedded Coder to generate code for the Cypress PSoC target. They then cover verification and validation, which provides a natural lead-in to a series of lectures on ISO 26262.

Working with ISO 26262, AUTOSAR, and Other Standards

Many automotive companies must adhere to ISO 26262, the functional safety standard for road vehicle software systems. Despite its prevalence in the industry, ISO 26262 is a new concept for the students, who have never had to follow rules governing how they design and build software. Over the course of several lectures, and with the support of Professor Maurizio Morisio, an introduction to real-world safety standards is provided, including ISO 26262, IEC 61508, and DO-178. Students learn that developing to these standards requires additional work, but that automation and available resources, such as qualification kits, can help reduce the effort required. For example, DO Qualification Kit (for DO-178) and IEC Certification Kit (for ISO 26262 and IEC 61508) are presented, as well as how these products can streamline the certification process within Model-Based Design.

Like ISO 26262, the AUTOSAR architecture is a concept that is both new to and immediately useful for many students upon graduation. Students learn that with a layered structure, software functionality can be decoupled from the hardware used to implement it. They readily grasp that models enable them to capture and simulate the behavior of an AUTOSAR software component and to generate code for AUTOSAR environments.

Advancing to Graduate Study

Several of the students who completed the course are now working on master’s theses on a range of topics involving Model-Based Design. Because Model-Based Design is the de facto industry standard in automotive, avionic, and industrial applications, the students often have the opportunity to work in cooperation with industry partners. Two students are working with a local automotive company on best practices for modeling control algorithms and for verification and validation. Two more are developing a control system for an industrial vehicle using Model-Based Design, and three others are working on an electric vehicle for a competition. Finally, two students are working on a master’s thesis to develop an open-source AUTOSAR stack that students who take the course next year will be able to use in the lab.

2013’s course will include additional hands-on lab exercises, enabling students to see more of the systems they design and develop in Simulink running on embedded systems.

© 2012 The MathWorks, Inc. MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See for a list of additional trademarks. Other product or brand names may be trademarks or registered trademarks of their respective holders.

This article has been reprinted with permission from MathWorks and Politecnico di Torino

Romain Nicolas opinion:

I’m not objective when I talk about that because I work in this area. Anyway, I think this is great to provide students capacity to be prepared to what they will face in industry. Indeed, mastering Matlab/Simulink is not sufficient in industry; you need to comply with modeling standards, adapt your way of modeling to company rules and guidelines, and also take into consideration constraints like code generation and configuration management. I would have definitely appreciated to follow this course. My only question is do they consider only automotive constraints or also avionics or railway systems?

1 Comment

  1. Thomas Dougan01-14-2013

    Hello Romain,

    This is Thomas Dougan from New Eagle. I noticed your link on LinkedIN. New Eagle is a vehicle controls engineering and supply company. We use Simulink and our proprietary software MotoHawk to program a range of ECUs directly from Simulink. We work with industry and academia. In fact a couple of universities have similar classes to yours and use MotoHawk ECUs. For information on a Rose-Hulman controls class using MotoHawk go to,

    Thomas Dougan

Leave a Reply