Impact-Site-Verification: dbe48ff9-4514-40fe-8cc0-70131430799e

Search This Blog

Calibrating Optimal IPMSM Control Using Model-Based Calibration


How to Calibrate Optimal IPM SM Control Using Model Based Calibration Toolbox


In this blog, we will explore the process of calibrating optimal IPM SM control using the Model Based Calibration Toolbox (MBC) in Matlab version 23b. We will focus on calibrating the speed-based lookup tables, which are an important component of this calibration process. By the end of this tutorial, you will have a good understanding of the workflow and steps involved in calibrating IPM SM control using the MBC toolbox.

Types of Lookup Tables

The first step in this calibration process is to understand the two types of lookup tables that we are trying to calibrate using the MBC toolbox. The first type is the speed-based tables, which take inputs such as absolute torque and motor speed. Alternatively, we can use percentage torque instead of absolute torque. Each table is calibrated based on a fixed DC bus voltage (VDC). If VDC is variable, we need to calibrate multiple pages of these lookup tables and the algorithm will interpolate between different bus voltage levels. The second type of lookup table is the maximum flux linkage-based lookup tables. In this type of algorithm, we first use VDC and speed to calculate the maximum allowed flux linkage, which becomes one of the inputs to the lookup tables. In this tutorial, we will focus on calibrating the speed-based lookup tables.

Getting Started

To get started, open Matlab and import the provided workflow example, which includes a 150 kilowatt pmsm characterization dataset. This dataset contains pmsm characterization data that has been dyno tested and arranged by columns. We will also provide a data pre-processing script, which is a Matlab live script. This script is required to pre-process the raw data, rearrange it by torque and speed operating points, and place it in a column format that is required by the MBC toolbox.

After generating the Excel data file, we will have everything we need to go through the model-based calibration workflow. The development team has provided an API script that invokes the MBC toolbox in the background. This script generates the final calibration tables using a single function called "calibrate pmsm". It is recommended to go through the entire MBC workflow first to understand each step and then come back to try the single point API function.

Importing Data and Creating Filters

Once the data pre-processing is complete, we can import the data into the MBC toolbox. To do this, go to the Apps Gallery and select "MBC Model Fitting". Import the PMsM_NBC data file into the MBC data editor. The first step is to create filters for voltage and current constraints. We add a voltage filter for the maximum modulation voltage and a current filter for the maximum current. By applying these filters, we can remove any data points that exceed these limits. We also add a margin to account for any variations in voltage and current. After creating the filters, we can check the summary section to see how many data points are left after filtering.

Fitting Models to the Data

Next, we need to fit models to the filtered data. In the fit models dialog, select the "Point by Point" model template. This template includes the necessary input and response variables for the speed-based lookup tables. Make sure to select the speed as the operating point input and the ID and torque as the local inputs. Also, ensure that the feed boundary model checkbox is selected. Click "OK" to proceed.

In the Define Operating Point Groupings page, set a tolerance for speed. This tolerance determines how closely two speed operating points need to be in order to be grouped together. In this example, the speed increments are precise at 250 RPM. However, if your speed information is not precise, you can adjust the tolerance accordingly. Click "OK" to proceed.

Once the model fitting process is complete, you can access the models in the model browser. Under the pmsm speed section, you will find IQ and vs models for each operating point. These models represent the calibration of the speed-based lookup tables.

Importing Models to Calibration Generation

To continue the calibration process, we need to import the fitted models into the Calibration Generation (CAGE) tool. Highlight the project in the CAGE browser and click "Generate Calibration". This will import the models into the CAGE browser. Now, you will see the IQ and vs models listed in the CAGE browser.

Optimizing Torque-Speed Envelope

The next step is to set up an optimization to find the torque-speed envelope for the IPM SM motor. We want to maximize the torque model under the constraints of current and voltage. In the optimization settings, select the maximum torque model and add the current and voltage constraints. Set the operating point as the breakpoints of the torque envelope, which are the speed values. Click "Run" to start the optimization process. Depending on your system's capabilities, this process can take a few minutes.

Once the optimization is complete, you can visualize the torque-speed envelope in the results. The green squares on the results curve indicate the operating points where the optimization converged. You can save the torque-speed envelope as a separate Matlab figure file for further analysis.

Creating Torque Grid and Optimizing ID and IQ Currents

Now that we have the torque-speed envelope, we can create a torque grid variable. This variable represents the percentage of maximum torque at every speed. To create the torque grid, go to the models section in the CAGE browser and create a new function model. Set the equation for the torque grid variable and assign the appropriate units. Once the torque grid variable is created, update the torque input for the IQ, is, and vs models to use the torque grid instead of the actual torque value.

With the torque grid variable in place, we can now optimize the ID and IQ currents. This optimization process aims to maximize the torque per ampere (TPA) under the constraints of current and voltage. By setting up the appropriate constraints and variables, we can find the optimal ID and IQ currents for each operating point. Once again, click "Run" to start the optimization process.

After the optimization is complete, you can check the results to see if all the operating points converged. The color-coded results indicate the success or failure of each operating point. You can adjust the tolerance for acceptance of violations if needed. Once the optimization is successful, you can fill the lookup tables with the optimization results.


In this tutorial, we explored the process of calibrating optimal IPM SM control using the Model Based Calibration Toolbox in Matlab. We went through the steps of importing data, creating filters, fitting models, optimizing the torque-speed envelope, and optimizing ID and IQ currents. By following this workflow, you can effectively calibrate the speed-based lookup tables and optimize the ID and IQ currents for your IPM SM motor. For more detailed information, you can refer to the technical article published on the MathWorks website.

Thank you for reading this tutorial!


No comments

Popular Posts