SPRUJH1 August 2025 F29H850TU
The servo drive system can be tested in incremental stages. Each stage is enabled by defining DMC_BUILDLEVEL in sys_settings.h and rebuilding the project. In the code example shown "Step 4: closed speed loop and current loop" is enabled by the DMC_BUILDLEVEL.
//=============================================================================
// Incremental Build options for System check-out
//=============================================================================
#define DMC_LEVEL_1 1 //Y 50% duty, offset calibration and verify phase shift
#define DMC_LEVEL_2 2 //Y open loop control to check sensing signals
#define DMC_LEVEL_3 3 //Y closed current loop to check the hardware settings
#define DMC_LEVEL_4 4 //Y run with sensored FOC
#define DMC_BUILDLEVEL DMC_LEVEL_4
#define DMC_BUILDLEVEL DMC_LEVEL_1
Verify the ADC offset calibration, ePWM 50% duty output, deadband, and phase shift.
#define DMC_BUILDLEVEL DMC_LEVEL_2
Spin the motor using open loop control to verify the motor current and voltage sensing signals.
#define DMC_BUILDLEVEL DMC_LEVEL_3
Spin the motor with a closed current loop to validate current sensing and the current control.
#define DMC_BUILDLEVEL
DMC_LEVEL_4
The final step is to run the motor with both the speed loop and the current loop closed.