SLUUDM5 March 2026 MSPM0G1507 , MSPM0G1519 , MSPM0G3507 , MSPM0G3519
Once the FOC project has been successfully migrated to match your hardware configuration, follow these steps to verify software functionality.
The ADC interrupt serves as the critical task for the FOC application, responsible for reading motor phase currents and executing the FOC algorithm. Users can set a breakpoint (or GPIO toggle) in FOC_ADC_ISR() to verify that the ADC interrupt trigger frequency aligns with the expected FOC loop frequency.
In IDLE state, ADC memory index registers are periodically updated with conversion results that reflect the hardware circuit's baseline conditions. These values establish proper reference readings prior to motor operation. For instance, applying 1.65V to the ADC phase current input channel yields an ADC memory index register value of approximately 2047.
Check the following configurations if the ADC interrupt is not triggered:
Add FOC_ISR_ADC1 macro if use ADC1 interrupt
Verify the proper PWM/Timer trigger event is set for ADC conversion
Verify one proper ADC interrupt trigger event is set for ADC module
Check the following configurations if the ADC interrupt occurs at an unexpected frequency:
Verify proper ADC trigger mode is set for each ADC memory index
Verify one proper ADC interrupt trigger event is set for ADC module
Sensorless/Universal FOC supports max 10kHz ADC interrupt and Sensored FOC supports max 16kHz ADC interrupt
Check the following configurations if the ADC conversion value is unexpected:
Verify motor phase A/B/C current input signal (to ADC channel) is correct
Verify the proper PWM/Timer trigger event is set for ADC conversion
The FOC application uses U/V/W to represent motor phases A/B/C respectively. Although there are no restrictions on maintaining the default relationships, users must ensure proper alignment between PWM outputs and phase current inputs.
For example, if your hardware circuit assigns:
FOC_PWMA0_U_IDX -> Motor Phase B
FOC_PWMA0_V_IDX -> Motor Phase A
Then you must configure the motor phase current accordingly:
Motor Phase B ADC Input Channel -> ADCx_CURRENT_U_CH
Motor Phase A ADC Input Channel -> ADCx_CURRENT_V_CH
This ensures the PWM-to-Current relationship remains consistent. If mistached, the current close loop function fails when running FOC application.
Follow the steps below to verify gate driver output:
Disconnect the motor
Use a scope to observe the three-phase PWM output
Configure the FOC application to run in Force Align Mode with PWM Loop (Section 7.7.1.1.1.2)
Set a non-zero value to FORCE_VQ_CURRENT_ LOOP_DIS or FORCE_VQ_CURRENT_ LOOP_DIS
Set a non-zero value to speedInput to start FOC statemachine
Validate that three-phase PWM outputs follow the SVPWM pattern (Figure 7-19)
Validate that the three PWM outputs follow the defined sequence with motor phases
Follow the steps below to verify motor phase current sensing circuit:
Connect the motor
Configure the DC voltage source output and set the current limit to an appropriate value, typically below the motor's rated current specification
Use a current probe to monitor one motor phase current and a voltage probe to monitor this motor phase current signal at the ADC input channel
Configure the FOC application to run in Force Align Mode with Current Loop (Section 7.7.1.1.1.1)
Set appropriate align time and align current parameters
Set a non-zero value to speedInput to start FOC statemachine
Validate that the motor phase current follows the Align Mode pattern (Figure 7-17)
Validate that the motor phase current amplitude match the align mode parameters
Check below configurations if the align current verification fails:
Check motor phase shunt resistance is proper for ADC sampling
Check the motor phase current signal at ADC input channel (scaled) match the current probe signal
Check Current Sensing Type and Current Sensing Method
Check ADC Channel Mapping with used shunt configurations
Check current loop PI parameters (See Section 7.3.2)
Follow the steps below to verify current control loop:
Validate the current sensing circuit works fine
Use a current probe to monitor one motor phase current and a voltage probe to monitor this motor phase current signal at the ADC input channel
Configure the FOC application to run in Force Open Loop (Section 7.7.1.2.2)
Set appropriate align mode parameters (typically set align current to 0h for unloaded motors)
Set proper open loop current and acceleration rate parameters (typically set open loop current to 0h for unloaded motors)
Set handoff threshold to 20-30% of motor rated speed
Configure current control loop parameters, recommend to start with auto calculated parameters (Section 7.3.2)
Set a non-zero value to speedInput to start FOC statemachine
Validate that the motor phase current follows the Open Loop Mode pattern (Figure 7-21) and is a clean sine wave
Validate that the motor phase current amplitude and frequency match the open loop parameters
Check the following configurations if the open loop verification fails:
Check the motor phase current signal at ADC input channel (scaled) match the current probe signal
Check current loop PI parameters (See Section 7.3.2)
Refer to Track Real-time Variable to monitor the ADC raw data and verify whether the raw ADC data matches a sine waveform.
Once hardware functionality is verified through these steps, refer to Tune the LVBLDC Motor to begin comprehensive motor tuning with all available features.