Technical Articles

Slovak University of Technology Students Win Freescale Cup EMEA Championship Using Model-Based Design

By Richard Balogh, Slovak University of Technology, Bratislava


Organized by Freescale Semiconductor, the Freescale Cup competition challenges student teams worldwide to build intelligent autonomous model cars and race them around a track with speed bumps, intersections, hills, and chicane curves. The Freescale Cup allows engineering students at Slovak University of Technology (STU) and other European universities to compare their abilities with those of students at top schools around the world. In 2014, more than 75 students in 28 teams from 11 European countries competed in the EMEA Freescale Cup finals, hosted by the Fraunhofer Institute of Integrated Circuits in Erlangen, Germany. A car built by the three-student STU team, the FEI-Minetors (Figure 1), completed the race in 19.2 seconds—just 0.3 seconds faster than the second-place car.

These students had virtually no previous experience with control design. By using Model-Based Design with MATLAB® and Simulink®, however, they were able to model their car, identify and tune key performance parameters, evaluate control ideas, and develop an electronic differential that helped keep the car on the track while it was executing high-speed turns.

Slovak_University_fig01_w.png
Figure 1. Top: The FEI-Minetors car. Bottom: The car negotiating an uneven section of the track during the championship race. Photos courtesy Andrej Lenčucha.

Building the Car and Selecting Design Tools

Freescale Cup competitors build their cars from a kit that includes a 1/18 scale model chassis, two DC motors for propulsion, a servo motor for steering, a CMOS camera for sensing the track, and a Freescale development board that runs the control system. By requiring all teams to use the same low-cost hardware, the competition organizers level the playing field. They also place a strong emphasis on control design; students can gain an advantage only by designing superior controls, not by using superior hardware.

Few of the competitors have taken a control design course, so they learn as they go, relying on trial and error. The FEI-Minetors team, led by graduate student Marek Lászlo, quickly recognized the potential advantages of modeling and simulating the car and their control design. Without any input from me, they decided to use MATLAB and Simulink on their Freescale cup project. They saw how simulations would enable them to try a variety of control ideas and parameter values without risking damage to the car. Simulations would also give them an understanding of the car’s dynamics, the properties of their controller, and how various parameters influenced performance.

Modeling the Electronic Differential

The key to winning a Freescale Cup race is to steer the car round the track’s numerous curves at the highest possible speed without sliding off the course. To help maintain control while cornering at high speeds, FEI-Minetors decided to implement an electronic differential. This subsystem automatically adjusts the speed of the inner and outer rear wheels according to the steering angle of the front wheels. The students knew that the differential would require thorough testing and parameter tuning, otherwise it could actually jeopardize performance. They took the time to model and simulate the differential using MATLAB and Simulink. Then they created a 3D chart in MATLAB to visualize the relationship between motor torque, steering angle, and vehicle speed (Figure 2).

Slovak_University_fig02_w.png
Figure 2. Plot of torque distribution (left) for the electronic differential (right).

Modeling and Simulating the Car

While modeling the electronic differential was a valuable first step, the students needed to model the entire car so that they could run closed-loop simulations with their controller. They began by creating a Simulink model of a DC motor based on models in their textbooks (Figure 3). They obtained parameters for this model from lab measurements and from the motor’s technical datasheet.

Slovak_University_fig03_w.png
Figure 3. Simulink model of a DC motor.

Next, the team created a Simulink model of the chassis, including its weight and dimensions. They combined the chassis and motor models to create a car model that calculated speed and acceleration based on the pulse-width modulated signal provided to the motor (Figure 4). The team verified this model by comparing its output to measurements taken from the actual car, adjusting model parameters until the model accurately represented the real system.

Slovak_University_fig04_w.png
Figure 4. Simulink model of the car, used to design the speed controller.

Developing the Controller

Once they had verified the plant model, the students began creating a controller model in Simulink. They combined the controller and plant models into a larger Simulink system model. Via simulations, the students identified nonlinearities in the system and studied their effect on the initial controller design. Based on this analysis they decided to implement a proportional-integral (PI) controller for curved sections of the track and a simple proportional controller for straight sections. The control system switched between these two controllers as the car raced.

The students used the system model to perform numerous simulations and obtain insights into how different control, motor, and chassis parameters affected the car’s performance. They conducted what-if analysis, changing parameters and running tests to see how the car’s behavior changed. Performing these tests in simulation was not only faster and more repeatable than real-world testing, but it also enabled the students to explore scenarios that would have damaged the hardware if performed on the actual car. Further, the simulations enabled them to analyze signals and parameter values that would be difficult or impossible to measure directly on the car. In one simulation they studied the effect of noise by introducing band-limited white noise in the feedback loop and plotting the car’s distance, velocity, and acceleration over time (Figure 5).

Slovak_University_fig05_w.png
Figure 5. Top: Simulink system model with noise source. Bottom: Plots of distance, velocity, and acceleration.

The Simulink simulation results helped the students gain a deep understanding of the car and how parameter changes affected the overall system. This understanding translated into a significant advantage in the competition because it enabled the students to precisely tune the controller so that the car navigated turns at the maximum possible speed without losing control.

Preparing for Next Year’s Competition

Having spent more than 100 hours of their own time building and developing their Freescale Cup cars, many STU students are already looking forward to next year’s competition. This year’s team wrote C code for their controllers based on their Simulink models. Next year’s team will use Embedded Coder® and the Embedded Coder Support Package for Freescale FRDM-KL25Z Board to generate C code directly from their models. This approach will enable students to spend more time on optimizing their control design and less time on writing and debugging code.

About the Author

Richard Balogh is an assistant professor at Slovak University of Technology in Bratislava, where he received a Ph.D. in automation and control. His research activities include robotics sensors and the use of robotics in education. He is a founder of the largest Slovak robotic competition, Istrobot. His teaching activities include embedded systems programming and designing smart sensors for industrial applications.

Published 2014 - 92252v00

View Articles for Related Capabilities

View Articles for Related Industries