Skip to content

Commit

Permalink
Improve documentation for most examples
Browse files Browse the repository at this point in the history
This commit represents only a slight improvement, since the
documentation that has been added is quite succinct. It's still an
improvement. Only one example, USBBatteryConverter, is left without
documentation since there's still some work to do on that one.
  • Loading branch information
raulrpearson committed Jul 1, 2017
1 parent a23df4d commit 1b3c6a2
Show file tree
Hide file tree
Showing 20 changed files with 241 additions and 188 deletions.
70 changes: 35 additions & 35 deletions PVSystems/Examples/Verification/IdealCBSwitchVerification.mo
Original file line number Diff line number Diff line change
Expand Up @@ -39,41 +39,41 @@ equation
StopTime=1,
Tolerance=1e-4),
Documentation(info="<html>
<p>
IdealCBSwitchValidation presents a simple circuit to validate the
behaviour of the corresponding component. The circuit is 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.
</p>
<p>
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:
</p>
<div class=\"figure\">
<p><img src=\"modelica://PVSystems/Resources/Images/IdealCBSwitchValidationResults.png\"
alt=\"IdealCBSwitchValidationResults.png\" />
<p>
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.
</p>
</div>
<p>
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 parallel diode). When the switch
is closed using the firing signal, it never blocks voltage, allowing
bidirectional flow of current.
</p>
<p>
Plot the voltage drop in the result to confirm these results or play
with the parameter values to see what effects they have.
</p>
<p>
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:
</p>
<div class=\"figure\">
<p><img src=\"modelica://PVSystems/Resources/Images/IdealCBSwitchVerificationResults.png\"
alt=\"IdealCBSwitchVerificationResults.png\" />
</p>
</div>
<p>
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.
</p>
<p>
Plot the voltage drop in the resistor to confirm these
results or play with the parameter values to see what
effects they have.</p>
</html>"));
end IdealCBSwitchVerification;
86 changes: 51 additions & 35 deletions PVSystems/Examples/Verification/MPPTControllerVerification.mo
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ model MPPTControllerVerification "MPPT controller verification"
origin={0,-10},
extent={{-10,-10},{10,10}},
rotation=270)));
Control.MPPTController controller(
Control.MPPTController mpptController(
sampleTime=1,
pkThreshold=0.01,
vrefStep=1,
Expand All @@ -32,11 +32,11 @@ model MPPTControllerVerification "MPPT controller verification"
startTime=50,
duration=50) annotation (Placement(transformation(extent={{-80,-80},{-60,-60}},
rotation=0)));
Modelica.Blocks.Math.Add add annotation (Placement(transformation(
Modelica.Blocks.Math.Add vdcSetpoint annotation (Placement(transformation(
origin={30,54},
extent={{-10,-10},{10,10}},
rotation=0)));
Modelica.Blocks.Sources.Ramp Perturbation(
Modelica.Blocks.Sources.Ramp perturbation(
height=10,
offset=0,
duration=20,
Expand All @@ -48,7 +48,7 @@ model MPPTControllerVerification "MPPT controller verification"
annotation (Placement(transformation(extent={{-80,70},{-60,90}})));
Modelica.Blocks.Sources.RealExpression isense(y=sink.i)
annotation (Placement(transformation(extent={{-80,44},{-60,64}})));
Modelica.Blocks.Sources.RealExpression isense1(y=26)
Modelica.Blocks.Sources.RealExpression vdcSetpoint1(y=26)
annotation (Placement(transformation(extent={{60,-60},{40,-40}})));
Modelica.Electrical.Analog.Basic.Ground ground1 annotation (Placement(
transformation(extent={{-30,-80},{-10,-60}}, rotation=0)));
Expand All @@ -64,21 +64,21 @@ model MPPTControllerVerification "MPPT controller verification"
equation
connect(G.y, pVArray.G) annotation (Line(points={{-69,10},{-60,10},{-60,-7},{
-45.5,-7}}, color={0,0,127}));
connect(add.y, sink.v) annotation (Line(points={{41,54},{60,54},{60,-10},{7,-10}},
color={0,0,127}));
connect(Perturbation.y, add.u2) annotation (Line(points={{-19,34},{0,34},{0,
48},{18,48}}, color={0,0,127}));
connect(vdcSetpoint.y, sink.v) annotation (Line(points={{41,54},{60,54},{60,-10},
{7,-10}}, color={0,0,127}));
connect(perturbation.y, vdcSetpoint.u2) annotation (Line(points={{-19,34},{0,34},
{0,48},{18,48}}, color={0,0,127}));
connect(pVArray.p, sink.p)
annotation (Line(points={{-40,0},{0,0}}, color={0,0,255}));
connect(vsense.y, controller.u1)
connect(vsense.y, mpptController.u1)
annotation (Line(points={{-59,80},{-59,80},{-42,80}}, color={0,0,127}));
connect(controller.y, add.u1) annotation (Line(points={{-19,74},{0,74},{0,60},
{18,60}}, color={0,0,127}));
connect(isense.y, controller.u2) annotation (Line(points={{-59,54},{-50,54},{
-50,68},{-42,68}}, color={0,0,127}));
connect(mpptController.y, vdcSetpoint.u1) annotation (Line(points={{-19,74},{0,
74},{0,60},{18,60}}, color={0,0,127}));
connect(isense.y, mpptController.u2) annotation (Line(points={{-59,54},{-50,54},
{-50,68},{-42,68}}, color={0,0,127}));
connect(pVArray1.p, sink1.p) annotation (Line(points={{-40,-40},{-28,-40},{-14,
-40},{0,-40}}, color={0,0,255}));
connect(sink1.v, isense1.y)
connect(sink1.v, vdcSetpoint1.y)
annotation (Line(points={{7,-50},{39,-50}}, color={0,0,127}));
connect(T.y, pVArray1.T) annotation (Line(points={{-59,-70},{-52,-70},{-52,-53},
{-45.5,-53}}, color={0,0,127}));
Expand All @@ -95,27 +95,43 @@ equation
connect(ground1.p, sink1.n)
annotation (Line(points={{-20,-60},{-1.77636e-015,-60}}, color={0,0,255}));
annotation (experiment(StopTime=180), Documentation(info="<html>
<p>
This examples places the 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.
</p>
<p>
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. The MPPT controller successfully
deals with these changing conditions as shown in the following plot:
</p>
<div class=\"figure\">
<p><img src=\"modelica://PVSystems/Resources/Images/MPPTControllerValidationResults.png\"
alt=\"MPPTControllerValidationResults.png\" />
<p>
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.
</p>
</div>
<p>
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:
</p>
<div class=\"figure\">
<p><img src=\"modelica://PVSystems/Resources/Images/MPPTControllerVerificationResultsA.png\"
alt=\"MPPTControllerVerificationResultsA.png\"
/>
</p>
</div>
<p>
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:
</p>
<div class=\"figure\">
<p><img src=\"modelica://PVSystems/Resources/Images/MPPTControllerVerificationResultsB.png\"
alt=\"MPPTControllerVerificationResultsB.png\"
/></p>
</div>
</html>"));
end MPPTControllerVerification;
37 changes: 19 additions & 18 deletions PVSystems/Examples/Verification/PLLVerification.mo
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,25 @@ equation
StopTime=0.1,
Tolerance=1e-4),
Documentation(info="<html>
<p>
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.
</p>
<p>
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:
</p>
<div class=\"figure\">
<p><img src=\"modelica://PVSystems/Resources/Images/PLLValidationResults.png\"
alt=\"PLLValidationResults.png\" />
<p>
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.
</p>
</div>
<p>
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:
</p>
<div class=\"figure\">
<p><img src=\"modelica://PVSystems/Resources/Images/PLLVerificationResults.png\"
alt=\"PLLVerificationResults.png\" /></p>
</div>
</html>"));
end PLLVerification;
49 changes: 25 additions & 24 deletions PVSystems/Examples/Verification/PVArrayVerification.mo
Original file line number Diff line number Diff line change
Expand Up @@ -33,39 +33,40 @@ equation
Diagram(graphics),
Documentation(info="<html>
<p>
PVArrayValidation presents a ramp DC voltage source in parallel with
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.
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.
</p>
<p>
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:
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:
</p>
<div class=\"figure\">
<p><img src=\"modelica://PVSystems/Resources/Images/PVArrayValidationResults.png\"
alt=\"PVArrayValidationResults.png\" />
<p><img src=\"modelica://PVSystems/Resources/Images/PVArrayVerificationResults.png\"
alt=\"PVArrayVerificationResults.png\" />
</p>
</div>
<p>
Notice how the variation in the current delivered by the PV array
(sinked by the voltage source) reflects the familiar PV module
curve.
Notice how the variation in the current delivered by the
PV array (sinked by the voltage source) reflects the
familiar PV module curve.
</p>
<p>
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.
</p>
</html>"),
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. </p>
</html>"),
experiment(
StartTime=0,
StopTime=1,
Expand Down
37 changes: 20 additions & 17 deletions PVSystems/Examples/Verification/ParkVerification.mo
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
within PVSystems.Examples.Verification;
model ParkVerification "Park transformations verification"
model ParkVerification "Park transforms verification"
extends Modelica.Icons.Example;
Control.Park park
annotation (Placement(transformation(extent={{0,20},{20,40}}, rotation=0)));
Expand Down Expand Up @@ -33,22 +33,25 @@ equation
Diagram(graphics),
experiment(StopTime=0.1),
Documentation(info="<html>
<p>
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:
</p>
<div class=\"figure\">
<p><img src=\"modelica://PVSystems/Resources/Images/ParkValidationResults.png\"
alt=\"ParkValidationResults.png\" />
<p>
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:
</p>
</div>
<p>
As expected, <i>d</i> is equal to the peak amplitude of the input
signal and <i>q</i> sets at zero. Feeding the signals back to the
inverse transformation block recreates the original signals.
</p>
<div class=\"figure\">
<p><img src=\"modelica://PVSystems/Resources/Images/ParkVerificationResults.png\"
alt=\"ParkVerificationResults.png\" />
</p>
</div>
<p>
As expected, <em>d</em> is equal to the peak amplitude
of the input signal and <em>q</em> sets at zero. Feeding
the signals back to the inverse transformation block
recreates the original signals (which overlap them on
the plot).</p>
</html>"));
end ParkVerification;
Loading

0 comments on commit 1b3c6a2

Please sign in to comment.