主要内容

Prepare Motor Data for Modeling

To model the motor data, use the MBC Model Fitting app to import, filter, and fit the data with a point-by-point model. For this example, the data file PMSM_MBCData.xlsx contains a large dataset. You can use a design of experiment (DOE) to limit the data. However, the data set represents typical FEA analysis results.

Since a simple relationship exists between the d- and q-axis currents for fixed torque-speed operating points, the point-by-point model provides an accurate fit.

For comparison, the PMSM maximum efficiency calibration case study contains the model fit.

Case studies list with PMSM maximum efficiency calibration selected

Import Data

For this example, PMSM_MBCData.xlsx contains this motor controller data:

  • Total flux, Ψtotal, in Wb

  • Allowed flux, Ψmax, in Wb

  • d-axis current, Id, in A

  • q-axis current, Iq, in A

  • Current magnitude, Is, in A

  • Voltage magnitude, Vs, in V

  • Motor torque, Te, in N·m

  • Motor speed, n, in rpm

  1. In MATLAB®, on the Apps tab, in the Automotive group, click MBC Model Fitting.

  2. In the Model Browser home page, click Import Data.

  3. Select Use data to fit a separate model for each operating point, then click OK to open a data source file.

    Import data fitting a separate model for each operating point

  4. Navigate to the matlab\toolbox\mbc\mbctraining folder. Open the data file PMSM_MBCData.xlsx. The Define Operating Point Groups dialog box and the Data Editor open with your data.

Define Operating Point Groupings

For point-by-point models, you need to define operating point groups. For this example, define groups for motor speed. Set the tolerances so that Model-Based Calibration Toolbox™ groups small variations in speed at the same operating point.

  1. Define an operating point group using speed, n.

  2. Set the motor speed tolerance, n, to 90.000.

    Define Operating Point Groupings dialog box

Filter Data

You can filter data to exclude records from the model fit. For this example, set up a filter to include only current and voltage magnitudes that are less than a specified threshold:

  • Current magnitude, Is, less than or equal to 1.2*615 A

  • Current voltage, Vs, less than or equal to 1.2*222.8 V

The filters keep data 20% above the maximum current and voltage to ensure the models provide an accurate fit at these limits.

  1. In the Data Editor, select Tools > Filters to open the Filter Editor. Create these filters:

    • Is <= 1.2*615

    • Vs <= 1.2*222.8

    Alternatively, you can navigate to the Filters tab, right-click in the window, and click Add to open the Filter Editor dialog box.

    Interface displaying optimization data. Left panel lists operating points with columns for number, record, and n values. Top center shows filter expressions and results. Middle section contains a 2D data plot with blue points forming curves. Right panel shows a data table with columns Id, Iq, and Is containing numeric values.

  2. In the Data Editor, select File > Save & Close. Accept the changes to the data.