メインコンテンツ

generateMotorDriveROM

Generate reduced-order model of motor drive subsystem

Since R2024a

Description

The generateMotorDriveROM function takes a motor drive subsystem and creates a reduced-order model (ROM) in the form of a Motor & Drive (System Level) block and parameterizes it with tabulated maximum torque in function of rotor speed and DC voltage, and tabulated power dissipated in function of rotor speed, shaft torque, and DC voltage.

The model-order reduction transforms a high-fidelity, computationally expensive model into an equivalent model that is easier to interpret and runs faster. This model is called a reduced-order model. A ROM captures the steady-state behavior of a motor drive in terms of energy balance and maximum torque capability. A ROM can also accurately capture the first-order response to changes in torque demand.

You can use the ROM to run faster simulations, by replacing the original motor drive subsystem with the generated ROM subsystem. ROMs enable you to quickly test and analyze system-level scenarios where the motor drive interacts with other systems.

generateMotorDriveROM(sys) generates an equivalent energy-based model from the electric motor drive subsystem sys.

example

generateMotorDriveROM(sys,Name=Value) specifies options using one or more name-value arguments in addition to the input argument in previous syntaxes. For example, for a nominal DC supply voltage equal to 500 V, set NominalDCVoltage to 500.

ROMParameters = generateMotorDriveROM(sys,Name=Value) returns a structure that contains the torque time constant and the lookup tables for the torque envelope and loss maps.

Examples

collapse all

This example shows how to generate the reduced order model (ROM) of a PMSM motor drive subsystem.

Open Model

Open the PMSMMotorDrive.slx model.

open_system("PMSMMotorDrive")

The PMSMDrive subsystem comprises a detailed motor drive model with a converter, a motor, sensors, and a torque control loop. This motor drive has a nominal DC voltage of 486 V, a maximum shaft speed of 4000 RPM, and a rated torque of 90 Nm.

Ensure that the subsystem has the correct port names and port types. The subsystem must follow these rules:

  • The ports of the subsystem must match the ports of the Motor & Drive (System Level) block: +, -, R, C, and a Simulink input port for the torque reference, in Nm.

  • The subsystem must be able to follow the torque reference dynamically for all torque values below the maximum torque you designed the drive for.

  • The initial state must be such that the torque is zero.

Generate ROM

Run the generateMotorDriveROM function to generate the ROM of the PMSMDrive subsystem and set these options:

  • The drive operates as a motor (positive speed, positive torque).

  • Based on the motor drive specifications, the nominal DC voltage is 486 V, the maximum speed is 4000 rpm, and the nominal torque is 90 Nm.

  • For a good balance between ROM accuracy and computational cost to generate the ROM, choose a grid of 12 speed breakpoints, 40 torque breakpoints, and three DC voltage breakpoints. Set the DC voltage breakpoints to 80%, 90%, and 100% of the nominal voltage. If you require more accuracy, reduce the ROM interpolation error by increasing the number of breakpoints to specify a grid with higher resolution. However, a higher number of breakpoints increases the computational cost to generate the ROM.

  • To run simulations in parallel, if a parallel pool is available or if MATLAB® can automatically create one, set UseParallel to "auto".

generateMotorDriveROM("PMSMMotorDrive/PMSMDrive", ...
    OperatingMode="motor", ...
    NominalDCVoltage=486, ...
    MaxRotorRPM=4000, ...
    NominalTorque=90, ...
    NumRPMBreakpoints=12, ...
    NumTorqueBreakpoints=40, ...
    PerUnitDCVoltageBreakpoints=[0.8, 0.9, 1.0], ...
    UseParallel="auto");
Starting parallel pool (parpool) using the 'Processes' profile ...
15-May-2025 17:06:36: Job Queued. Waiting for parallel pool job with ID 1 to start ...
15-May-2025 17:07:37: Job Running. Waiting for parallel pool workers to connect ...
Connected to parallel pool with 4 workers.
Using:
  NominalDCVoltage = 486
  MaxRotorRPM = 4000
  NominalTorque = 90
Auto-selected nominal operating conditions:
  DCV = 486
  RPM = 400
  TrNm = 90
Validating harness initialization at nominal operating conditions ...
Harness initialization validated successfully.
Calculating torque time constant at nominal operating conditions ...
	Running iteration #1 : StopTime = 0.01
	Running iteration #2 : StopTime = 0.03
	Running iteration #3 : StopTime = 0.06
	Running iteration #4 : StopTime = 0.12
Estimated torque time constant = 0.0017344 seconds.

Figure contains an axes object. The axes object with title Simulation Results for Torque Time Constant Calculation DCV = 486 RPM = 400, xlabel Time [s], ylabel Torque [N*m] contains 3 objects of type line. These objects represent reference, response, fitted response (ROM).

Finding maximum torque at zero speed ...
	Running iteration #1 : StopTime = 0.036016, MaxTrqNmSearch = 180
	Running iteration #2 : StopTime = 0.036016, MaxTrqNmSearch = 360
Found an acceptable torque search range = 540 N*m.
Running simulations with constant speed and voltage, and ramp in reference torque ...
  RPMBkpts = [0 363.636363636364 727.272727272727 1090.90909090909 1454.54545454545 1818.18181818182 2181.81818181818 2545.45454545455 2909.09090909091 3272.72727272727 3636.36363636364 4000]
  DCVBkpts = [388.8;437.4;486]
Each simulation ramps the reference torque from 0 to 540 N*m.
[15-May-2025 17:11:48] Checking for availability of parallel pool...
[15-May-2025 17:11:53] Starting Simulink on parallel workers...
[15-May-2025 17:14:31] Configuring simulation cache folder on parallel workers...
[15-May-2025 17:14:36] Loading model on parallel workers...
[15-May-2025 17:15:37] Running simulations...
[15-May-2025 17:24:40] Cleaning up parallel workers...

Figure untitled/MotorDriveROM/Motor & Drive (System Level) efficiency contour plot contains an axes object and another object of type uigridlayout. The axes object with title Overall Electrical Efficiency of Motor Drive (%), xlabel Speed (rpm), ylabel Electrical Torque (N*m) contains 6 objects of type contour, line. One or more of the lines displays its values using only markers These objects represent Table breakpoints, Maximum torque curve.

Validation scenario: step + ramp torque reference.

Running original and ROM simulations in validation scenario ...
	Original system compile-time in validation scenario: 32.175 seconds.
	ROM system compile-time in validation scenario: 18.7306 seconds.
	Compile-time speedup factor in validation scenario: x1.7178.

	Original system run-time in validation scenario: 30.8043 seconds.
	ROM system run-time in validation scenario: 0.89913 seconds.
	Run-time speedup factor in validation scenario: x34.2601.

Calculating power loss summary to compare original and ROM in validation scenario ...
	Original sys power loss summary:
                                        LoggingNode                                        Power 
    ___________________________________________________________________________________    ______

    "PMSMDrive.PMSM"                                                                       952.25
    "PMSMDrive.Three_Phase_Inverter.Average_Value_Voltage_Source_Converter_Three_Phase"    314.29

	ROM power loss summary:
                  LoggingNode                   Power
    ________________________________________    _____

    "MotorDriveROM.Motor_Drive_System_Level"    1258 


Generating plot to compare original and ROM in validation scenario ...

Figure contains 3 axes objects. Axes object 1 with title Original and ROM simulation results for: DCV = 486 RPM ramp from 0 to 400, xlabel time [s], ylabel Electrical torque [N*m] contains 3 objects of type line. These objects represent reference, original, ROM. Axes object 2 with xlabel time [s], ylabel DC supply current [A] contains 2 objects of type line. These objects represent original, ROM. Axes object 3 with xlabel time [s], ylabel Rotor RPM contains 2 objects of type line. These objects represent original, ROM.

ROM generation complete.

Input Arguments

collapse all

Block path to the motor drive subsystem from which the function generates the ROM, specified as a character vector or a string.

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: generateMotorDriveROM("model",NominalDCVoltage=48,NominalTorque=5,MaxRotorRPM=4500);

Option to specify the quadrants to explore in the torque-speed region, specified as:

  • "motor" — The function explores the first quadrant only where both the revolution per minute and the torque are greater than 0.

  • "generator" — The function explores the fourth quadrant only, where the revolution per minute is lower than zero and the torque is greater than zero.

  • "motor-generator" — The function explores the first and fourth quadrants, where the torque is greater than 0.

The function computes the missing quadrants by symmetry with the other quadrants. The third quadrant is symmetric with the first quadrant and the second quadrant is symmetric with the fourth quadrant.

Nominal DC supply voltage, in volts, specified as a nonnegative scalar. The values of the NominalDcVoltage and PerUnitDCVoltageBreakpoints arguments determine the voltage breakpoints, as defined by this equation:

DCVoltageBreakpoints = NominalDCVoltage*PerUnitDCVoltageBreakpoints

Maximum rotor speed to explore, in revolutions per minute (RPM), specified as a nonnegative scalar. The value of this argument determines the speed breakpoints.

Nominal torque reference, in Nm, specified as a nonnegative scalar. The function uses the value of this parameter to compute the torque time constant at 10% of the maximum speed.

Number of speed breakpoints for the lookup tables, specified as a positive scalar.

Number of torque breakpoints for the lookup tables, specified as a positive scalar.

DC supply voltage breakpoints, specified as a vector of positive per-unit values with respect to the NominalDCVoltage argument. The values of the NominalDcVoltage and PerUnitDCVoltageBreakpoints arguments determine the voltage breakpoints, as defined by this equation:

DCVoltageBreakpoints = NominalDCVoltage*PerUnitDCVoltageBreakpoints

Option to display the progress of the function and results, specified as either true or false. To display the results, you must set CreateModel to true.

Option to create a Simulink model that contains the ROM, specified as either true or false.

Option to perform computations in parallel using a parallel pool of workers, specified as one of these values:

  • "off" — Run in serial on the MATLAB® client.

  • "auto" — Use a parallel pool if one is open or if MATLAB can automatically create one. If a parallel pool is not available, run in serial on the MATLAB client.

  • "on" — Use a parallel pool if one is open or if MATLAB can automatically create one. If a parallel pool is not available, throw an error.

If you do not have a parallel pool open and automatic pool creation is enabled, MATLAB opens a pool using the default cluster profile. To use a parallel pool to run computations in MATLAB, you must have Parallel Computing Toolbox™. For more information, see Run MATLAB Functions with Automatic Parallel Support (Parallel Computing Toolbox).

Before R2026a: You can specify this argument as true or false only. The default value is false. To run computations in parallel, set this argument to true.

Output Arguments

collapse all

ROM parameters generated from the motor drive system, returned as a structure with these fields:

Torque time constant, in seconds, returned as a nonnegative scalar.

Lookup table for the torque envelope, returned as a structure.

Lookup table for the loss maps, returned as a structure.

Limitations

The generated ROM does not include high-order dynamics, including torque ripple and vibrations, or power switching dynamics. If your model must represent these high-order dynamic behaviors, do not replace the original system.

Algorithms

The generateMotorDriveROM function runs simulations to calculate the parameters that define the motor drive system ROM. The function follows these steps:

  • Compute the torque-tracking time constant — The function simulates a step response from 0 Nm to the nominal torque value specified by the NominalTorque argument and at the nominal DC supply voltage, specified in the NominalDCVoltage while keeping the rotor speed constant at 10% of the maximum speed. The function fits the response to a first-order response to compute the torque-tracking time constant.

  • Find the maximum torque at zero speed — The function simulates a ramp reference torque response with increasingly higher slopes until the motor drive is unable to keep up with the demand and detaches from the reference. The function uses the value of the NominalTorque argument as a first guess for this iterative search algorithm. This maximum torque value determines the torque breakpoints for the power losses lookup table.

  • Compute maximum torque-speed envelopes and power losses at the table lookup breakpoints — The function runs a simulation for each speed and voltage breakpoint. The simulation consists of a ramp reference torque response with a slowly increasing torque reference from 0 Nm to the maximum torque value.

Extended Capabilities

expand all

Version History

Introduced in R2024a

expand all