SLUUDM5 March 2026 MSPM0G1507 , MSPM0G1519 , MSPM0G3507 , MSPM0G3519
32-bit algorithm variables can be output in real time from the MCU through the DAC12 module. DAC12 output is enabled by setting pUserCtrlRegs->dacCtrl.dacEn as 1b. The DAC12 in MSPM0 is a 12-bit DAC module, thus a scaling needs to be applied before output. Follow the steps below to configure DAC12 output:
Settings dacEn as 1b feeds the variable output to the DAC registers, but user needs to enable the DAC peripheral in TI SysConfig for the DAC peripheral to function. Also make sure the DAC output pin is not loaded by any other peripheral or DRV board.
Table 9-1 lists the FOC motor control variable addresses for real-time tracking, with updates occurring every FOC loop. In contrast, variables in pUserStatusRegs update every 1ms and therefore cannot display real-time changes.
| Parameter | Variable Address / Name | IQ Type | ||
|---|---|---|---|---|
| Sensorless FOC | Universal FOC | Sensored FOC | ||
| A phase current | g_pMotorInputs->current.iabc.a | IQ27 | ||
| B phase current | g_pMotorInputs->current.iabc.b | IQ27 | ||
| C phase current | g_pMotorInputs->current.iabc.c | IQ27 | ||
| A phase current raw ADC value | g_pMotorInputs->current.iabcRaw.a | IQ11 | ||
| B phase current raw ADC value | g_pMotorInputs->current.iabcRaw.b | IQ11 | ||
| C phase current raw ADC value | g_pMotorInputs->current.iabcRaw.c | IQ11 | ||
| A phase voltage | g_pMotorInputs->voltage.vabc.a | IQ27 | ||
| B phase voltage | g_pMotorInputs->voltage.vabc.b | IQ27 | ||
| C phase voltage | g_pMotorInputs->voltage.vabc.c | IQ27 | ||
| A phase voltage raw ADC value | g_pMotorInputs->voltage.vabcRaw.a | IQ12 | ||
| B phase voltage raw ADC value | g_pMotorInputs->voltage.vabcRaw.b | IQ12 | ||
| C phase voltage raw ADC value | g_pMotorInputs->voltage.vabcRaw.c | IQ12 | ||
| D axis current | 0x20200760 | g_pMC_App->foc.idq.d | IQ27 | |
| Q axis current | 0x20200764 | g_pMC_App->foc.idq.q | IQ27 | |
| D axis voltage | 0x20200768 | g_pMC_App->foc.vdq.d | IQ27 | |
| Q axis voltage | 0x2020076C | g_pMC_App->foc.vdq.q | IQ27 | |
| D axis Filtered BEMF | 0x20200BEC | g_pMC_App->angleTrackingPLLEstim.EdqFilt.d | NA | IQ27 |
| Q axis Filtered BEMF | 0x20200BF0 | g_pMC_App->angleTrackingPLLEstim.EdqFilt.q | NA | IQ27 |
| Estimated motor velocity filtered | 0x20200C0C | g_pMC_App->angleTrackingPLLEstim.velocityFilt | g_pMC_App->foc.hallObj.hallEstimVelocityFilt | IQ27 |
| Estimated rotor angle | 0x20200C14 | g_pMC_App->angleTrackingPLLEstim.fluxAngle | g_pMC_App->foc.hallObj.hallEstimFluxAngle | IQ27 |
| Power Feedback | 0x20200940 | g_pMC_App->foc.closeLoop.PowerFeedback | IQ27 | |
| SVM output duty A phase | 0x20200730 | g_pMC_App->foc.svm.Dabc.a | IQ0 | |
| SVM output duty B phase | 0x20200734 | g_pMC_App->foc.svm.Dabc.b | IQ0 | |
| SVM output duty C phase | 0x20200738 | g_pMC_App->foc.svm.Dabc.c | IQ0 | |
Variable address might vary in different FOC algorithm versions. Refer to latest MSPM0 Sensorless FOC Tuning Guide for variable address of newer Sensorless FOC algorithm versions.
Figure 9-2 and Figure 9-3 show an example to output estimated rotor angle variable at DAC12 output pin.
For estimated rotor angle, IQ(1.0) represents 32 electrical angle cycles to avoid the overflow in algorithm.