- Disable the data cache by unchecking the
Data Cache Enabled in the Tools > ARM Advanced Features.
- Run the code by pressing on the Resume button, or
click Run → Resume in the Debug tab.
- The project now runs, and the values in the graph and watch window keep updating.
- In the Expressions window, set the variables motorVars_M1.flagEnableRunAndIdentify to 1
after systemVars.flagEnableSystem was automatically set to 1 in the watch
window.
- The project now runs, and the values in the graphs and expressions window continuously update as
shown in Figure 4-13 while using this project. You can re-size the windows according to your
preference.
- In the watch view, the variables
motorVars_M1.flagRunIdentAndOnLine is set to 1 automatically if there are no
faults. The ISRCount increases continuously.
- Check the calibration offsets of the motor driver board. The offset values of the motor phase
current sensing values are equal to approximately half of the ADC scale current as shown
in Figure 4-13.
- If using the graph tool, the variables shown in the graphs are the FOC angle and phase currents
for phase u, v and w.
- Expand and check the MotorVars_M1.faultMtrPrev.bit structure to maintain that there are
no fault flags set.
- Using an oscilloscope, probe the PWM outputs that are used for motor drive control. The duty
cycles of the three PWMs are set to 50% in this build level. The expected PWM output
waveforms are as shown in Figure 4-14. The PWM switching frequency are the same as the value that was set for the
USER_M1_PWM_FREQ_kHz define in the user_mtr1.h file.
- Set the motorVars_M1.flagEnableRunAndIdentify variable to 0 to disable the PWMs.
- If any of the previous steps provide unexpected results, additional debug is necessary. A few
things to check are:
- Make sure that the motor driver board being used is the same as the board selected
in the build configurations.
- Make sure that the proper predefines are set.
- Make sure that the switches are configured properly on the Lunchpad/ControlCARD as
described in Section 4.3.
- Once the previous steps are complete, the
controller can now be halted, and the debug connection terminated. Halt the controller by
first clicking the Halt button on the toolbar or by clicking Target → Halt.
Finally, reset the controller by clicking on the button or clicking Run →
Reset→CPU Reset.
- Close the CCS debug session by clicking the
Terminate Debug Session button or clicking Run → Terminate. This halts the
program and disconnect Code Composer from the MCU.
- Terminating the debug session each time the user
changes or runs the code again is not necessary. Instead, the following procedure can be
followed. After rebuilding the project, press the button or click Run →
Reset→CPU Reset, and then press the Restart button or click Run →
Restart. The project must be terminated if the target device or the configuration
is changed, and before shutting down CCS.
The PWM with deadband
outputs to the input of the gate drive are shown in Figure 4-14.