主要内容

mcb.generateMotorLUT

Generate lookup tables for motor parameters

Since R2022b

    Description

    outSt = mcb.generateMotorLUT(motor,inverter,purpose) returns lookup tables (LUTs) of parameters for a motor with parameters motor.

    Use the purpose argument to specify the type of lookup table.

    • "Star2Star" or "Star2Delta" — Generate lookup tables that you can use for FEM parameterized plant models for a permanent magnet synchronous motor (PMSM).

    • "idiqLUTs" or related options — Generate 2D reference current lookup tables i(T,w) or i(w,T) as a function of torque T and motor speed w.

    • "idiq3dLUTs" or related options — Generate 3D reference current lookup tables i(w,T,v) or i(T,w,v) as a function of torque T, motor speed w, and DC voltage v.

    For reference current lookup tables, input nonlinear lookup table parameters using the optional PMSMLUT field of the motor argument. Specify the lookup table generation method using the PMSMLUT.method field:

    • "lumped" — Use linear model with lumped parameters for Ld, Lq, and FluxPM.

    • "Ldq" — Use nonlinear model with Ld, Lq, and FluxPM LUTs.

    • "FluxDQ" — Use nonlinear model with d-axis and q-axis flux linkage LUTs.

    If you do not specify the PMSMLUT or PMSMLUT.method field, the function assumes linear lumped parameters.

    Use the generated lookup tables to characterize the linear or non-linear behavior of your motor. For instance, use reference current lookup tables as inputs to an LUT based PMSM Control Reference, LUT based ACIM Control Reference, or LUT based SynRM Control Reference block. For an example involving a PMSM, see Determine Nonlinear Behavior of PMSM Using Characterization Test Data.

    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");

    Generate lookup tables for a star-to-delta FEM PMSM plant model.

    mcb.generateMotorLUT(pmsm,inverter,"Star2Delta")
    ans = 
    
      struct with fields:
    
              idVec: [-1.8000 -0.9000 0 0.9000 1.8000]
              iqVec: [-1.8000 -0.9000 0 0.9000 1.8000]
             degVec: [0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30]
        windingType: 'star'
              fluxD: [5×5×16 double]
              fluxQ: [5×5×16 double]
               Torq: [5×5×16 double]
                 Rs: 0.7500

    Get lumped 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");

    Generate 2D reference current lookup tables, and draw their values in current space.

    mcb.generateMotorLUT(pmsm,inverter,"idiqLUTs",drawLUT=1)
    ans = 
    
      struct with fields:
    
        drawLUTonConstraintCurves: 0
                        FWCMethod: 'vclmt'
                        motorType: 'spmsm'
                          wrpmVec: [1 150 299 447 596 745 894 1042 1191 1340 1489 1637 1786 1935 2084 2232 2381 2530 2679 2827 2976 3125 3274 3423 3571 … ] (1×64 double)
                          trefVec: [-0.0566 -0.0509 -0.0453 -0.0396 -0.0339 -0.0283 -0.0226 -0.0170 -0.0113 -0.0057 0 0.0057 0.0113 0.0170 0.0226 … ] (1×21 double)
                          idTable: [21×64 double]
                          iqTable: [21×64 double]
                        idqformat: 'Tw'

    Get lumped parameters for your motor and inverter. This example uses a Teknic2310P PMSM and BoostXL-DRV8305 inverter.

    pmsm = mcb.getPMSMParameters("Teknic2310P");
    inverter = mcb.getInverterParameters("BoostXL-DRV8305");

    Populate the pmsm.PMSMLUT structure with inductance flux data from a nonlinear model.

    pmsm.PMSMLUT.method = "Ldq";
    pmsm.PMSMLUT.idVec = [-4,-2,0,2] * pmsm.I_rated;
    pmsm.PMSMLUT.iqVec = [-4,-2,0,2,4] * pmsm.I_rated;
    pmsm.PMSMLUT.LdTable = pmsm.Ld * ones(4,5);
    pmsm.PMSMLUT.LqTable = pmsm.Lq * ones(4,5);
    pmsm.PMSMLUT.FluxPMTable = pmsm.FluxPM * ones(4,5);

    Generate 2D reference current lookup tables, then draw their values in current space.

    mcb.generateMotorLUT(pmsm,inverter,"idiqLUTs",drawLUT=1)
    ans = 
    
      struct with fields:
    
             method: 'Ldq'
              idVec: [-28.4000 -14.2000 0 14.2000]
              iqVec: [-28.4000 -14.2000 0 14.2000 28.4000]
            LdTable: [4×5 double]
            LqTable: [4×5 double]
        FluxPMTable: [4×5 double]
          FWCMethod: 'vclmt'
          motorType: 'spmsm'
            wrpmVec: [1 105 208 312 415 519 622 726 829 933 1036 1140 1243 1347 1450 1554 1657 1761 1865 1968 2072 2175 2279 2382 2486 2589 2693 2796 2900 … ] (1×64 double)
            trefVec: [-0.2724 -0.2452 -0.2180 -0.1907 -0.1635 -0.1362 -0.1090 -0.0817 -0.0545 -0.0272 0 0.0272 0.0545 0.0817 0.1090 0.1362 0.1635 0.1907 … ] (1×21 double)
            idTable: [21×64 double]
            iqTable: [21×64 double]
          idqformat: 'Tw'

    Input Arguments

    collapse all

    Motor parameters, specified as a struct.

    To specify lumped linear parameters, set the PMSMLUT.method field to lumped or leave PMSMLUT.method unset. Specify 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

    To specify Ld, Lq, and FluxPM lookup tables from a nonlinear model, set PMSMLUT.method to Ldq. Specify 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

    To specify d-axis and q-axis flux linkage lookup tables from a nonlinear model, set PMSMLUT.method to FluxDQ. Specify 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

    Additionally, PMSMLUT can contain the following optional fields:

    • PMSMLUT.FWCMethod — Field-weakening control method, specified as a character vector. If you do not specify this field, the function assumes 'vclmt'.

    • PMSMLUT.trefVec — Reference torque values (in newton-meters), specified as a vector

    • PMSMLUT.trefPctVec — Reference torque values (as percentage of rated torque), specified as a vector

    • PMSMLUT.Tenvelope — Envelope of torque-speed characteristics, specified as a vector

    • PMSMLUT.TenvelopeNeg — Envelope of negative torque-speed characteristics, specified as a vector

    • PMSMLUT.vdcVec — DC voltage values (in volts) for variable voltage system, specified as a vector

    • PMSMLUT.wrpmVec — Speed values (in rpm) of lookup table, specified as a vector

    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

    Type of lookup tables to generate, specified as a character vector or string.

    Use this argument to specify whether to generate lookup tables for FEM plant models or for reference currents. For reference currents, this argument also determines whether to generate 2D lookup tables as a function of torque T and motor speed w, or 3D lookup tables as a function of T, w, and DC voltage v. Specify one of the following:

    • "Star2Star" — Generate lookup tables for use in star-to-star FEM parameterized PMSM plant models. The generated lookup tables contain the star-equivalent of motor parameters fluxD, fluxQ, Torq, and Rs.

    • "Star2Delta" — Generate lookup tables for use in star-to-delta FEM PMSM plant models. The generated lookup tables contain the delta-equivalent of motor parameters fluxD, fluxQ, Torq, and Rs.

    • "idiqLUTsinit" — Generate default d-axis and q-axis current lookup tables i(T,w) based on PMSM and inverter parameters.

    • "idiqLUTs" — Generate d-axis and q-axis current lookup tables i(T,w) based on PMSM and inverter parameters.

    • "idiqLUTsTw" — Same as "idiqLUTs".

    • "idiqLUTswT" — Generate d-axis and q-axis current lookup tables i(w,T) based on PMSM and inverter parameters.

    • "idiq3dLUTsinit" — Generate default d-axis and q-axis current lookup tables i(T,w,v) based on PMSM and inverter parameters.

    • "idiq3dLUTs" — Generate d-axis and q-axis current lookup tables i(T,w,v) based on PMSM and inverter parameters.

    • "idiq3dLUTsTwv" — Same as "idiq3dLUTs".

    • "idiq3dLUTswTv" — Generate d-axis and q-axis current lookup tables i(w,T,v) based on PMSM and inverter parameters.

    Data Types: char | 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: mcb.generateMotorLUT(pmsm,inverter,"idiqLUTs",useTorquePercent=1)

    Option to compute d-axis and q-axis lookup tables using the torque percentage grid, as defined in the optional field pmsm.PMSMLUT.trefPctVec.

    When you enable this option, you must provide the envelope of torque-speed characteristics using the field pmsm.PMSMLUT.Tenvelope, and the corresponding speed values in the field pmsm.PMSMLUT.wrpmVec.

    Example: mcb.generateMotorLUT(pmsm,inverter,'idiqLUTs',useTorquePercent=1) computes d-axis and q-axis current LUTs using the torque percentage grid.

    Option to plot the lookup table data. Specify one of the following:

    • 0 — Do not plot lookup table

    • 1 — Plot lookup table

    • 2 — Plot lookup table and torque and voltage limit contours

    • 6 — Plot lookup table and torque and voltage limit contours with rotated d-q axis reference current frame for synchronous reluctance motors or inductance motors.

    Example: mcb.generateMotorLUT(pmsm,inverter,'idiqLUTs',drawLUT=1) draws the values of the d- and q-axis current lookup tables.

    Option to show verbose output when generating the lookup tables, specified as a numeric or logical 1 (true) or 0 (false).

    Example: mcb.generateMotorLUT(pmsm,inverter,'idiqLUTs',verbose=1) enables verbose output.

    Option to show a progress bar when generating the lookup tables, specified as a numeric or logical 1 (true) or 0 (false).

    Example: mcb.generateMotorLUT(pmsm,inverter,'idiqLUTs',showProgress=0) disables the progress bar.

    Output Arguments

    collapse all

    Lookup table data, returned as a struct.

    If purpose is "Star2Star" or "Star2Delta", the structure contains the following fields:

    • idVecd-axis current breakpoints (in amperes) of lookup tables, returned as a vector

    • iqVecq-axis current breakpoints (in amperes) of lookup tables, returned as a vector

    • degVec — Position breakpoints (in degrees) of lookup tables, returned as a vector

    • windingType — Type of motor winding, returned as one of the following:

      • 'star' — Star winding

      • 'delta' — Delta winding

    • fluxDd-axis flux (in webers) lookup table, returned as a matrix

    • fluxQq-axis flux (in webers) lookup table, returned as a matrix

    • Torq — Torque (in newton-meters) lookup table, returned as a matrix

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

    If purpose is "idiqLUTs", "idiq3dLUTs", or related options, the structure contains the following possible fields:

    • method — Lookup table generation method

    • idVecd-axis current breakpoints (in amperes) of input lookup tables, returned as a vector

    • iqVecq-axis current breakpoints (in amperes) of input lookup tables, returned as a vector

    • LdTabled-axis inductance (in henries) input lookup tables, returned as a matrix

    • LqTableq-axis inductance (in henries) input lookup tables, returned as a matrix

    • FluxPMTable — Permanent magnet flux linkage (in webers) input lookup tables, returned as a matrix

    • FluxDTabled-axis flux (in webers) input lookup tables, returned as a matrix

    • FluxQTableq-axis flux (in webers) input lookup tables, returned as a matrix

    • vdcVec — DC voltage breakpoints (in volts) of output lookup tables, returned as a vector

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

    • motorType — Type of motor, returned as a character vector

    • wrpmVec — Motor speed breakpoints (in rpm) of output lookup tables, returned as a vector

    • trefVec — Reference torque breakpoints (in newton-meters) of output lookup tables, returned as a vector

    • idTabled-axis current (in amperes) lookup table, returned as a matrix

    • iqTableq-axis current (in amperes) lookup table, returned as a matrix

    • idqformat — Format of reference current lookup table, returned as one of the following, where T, w, and v are torque, motor speed, and DC voltage respectively:

      • 'Tw' — Lookup tables returned as i(T,w)

      • 'wT' — Lookup tables returned as i(w,T)

      • 'wTv' — Lookup tables returned as i(w,T,v)

      • 'Twv' — Lookup tables returned as i(T,w,v)

    If purpose is "idiqLUTsinit" or "idiq3dLUTsinit", the structure contains the following fields:

    • trefVec — Reference torques (in Nm), returned as a vector

    • trefPctVec — Reference torques (as percentage of rated torque), returned as a vector

    • Tenvelope — Envelope of torque-speed characteristics, returned as a vector

    • TenvelopeNeg — Envelope of negative torque-speed characteristics, returned as a vector

    • wrpmVec — Motor speed breakpoints (in rpm) of lookup tables, returned as a vector

    • idTabled-axis current (in amperes) lookup table, returned as a matrix

    • iqTableq-axis current (in amperes) lookup table, returned as a matrix

    Version History

    Introduced in R2022b

    expand all