主要内容

mcb.PMSMCharacteristics

Compute and plot PMSM drive characteristics and constraint curves

Since R2022b

    Description

    characteristics = mcb.PMSMCharacteristics(pmsm,inverter) computes and plots drive characteristics and constraint curves for a permanent magnet synchronous motor (PMSM) with parameters pmsm and inverter with parameters inverter.

    characteristics = mcb.PMSMCharacteristics(pmsm,inverter,Name=Value) specifies options using one or more name-value arguments. For example, to plot drive characteristics in addition to constraint curves, set driveCharacteristics to 1.

    The function plots the current limit curve, constant torque curve, MTPA curve, voltage limit curve, and MTPV curve in current and voltage space. When enabled, the function also plots torque-speed, power-speed, current-speed, and peak current-speed drive characteristics. For details, see PMSM Constraint Curves and Their Application and PMSM Drive Characteristics and Constraint Curves.

    example

    Examples

    collapse all

    Get parameters for your motor and inverter. This example uses a BLY171D PMSM and DRV8312-C2-KIT inverter.

    pmsm = mcb.getPMSMParameters("BLY171D");
    inverter = mcb.getInverterParameters("DRV8312-C2-KIT");

    Plot constraint curves and characteristic curves and assign the data to a variable.

    characteristics = mcb.PMSMCharacteristics(pmsm,inverter,driveCharacteristics=1)
    characteristics = 
    
      struct with fields:
    
                current: [1×1 struct]
                 torque: [1×1 struct]
                   mtpa: [1×1 struct]
                voltage: [1×1 struct]
                   mtpv: [1×1 struct]
                idArray: [0 0 0 0 -0.0739 -0.1455 -0.2126 -0.2767 -0.3388 -0.3974 -0.4534 -0.5079 -0.5594 -0.6089 -0.6571 -0.7028 -0.7467 -0.7896 … ] (1×64 double)
                iqArray: [1.8000 1.8000 1.8000 1.8000 1.7985 1.7941 1.7874 1.7786 1.7678 1.7556 1.7420 1.7268 1.7109 1.6939 1.6758 1.6571 1.6378 1.6176 … ] (1×64 double)
                vdArray: [-7.9168e-04 -1.4234 -2.8469 -4.2695 -4.3736 -4.4696 -4.5555 -4.6336 -4.7055 -4.7695 -4.8274 -4.8803 -4.9269 -4.9684 -5.0057 … ] (1×64 double)
                vqArray: [1.3522 5.2947 9.2394 13.1819 13.1481 13.1157 13.0861 13.0587 13.0330 13.0097 12.9883 12.9685 12.9509 12.9350 12.9206 12.9081 … ] (1×64 double)
                 wArray: [1 1798 3596 5393 5459 5526 5592 5658 5725 5791 5857 5924 5990 6056 6123 6189 6255 6322 6388 6454 6521 6587 6653 6720 6786 … ] (1×64 double)
                 TArray: [0.0566 0.0566 0.0566 0.0566 0.0565 0.0564 0.0562 0.0559 0.0556 0.0552 0.0547 0.0543 0.0538 0.0532 0.0527 0.0521 0.0515 0.0508 … ] (1×64 double)
                 PArray: [0.0059 10.6507 21.3013 31.9460 32.3097 32.6268 32.8930 33.1175 33.3065 33.4574 33.5758 33.6653 33.7251 33.7585 33.7670 … ] (1×64 double)
                   pmsm: [1×1 struct]
               inverter: [1×1 struct]
              FWCMethod: 'vclmt'
        voltageEquation: 'actual'
        speed_milestone: [2×1 double]
           id_milestone: [0 -1.7631]
           iq_milestone: [1.8000 0.3624]
    

    PMSM constraint curves using VCLMT and actual voltage equations

    PMSM torque-speed, power-speed, and current speed characteristics

    Input Arguments

    collapse all

    PMSM parameters, specified as a struct.

    Specify lumped linear parameters with the following required fields:

    • Ldd-axis stator winding inductance (in henries), specified as a scalar

    • Lqq-axis stator winding inductance (in henries), specified as a scalar

    • FluxPM — Permanent magnet flux linkage (in webers), specified as a scalar

    • p — Number of pole pairs, specified as a scalar

    • Rs — Stator resistance (in ohms), specified as a scalar

    • B — Viscous damping coefficient (in kg-m2/ sec), specified as a scalar

    • I_rated — Rated current (in amperes), specified as a scalar

    You can create a structure with lumped linear parameters using mcb.getPMSMParameters.

    Alternatively, specify nonlinear lookup table data with the following required fields:

    • PMSMLUT.idvecd-axis current breakpoints (in amperes) of lookup tables, specified as a vector

    • PMSMLUT.iqvecq-axis current breakpoints (in amperes) of lookup tables, specified as a vector

    • PMSMLUT.LdTabled-axis inductance (in henries) lookup table, specified as matrix

    • PMSMLUT.LqTableq-axis inductance (in henries) lookup table, specified as a matrix

    • PMSMLUT.FluxPMTable — Permanent magnet flux linkage (in weber) lookup table, specified as a matrix

    or the following required fields:

    • PMSMLUT.idvecd-axis current breakpoints (in amperes) of lookup tables, specified as a vector

    • PMSMLUT.iqvecq-axis current breakpoints (in amperes) of lookup tables, specified as a vector

    • PMSMLUT.FluxDTabled-axis flux linkage lookup table, specified as a matrix

    • PMSMLUT.FluxQTableq-axis flux linkage lookup table, specified as a matrix

    Whether you specify lumped parameters or lookup tables, the structure can also contain the following optional fields:

    • model — Manufacturer's model number, specified as a character vector

    • sn — Manufacturer's serial number, specified as a character vector

    • J — Motor inertia coefficient (in kg-m2), specified as a scalar

    • Ke — Back EMF constant (in volts/krpm), specified as a scalar

    • Kt — Torque constant (in Nm/amperes), specified as a scalar

    • N_max — Maximum rotor speed (in rpm), specified as a scalar

    • PositionOffset — Rotor position offset (in PU), specified as a scalar

    • QEPSlits — Number of quadrature encoder pulse (QEP) slits, specified as a scalar

    • T_rated — Rated torque (in Nm), specified as a scalar

    Data Types: struct

    Inverter parameters, specified as a struct. You can create this structure using mcb.getInverterParameters. Specify the structure with the following required field:

    • V_dc — DC voltage

    The structure can also contain the following optional fields:

    • model — Manufacturer's model number, specified as a character vector

    • sn — Manufacturer's serial number, specified as a character vector

    • I_trip — Maximum permissible inverter current (in amperes), specified as a scalar

    • Rds_on — On-state resistance of MOSFETs (in ohms), specified as a scalar

    • Rshunt — Shunt resistance for current sensing (in ohms), specified as a scalar

    • R_board — Per-phase board resistance seen by motor (in ohms), specified as a scalar

    • CtSensAOffset — ADC offset for phase A, specified as a scalar

    • CtSensBOffset — ADC offset for phase B, specified as a scalar

    • CtSensCOffset — ADC offset for phase C, specified as a scalar

    • CtSensOffsetMax — Maximum limit of automatically calibrated ADC offsets for current sensor, specified as a scalar

    • CtSensOffsetMin — Minimum limit of automatically calibrated ADC offsets for current sensor, specified as a scalar

    • ADCGain — ADC gain factor scaled by SPI, specified as a scalar

    • EnableLogic — Type of inverter, specified as one of the following:

      • 1 — Active-high enabled inverter

      • 0 — Active-low enabled inverter

    • invertingAmp — Convention for current entering motor, specified as one of the following:

      • 1 — Current entering motor sensed as positive by current sense amplifier

      • –1 — Current entering motor sensed as negative by current sense amplifier

    • ISenseVref — Reference voltage of current sensor circuit (in volts), specified as a scalar

    • ISenseVoltPerAmp — Current sensor voltage output per ampere of current (in V/A), specified as a scalar

    • ISenseMax — Maximum peak-neutral current that can be measured by current sensor (in amperes), specified as a scalar

    The following optional fields are not in the structure you create with mcb.getInverterParameters:

    • ADCOffsetCalibEnable — Auto-calibration setting for current sense ADCs, specified as one of the following:

      • 1 — Enable auto-calibration

      • 0 — Disable auto-calibration

    • SPI_Gain_Setting — SPI hex value encoding op-amp gain, specified as a scalar

    Data Types: struct

    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: mcb.PMSMCharacteristics(pmsm,inverter,driveCharacteristics=1)

    Voltage equations for calculating base speed, specified as a character vector or string. Specify one of the following:

    • "actual" — Use actual voltage equations.

    • "approximate" — Use approximate voltage equations.

    Example: mcb.PMSMCharacteristics(pmsm,inverter,voltageEquation="approximate") uses approximate voltage equations.

    Data Types: char | string

    Motor speed (in rpm), specified as a scalar. If you do not specify a motor speed, the function uses the maximum motor speed.

    Example: mcb.PMSMCharacteristics(pmsm,inverter,speed=5298) uses a motor speed of 5298 rpm.

    Data Types: double

    Load torque (in Nm), specified as a scalar. If you do not specify a load torque, the function uses zero torque.

    Example: mcb.PMSMCharacteristics(pmsm,inverter,torque=10) uses a load torque of 10 Nm.

    Data Types: double

    Option for plotting drive characteristics and constraint curves, specified as one of:

    • 0 — Do not plot drive characteristics. Plot constraint curves in current space.

    • 1 — Plot drive characteristics. Plot constraint curves in current space.

    • 2 — Plot drive characteristics. Plot constraint curves in current space and trajectory of operating points in voltage space.

    Example: mcb.PMSMCharacteristics(pmsm,inverter,driveCharacteristics=1) plots drive characteristics and plots constraint curves in current space.

    Option to plot constraint curves after computing characteristics, specified as a numeric or logical 1 (true) or 0 (false).

    Example: mcb.PMSMCharacteristics(pmsm,inverter,constraintCurves=0) disables plotting constraint curves.

    Field-weakening control method, specified as a character vector or string. Specify one of the following:

    • "vclmt" — Use voltage and current limited maximum torque (VCLMT) method.

    • "none" — Do not use field-weakening control.

    • "cvcp" — Use constant voltage constant power (CVCP) method.

    • "cccp" — Use constant current constant power (CCCP) method.

    Example: mcb.PMSMCharacteristics(pmsm,inverter,FWCMethod="cvcp") uses CVCP field-weakening method to compute characteristics.

    Data Types: char | string

    Opacity of the plotted curves. Specify a value greater than 0 and less than or equal to 1.

    Example: mcb.PMSMCharacteristics(pmsm,inverter,opacity=0.5) plots half-opaque curves.

    Data Types: double

    Maximum motor current (in amperes), specified as a scalar. If the specified value is greater than the rated current, the function also plots the torque-speed characteristics using the maximum current.

    Example: mcb.PMSMCharacteristics(pmsm,inverter,imax=10) specifies a maximum current of 10 amperes.

    Data Types: double

    External d- and q-axis currents (in amperes), specified as a matrix of dimensions N-by-2, where N is the number of current samples. The function plots the specified currents on top of the constraint curves in current space.

    Example: mcb.PMSMCharacteristics(pmsm,inverter,idqExternal=idqMat) plots external currents from the matrix idqMat.

    Data Types: double

    Output Arguments

    collapse all

    Raw data for PMSM characteristic curves, returned as a struct with the following fields:

    • currentd- and q-axis current coordinates (in amperes) of current limit curve, returned as a struct

    • torqued- and q-axis current coordinates (in amperes) of constant torque curve, returned as a struct

    • mtpad- and q-axis current coordinates (in amperes) of MTPA curve, returned as a struct

    • voltaged- and q-axis current coordinates (in amperes) of voltage limit curve, returned as a struct

    • mtpvd- and q-axis current coordinates (in amperes) of MTPV curve, returned as a struct

    • idArrayd-axis current values (in amperes) at which to compute constraint curves, returned as a vector

    • iqArrayq-axis current values (in amperes) at which to compute constraint curves, returned as a vector

    • vdArrayd-axis voltage values (in volts) at which to compute constraint curves, returned as a vector

    • vqArrayq-axis voltage values (in volts) at which to compute constraint curves, returned as a vector

    • wArray — Speed values (in rpm) at which to compute drive characteristics, returned as a vector

    • TArray — Torque values (in newton-meters) of drive characteristics, returned as a vector

    • PArray — Power values (in watts) of drive characteristics, returned as a vector

    • pmsm — PMSM parameters, returned as a struct

    • inverter — Inverter parameters, returned as a struct

    • FWCMethod — Field-weakening control method, returned as a character vector

    • voltageEquation — Voltage equation for calculating speed, returned as a character vector

    • speed_milestone — Milestone motor speed (in rpm), returned as a vector

    • id_milestone — Milestone d-axis current (in amperes), returned as a vector

    • iq_milestone — Milestone q-axis current (in amperes), returned as a vector

    Version History

    Introduced in R2022b

    expand all