PVSystems.Examples.Verification

Simple examples for verification of library's components

Information

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

Name Description
PVSystems.Examples.Verification.IdealCBSwitchVerification IdealCBSwitchVerification Ideal current bidirectional switch verification
PVSystems.Examples.Verification.SW1Verification SW1Verification SW1 verification
PVSystems.Examples.Verification.SW2Verification SW2Verification SW2 verification
PVSystems.Examples.Verification.SW3Verification SW3Verification SW3 verification
PVSystems.Examples.Verification.CCMXVerification CCMXVerification CCMX models verification
PVSystems.Examples.Verification.CCM_DCMXVerification CCM_DCMXVerification Averaged CCM_DCM models verification
PVSystems.Examples.Verification.PVArrayVerification PVArrayVerification PVArray verification
PVSystems.Examples.Verification.SimpleBatteryVerification SimpleBatteryVerification SimpleBattery verification
PVSystems.Examples.Verification.SwitchingPWMVerification SwitchingPWMVerification SwitchingPWM verification
PVSystems.Examples.Verification.SwitchingCPMVerification SwitchingCPMVerification SwitchingCPM verification
PVSystems.Examples.Verification.DeadTimeVerification DeadTimeVerification DeadTime verification
PVSystems.Examples.Verification.CPM_CCMVerification CPM_CCMVerification Averaged CPM_CCM verification
PVSystems.Examples.Verification.CPMVerification CPMVerification Averaged CPM verification
PVSystems.Examples.Verification.ParkTransformsVerification ParkTransformsVerification Park transforms verification
PVSystems.Examples.Verification.PLLVerification PLLVerification PLL verification
PVSystems.Examples.Verification.MPPTControllerVerification MPPTControllerVerification MPPT controller verification

PVSystems.Examples.Verification.IdealCBSwitchVerification PVSystems.Examples.Verification.IdealCBSwitchVerification

Ideal current bidirectional switch verification

PVSystems.Examples.Verification.IdealCBSwitchVerification

Information

This example presents a circuit composed of a resistor in series with a sinusoidal AC voltage source and the ideal current bidirectional switch. The switch is operated by a step block that changes from 0 to 1 in the middle of the simulation. This changes the state of the switch from open to closed.

To use the example, simulate the model as provided and plot the source voltage as well as the switch voltage, the plot should look like this:

IdealCBSwitchVerificationResults.png

Notice how at the begining of the simulation, when the switch is not closed, it blocks all the positive voltage, preventing current from flowing. On the other hand, the negative voltage is not blocked, so the current can flow (through the anti-parallel diode). When the switch is closed using the firing signal, it never blocks voltage, allowing bidirectional flow of current.

Plot the voltage drop in the resistor to confirm these results or play with the parameter values to see what effects they have.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model IdealCBSwitchVerification "Ideal current bidirectional switch verification" extends Modelica.Icons.Example; Electrical.IdealCBSwitch idealCBSwitch; Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage(freqHz=5, V=1); Modelica.Blocks.Sources.BooleanStep booleanStep(startValue=true, startTime= 0.5); Modelica.Electrical.Analog.Basic.Ground ground; Modelica.Electrical.Analog.Basic.Resistor resistor(R=2); equation connect(booleanStep.y, idealCBSwitch.c); connect(idealCBSwitch.p, resistor.n); connect(resistor.p, sineVoltage.p); connect(idealCBSwitch.n, ground.p); connect(ground.p, sineVoltage.n); end IdealCBSwitchVerification;

PVSystems.Examples.Verification.SW1Verification PVSystems.Examples.Verification.SW1Verification

SW1 verification

PVSystems.Examples.Verification.SW1Verification

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model SW1Verification "SW1 verification" extends Modelica.Icons.Example; Electrical.SW1 sw1(fs=1); Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage(freqHz=5, V=1); Modelica.Electrical.Analog.Basic.Ground ground; Modelica.Electrical.Analog.Basic.Resistor resistor(R=2); Modelica.Blocks.Sources.RealExpression duty(y=0.5); equation connect(resistor.p,sineVoltage. p); connect(ground.p,sineVoltage. n); connect(sw1.p2, resistor.n); connect(sw1.n2, ground.p); connect(sw1.n1, ground.p); connect(sw1.p1, resistor.n); connect(duty.y, sw1.d); end SW1Verification;

PVSystems.Examples.Verification.SW2Verification PVSystems.Examples.Verification.SW2Verification

SW2 verification

PVSystems.Examples.Verification.SW2Verification

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model SW2Verification "SW2 verification" extends Modelica.Icons.Example; Electrical.SW2 sw2(deadTime=0.1, fs=2); Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage(freqHz=5, V=1); Modelica.Electrical.Analog.Basic.Ground ground; Modelica.Electrical.Analog.Basic.Resistor resistor(R=2); Modelica.Blocks.Sources.RealExpression duty(y=0.5); equation connect(resistor.p,sineVoltage. p); connect(ground.p,sineVoltage. n); connect(sw2.p2, resistor.n); connect(sw2.n2, ground.p); connect(sw2.n1, ground.p); connect(sw2.p1, resistor.n); connect(duty.y, sw2.d); end SW2Verification;

PVSystems.Examples.Verification.SW3Verification PVSystems.Examples.Verification.SW3Verification

SW3 verification

PVSystems.Examples.Verification.SW3Verification

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model SW3Verification "SW3 verification" extends Modelica.Icons.Example; Electrical.SW3 sw3(fs=2, deadTime=0.1); Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage(freqHz=5, V=1); Modelica.Electrical.Analog.Basic.Ground ground; Modelica.Electrical.Analog.Basic.Resistor resistor(R=2); Modelica.Blocks.Sources.RealExpression duty(y=0.5); equation connect(resistor.p,sineVoltage. p); connect(ground.p,sineVoltage. n); connect(sw3.n1, ground.p); connect(sw3.p1, resistor.n); connect(duty.y, sw3.d); connect(sw3.p2, resistor.n); connect(sw3.n2, ground.p); end SW3Verification;

PVSystems.Examples.Verification.CCMXVerification PVSystems.Examples.Verification.CCMXVerification

CCMX models verification

PVSystems.Examples.Verification.CCMXVerification

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model CCMXVerification "CCMX models verification" extends Modelica.Icons.Example; Electrical.CCM1 ccm1; Modelica.Blocks.Sources.Ramp duty( duration=0.8, startTime=0.1, height=0.8, offset=0.1); Modelica.Electrical.Analog.Sources.ConstantVoltage V1(V=10); Modelica.Electrical.Analog.Basic.Resistor R1(R=1); Modelica.Electrical.Analog.Basic.Ground g1; Modelica.Electrical.Analog.Basic.Ground g2; Modelica.Electrical.Analog.Basic.Resistor Ri1(R=1e-3); Electrical.CCM2 ccm2( Ron=1, RD=0.01, VD=0.8); Modelica.Electrical.Analog.Sources.ConstantVoltage V2(V=10); Modelica.Electrical.Analog.Basic.Resistor R2(R=1); Modelica.Electrical.Analog.Basic.Ground g3; Modelica.Electrical.Analog.Basic.Ground g4; Modelica.Electrical.Analog.Basic.Resistor Ri2(R=1e-3); Electrical.CCM3 ccm3(n=2); Modelica.Electrical.Analog.Sources.ConstantVoltage V3(V=10); Modelica.Electrical.Analog.Basic.Resistor R3(R=1); Modelica.Electrical.Analog.Basic.Ground g5; Modelica.Electrical.Analog.Basic.Ground g6; Modelica.Electrical.Analog.Basic.Resistor Ri3(R=1e-3); Electrical.CCM4 ccm4( Ron=1, RD=0.01, n=2, VD=0.8); Modelica.Electrical.Analog.Sources.ConstantVoltage V4(V=10); Modelica.Electrical.Analog.Basic.Resistor R4(R=1); Modelica.Electrical.Analog.Basic.Ground g7; Modelica.Electrical.Analog.Basic.Ground g8; Modelica.Electrical.Analog.Basic.Resistor Ri4(R=1e-3); Electrical.CCM5 ccm5( Ron=1, VD=0.8, fs=100e3, Qr=0.75e-6, tr=75e-9); Modelica.Electrical.Analog.Sources.ConstantVoltage V5(V=10); Modelica.Electrical.Analog.Basic.Resistor R5(R=1); Modelica.Electrical.Analog.Basic.Ground g9; Modelica.Electrical.Analog.Basic.Ground g10; Modelica.Electrical.Analog.Basic.Resistor Ri5(R=1e-3); equation connect(R1.p, ccm1.p2); connect(ccm1.n2,R1. n); connect(g1.p, ccm1.n1); connect(V1.n, g1.p); connect(V1.p, Ri1.p); connect(Ri1.n, ccm1.p1); connect(duty.y, ccm5.d); connect(ccm4.d, ccm5.d); connect(ccm3.d, ccm5.d); connect(ccm2.d, ccm5.d); connect(ccm1.d, ccm5.d); connect(V2.p, Ri2.p); connect(Ri2.n, ccm2.p1); connect(g3.p, ccm2.n1); connect(R2.p, ccm2.p2); connect(g4.p, ccm2.n2); connect(V3.p, Ri3.p); connect(Ri3.n, ccm3.p1); connect(g5.p, ccm3.n1); connect(R3.p, ccm3.p2); connect(g6.p, ccm3.n2); connect(V4.p, Ri4.p); connect(Ri4.n, ccm4.p1); connect(g7.p, ccm4.n1); connect(V5.p, Ri5.p); connect(Ri5.n, ccm5.p1); connect(g9.p, ccm5.n1); connect(R5.p, ccm5.p2); connect(g10.p, ccm5.n2); connect(R4.p, ccm4.p2); connect(g8.p, ccm4.n2); connect(ccm1.n2, g2.p); connect(R2.n, g4.p); connect(R3.n, g6.p); connect(R4.n, g8.p); connect(R5.n, g10.p); connect(V2.n, g3.p); connect(V3.n, g5.p); connect(V4.n, g7.p); connect(V5.n, g9.p); end CCMXVerification;

PVSystems.Examples.Verification.CCM_DCMXVerification PVSystems.Examples.Verification.CCM_DCMXVerification

Averaged CCM_DCM models verification

PVSystems.Examples.Verification.CCM_DCMXVerification

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model CCM_DCMXVerification "Averaged CCM_DCM models verification" extends Modelica.Icons.Example; Modelica.Blocks.Sources.Ramp duty( duration=0.8, startTime=0.1, height=0.8, offset=0.1); Electrical.CCM_DCM1 ccm_dcm1(fs=100e3, Le=0.6e-6); Modelica.Electrical.Analog.Sources.ConstantVoltage V1(V=10); Modelica.Electrical.Analog.Basic.Resistor R1(R=1); Modelica.Electrical.Analog.Basic.Ground g1; Modelica.Electrical.Analog.Basic.Ground g2; Modelica.Electrical.Analog.Basic.Resistor Ri1(R=1e-3); Electrical.CCM_DCM2 ccm_dcm2( fs=100e3, n=2, Le=0.6e-6); Modelica.Electrical.Analog.Sources.ConstantVoltage V2(V=10); Modelica.Electrical.Analog.Basic.Resistor R2(R=1); Modelica.Electrical.Analog.Basic.Ground g3; Modelica.Electrical.Analog.Basic.Ground g4; Modelica.Electrical.Analog.Basic.Resistor Ri2(R=1e-3); equation connect(V1.p,Ri1. p); connect(Ri1.n, ccm_dcm1.p1); connect(g1.p, ccm_dcm1.n1); connect(R1.p, ccm_dcm1.p2); connect(g2.p, ccm_dcm1.n2); connect(R1.n, g2.p); connect(V1.n,g1. p); connect(V2.p,Ri2. p); connect(V2.n,g3. p); connect(Ri2.n, ccm_dcm2.p1); connect(g3.p, ccm_dcm2.n1); connect(g4.p, ccm_dcm2.n2); connect(R2.n, g4.p); connect(R2.p, ccm_dcm2.p2); connect(duty.y, ccm_dcm2.d); connect(duty.y, ccm_dcm1.d); end CCM_DCMXVerification;

PVSystems.Examples.Verification.PVArrayVerification PVSystems.Examples.Verification.PVArrayVerification

PVArray verification

PVSystems.Examples.Verification.PVArrayVerification

Information

A ramp DC voltage source is applied in parallel to an instance of the PVArray model. The voltage ramp is configured to sweep from -10 volts to 35 volts in 1 second. This provides the enough voltage range to cover all of the PV array's working range when initialized with default values.

To use the example, simulate the model and start by displaying both voltage and current of the ramp voltage source. A figure like the following should be displayed:

PVArrayVerificationResults.png

Notice how the variation in the current delivered by the PV array (sinked by the voltage source) reflects the familiar PV module curve.

Modify the values for the irradiance and temperature blocks and see how these changes are reflected in a change in the PV curve, accurately reflecting the effects of these variables in the PV module performance.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model PVArrayVerification "PVArray verification" extends Modelica.Icons.Example; Modelica.Electrical.Analog.Sources.RampVoltage rampVoltage( duration=1, V=45, offset=-10); Modelica.Electrical.Analog.Basic.Ground ground; Electrical.PVArray pVArray; Modelica.Blocks.Sources.Constant Gn(k=1000); Modelica.Blocks.Sources.Constant Tn(k=298.15); equation connect(Gn.y, pVArray.G); connect(Tn.y, pVArray.T); connect(pVArray.p, rampVoltage.p); connect(pVArray.n, rampVoltage.n); connect(ground.p, rampVoltage.n); end PVArrayVerification;

PVSystems.Examples.Verification.SimpleBatteryVerification PVSystems.Examples.Verification.SimpleBatteryVerification

SimpleBattery verification

PVSystems.Examples.Verification.SimpleBatteryVerification

Information

This example provides a charge/discharge control logic to a current source in parallel with the battery model. The control is configured to put the battery through charge/discharge cycles for as long as the simulation runs:

SimpleBatteryVerificationResults.png

Notice how the charge and discharge cycles take about 30 minutes, which is what was to be expected by charging/discharging a 1A.h battery with a 2A current.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model SimpleBatteryVerification "SimpleBattery verification" extends Modelica.Icons.Example; Modelica.Electrical.Analog.Sources.SignalCurrent CC; Modelica.Electrical.Analog.Basic.Ground ground; Electrical.SimpleBattery B(Q=1, DoDini=0.5); Modelica.Blocks.Nonlinear.SlewRateLimiter slewRateLimiter(Rising=4); Modelica.Blocks.Logical.Hysteresis hysteresis(uHigh=4.19, uLow=0.1); Modelica.Blocks.Logical.Switch switch1; Modelica.Blocks.Sources.RealExpression idis(y=-2); Modelica.Blocks.Sources.RealExpression ich(y=2); Modelica.Blocks.Sources.RealExpression vsense(y=B.v); equation connect(ground.p, CC.p); connect(CC.p, B.n); connect(CC.n, B.p); connect(slewRateLimiter.y, CC.i); connect(switch1.y, slewRateLimiter.u); connect(hysteresis.y, switch1.u2); connect(idis.y, switch1.u1); connect(ich.y, switch1.u3); connect(vsense.y, hysteresis.u); end SimpleBatteryVerification;

PVSystems.Examples.Verification.SwitchingPWMVerification PVSystems.Examples.Verification.SwitchingPWMVerification

SwitchingPWM verification

PVSystems.Examples.Verification.SwitchingPWMVerification

Information

This model provides a changing duty cycle with the use of two step blocks. When running the simulation with the provided values, plotting the fire output generates the following graph:

SwitchingPWMVerificationResults.png

Through inspection of the plot, it can be seen how the signal constitutes a PWM signal with a duty cycle changing in steps through the values 0.2, 0.5 and 0.8. Zoom into the signal to confirm this fact as well as the value of the period, set at 10 milliseconds.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model SwitchingPWMVerification "SwitchingPWM verification" extends Modelica.Icons.Example; Control.SwitchingPWM signalPWM(fs=100); Modelica.Blocks.Sources.Step step( height=0.3, offset=0.2, startTime=0.3); Modelica.Blocks.Sources.Step step1(height=0.3, startTime=0.6); Modelica.Blocks.Math.Add add; equation connect(step.y, add.u1); connect(step1.y, add.u2); connect(add.y, signalPWM.vc); end SwitchingPWMVerification;

PVSystems.Examples.Verification.SwitchingCPMVerification PVSystems.Examples.Verification.SwitchingCPMVerification

SwitchingCPM verification

PVSystems.Examples.Verification.SwitchingCPMVerification

Information

The switching CPM block requires the vs input, corresponding to the voltage output of the current sensor. In order to simplify things, a switch with some constant sources and an integrator are used to emulate the behaviour of an inductor. This setup creates the conditions to exercise the CPM block, as can be seen in the following figure:

SwitchingCPMVerificationresults.Png

>

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model SwitchingCPMVerification "SwitchingCPM verification" extends Modelica.Icons.Example; Control.SwitchingCPM switchingCPM( vcMax=5, dMin=0.05, dMax=0.95, fs=200e3, Va=0.01); Modelica.Blocks.Continuous.Integrator integrator(initType=Modelica.Blocks.Types.Init.InitialState, y_start=3.99, k=1e4); Modelica.Blocks.Sources.Constant vdT(k=2); Modelica.Blocks.Logical.Switch switch1; Modelica.Blocks.Sources.Constant vdpT(k=-1); Modelica.Blocks.Sources.Constant vc(k=4); equation connect(vdT.y, switch1.u1); connect(switch1.y, integrator.u); connect(vdpT.y, switch1.u3); connect(switchingCPM.c, switch1.u2); connect(integrator.y, switchingCPM.vs); connect(vc.y, switchingCPM.vc); end SwitchingCPMVerification;

PVSystems.Examples.Verification.DeadTimeVerification PVSystems.Examples.Verification.DeadTimeVerification

DeadTime verification

PVSystems.Examples.Verification.DeadTimeVerification

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model DeadTimeVerification "DeadTime verification" extends Modelica.Icons.Example; Control.DeadTime deadTime(deadTime=0.03); Modelica.Blocks.Sources.BooleanPulse booleanPulse(period=0.2); equation connect(booleanPulse.y, deadTime.c); end DeadTimeVerification;

PVSystems.Examples.Verification.CPM_CCMVerification PVSystems.Examples.Verification.CPM_CCMVerification

Averaged CPM_CCM verification

PVSystems.Examples.Verification.CPM_CCMVerification

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model CPM_CCMVerification "Averaged CPM_CCM verification" extends Modelica.Icons.Example; Control.SwitchingCPM switchingCPM( dMin=0.05, dMax=0.95, fs=200e3, vcMax=10, Va=0.01); Modelica.Blocks.Continuous.Integrator integrator(initType=Modelica.Blocks.Types.Init.InitialState, k=1e4, y_start=3.99); Modelica.Blocks.Sources.Constant vdT(k=2); Modelica.Blocks.Logical.Switch switch1; Modelica.Blocks.Sources.Constant vdpT(k=-1); Modelica.Blocks.Sources.Constant vc(k=4); Control.CPM_CCM CPM_CCM( L=1e-4, fs=200e3, Rf=1, d_disabled=0.05, Va=0.01); Modelica.Blocks.Math.Abs abs1; Modelica.Blocks.Sources.BooleanStep enable(startTime=1e-5); Modelica.Blocks.Math.Mean mean(f=200e3); equation connect(vdT.y, switch1.u1); connect(switch1.y, integrator.u); connect(vdpT.y, switch1.u3); connect(switchingCPM.c, switch1.u2); connect(integrator.y, switchingCPM.vs); connect(vc.y, switchingCPM.vc); connect(CPM_CCM.vc, switchingCPM.vc); connect(abs1.u, vdpT.y); connect(abs1.y, CPM_CCM.vm2); connect(CPM_CCM.vm1, vdT.y); connect(mean.y, CPM_CCM.vs); connect(mean.u, switchingCPM.vs); connect(enable.y, CPM_CCM.enable); end CPM_CCMVerification;

PVSystems.Examples.Verification.CPMVerification PVSystems.Examples.Verification.CPMVerification

Averaged CPM verification

PVSystems.Examples.Verification.CPMVerification

Information

Extends from Modelica.Icons.Example (Icon for runnable examples), Modelica.Icons.UnderConstruction (Icon for classes that are still under construction).

Modelica definition

model CPMVerification "Averaged CPM verification" extends Modelica.Icons.Example; extends Modelica.Icons.UnderConstruction; Control.SwitchingCPM switchingCPM( dMin=0.05, dMax=0.95, fs=200e3, vcMax=10, Va=0.1); Modelica.Blocks.Continuous.LimIntegrator integrator(initType=Modelica.Blocks.Types.Init.InitialState, k=1e4, outMin=0, outMax=Modelica.Constants.inf); Modelica.Blocks.Sources.Constant vdT(k=6); Modelica.Blocks.Logical.Switch switch1; Modelica.Blocks.Sources.Constant vdpT(k=-3); Modelica.Blocks.Sources.Constant vc(k=0.5); Control.CPM CPM( fs=200e3, Rf=1, L=1e-4, Va=0.1); Modelica.Blocks.Math.Abs abs1; Modelica.Blocks.Math.Mean mean(f=200e3); equation connect(vdT.y, switch1.u1); connect(switch1.y, integrator.u); connect(vdpT.y, switch1.u3); connect(switchingCPM.c, switch1.u2); connect(integrator.y, switchingCPM.vs); connect(vc.y, switchingCPM.vc); connect(CPM.vc, switchingCPM.vc); connect(abs1.u, vdpT.y); connect(abs1.y, CPM.vm2); connect(CPM.vm1, vdT.y); connect(mean.y, CPM.vs); connect(mean.u, switchingCPM.vs); end CPMVerification;

PVSystems.Examples.Verification.ParkTransformsVerification PVSystems.Examples.Verification.ParkTransformsVerification

Park transforms verification

PVSystems.Examples.Verification.ParkTransformsVerification

Information

This example provides some easy input for the Park transform blocks to check that calculations are being done as expected. Run the simulation and you should get something like the following figure:

ParkVerificationResults.png

As expected, d is equal to the peak amplitude of the input signal and q sets at zero. Feeding the signals back to the inverse transformation block recreates the original signals (which overlap them on the plot).

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model ParkTransformsVerification "Park transforms verification" extends Modelica.Icons.Example; Control.Park park; Control.InversePark inversePark; Modelica.Blocks.Sources.SawTooth sawTooth(amplitude=2*Modelica.Constants.pi, period=0.02); Modelica.Blocks.Math.Sin sin; Modelica.Blocks.Math.Cos cos; equation connect(park.d, inversePark.d); connect(park.q, inversePark.q); connect(cos.u, sawTooth.y); connect(sin.u, sawTooth.y); connect(cos.y, park.alpha); connect(sin.y, park.beta); connect(park.theta, sawTooth.y); connect(inversePark.theta, sawTooth.y); end ParkTransformsVerification;

PVSystems.Examples.Verification.PLLVerification PVSystems.Examples.Verification.PLLVerification

PLL verification

PVSystems.Examples.Verification.PLLVerification

Information

This simple example provides a sinusoidal input to the PLL block and applies the output provided by the PLL, the calculated phase of the input sine, to drive a sine block so that the synchronization capabilities of the PLL can be visualized.

Run the model and plot the output of the sinusoidal source and the output of the sine block to see how, after some short transient, the PLL successfully follows the reference:

PLLVerificationResults.png

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model PLLVerification "PLL verification" extends Modelica.Icons.Example; Modelica.Blocks.Sources.Sine source(freqHz=50); Control.PLL pLL; Modelica.Blocks.Math.Cos sync; equation connect(source.y, pLL.v); connect(pLL.theta, sync.u); end PLLVerification;

PVSystems.Examples.Verification.MPPTControllerVerification PVSystems.Examples.Verification.MPPTControllerVerification

MPPT controller verification

PVSystems.Examples.Verification.MPPTControllerVerification

Information

This examples places an MPPT controller closing the loop for a voltage source connected to a PV array. The MPPT controller senses the power coming out of the PV array and provides a setpoint for the voltage source. This changes the operation point of the PV array with the goal of maximizing its output power for any given solar irradiation and junction temperature conditions.

The model is designed to challenge the control by ramping solar irradiation, temperature at different times and by injecting a perturbation into the control loop:

MPPTControllerVerificationResultsA.png

The MPPT controller successfully deals with these changing conditions as shown in the following plots, which compares the static PV array control with the MPPT control:

MPPTControllerVerificationResultsB.png

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model MPPTControllerVerification "MPPT controller verification" extends Modelica.Icons.Example; Modelica.Electrical.Analog.Basic.Ground ground; Electrical.PVArray pVArray; Modelica.Electrical.Analog.Sources.SignalVoltage sink; Control.MPPTController mpptController( sampleTime=1, pkThreshold=0.01, vrefStep=1, vrefStart=5); Modelica.Blocks.Sources.Ramp G( offset=1000, height=-500, startTime=30, duration=10); Modelica.Blocks.Sources.Ramp T( height=-25, offset=273.15 + 25, startTime=50, duration=50); Modelica.Blocks.Math.Add vdcSetpoint; Modelica.Blocks.Sources.Ramp perturbation( height=10, offset=0, duration=20, startTime=130); Modelica.Blocks.Sources.RealExpression vsense(y=sink.v); Modelica.Blocks.Sources.RealExpression isense(y=sink.i); Modelica.Blocks.Sources.RealExpression vdcSetpoint1(y=26); Modelica.Electrical.Analog.Basic.Ground ground1; Electrical.PVArray pVArray1; Modelica.Electrical.Analog.Sources.SignalVoltage sink1; equation connect(G.y, pVArray.G); connect(vdcSetpoint.y, sink.v); connect(perturbation.y, vdcSetpoint.u2); connect(pVArray.p, sink.p); connect(vsense.y, mpptController.u1); connect(mpptController.y, vdcSetpoint.u1); connect(isense.y, mpptController.u2); connect(pVArray1.p, sink1.p); connect(sink1.v, vdcSetpoint1.y); connect(T.y, pVArray1.T); connect(T.y, pVArray.T); connect(G.y, pVArray1.G); connect(pVArray.n, ground.p); connect(sink.n, ground.p); connect(pVArray1.n, ground1.p); connect(ground1.p, sink1.n); end MPPTControllerVerification;

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