mcb.getPIControllerParameters
Compute gains for PI controller in field-oriented control
mcb.getPIControllerParameters is not recommended for gain calculation
for a permanent magnetic synchronous motor (PMSM). Use mcb.calcFOCGains
instead. For more information, see Version History.
Syntax
Description
computes the PI controller gains PI_Params = mcb.getPIControllerParameters(motor,inverter,PU_System,T_pwm,Ts,Ts_speed)Kp and Ki for
field-oriented control of a motor with parameters motor.
computes PI controller gains with additional delay parameters in PI_Params = mcb.getPIControllerParameters(motor,inverter,PU_System,T_pwm,Ts,Ts_speed,Delays)Delays.
You can modify the default system responses by specifying the system delays, damping
factor, and symmetrical optimum factor using the optional Delays
argument. For more information about these parameters, see Damping Factor and Symmetric Optimum Factor.
If you do not specify Delays, the function automatically computes the
system delays, damping factor, and symmetrical optimum factor based on the other input
arguments.
Examples
Set the pulse-width modulation (PWM) switching frequency and sample times.
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 an EM_Synergy ACIM and DRV8312-C2-KIT inverter.
acim = mcb.getACIMParameters("EM_Synergy"); inverter = mcb.getInverterParameters("DRV8312-C2-KIT");
Specify the motor type and d and q axis inductances.
acim.motorType = "acim";
acim.Ld = acim.sigma*acim.Ls;
acim.Lq = acim.sigma*acim.Ls;Get the per-unit base values for the ACIM and inverter.
PU_System = mcb.getPUSystemParameters(acim,inverter);
Get PI controller gains for the ACIM in the per-unit system.
PI_params = mcb.getPIControllerParameters(acim,inverter,PU_System,T_pwm,Ts,Ts_speed)
PI_params =
struct with fields:
delay_IIR: 0.0200
Ti_i: 0.0019
Kp_i: 25.2078
Ki_i: 1.2940e+04
Kp_id: 25.2078
Ki_id: 1.2940e+04
Ti_speed: 0.0379
Kp_speed: 8.3175
Ki_speed: 219.6211
Ti_fwc: 0.0019
Kp_fwc: 0.0486
Ki_fwc: 24.9377Set the pulse-width modulation (PWM) switching frequency and sample times.
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 an EM_Synergy ACIM and DRV8312-C2-KIT inverter.
acim = mcb.getACIMParameters("EM_Synergy"); inverter = mcb.getInverterParameters("DRV8312-C2-KIT");
Specify the motor type and d and q axis inductances.
acim.motorType = "acim";
acim.Ld = acim.sigma*acim.Ls;
acim.Lq = acim.sigma*acim.Ls;Get the per-unit base values for the ACIM and inverter.
PU_System = mcb.getPUSystemParameters(acim,inverter);
Populate the Delays structure with sensor and controller delay
parameters.
% Sensor Delays Delays.Current_Sensor = 2*Ts; Delays.Speed_Sensor = Ts; Delays.Speed_Filter = 20e-3; % Controller Delays Delays.OM_damping_factor = 1/sqrt(2); Delays.SO_factor_speed = 1.5;
Get PI controller gains for the ACIM in the per-unit system with the specified delays.
PI_params = mcb.getPIControllerParameters(acim,inverter,PU_System,T_pwm,Ts,Ts_speed,Delays)
PI_params =
struct with fields:
delay_IIR: 0.0200
Ti_i: 0.0019
Kp_i: 12.6039
Ki_i: 6.4698e+03
Kp_id: 12.6039
Ki_id: 6.4698e+03
Ti_speed: 0.0614
Kp_speed: 6.4103
Ki_speed: 104.3591
Ti_fwc: 0.0019
Kp_fwc: 0.0486
Ki_fwc: 24.9377Input Arguments
Motor 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 doubleLq— q-axis stator winding inductance (in henries), specified as a doubleFluxPM— Permanent magnet flux (in webers), specified as a doublep— Number of pole pairs, specified as an integerRs— Stator resistance (in ohms), specified as a double
You can create a structure with lumped linear parameters using mcb.getPMSMParameters or mcb.getACIMParameters.
Alternatively, for PMSM topologies, specify non-linear 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 webers) 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
The structure can also contain the following optional field:
motorType— Type of motor, specified as one of the following:'ipmsm'— Interior PMSM'spmsm'— Surface PMSM'synrm'— SynRM'pmasynrm'— PMa-SynRM'acim'— ACIM
If you do not specify the motorType field, the function assumes an
interior PMSM.
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
PWM switching time period (in seconds), specified as a scalar.
Data Types: double
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
Sensor and controller delay parameters, specified as a struct
with the following fields:
Current_Sensor— Current sensor delay (in seconds), specified as a scalarSpeed_Sensor— Speed sensor delay (in seconds), specified as a scalarSpeed_Filter— Speed filter delay (in seconds), specified as a scalarOM_damping_factor— Damping factor for current control loop, specified as a scalarSO_factor_speed— Symmetrical optimum factor, specified as a scalar in the range (1,20)
For more information about these parameters, see Damping Factor and Symmetric Optimum Factor.
Data Types: struct
Output Arguments
PI controller gains, returned as a struct with the following fields:
Ti_i— q-axis current controller integral time constant (in seconds), returned as a scalarKp_i— q-axis current controller proportional gain, returned as a scalarKi_i— q-axis current controller integral gain, returned as a scalarTi_id— d-axis current controller integral time constant (in seconds), returned as a scalarKp_id— d-axis current controller proportional gain, returned as a scalarKi_id— d-axis current controller integral gain, returned as a scalarTi_speed— Speed controller integral time constant (in seconds), returned as a scalarKp_speed— Speed controller proportional gain, returned as a scalarKi_speed— Speed controller integral gain, returned as a scalarTi_fwc— Field-weakening controller integral time constant (in seconds), returned as a scalarKp_fwc— Field-weakening controller proportional gain, returned as a scalarKi_fwc— Field-weakening controller integral gain, returned as a scalar
More About
Damping factor (ζ) defines the dynamic behavior of the standard form
of a second-order system, where 0 < ζ <
1 [1]. An underdamped system gets close to the final value more quickly
than a critically damped or an overdamped system. Among the systems that respond without
oscillations, a critically damped system shows the quickest response. An overdamped system
is always slow in responding to any inputs. This parameter has a default value of .
Symmetrical optimum factor (a) defines the placement of the
cross-over frequency at the geometric mean of the two corner frequencies, to obtain maximum
phase margin that results in optimum damping of the speed loop, where a >
1 (see [2]). This parameter has a default value of
1.2.
References
[1] Ogata, Katsuhiko. Modern Control Engineering. 5th ed. Instrumentation and Control Series. Prentice-Hall, 2010.
[2] Leonhard, Werner. Control of Electrical Drives. Power Systems. Springer Berlin Heidelberg, 2001: 86. https://doi.org/10.1007/978-3-642-56649-3.
Version History
Introduced in R2020aThe function mcb_SetControllerParameters is now named
mcb.getPIControllerParameters.
mcb.getPIControllerParameters is not recommended for computing PI
controller gains for a PMSM. Use mcb.calcFOCGains
instead.
Using mcb.calcFOCGains enables you to:
Specify delays for individual delay elements in each PI controller loop for more optimal gain calculation.
Compute open-loop and closed-loop transfer functions for extended analysis.
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.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- 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)