PVSystems.Control

Control elements for power converters

Information

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

Package Content

Name Description
PVSystems.Control.SignalPWM SignalPWM Generates a pulse width modulated (PWM) boolean fire signal
PVSystems.Control.Park Park Park transformation
PVSystems.Control.InversePark InversePark Inverse Park transformation
PVSystems.Control.PLL PLL Phase-locked loop
PVSystems.Control.ControllerMPPT ControllerMPPT Maximum Power Point Tracking Controller
PVSystems.Control.ControllerInverter1phCurrent ControllerInverter1phCurrent Simple synchronous reference frame PI current controller
PVSystems.Control.ControllerInverter1ph ControllerInverter1ph Complete synchronous reference frame inverter controller

PVSystems.Control.SignalPWM PVSystems.Control.SignalPWM

Generates a pulse width modulated (PWM) boolean fire signal

PVSystems.Control.SignalPWM

Information

This block provides the switching signal needed to drive the ideal switch models. It's input duty receives the desired duty cycle and the outputs fire and notFire provide the PWM and negated PWM signals.

Extends from Modelica.Blocks.Interfaces.BlockIcon (This icon will be removed in future Modelica versions, use Modelica.Blocks.Icons.Block instead.).

Parameters

TypeNameDefaultDescription
Timeperiod1Time for one period [s]

Connectors

TypeNameDescription
input RealInputduty 
output BooleanOutputfire 
output BooleanOutputnotFire 

Modelica definition

block SignalPWM "Generates a pulse width modulated (PWM) boolean fire signal" extends Modelica.Blocks.Interfaces.BlockIcon; // Parameters parameter Modelica.SIunits.Time period(final min=Modelica.Constants.small) = 1 "Time for one period"; // Interface Modelica.Blocks.Interfaces.RealInput duty; Modelica.Blocks.Interfaces.BooleanOutput fire; Modelica.Blocks.Interfaces.BooleanOutput notFire; // Elements Modelica.Blocks.Sources.SawTooth sawTooth(period=period); Modelica.Blocks.Logical.Less lessBlock; Modelica.Blocks.Logical.Not notBlock; equation connect(sawTooth.y, lessBlock.u1); connect(duty, lessBlock.u2); connect(lessBlock.y, fire); connect(notBlock.u, lessBlock.y); connect(notBlock.y, notFire); end SignalPWM;

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.Interfaces.BlockIcon (This icon will be removed in future Modelica versions, use Modelica.Blocks.Icons.Block instead.).

Connectors

TypeNameDescription
input RealInputalpha 
input RealInputbeta 
output RealOutputd 
output RealOutputq 
input RealInputtheta 

Modelica definition

block Park "Park transformation" extends Modelica.Blocks.Interfaces.BlockIcon; 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.Interfaces.BlockIcon (This icon will be removed in future Modelica versions, use Modelica.Blocks.Icons.Block instead.).

Connectors

TypeNameDescription
input RealInputd 
input RealInputq 
output RealOutputalpha 
output RealOutputbeta 
input RealInputtheta 

Modelica definition

block InversePark "Inverse Park transformation" extends Modelica.Blocks.Interfaces.BlockIcon; 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.Interfaces.BlockIcon (This icon will be removed in future Modelica versions, use Modelica.Blocks.Icons.Block instead.).

Parameters

TypeNameDefaultDescription
Frequencyfrequency50[Hz]

Connectors

TypeNameDescription
input RealInputv 
output RealOutputtheta 

Modelica definition

block PLL "Phase-locked loop" extends Modelica.Blocks.Interfaces.BlockIcon; 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.ControllerMPPT PVSystems.Control.ControllerMPPT

Maximum Power Point Tracking Controller

PVSystems.Control.ControllerMPPT

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]

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 ControllerMPPT "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"; protected Modelica.SIunits.Voltage vk; Modelica.SIunits.Current ik; Modelica.SIunits.Power pk; Modelica.SIunits.Voltage vref; equation when sample(0, sampleTime) then if initial() then vk = pre(u1); ik = pre(u2); pk = vk*ik; vref = 10; else 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 if; end when; y = vref; end ControllerMPPT;

PVSystems.Control.ControllerInverter1phCurrent PVSystems.Control.ControllerInverter1phCurrent

Simple synchronous reference frame PI current controller

PVSystems.Control.ControllerInverter1phCurrent

Information

Partial current controller for monophasic inverter. Currently under construction.

Extends from Modelica.Blocks.Interfaces.BlockIcon (This icon will be removed in future Modelica versions, use Modelica.Blocks.Icons.Block instead.), Modelica.Icons.UnderConstruction (Icon for classes that are still under construction).

Connectors

TypeNameDescription
input RealInputiSensed current
input RealInputidSetpointCurrent d component setpoint
input RealInputiqSetpointCurrent q component setpoint
input RealInputthetaSensed AC voltage phase
input RealInputudcSensed DC voltage
output RealOutputdDuty cycle output

Modelica definition

block ControllerInverter1phCurrent "Simple synchronous reference frame PI current controller" extends Modelica.Blocks.Interfaces.BlockIcon; extends Modelica.Icons.UnderConstruction; Park park; Modelica.Blocks.Nonlinear.FixedDelay fixedDelay(delayTime=1/50/4); Modelica.Blocks.Continuous.PI idPI(k=0.1, T=0.01); Modelica.Blocks.Math.Feedback idFB; Modelica.Blocks.Continuous.PI iqPI(k=0.1, T=0.01); Modelica.Blocks.Math.Feedback iqFB; InversePark inversePark; Modelica.Blocks.Sources.Constant dOffset(k=0.5); Modelica.Blocks.Interfaces.RealInput i "Sensed current"; Modelica.Blocks.Interfaces.RealInput idSetpoint "Current d component setpoint"; Modelica.Blocks.Interfaces.RealInput iqSetpoint "Current q component setpoint"; Modelica.Blocks.Interfaces.RealInput theta "Sensed AC voltage phase"; Modelica.Blocks.Interfaces.RealInput udc "Sensed DC voltage"; Modelica.Blocks.Interfaces.RealOutput d "Duty cycle output"; Modelica.Blocks.Math.Division division; Modelica.Blocks.Math.Add add; equation // Connections connect(park.beta, fixedDelay.y); connect(idFB.y, idPI.u); connect(park.d, idFB.u2); connect(iqFB.y, iqPI.u); connect(park.q, iqFB.u2); connect(iqPI.y, inversePark.q); connect(idPI.y, inversePark.d); connect(i, park.alpha); connect(i, fixedDelay.u); connect(idSetpoint, idFB.u1); connect(iqSetpoint, iqFB.u1); connect(inversePark.theta, theta); connect(park.theta, theta); connect(inversePark.alpha, division.u1); connect(udc, division.u2); connect(dOffset.y, add.u1); connect(division.y, add.u2); connect(add.y, d); end ControllerInverter1phCurrent;

PVSystems.Control.ControllerInverter1ph PVSystems.Control.ControllerInverter1ph

Complete synchronous reference frame inverter controller

PVSystems.Control.ControllerInverter1ph

Information

Complete controller for monophasic inverter. Currently under construction.

Extends from Modelica.Blocks.Interfaces.BlockIcon (This icon will be removed in future Modelica versions, use Modelica.Blocks.Icons.Block instead.), Modelica.Icons.UnderConstruction (Icon for classes that are still under construction).

Parameters

TypeNameDefaultDescription
Realik0.2Current PI gain
TimeiT0.02Current PI time constant [s]
Realvk0.2Voltage PI gain
TimevT0.02Voltage PI time constant [s]
Frequencyfline50Line frequency [Hz]

Connectors

TypeNameDescription
input RealInputiacAC current sense
input RealInputvacAC voltage sense
input RealInputidcDC current sense
input RealInputvdcDC voltage sense
output RealOutputdDuty cycle

Modelica definition

block ControllerInverter1ph "Complete synchronous reference frame inverter controller" extends Modelica.Blocks.Interfaces.BlockIcon; extends Modelica.Icons.UnderConstruction; // Parameters parameter Real ik=0.2 "Current PI gain"; parameter Modelica.SIunits.Time iT=0.02 "Current PI time constant"; parameter Real vk=0.2 "Voltage PI gain"; parameter Modelica.SIunits.Time vT=0.02 "Voltage PI time constant"; parameter Modelica.SIunits.Frequency fline=50 "Line frequency"; // Interface Modelica.Blocks.Interfaces.RealInput iac "AC current sense"; Modelica.Blocks.Interfaces.RealInput vac "AC voltage sense"; Modelica.Blocks.Interfaces.RealInput idc "DC current sense"; Modelica.Blocks.Interfaces.RealInput vdc "DC voltage sense"; Modelica.Blocks.Interfaces.RealOutput d "Duty cycle"; // Components Park park; PLL pLL(frequency=fline); Modelica.Blocks.Nonlinear.FixedDelay fixedDelay(delayTime=1/fline/4); Modelica.Blocks.Continuous.PI idPI(k=ik, T=iT); Modelica.Blocks.Math.Feedback idFB; Modelica.Blocks.Continuous.PI iqPI(k=ik, T=iT); Modelica.Blocks.Math.Feedback iqFB; Modelica.Blocks.Sources.Constant const(k=0); PVSystems.Control.ControllerMPPT mPPTController; Modelica.Blocks.Continuous.PI vdcPI(k=vk, T=vT); Modelica.Blocks.Math.Feedback iqFB1; InversePark inversePark; equation connect(pLL.v, vac); connect(pLL.theta, park.theta); connect(iac, fixedDelay.u); connect(park.alpha, iac); connect(park.beta, fixedDelay.y); connect(idFB.y, idPI.u); connect(park.d, idFB.u2); connect(iqFB.y, iqPI.u); connect(park.q, iqFB.u2); connect(const.y, iqFB.u1); connect(idc, mPPTController.u2); connect(vdc, mPPTController.u1); connect(mPPTController.y, iqFB1.u1); connect(iqFB1.u2, vdc); connect(iqFB1.y, vdcPI.u); connect(vdcPI.y, idFB.u1); connect(inversePark.alpha, d); connect(iqPI.y, inversePark.q); connect(idPI.y, inversePark.d); connect(pLL.theta, inversePark.theta); end ControllerInverter1ph;

Automatically generated Sun Apr 02 18:12:01 2017.