This topic explains the steps to add hardware drivers to a simulation model and deploy the model to the target hardware.
This topic uses the model
mcb_pmsm_foc_sim as a reference to
explain the steps involved in the hardware deployment. The model
mcb_pmsm_foc_sim simulates the field-oriented control (FOC)
algorithm for implementing speed control for a PMSM.
The speed control algorithm is deployed to the target hardware Texas Instruments™ LAUNCHXL-F28379D (connected to Texas Instruments BOOSTXL-DRV8305). These are the hardware interface details:
|Interface||Pin on LAUNCHXL-F28379D|
|Phase-A input of the motor||ADCINC2|
|Phase-B input of the motor||ADCINB2|
|PWM A output from the motor||EPWM1A|
|PWM B output from the motor||EPWM2A|
|PWM C output from the motor||EPWM3A|
|Enable Driver BOOSTXL-DRV8305||GPIO124|
These steps explain how to add the hardware driver blocks from the Embedded Coder® Support Package for Texas Instruments C2000™ Processors so as to deploy the control algorithm to the target hardware LAUNCHXL-F28379D (connected to BOOSTXL-DRV8305).
These steps use variables to define the datatypes, the execution time of the current
controller, and the execution time of the speed controller. See the model initialization
script of the example model
mcb_pmsm_foc_sim for details on the
variables defined in these steps.
To implement a simulation model with a PMSM motor FOC control algorithm, see Design Field-Oriented Control Algorithm.
A basic understanding of Simulink® is a prerequisite to follow these steps. For details about the ADC driver,
the quadrature encoder driver, and the hardware interrupt block, see the example model
mcb_pmsm_foc_qep_f28379d, which uses an architecture similar to
what we describe.
For target hardware other than LAUNCHXL-F28379D (connected to BOOSTXL-DRV8305), you can follow these steps, but select the driver blocks (ADC, PWM, Interrupt) from the appropriate supported hardware library.