SLUUDM5 March 2026 MSPM0G1507 , MSPM0G1519 , MSPM0G3507 , MSPM0G3519
The section uses a standard BLDC motor (DT4260) with hall sensor to demonstrate Sensored FOC solution. The following table shows the parameters of the motor.
| Part Number | Rated | Line to Line | Torque Constant | BEMF | Inertia | Pole Pairs | |||
|---|---|---|---|---|---|---|---|---|---|
| Voltage | Speed | Torque | Resistance | Inductance | |||||
| DT4260-24-055-04H | VDC | rpm | mNm | Ohm | mH | mNm/A | mV/Hz | g·cm2 | / |
| 24 | 4000 | 125 | 0.8 | 1.2 | 35.50 | 35.7 | 48 | 4 | |
Follow the steps below to spin the motor with Sensored FOC solution:
hall_sensored-foc_DRV8316_LP_MSPM0G3507_nortos_ticlang or
hall_sensored-foc_DRV8316_LP_MSPM0G3519_nortos_ticlang
g_pMC_App->foc.hallCalibObj.calibState
g_pMC_App->hallAngleTableReverse
Users should update the hardcoded Hall Angle Table in ISR.c with the newly calibrated hall angle values (See Table 7-7).
Hall calibration is required to spin a new BLDC motor with hall interface.
Figure 7-11 shows the hardcode to set the motor parameters (DT4260) and Hall calibration parameters.
Figure 7-12 and Figure 7-13 show the detailed flow for Hall calibration execution in CCS Expressions Window.
Users need manually set speedInput to zero to reset the FOC state machine. Then, users set a target speed in IQ15 format to speedInput register to spin the motor, as shown in Figure 7-14.
After Hall Calibration done, users should overwrite the Hall angle table in ISR.c file, as shown in Figure 7-14. Any changes to the hall signal wiring require re-execution of the complete calibration flow.
Hall calibration requires additional register modifications and takes time to complete. For hardcode to automatically implement the Hall calibration, refers to the code below:
/* Start Calibration when first connected to the motor */
__BKPT(0); /* For debug */
pUserCtrlRegs->algoDebugCtrl2.b.hallCalibEnable = 0x1;
pUserCtrlRegs->algoDebugCtrl2.b.updateConfigs = 0x1;
while(pUserCtrlRegs->algoDebugCtrl2.b.updateConfigs){
updateConfigs(); /* Polling until all register updated */
}
/* Start Calibration */
pUserCtrlRegs->speedCtrl.b.speedInput = 10000;
while (g_pMC_App->foc.hallCalibObj.calibState != HAL_CALIB_COMPLETE) {
updateConfigs();
/* Polling until calibration done */
}
/* Reset motor control state machine */
pUserCtrlRegs->speedCtrl.b.speedInput = 0;
pUserCtrlRegs->algoDebugCtrl2.b.hallCalibEnable = 0x0;
pUserCtrlRegs->algoDebugCtrl2.b.updateConfigs = 0x1;
while(pUserCtrlRegs->algoDebugCtrl2.b.updateConfigs){
updateConfigs();
}
__BKPT(0); /* For debug */
/* Calibration done */