Run the code by going to Run →
Resume or clicking the Resume button in the tool bar. The project can now
run and the variables display in the Expressions window. Check the following to
confirm the application and hardware set up are working:
- The green power LED on the gate-drive
boards must be on. This indicates the auxiliary power supply to the board is enabled.
- If the initializations occur correctly
and the FreeRTOS scheduler is working, the red and blue LEDs are supposed to blink. If the
DRV3255 gate driver is initialized correctly without any faults, the fault bits
corresponding to the DRV, faultStatusFlags.DRVnFLT1 and
faultStatusFlags.DRVFLT is supposed to be 0.
- Similarly other variables in the
faultStatusFlags structure show the status of other faults. If no fault flags are
set, to run the test motor, the runMotor can be set to runMotor. Variables
need to appear similar to what is shown in Figure 4-5.
- Start with a conservative value of
IqRef and slowly increase IqRef during testing. Compare the actual
IQ feedback against reference by viewing the variables in motor1
structure.
- If the motor does not operate as
expected, try to disable SKIP_QEP_CALIB in the pre-defined symbols. This forces
the control loop to perform initial position calibration. In this case, when
runMotor is set, the control algorithm automatically sets IdRef for
alignment, then set IqRef to spin the motor with a generated angle and finally once
the index pulse of the ABI position output is detected, reset IdRef and
IqRef to 0. At this point, slowly start increasing IqRef.
- Check the calibration offsets of the
motor inverter board. The offset values of the motor phase current sensing values must be
half per unit value, that is, around 0.5.
- The PWM output for motor drive can also
be probed with an oscilloscope.
Halt the CPU by first clicking the Suspend
button on the toolbar or by selecting Target → Suspend. To run the application
from the start again, reset the controller by clicking on the CPU Reset tool bar
button or clicking Run → Reset → CPU Reset and then click on the
Restart button or Run → Restart. Close the CCS debug session by
clicking the Terminate button or by clicking Run → Terminate. This
halts the program and disconnects CCS from the controller.
It is not necessary to terminate the debug session
each time the code is changed. Instead go to Run → Load → Load
Program... (or Reload Program... if using the same file). If CSS detects the
executable was rebuilt, CCS automatically inquires if reloading the executable is
desired.