Run the project by clicking the button , or click Run → Resume in the Debug tab.
In the Expressions window, set the variables pfcVars.flagEnablePFC, motorVars[0].flagEnableRunAndIdentify, and motorVars[1].flagEnableRunAndIdentify to 1 after systemVars.flagEnableSystem was automatically set to 1 in the watch window.
The project should now run, and the values in the graphs and expressions window should continuously update as shown in Figure 3-12 while using this project. You might want to resize the windows according to your preference.
In the watch view, the variables motorVars[0].flagRunIdentAndOnLine and motorVars[1].flagRunIdentAndOnLine should be set to 1 automatically. The ISRCount should be increasing continuously.
Check calibration offsets of dual motor and PFC, the offset value of the motor phase current sensing should be equal to approximately half of the scale current of ADC as shown in Figure 3-12.
Probe the PWM output for dual motor and PFC drive control with an oscilloscope. All of the PWM duty are set to 50% in this build level, the PWM output waveforms are as shown in Figure 3-13. The PWM switching frequency of motor_1 is 6 kHz, the PWM frequency of motor_2 and PFC have an integral multiple of motor_1 with 18 kHz and 72 kHz. A fixed degree lags are between motor_1, motor_2 and PFC for avoiding the ADC modules are triggered and the ISRs occupy the CPU at the same time.
The controller can now be halted, and the debug connection terminated. Fully halting the controller by first clicking the Halt button on the toolbar or by clicking Target → Halt. Finally, reset the controller by clicking on or clicking Run → Reset.
Erase the code in controller for next build level by clicking Tools → On-Chip Flash, and click Erase Flash in On-Chip Flash tab (make sure that all of the flash banks are checked) as shown in Figure 3-14. This operation will erase all of the program code stored in flash. (This step is option, the user can ignore this step to load the new program code in next build level)
Note:
Do not click Cancel, turn off the power of the board, or disconnect the emulator when erasing flash
Close CCS debug session by clicking the Terminate Debug Session or clicking Run → Terminate.
Figure 3-12 Build Level 1: Expressions Window at Run Time
Figure 3-13 Build Level 1: Dual Motor and PFC PWM Output
Figure 3-14 Build Level 1: Erase Program Code in Flash for Next Build Level