Technical Articles and Newsletters |

By Prof. Jim Freudenberg, University of Michigan and Prof. Jeff Cook, University of Michigan

In 1999, senior research engineers at one of Detroit’s “Big Three” automotive OEMs drew our attention to the shortage of graduating seniors fully prepared for careers in embedded systems engineering. While new electrical engineers have a good grasp of signal processing and control theory, many have never implemented a control system on an embedded processor. Likewise, recent graduates in computer engineering understand microprocessor hardware and programming but are less familiar with control design, signal processing, and the challenges of implementing real-time embedded systems.

The key to bridging this gap was to educate teams of electrical and computer engineers to collaborate on cross-disciplinary projects, where they learn to develop algorithms and implement them on hardware. Under the guidance of Detroit engineers, and with the invaluable assistance of numerous graduate students over several years (especially Noah Cowan, now a professor of mechanical engineering at Johns Hopkins University), University of Michigan developed an elective course for seniors and first-year graduate students in both engineering disciplines. Throughout the semester-long course, students are exposed to industry-standard tools and technologies, and to Model-Based Design for embedded control systems.

The course is built around a series of labs employing the Freescale™ MPC5553 microprocessor and a “haptic wheel” designed by Professor Brent Gillespie in the Department of Mechanical Engineering.

Students use the knowledge gained in eight laboratory exercises over the course of a semester to design and implement a driving simulator using the haptic wheel to steer a mathematical vehicle model along a virtual road. Ultimately, every team’s driving simulator is connected via a Controller Area Network (CAN) and simulated on a single road. Students implement an adaptive cruise controller to maintain a preset distance between virtual cars on the road.

EECS 461 incorporates three hours of lectures and three hours of laboratory work each week. We introduce each new system and control concept in the lecture, typically with a homework assignment employing Simulink^{®} and Stateflow^{®}. The concepts are then applied in the lab using a different peripheral device on the MPC5553 each week. For most of the course, students interface with hardware and implement algorithms by hand-coding in C. This helps them understand the microprocessor architecture, the operation of peripheral devices, and the intricacies of low-level device-driver programming.

In the first lab, students employ a University of Michigan–designed interface to the microprocessor containing two banks of digital input DIP switches and a bank of LED displays connected to digital output pins. The exercise is straightforward: Two binary values are input using the DIP switches. The values are summed, and the result output to the LEDs. In subsequent labs, students program queued analog-to-digital conversion and examine issues of sampling and signal aliasing. They use the optical encoder and quadrature decode function of the MPC5553-enhanced Time Processing Unit (eTPU) to measure the position of the haptic wheel. In a related homework problem, students model the quadrature decode operation of the microprocessor using Stateflow.

In the fourth week, students program the MPC5553 to generate a pulse width modulated (PWM) signal to control the speed and direction of the haptic wheel and implement two simple haptic virtual worlds: a virtual spring, in which a restoring torque is generated proportional to the wheel angular displacement, and a virtual wall, in which the wheel is permitted to rotate freely up to a specified displacement, at which point the motor generates a strong restoring force, or virtual wall.

The following lab introduces interrupt processing: A sine wave from a signal generator is periodically sampled and its value used to modulate the duty cycle of a PWM signal. The input signal is then reconstructed from the PWM signal using a low-pass filter to attenuate the high-frequency content, leaving only the sinusoidal modulation frequency. Concurrently, students model the DC motor in Simulink and investigate PWM motor control in simulation.

By this point, students have developed the ability to implement complex virtual worlds with haptic feedback incorporating various connections of walls, dampers, and springs. They design a virtual knob that gives the user feedback—detents that can be felt at regular intervals. A virtual spring-damper adds a retarding force proportional to wheel angular velocity to the virtual spring developed in an earlier lab. Virtual spring-mass and spring-mass-damper systems (Figure 1) require students to deal with implementation and numerical instability issues involved in Euler integration. Students model dynamic systems in Simulink, where they evaluate differences between continuous and discrete implementations and the effects of integration methods. In the penultimate lab exercise, they investigate issues of networked control by distributing each team’s virtual spring across a CAN network to form a virtual chain. In this way, displacement of a wheel at one end of the chain propagates through each of the six connected haptic devices.

In the lab that precedes the final project, we introduce rapid prototyping and code generation using Real-Time Workshop and Real-Time Workshop Embedded Coder. In lecture, we discuss the advantages of Model-Based Design, emphasizing the ability to debug and verify control systems before implementing them in hardware and the importance of eliminating the gap between control design and controller implementation.

The students reimplement the virtual wall exercise that they completed in an earlier lab, this time using code generation. They compare the efficiency and structure of their hand-coded implementation with the generated code. They then create a Simulink model to simulate a virtual world with two spring-inertia-damper systems coupled to the haptic wheel (Figure 2). The two systems have significantly different time constants, and thus require a multitasking solution. This lab highlights the time savings that rapid prototyping can provide in the development of complex embedded control systems.

For the final project, which lasts about four weeks, student teams implement their driving simulators entirely in code generated from Simulink and Stateflow models. Stateflow is particularly valuable in describing the three required operating modes: *manual*, in which the speed of the virtual car is controlled by a potentiometer on the interface board; *constant speed*, which is much like the cruise control systems in vehicles today; and *constant distance*, in which the virtual vehicle maintains a distance between itself and the virtual car in front determined from speed and position data broadcast over the CAN bus from each team’s simulator (Figure 3).

EECS 461 graduates have gone on to work for leading automakers and suppliers, semiconductor companies, appliance manufacturers, and aerospace companies. A former student now working at a tier-one automotive supplier recently wrote to tell us, “The tools and information that I learned in EECS 461 have done more for me than any other class at the university.” Another student was hired for an internship at a leading automotive supplier after she told the interviewer of her course experience with Simulink, Stateflow, and the adaptive cruise control system.

In some cases, employers from other states have paid for staff to temporarily relocate to Michigan in order to take the course. We’ve had professional engineers who were already employed locally sign up for the course, and we know of others who were hired on condition that they complete the course before beginning work.

Recently, EECS 461 has “gone international.” For the first time last September, Professor Lino Guzzella of the Swiss Federal Institute of Technology (ETH) brought the course to Zurich, where it was taught by Jeff Cook. This year, Jim Freudenberg will teach the course at ETH.

Between 80 and 100 students enroll in EECS 461 each year, a number limited only by how many students can be accommodated in the laboratory. Ten years after our initial discussion with the OEM, the continued interest from students and industry tells us that EECS 461 is extremely valuable to students and makes our students valuable to industry.

Published 2009 - 91784v00