Motor Control University

Embedded code implementation

This chapter details the important steps for the embedded real-time implementation of a multi-rate control law. The embedded code is obtained using MPLAB Device Blocks for Simulink. It enables Embedded Coder for automated build and execution of real-time executable for any board equipped with a dsPIC :registered:, PIC32 :registered: or SAM from a Simulink model. Any model can thus be embedded. To compile the generated code and program the board from the Simulink interface with a single “Build” push button on top right of the Simulink interface :

The reasons why MPLAB device blocks for Simulink tool was chosen are:

Finally, embedded codes need to respect some constraints described in this chapter, divided into 3 pages:

Real-time implementation

Data Visualization

Data types


(Delpoux2021) Delpoux, R., Kerhuel, L., & Léchappé, V. (2021). On Chip Rapid Control Prototyping for DC Motor. J3eA, Journal Sur l’enseignement Des Sciences et Technologies de l’information et Des Systèmes.