mcb.getMotorControlAnalysis
Frequency-domain analysis plots for PI controller of field-oriented control
Description
mcb.getMotorControlAnalysis(
generates frequency-domain analysis plots for PI controllers used in field-oriented control
of a permanent magnet synchronous motor (PMSM).pmsm,inverter,PU_System,PI_params,Ts,Ts_speed)
The function plots the root locus curves, Bode diagram, current loop unit-step response, and pole-zero map for the system with the provided PI gains.
This function requires Control System Toolbox™.
Examples
Set the pulse-width modulation (PWM) switching frequency and sample times for your motor control system.
PWM_frequency = 20e3; T_pwm = 1/PWM_frequency; Ts = T_pwm; Ts_speed = 10*Ts;
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");
Get the per-unit base values for the PMSM and inverter.
PU_System = mcb.getPUSystemParameters(pmsm,inverter);
Get the PI controller gains for the PMSM in per-unit system.
PI_params = mcb.calcFOCGains(pmsm,Ts,Ts_speed,Base=PU_System);
Plot results of frequency domain analysis for the PMSM.
mcb.getMotorControlAnalysis(pmsm,inverter,PU_System,PI_params,Ts,Ts_speed)

Input Arguments
PMSM parameters, specified as a struct.
Specify lumped linear parameters with the following required fields:
Ld— d-axis stator winding inductance (in henries), specified as a scalarLq— q-axis stator winding inductance (in henries), specified as a scalarFluxPM— Permanent magnet flux linkage (in webers), specified as a scalarp— Number of pole pairs, specified as a scalarRs— Stator resistance (in ohms), specified as a scalarB— Viscous damping coefficient (in kg-m2/ sec), specified as a scalarI_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.idvec— d-axis current breakpoints (in amperes) of lookup tables, specified as a vectorPMSMLUT.iqvec— q-axis current breakpoints (in amperes) of lookup tables, specified as a vectorPMSMLUT.LdTable— d-axis inductance (in henries) lookup table, specified as matrixPMSMLUT.LqTable— q-axis inductance (in henries) lookup table, specified as a matrixPMSMLUT.FluxPMTable— Permanent magnet flux linkage (in weber) lookup table, specified as a matrix
or the following required fields:
PMSMLUT.idvec— d-axis current breakpoints (in amperes) of lookup tables, specified as a vectorPMSMLUT.iqvec— q-axis current breakpoints (in amperes) of lookup tables, specified as a vectorPMSMLUT.FluxDTable— d-axis flux linkage lookup table, specified as a matrixPMSMLUT.FluxQTable— q-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 vectorsn— Manufacturer's serial number, specified as a character vectorJ— Motor inertia coefficient (in kg-m2), specified as a scalarKe— Back EMF constant (in volts/krpm), specified as a scalarKt— Torque constant (in Nm/amperes), specified as a scalarN_max— Maximum rotor speed (in rpm), specified as a scalarPositionOffset— Rotor position offset (in PU), specified as a scalarQEPSlits— Number of quadrature encoder pulse (QEP) slits, specified as a scalarT_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 vectorsn— Manufacturer's serial number, specified as a character vectorI_trip— Maximum permissible inverter current (in amperes), specified as a scalarRds_on— On-state resistance of MOSFETs (in ohms), specified as a scalarRshunt— Shunt resistance for current sensing (in ohms), specified as a scalarR_board— Per-phase board resistance seen by motor (in ohms), specified as a scalarCtSensAOffset— ADC offset for phase A, specified as a scalarCtSensBOffset— ADC offset for phase B, specified as a scalarCtSensCOffset— ADC offset for phase C, specified as a scalarCtSensOffsetMax— Maximum limit of automatically calibrated ADC offsets for current sensor, specified as a scalarCtSensOffsetMin— Minimum limit of automatically calibrated ADC offsets for current sensor, specified as a scalarADCGain— ADC gain factor scaled by SPI, specified as a scalarEnableLogic— 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 scalarISenseVoltPerAmp— Current sensor voltage output per ampere of current (in V/A), specified as a scalarISenseMax— 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
Base values for per-unit system, specified as a struct. You can create this
structure using the mcb.getPUSystemParameters function. Specify the
structure with the following required fields:
V_base— Base voltage (in volts), specified as a scalarI_base— Base current (in amperes), specified as a scalarN_base— Base speed (in rpm), specified as a scalarP_base— Base power (in watts), specified as a scalarT_base— Base torque (in newton-meters), specified as a scalar
Data Types: struct
PI controller gains, specified as a struct. You can create this
struct using mcb.calcFOCGains. Specify the structure with the
following fields:
Ti_i— q-axis current controller integral time constant, specified as a doubleKp_i— q-axis current controller proportional gain, specified as a doubleKi_i— q-axis current controller integral gain, specified as a doubleTi_id— d-axis current controller integral time constant, specified as a doubleKp_id— d-axis current controller proportional gain, specified as a doubleKi_id— d-axis current controller integral gain, specified as a doubleTi_speed— Speed controller integral time constant, specified as a doubleKp_speed— Speed controller proportional gain, specified as a doubleKi_speed— Speed controller integral gain, specified as a double
Data Types: struct
Control system sample time (in seconds), specified as a scalar.
Data Types: double
Speed controller sample time (in seconds), specified as a scalar.
Data Types: double
Version History
Introduced in R2020aThe function mcb_getControlAnalysis is now named
mcb.getMotorControlAnalysis.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)