The TAFE team rewrote the embedded control software using Model-Based Design and reduced model development time by 36%. They also assembled a library of component models and tests for reuse on other projects.
To shorten the time it would take to learn the tools, the team attended sessions on simulation, physical modeling, and code generation led by MathWorks Training Services.
They constructed a Simulink plant model by importing the mechanical design for a three-point hitch assembly from their CAD software using Simscape Multibody™. They added hydraulic components, including pumps, valves, and actuators, from Simscape Fluids™.
Working in Simulink, the team then modeled the MIMO control system, including separate PID control loops for the system’s position and draft sensors, as well as 15 state machines, built with Stateflow®, to represent the system’s operational modes.
The engineers used Simulink Control Design™ to tune the PID control loops and Signal Processing Toolbox™ to design a bandpass filter that isolates a specific frequency band from the signals produced by the draft sensor.
As they developed the control model, the team took steps to enforce modeling standards by regularly verifying that their model complied with MathWorks Automotive Advisory Board (MAAB) modeling guidelines using Simulink Check™. They established requirements traceability using Simulink Requirements™ to link system requirements to the model elements that implemented them.
To verify the functional design, the team ran simulations of the controller and plant models.
In preparation for code generation, they converted their design from floating point to fixed point with Fixed-Point Designer™. They then generated MISRA®-compliant C code from the control model with Embedded Coder®, and implemented the code on a 16-bit Freescale™ microcontroller for software-in-the-loop (SIL) tests.
To automate SIL execution, the engineers created a test suite and test sequences using Simulink Test™.
During the SIL tests, they measured code coverage with Simulink Coverage™. Based on the initial coverage results, they added to and refined the SIL tests to achieve 100% condition, decision, and MC/DC coverage. The team wrapped up the project following a series of successful hardware-in-the-loop (HIL) tests and field tests of the generated code.
TAFE engineers have already replicated their initial accomplishments with Model-Based Design on a second project, in which they used Simscape Driveline™ to model a tractor transmission. The group now uses Simulink Real-Time™ and Speedgoat target hardware for HIL testing on all projects completed with Model-Based Design because this approach supports faster running of their physical models and provides tight integration of hardware and software.