Main Content

Calculate Optimal Current Lookup Tables for Motor

To calculate optimal current lookup tables for the motor, set up torque per ampere (TPA) as the target to maximize.

Note

If creating lookup tables as a function of motor torque, use Trq in place of TrqGrid, and use the lookup tables from Is and Iq in place of Is_Grid and Iq_Grid in these steps.

Create the function model TPA.

  1. In the CAGE Browser toolbar, use the New Function Model wizard to create the function TPA = TrqGrid/Is_TrqGrid.

    Function model wizard dialog

  2. In the CAGE Browser, verify that the function model has this description:

    • TPAId,n, TrqPercent

Create Lookup Tables from Model

Create tables that the Model-Based Calibration Toolbox™ optimizers uses to store the optimized parameters. For this example, the tables are:

  • d-axis current, Id, as a function of motor torque percent, TrqPercent, and motor speed, n

  • q-axis current, Iq, as a function of motor torque percent, TrqPercent, and motor speed, n

  1. In the CAGE Browser, click Lookup Tables and Tradeoff. In the Create Lookup Tables from Model dialog box, select Iq_TrqGrid. Click Next.

    Create lookup tables from model wizard

  2. In the Create Lookup Tables from Model dialog box:

    • Clear Use model operating points.

    • Set Normalizer to n_norm to select existing breakpoints for n.

    • Set Rows (Y) input to n.

    • Set Columns (X) input to TrqPercent.

    • Click Edit breakpoints to edit breakpoints for TrqPercent. Select Freeform Vector and enter [1 4:4:100].

    • Click Next.

    Create lookup tables from model wizard

  3. In the Create Lookup Tables from Model dialog box:

    • Select Id and Iq_TrqGrid.

    • Update the lookup table name for Iq_TrqGrid to Iq_Table.

    • Click Finish.

    Create lookup tables from model wizard

  4. In the CAGE Browser, examine the tables.

    Tradeoffs tree with gs_example selected

Run Optimization on TPA

For this example, run an optimization with these specifications:

  • Current magnitude, Is_TrqGrid, less than or equal to 615 A

  • Voltage magnitude Vs_TrqGrid, less than or equal to 222.8 V

  1. In the CAGE Browser, click Optimization.

    Optimization pane

  2. The Optimization Quick Start dialog box opens to guide you through the optimization setup. Click Next.

    Optimization Quick Start dialog box welcome page.

  3. In the Optimization Quick Start dialog box on the Objectives tab:

    • From the Model list, select TPA.

    • From the Goal list, select Maximize.

    The Variable Id is automatically selected to optimize. Click Next.

    Create optimization from model wizard

  4. In the Optimization Quick Start dialog box on the Constraints tab, add the optimization constraint for the current magnitude, Is_TrqGrid <= 615, and voltage magnitude, Vs_TrqGrid <= 222.8. Then, click Next.

    Create optimization from model wizard

  5. In the Optimization Quick Start dialog box on the Operating Points tab:

    • From the Operating points list select Breakpoints and Id_Table(n,TrqPercent).

    • Under Optimize operating points, select Point: optimize each operating point separately.

    Click Apply. Then, click Close.

    Create optimization from model dialog with operating points defined on the operating points tab.

  6. In the CAGE Browser, carefully verify the Objectives and Constraints.

    Objectives dialog with TPA and TBA_Boundary constraints selected

  7. In the CAGE Browser, click Run.

Fill Lookup Tables

The lookup tables automatically fill after the optimization runs.

Lookup table fill

  • Id_Table fills with Id.

  • Iq_Table fills with Iq_TrqGrid.

  1. Review the results for Id_Table. The results are similar to the results shown here.

    3D plot of Id versus TrqPercent and n

  2. Review the results for Iq_Table. The results are similar to the results shown here.

    3D plot of Iq versus TrqPercent and n

  3. Select File > Save Project. Save the gs_example.cag file to the work folder.