Automatic Code Generation Within Model-Based Design

Fredrik Håbring, MathWorks

In this master class we feature the development and implementation of a field-oriented controller for a permanent magnet synchronous machine (PMSM) using a real-time microcontroller. The workflow shows you how to:

  • Design and test motor control algorithms using simulation in the initial stages of development before hardware is available
  • Eliminate hand coding errors by generating C code for the controller and integrating it into an existing software application
  • Measure performance of the compiled code executing on the processor by profiling resource usage and conducting processor-in-the-loop (PIL) testing
  • Increase performance by using optimized processor-specific libraries
  • Test and verify the controller against real motor hardware by running the generated C code in real time on a TI microcontroller

Product Focus

  • Simulink
  • Stateflow
  • Embedded Coder

Recorded: 22 May 2014