Motor Parameter Estimator
Estimate electrical and mechanical parameters of motor connected to control hardware
Since R2024b
Description
The Motor Parameter Estimator app enables you to interactively run parameter estimation tests on a motor connected to a control hardware. The app runs these tests to estimate the electrical and mechanical parameters of the motor.
The app estimates these motor parameters:
Phase resistance, Rs (ohms)
D-axis inductance, Ld (henries)
Q-axis inductance, Lq (henries)
Back-EMF constant, Ke (Vpk_LL/krpm, where Vpk_LL is the peak voltage line-to-line measurement)
Motor inertia, J (Kg.m^2)
Friction constant, B (N.m/rad/s)
Because the Motor Hardware Configurator app configures, tests, validates, and prepares your motor control hardware (controller and inverter boards along with motor) to run the parameter estimation algorithm, running Motor Hardware Configurator is a pre-requisite to using the Motor Parameter Estimator app.
When you use Motor Hardware Configurator to validate a board and motor preset or profile (that matches your hardware) and launch the Motor Parameter Estimator app, Motor Hardware Configurator transfers the presets or profiles for the validated board-motor pairs (or board-motor pairs that successfully passed all the board and motor tests) to Motor Parameter Estimator. For more details about using the Motor Hardware Configurator app, see Motor Hardware Configurator.
If you launch the Motor Parameter Estimator app without validating at least one board-motor pair, the app interface guides you to launch the Motor Hardware Configurator app first.
You can view the transferred board-motor presets or profiles using the Board and Motor fields available in the Hardware Selection section of the app toolstrip.
The app provides the following check-boxes in the Test section of the app toolstrip to enable you to select one or more parameter estimation algorithms (or tests) that you can execute on the connected hardware:
Rs Estimation — Select this checkbox to run tests for estimating Rs. These tests are identical to the ones used by the PMSM Rs Estimator block. For more details, see PMSM Rs Estimator.
Ld Estimation — Select this checkbox to run tests for estimating Ld. These tests are identical to the ones used by the Ld Estimator block. For more details, see Ld Estimator.
Lq Estimation — Select this checkbox to run tests for estimating Lq. These tests are identical to the ones used by the Lq Estimator block. For more details, see Lq Estimator.
Ke, J, and B Estimation — Select this checkbox to run tests for estimating Ke, J, and B. These tests are identical to the ones used by the PMSM Mechanical Parameter Estimator block. For more details, see PMSM Mechanical Parameter Estimator.
Note
The app uses the System Messages panel as well as pop-up dialogs to interactively guide you by providing debugging and troubleshooting instructions, error messages, warnings, and other status updates.
Open the Motor Parameter Estimator App
Simulink® Toolstrip: On the Apps tab, under the Control Systems group, click the Motor Parameter Estimator app icon to launch the app.
Examples
Save and Restore User Inputs for Estimation Algorithms
The Motor Parameter Estimator app enables you to provide inputs (also known as algorithm parameters) needed to run the algorithms for estimating the following parameters:
D-axis inductance (Ld)
Q-axis inductance (Lq)
Back-EMF constant (Ke), Motor inertia (J), and Friction constant (B)
Note
The algorithm for phase resistance (Rs) estimation does not require any inputs.
Click an algorithm available in the Algorithms panel to open a tab containing the associated algorithm parameters in the documents panel. For example the following figure shows the algorithm parameters needed for the Ke, J, and B Estimation test.
For each algorithm listed in the Algorithms panel, you can use the documents panel tab to change the associated algorithm parameters. You can also use the Reset button available in each tab to reset the parameters to their default values anytime.
These parameters are identical to the PMSM Parameter Estimation Configurator block parameters. For more information, see PMSM Parameter Estimation Configurator.
The app uses the algorithm parameters to run the selected parameter estimation tests on the Board and Motor that you select in the app toolstrip.
By default, the app uses a temporary storage to save the algorithm parameters and the test selection status (status of check-boxes in the Test section of the app toolstrip). However, any updates to these fields are lost when you close the app. To avoid such data losses, the app enables you to save the following data in a MAT file as well as use this file to restore the data in the app:
Default and modified values of the algorithm parameters for the preceding three algorithms.
Status of the check-boxes available in the Test section of the app toolstrip.
The app only saves one common instance of data. It does not associate the saved data with any board-motor pair. After you restore data from a MAT file, you can use the restored algorithm parameters to run tests on any board-motor pair.
The app does not save the transferred board-motor presets or profiles. If you close the app after saving the algorithm parameters and test selection data, you must use the Motor Hardware Configurator app to relaunch Motor Parameter Estimator for obtaining the validated board-motor presets or profiles.
The Ld estimation and Lq estimation algorithms uses Rs as input. If you select the Rs Estimation test (in the Test section of the app toolstrip), then the app automatically computes Rs and uses it to run the Ld estimation and Lq estimation tests.
If you clear the Rs Estimation checkbox, the app uses the Rs algorithm parameter available in the Ld Estimation and Lq Estimation tabs to run the tests.
Similarly, the Ke, J, and B estimation algorithm uses Rs and Ld as inputs. If you select the Rs Estimation and Ld Estimation tests (in the Test section of the app toolstrip), then the app automatically computes Rs and Ld values and uses them to run the Ke, J, and B estimation tests. If you clear the Rs Estimation and Ld Estimation check-boxes, the app uses the Rs and Ld algorithm parameters available in the Ke, J, and B Estimation tab to run the tests.
The following procedure shows how to save the algorithm parameter and test selection data to a MAT file as well as use the file to restore the data in the app.
Anytime while using the app, click Save > Save As (or the Save option) to launch the Select File to Write window.
Note
Before launching the Select File to Write window, the app automatically saves the all data in the temporary storage of the app. After you change an algorithm parameter, you must save them at least in the temporary storage of the app (by clicking the Save button) to run the parameter estimation tests. Even though saving the parameter changes to the MAT file is not necessary to run the tests, however it is recommended that you save them regularly to a MAT file.
Enter a name for the MAT file and save the file to a folder of your choice. You can also replace an existing MAT file.
After you save the data once, you can directly use the Save option to update the data to the last saved file.
To restore a saved data set, click the Open button in the app toolstrip to launch the Select File to Open window. Locate and select a MAT file containing the algorithm parameter and test selection data. Click Open to restore the saved data from the MAT file.
Restoring the data from a MAT file replaces the algorithm parameter and test selection information the app is currently using.
After you restore the data, clicking the Save option updates the data to the same MAT file that you used to restore the session. Use Save As option to save data to a different file.
Running Parameter Estimation Tests
The Motor Parameter Estimator app enables you to select and run one or more parameter estimation algorithms or tests. Use the check-boxes (available in the Test section of the app toolstrip) to select the tests that you want to run.
The app uses the algorithm parameter data available in the temporary storage to run the selected tests on the Board and Motor that you select in the app toolstrip.
The following procedure shows how to run one or more parameter estimation tests.
Ensure that you have used the Motor Hardware Configurator app to validate (or successfully complete all the board and motor tests without any faults, errors, or failures for) the board-motor pairs that you want to use with the Motor Parameter Estimator app.
After validating one or more board-motor pairs, launch the Motor Parameter Estimator app from within the Motor Hardware Configurator app to ensure transfer of the validated board-motor presets or profiles to Motor Parameter Estimator.
In the Hardware Selection section of the app toolstrip, select a Board and Motor that you want to use to run the parameter estimation algorithms.
In the Test section of the app toolstrip, select one or more tests that you want to run.
In the Algorithms panel, click each selected test to open the tabs containing the associated algorithm parameters in the documents panel.
Update the algorithm parameters (if required) in these tabs and click Save to at least save them in the temporary storage of app. Optionally, you can save them to an external MAT file.
Click the Estimate Parameters button in the Test section of the app toolstrip to deploy and start running the selected tests on the connected hardware.
Use the following panels to learn about the test status, faults, and the results:
Motor State — This panel indicates the real-time motor speed when the motor runs during the tests (the motor only runs during the execution of Ke, J, and B estimation tests).
Fault Status — This panel includes a Communication LED that turns red when the app detects a communication fault.
Results — This panel uses the Test Status field to indicate the current running status of the selected tests.
In addition, the panel indicates the test Status as well as the Result (or estimated value) of the following motor parameters:
Phase resistance, Rs (ohms)
D-axis inductance, Ld (henries)
Q-axis inductance, Lq (henries)
Back-EMF constant, Ke (Vpk_LL/krpm, where Vpk_LL is the peak voltage line-to-line measurement)
Motor inertia, J (Kg.m^2)
Friction constant, B (N.m/rad/s)
The field Last completed on shows the date and time of the most recent test execution instance when all the selected tests completed successfully on the hardware.
Export Test Results
The Motor Parameter Estimator app enables you to export the following information available in the Results panel:
Test status of the selected parameter estimation tests.
Test status and estimated values of the electrical and mechanical parameters of the motor.
The app stores the test results in the temporary storage but discards them when you restart the tests. The export function enables you to save the results associated with an instance of executing the parameter estimation tests in a MAT file.
The following procedure shows how to export the test results:
After an instance of successful test execution (when all selected parameter estimation tests complete successfully), click Export button in the Export section of the app toolstrip to launch the Select File to Write window.
Enter a name for the MAT file and save the file to a folder of your choice. You can also replace an existing MAT file.
Note
You can save the results only when the most recent instance of executing the parameter estimation tests is successful (when all the selected tests completed successfully on hardware).
You cannot import the results data into the app.
Related Examples
- Estimate PMSM Parameters Using Recommended Hardware
- Estimate Induction Motor Parameters Using Recommended Hardware
- Estimate PMSM Parameters Using Custom Hardware
- Estimate Induction Motor Parameters Using Parameter Estimation Blocks
- Estimate PMSM Parameters Using Parameter Estimation Blocks
- Estimate PMSM Parameters Using Parameter Estimation Blocks on Real-Time Systems
- Estimate PMSM Parameters Using FPGA-Based Motor Control Development Kit
- Run-Time Parameter Estimation of PMSM Using Sensor Feedback
- Generate Motor Control Models for Selected Algorithm and Hardware
Version History
Introduced in R2024b