MSPM0 Sensored FOC Software User’s Guide¶
1. CCS Project setup¶
Go to Import CCS Projects as shown below.
Click Browse. Navigate to
C:\ti\mspm0_sdk_<SDK_Version>\examples\nortos\[LAUNCHPAD]\motor_control_pmsm_sensored_foc
.Click Select Folder. Check the desired hardware board, and click Finish to import the project into your workspace.

Register Overview¶
The Sensored FOC Library is structured to be interfaced through Specific Registers, the Registers will be periodically parsed by the application interface to convert to the Sensored FOC algorithm variables. This helps users to have a clear interface to the motor control software via external communication.
For using the Sensored FOC library the user need to use three registers namely UserCtrlRegs, UserInputRegs and UserStatusRegs. The Library exposes these registers through pointers.
The pointers for 3 registers:
pUserCtrlRegs
All the variables used for controlling the motor like speed input is present in this user controls structure
pUserInputRegs
All the configurations like different startup modes etc are present in the User input registers
pUserStatusRegs
Used for monitoring the algorithm status and algorithm variables
Configuring the Project¶
For running the motor we first need to configure the userInputRegs with the correct parameters.
There are 2 types of parameters present in the userInputRegs:
System parameters
This sets the motor parameters, and hardware defined parameters like Current base value, Voltage base value .etc. The system parameters are present in pUserInputRegs→systemParams.
Tuning parameters
All the other elements in the userInputRegs except systemParams are the tuning parameters. The tuning parameter helps to tune the motor to the desired performance. Refer to the Tuning Document Tuning Document for further details on tuning specific motor for application use case.
The Sensored FOC library initializes the input registers to a default value it is present in the setUserDefaultMotorParameters() function in ISR.c file. The default motor parameters are for LVSERVOMTR motor available at ti.com .
Refer to the Tuning Document for details on configurations.
Starting the Project¶
Connect the hardware and turn on the power supply. There should be no more than 50mA on the power supply.
Click on the Build button.
Project should build with no errors.
Click on the Debug button.
Open the Expressions window and add the following global structures pointers as below.

pUserCtrlRegs
pUserInputRegs
pUserStatusRegs
Press Play
to start the code.
Enable “Continuous Refresh” in the Expressions window.
Refer to the Tuning Document for spinning and tuning the motor.
2. API Guide¶
The Sensored FOC API guide provides a detailed description of files, variables, and APIs for the MSPM0 FOC motor control library
3. Supported Devices¶
DRV8316¶
Supported MSPM0 LaunchPads
Links
TIDA010251¶
Links
5. Tuning Documentation¶
For tuning the motor for running FOC application please refer to Hall SENSORED FOC Guide