PVSystems.Control

Control elements for power converters

Information

Extends from Modelica.Icons.Package (Icon for standard packages).

Package Content

Name Description
PVSystems.Control.SwitchingPWM SwitchingPWM Generates a pulse width modulated (PWM) boolean fire signal
PVSystems.Control.SwitchingCPM SwitchingCPM Current Peak Mode modulator for switching models
PVSystems.Control.DeadTime DeadTime Introduces a dead time in complementary PWM firing signals
PVSystems.Control.CPM_CCM CPM_CCM Current Peak Mode modulator for averaged CCM models
PVSystems.Control.CPM CPM Current Peak Mode modulator for averaged models
PVSystems.Control.Park Park Park transformation
PVSystems.Control.InversePark InversePark Inverse Park transformation
PVSystems.Control.PLL PLL Phase-locked loop
PVSystems.Control.MPPTController MPPTController Maximum Power Point Tracking Controller
PVSystems.Control.Assemblies Assemblies Block assemblies useful in PV and power electronics
PVSystems.Control.Interfaces Interfaces Common interfaces for control blocks

PVSystems.Control.SwitchingPWM PVSystems.Control.SwitchingPWM

Generates a pulse width modulated (PWM) boolean fire signal

PVSystems.Control.SwitchingPWM

Information

Generate boolean firing signal from duty cycle input. Adapted from SignalPWM.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
RealdMax1Maximum duty cycle
RealdMin0Minimum duty cycle
Frequencyfs Switching frequency [Hz]
TimestartTime0Start time [s]

Connectors

TypeNameDescription
input RealInputvcControl voltage
output BooleanOutputc1Firing PWM signal

Modelica definition

block SwitchingPWM "Generates a pulse width modulated (PWM) boolean fire signal" extends Modelica.Blocks.Icons.Block; parameter Real dMax=1 "Maximum duty cycle"; parameter Real dMin=0 "Minimum duty cycle"; parameter Modelica.SIunits.Frequency fs "Switching frequency"; parameter Modelica.SIunits.Time startTime=0 "Start time"; Modelica.Blocks.Interfaces.RealInput vc "Control voltage"; Modelica.Blocks.Interfaces.BooleanOutput c1 "Firing PWM signal"; Modelica.Blocks.Nonlinear.Limiter limiter(uMax=dMax, uMin=dMin); Modelica.Blocks.Logical.Less greaterEqual; Modelica.Blocks.Sources.SawTooth sawtooth( final period=1/fs, final amplitude=1, final nperiod=-1, final offset=0, final startTime=startTime); equation connect(vc, limiter.u); connect(sawtooth.y, greaterEqual.u1); connect(limiter.y, greaterEqual.u2); connect(greaterEqual.y, c1); end SwitchingPWM;

PVSystems.Control.SwitchingCPM PVSystems.Control.SwitchingCPM

Current Peak Mode modulator for switching models

PVSystems.Control.SwitchingCPM

Information

Current-programmed mode (CPM), i.e. Peak Current Mode modulator switching model. Generates PWM signal based on sensed current signal vs and control current signal vc. Also outputs the artificial ramp signal.

Model taken from EM01 and EMA16.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
RealdMin0Minimum duty cycle
RealdMax1Maximum duty cycle
Frequencyfs Switching frequency [Hz]
TimestartTime0Time instant of first pulse [s]
VoltageVa Amplitude of artificial ramp [V]
VoltagevcMax Maximum control voltage [V]

Connectors

TypeNameDescription
input RealInputvcControl voltage
input RealInputvsSensed voltage
output BooleanOutputcBoolean firing signal
output RealOutputrampArtificial ramp signal

Modelica definition

block SwitchingCPM "Current Peak Mode modulator for switching models" extends Modelica.Blocks.Icons.Block; parameter Real dMin( final min=Modelica.Constants.small, final max=1) = 0 "Minimum duty cycle"; parameter Real dMax( final min=Modelica.Constants.small, final max=1) = 1 "Maximum duty cycle"; // TODO: assert dMax > dMin parameter Modelica.SIunits.Frequency fs(final min=Modelica.Constants.small) "Switching frequency"; parameter Modelica.SIunits.Time startTime(final min=0) = 0 "Time instant of first pulse"; parameter Modelica.SIunits.Voltage Va(final min=0) "Amplitude of artificial ramp"; parameter Modelica.SIunits.Voltage vcMax "Maximum control voltage"; Modelica.Blocks.Interfaces.RealInput vc "Control voltage"; Modelica.Blocks.Interfaces.RealInput vs "Sensed voltage"; Modelica.Blocks.Interfaces.BooleanOutput c "Boolean firing signal"; Modelica.Blocks.Interfaces.RealOutput ramp "Artificial ramp signal"; Modelica.Blocks.Logical.GreaterEqual greaterEqual; Modelica.Blocks.Logical.RSFlipFlop rSFlipFlop; Modelica.Blocks.Math.Add addVa; Modelica.Blocks.Sources.SawTooth artificialRamp( amplitude=Va, period=1/fs, nperiod=-1, offset=0, startTime=startTime); Modelica.Blocks.Nonlinear.Limiter vcLimiter(uMax=vcMax, uMin=0); Modelica.Blocks.Sources.BooleanPulse dMinLimiter( period=1/fs, startTime=startTime, width=100*dMin); Modelica.Blocks.Sources.BooleanPulse dMaxLimiter( period=1/fs, startTime=startTime + dMax/fs, width=100*(1 - dMax)); Modelica.Blocks.Logical.Or orBlock; equation connect(addVa.u1, vs); connect(artificialRamp.y, addVa.u2); connect(ramp, artificialRamp.y); connect(rSFlipFlop.QI, c); connect(addVa.y, greaterEqual.u1); connect(vc, vcLimiter.u); connect(vcLimiter.y, greaterEqual.u2); connect(dMinLimiter.y, rSFlipFlop.R); connect(greaterEqual.y, orBlock.u2); connect(orBlock.y, rSFlipFlop.S); connect(dMaxLimiter.y, orBlock.u1); end SwitchingCPM;

PVSystems.Control.DeadTime PVSystems.Control.DeadTime

Introduces a dead time in complementary PWM firing signals

PVSystems.Control.DeadTime

Information

Given an input boolean firing signal, output that signal and it's complement with deadTime seconds of dead time.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
TimedeadTime0Dead time [s]

Connectors

TypeNameDescription
input BooleanInputcPWM input
output BooleanOutputc1PWM output
output BooleanOutputc2PWM complement

Modelica definition

block DeadTime "Introduces a dead time in complementary PWM firing signals" extends Modelica.Blocks.Icons.Block; parameter Modelica.SIunits.Time deadTime=0 "Dead time"; Modelica.Blocks.Interfaces.BooleanInput c "PWM input"; Modelica.Blocks.Interfaces.BooleanOutput c1 "PWM output"; Modelica.Blocks.Interfaces.BooleanOutput c2 "PWM complement"; Modelica.Blocks.MathBoolean.OnDelay c1_onDelay(delayTime=deadTime); Modelica.Blocks.MathBoolean.OnDelay c2_onDelay(delayTime=deadTime); Modelica.Blocks.Logical.Not notBlock; equation connect(c1_onDelay.y, c1); connect(c2_onDelay.y, c2); connect(notBlock.y, c2_onDelay.u); connect(c, c1_onDelay.u); connect(c, notBlock.u); end DeadTime;

PVSystems.Control.CPM_CCM PVSystems.Control.CPM_CCM

Current Peak Mode modulator for averaged CCM models

PVSystems.Control.CPM_CCM

Information

Current-Programmed-Mode controller model. Computes duty ratio based on averaged inductor current, voltages applied to the inductor, and amplitude of the artificial ramp. This CPM controller model is valid only for CCM operation of the powerconverter. All parameters and inputs are referred to the primary side.

Limitation: does not include sampling effects or preditions of period-doubling instability.

Model taken from EM01 and EMA16.

Extends from Interfaces.CPMInterface (Common interface for averaged CPM block).

Parameters

TypeNameDefaultDescription
InductanceL Equivalent inductance, referred to primary [H]
Frequencyfs Switching frequency [Hz]
VoltageVa Amplitude of the artificial ramp, Va=Rf*ma/fs [V]
ResistanceRf Equivalent current-sense resistance [Ohm]
Reald_disabled Value of duty cycle when disabled [1]

Connectors

TypeNameDescription
input RealInputvcControl input, vc=Rf*ic
input RealInputvsSensed average inductor current vs=Rf*iL
input RealInputvm1Voltage across L in interval 1, slope m1=vm1/L
input RealInputvm2(-) Voltage across L in interval 2, slope m2=vm2/L
output RealOutputdDuty cycle
input BooleanInputenableBlock enable/disable

Modelica definition

model CPM_CCM "Current Peak Mode modulator for averaged CCM models" extends Interfaces.CPMInterface; parameter Real d_disabled(final unit="1") "Value of duty cycle when disabled"; Modelica.Blocks.Interfaces.BooleanInput enable "Block enable/disable"; equation if enable then d = 2*(vc - vs)/(Rf/L/fs*(vm1 + vm2)*(1 - d) + 2*Va); else d = d_disabled; end if; end CPM_CCM;

PVSystems.Control.CPM PVSystems.Control.CPM

Current Peak Mode modulator for averaged models

PVSystems.Control.CPM

Information

Current-Programmed-Mode controller model. Computes duty ratio based on averaged inductor current, voltages applied to the inductor, and amplitude of the artificial ramp. The CPM controller model is valid for CCM and DCM operation of the power converter. All parameters and inputs are referred to the primary side.

Limitation: does not include sampling effects or preditions of period-doubling instability.

Model taken from EM01 and EMA16.

Extends from Interfaces.CPMInterface (Common interface for averaged CPM block).

Parameters

TypeNameDefaultDescription
InductanceL Equivalent inductance, referred to primary [H]
Frequencyfs Switching frequency [Hz]
VoltageVa Amplitude of the artificial ramp, Va=Rf*ma/fs [V]
ResistanceRf Equivalent current-sense resistance [Ohm]

Connectors

TypeNameDescription
input RealInputvcControl input, vc=Rf*ic
input RealInputvsSensed average inductor current vs=Rf*iL
input RealInputvm1Voltage across L in interval 1, slope m1=vm1/L
input RealInputvm2(-) Voltage across L in interval 2, slope m2=vm2/L
output RealOutputdDuty cycle

Modelica definition

model CPM "Current Peak Mode modulator for averaged models" extends Interfaces.CPMInterface; protected Real d2; equation d2 = min(L*fs*(vc - Va*d)/Rf/vm2, 1 - d); d = 2*(vc*(d + d2) - vs)/(Rf/L/fs*(vm1 + vm2)*d2*(d + d2) + 2*Va*(d + d2)); end CPM;

PVSystems.Control.Park PVSystems.Control.Park

Park transformation

PVSystems.Control.Park

Information

Perform Park transformation. This transformation translates from the static reference frame (alfa-beta) to the synchronous reference frame (d-q).

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Connectors

TypeNameDescription
input RealInputalpha 
input RealInputbeta 
output RealOutputd 
output RealOutputq 
input RealInputtheta 

Modelica definition

block Park "Park transformation" extends Modelica.Blocks.Icons.Block; Modelica.Blocks.Interfaces.RealInput alpha; Modelica.Blocks.Interfaces.RealInput beta; Modelica.Blocks.Interfaces.RealOutput d; Modelica.Blocks.Interfaces.RealOutput q; Modelica.Blocks.Interfaces.RealInput theta; equation d = alpha*cos(theta) + beta*sin(theta); q = -alpha*sin(theta) + beta*cos(theta); end Park;

PVSystems.Control.InversePark PVSystems.Control.InversePark

Inverse Park transformation

PVSystems.Control.InversePark

Information

Perform inverse Park transformation. This transformation translates from the synchronous reference frame (d-q) to the static reference frame (alfa-beta).

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Connectors

TypeNameDescription
input RealInputd 
input RealInputq 
output RealOutputalpha 
output RealOutputbeta 
input RealInputtheta 

Modelica definition

block InversePark "Inverse Park transformation" extends Modelica.Blocks.Icons.Block; Modelica.Blocks.Interfaces.RealInput d; Modelica.Blocks.Interfaces.RealInput q; Modelica.Blocks.Interfaces.RealOutput alpha; Modelica.Blocks.Interfaces.RealOutput beta; Modelica.Blocks.Interfaces.RealInput theta; equation d = alpha*cos(theta) + beta*sin(theta); q = -alpha*sin(theta) + beta*cos(theta); end InversePark;

PVSystems.Control.PLL PVSystems.Control.PLL

Phase-locked loop

PVSystems.Control.PLL

Information

Phase-locked loop. Given a sinusoidal input, extract the phase.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
Frequencyfrequency50[Hz]

Connectors

TypeNameDescription
input RealInputv 
output RealOutputtheta 

Modelica definition

block PLL "Phase-locked loop" extends Modelica.Blocks.Icons.Block; parameter Modelica.SIunits.Frequency frequency=50; Modelica.Blocks.Continuous.Integrator integrator; Modelica.Blocks.Continuous.FirstOrder firstOrder(T=1e-3, k=100); Modelica.Blocks.Nonlinear.FixedDelay QuarterTDelay(delayTime=1/frequency/4); Modelica.Blocks.Interfaces.RealInput v; Modelica.Blocks.Interfaces.RealOutput theta; Park park; Modelica.Blocks.Math.Add add; Modelica.Blocks.Sources.Constant lineFreq(k=2*Modelica.Constants.pi*frequency); equation connect(v, park.alpha); connect(QuarterTDelay.y, park.beta); connect(QuarterTDelay.u, v); connect(integrator.y, theta); connect(park.theta, integrator.y); connect(add.y, integrator.u); connect(firstOrder.y, add.u2); connect(lineFreq.y, add.u1); connect(park.q, firstOrder.u); end PLL;

PVSystems.Control.MPPTController PVSystems.Control.MPPTController

Maximum Power Point Tracking Controller

PVSystems.Control.MPPTController

Information

Maximum power-point tracking controller. Given the DC voltage and current, this controller will output a moving reference for a DC voltage control loop in order to maximize the power extracted from a PV array for a given (unknown) solar irradiation and junction temperature.

The operation of the block can be customized by setting the following parameters:

Extends from Modelica.Blocks.Interfaces.SI2SO (2 Single Input / 1 Single Output continuous control block).

Parameters

TypeNameDefaultDescription
TimesampleTime1Sample time of control block [s]
VoltagevrefStep5Step of change for vref [V]
PowerpkThreshold1Power threshold below which no change is considered [W]
VoltagevrefStart10Voltage reference initial value [V]

Connectors

TypeNameDescription
input RealInputu1Connector of Real input signal 1
input RealInputu2Connector of Real input signal 2
output RealOutputyConnector of Real output signal

Modelica definition

block MPPTController "Maximum Power Point Tracking Controller" extends Modelica.Blocks.Interfaces.SI2SO; parameter Modelica.SIunits.Time sampleTime=1 "Sample time of control block"; parameter Modelica.SIunits.Voltage vrefStep=5 "Step of change for vref"; parameter Modelica.SIunits.Power pkThreshold=1 "Power threshold below which no change is considered"; parameter Modelica.SIunits.Voltage vrefStart=10 "Voltage reference initial value"; protected discrete Modelica.SIunits.Voltage vk; discrete Modelica.SIunits.Current ik; discrete Modelica.SIunits.Power pk; discrete Modelica.SIunits.Voltage vref(start=vrefStart); equation when sample(sampleTime, sampleTime) then vk = pre(u1); ik = pre(u2); pk = vk*ik; if abs(pk - pre(pk)) < pkThreshold then // power unchanged => don't change vref vref = pre(vref); elseif pk - pre(pk) > 0 then // power increased => repeat last action vref = pre(vref) + vrefStep*sign(vk - pre(vk)); else // power decreased => change last action vref = pre(vref) - vrefStep*sign(vk - pre(vk)); end if; end when; y = vref; end MPPTController;

Automatically generated Mon Sep 11 16:11:48 2017.