To build and load the project, complete the following steps:
- Right-click on the project name, click the Properties command, move to
pre-defined symbols to change GUI_SCI_EN to GUI_SCI_N to disable
the SCI function for the GUI as described in Figure 3-24.
- Open the sys_settings.h file and set DMC_BUILDLEVEL to the selected build level.
The build levels are described in Table 3-1.
- DMC_LEVEL_1
- DMC_LEVEL_2
- DMC_LEVEL_3
- DMC_LEVEL_4
- Build Levels 2, 3, and 4 require
the motor physical parameters to be accurately known.
- The required motor
parameters must be recorded in the header files (user_mtr1.h) as
shown in the following example codes. These are not the only motor
parameters, this is an excerpt for example
purposes.
#define USER_MOTOR1_Rs_Ohm (2.68207002f)
#define USER_MOTOR1_Ls_d_H (0.00926135667f)
#define USER_MOTOR1_Ls_q_H (0.00926135667f)
#define USER_MOTOR1_RATED_FLUX_VpHz (0.381890297f)
- If the four specific
motor parameters listed above are not accurately known, FAST motor
identification can be used in Build Level 4 to determine the motor
parameters if the FAST estimator is utilized. Do the following, then
refer to the Build Level 4 instructions for further information.
- In main(), change
the userParams_M1.flag_bypassMotorId value to "false" to
enable motor identification, as shown in the following example
code.
// true->enable identification, false->disable identification
userParams[MTR_1].flag_bypassMotorId = false;
Set
the following identification parameters to appropriate values in
the user_mtr1.h header file according to the
specifications of the motor, if
known. #define USER_MOTOR1_RES_EST_CURRENT_A (1.0f) // A - 10~30% of rated current of the motor
#define USER_MOTOR1_IND_EST_CURRENT_A (-1.0f) // A - 10~30% of rated current of the motor, just enough to enable rotation
#define USER_MOTOR1_MAX_CURRENT_A (6.5f) // A - 30~150% of rated current of the motor
#define USER_MOTOR1_FLUX_EXC_FREQ_Hz (40.0f) // Hz - 10~30% of rated frequency of the motor
- If another build option was built
previously, right click on the project name and click on Clean Project,
and then click on Build Project. Watch the tools run in the build window.
Wait until the project builds successfully.
- In the Project Explorer
window, right-click on the .ccxml file and select 'Set as Active Target
Configuration'
- Turn on the AC or DC power supply
to apply 30 VAC or 40 VDC to J5, generating the +15 V and +3.3 V for the
controller and gate driver. Click on the Debug button or
click Run → Debug. The code for the selected build level can be
compiled and loaded onto the C2000 device. Notice the CCS Debug icon in the
upper right-hand corner, indicating that the user is now in the Debug
Perspective view. When launched, the program stops at the start of
main().