GM Engineering Europe Develops HVAC Controller for GM Vehicles Using Model-Based Design
- System models reused across 54 products worldwide
- Quality improved through early verification
- Team communication improved
"Developing an HVAC system as complex as ours by hand-coding in C would not be possible. Model-Based Design not only made development possible, it also made it faster while enabling us to verify and test months earlier than we could before."Johan Hägnander, GM Engineering Europe
GM Engineering Europe used Model-Based Design to develop a sophisticated embedded HVAC control system that calculates air temperature throughout the vehicle interior by simulating, in real time, the effects of ambient temperature, sun load, heat-transfer mechanisms, convection, air flow, and heat radiation.
"Given the time constraints, we could not have developed such a complex model by hand-coding in C," says Johan Hägnander, manager of chassis controls for the Software Controls Group at GM Engineering Europe. "With MathWorks tools for Model-Based Design, we created system-level simulations of the HVAC system to verify functionality and performance much earlier in the project. We then used the same models to generate code for prototyping and, finally, target the code for production hardware."
Engineers at GM Engineering Europe have years of experience in developing software for GM’s European brands. Recently, the group became responsible for developing HVAC software for all GM vehicles worldwide, including new hybrid and extended-range electric vehicles.
“Our development platform had to be more flexible because we wanted to support all GM vehicles with the same core software,” says Hägnander. “We also needed to add new functionality for hybrid vehicles, in which minimizing power consumption is a top priority.”
Additionally, GM Engineering Europe wanted a platform that would enable engineering teams in Asia, North America, and Europe to collaborate effectively.
In the past, GM engineers could not begin testing until the entire system had been developed and hardware was available. “Our goal was to verify the design much earlier in the process,” explains Gerhard Stengel, software developer at GM Engineering Europe.
The team developing the new, more complex HVAC controller was also expected to maintain their delivery schedule for products already in the pipeline.
To develop the new HVAC controller, GM engineers used MathWorks tools and adopted Model-Based Design, an approach that enabled them to validate their designs and test components under various failure conditions before hardware was available.
Working with MathWorks consultants, the team developed a model framework for the entire HVAC controller in Simulink®, and then integrated existing components coded in C.
Engineers converted components written in C into Simulink and Stateflow® models, adding functionality to meet current design requirements. This approach enabled them to update the system component by component while maintaining the ability to deliver the latest control software to vehicles entering production.
With Simulink Report Generator™, GM Engineering Europe created documentation for their Simulink and Stateflow models, which helped team members understand component designs created by others. The Simulink framework, combined with this documentation, enabled GM engineering teams in India, North America, Germany, and Sweden to work on the design in parallel.
New components, including controls for the hybrid vehicles’ electrically driven compressors, were developed entirely in Simulink and Stateflow. The team developed Simulink plant models for the compressor, blower, and auxiliary heat to verify component functionality via closed-loop simulations.
With Simulink Coder™, they automatically generated code for components modeled in Simulink and conducted real-time, in-vehicle tests using rapid prototyping hardware. Because the code was automatically generated from their system model, they could make changes in the model, re-generate the code, and test the new version—all within minutes.
They then generated production code using Embedded Coder® and deployed it to the target 32-bit microcontroller.
The new controller is already installed in several production vehicles, including the Opel Insignia, and GM engineers are working toward a full Simulink implementation, increasing the percentage of automatically generated code in each release of the software.
System models reused across 54 products worldwide. “Once we had moved to Model-Based Design, we were able to use the same core system in many different vehicles by simply calibrating parameters such as the vehicle dimensions and then re-generating production code,” says Hägnander.
Quality improved through early verification. “There is no contest between debugging on the target and debugging in the model,” says Stengel. “In the past we could only test the whole system once it was deployed. With Simulink, we simulated and tested at the component level months earlier, which improved the quality of the final product.”
Team communication improved. “Simulink models are much easier to understand than C code,” says Hägnander. “You get a better understanding of what you and your teammates are developing—especially when you can see the models execute through simulation.”