-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement choice between sawtooth and triangle reference signal in Po…
…werConverters/DCDC/Control/SignalPWM
- Loading branch information
Showing
5 changed files
with
66 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
Modelica/Electrical/PowerConverters/Examples/DCDC/HBridge/HBridge_TrianglePWM_RL.mo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
within Modelica.Electrical.PowerConverters.Examples.DCDC.HBridge; | ||
model HBridge_TrianglePWM_RL "H bridge DC/DC converter with R-L load" | ||
extends ExampleTemplates.HBridge(signalPWM(refType=Modelica.Electrical.PowerConverters.Types.SingleReferenceType.Triangle)); | ||
extends Modelica.Icons.Example; | ||
parameter SI.Resistance R=100 "Resistance"; | ||
parameter SI.Inductance L=1 "Inductance"; | ||
Modelica.Electrical.Analog.Basic.Resistor resistor(R=R) annotation ( | ||
Placement(transformation( | ||
extent={{-10,-10},{10,10}}, | ||
rotation=270, | ||
origin={20,50}))); | ||
Modelica.Electrical.Analog.Basic.Inductor inductor(i(fixed=true, | ||
start=0), L=L) annotation (Placement(transformation( | ||
extent={{-10,-10},{10,10}}, | ||
rotation=270, | ||
origin={20,10}))); | ||
Blocks.Discrete.ZeroOrderHold zeroOrderHold(samplePeriod=1/f, startTime=0.5/f) | ||
annotation (Placement(transformation(extent={{12,-30},{32,-10}}))); | ||
equation | ||
connect(resistor.n, inductor.p) annotation (Line( | ||
points={{20,40},{20,20}}, color={0,0,255})); | ||
connect(inductor.n, currentSensor.p) annotation (Line( | ||
points={{20,0},{20,-6},{0,-6}}, color={0,0,255})); | ||
connect(resistor.p, hbridge.dc_p2) annotation (Line( | ||
points={{20,60},{20,70},{-30,70},{-30,6},{-40,6}}, color={0,0,255})); | ||
connect(currentSensor.i, zeroOrderHold.u) | ||
annotation (Line(points={{-10,-17},{-10,-20},{10,-20}}, color={0,0,127})); | ||
annotation ( | ||
Documentation(info="<html> | ||
<p> | ||
This is the same example as <a href=\"modelica://Modelica.Electrical.PowerConverters.Examples.DCDC.HBridge.HBridge_RL\">HBridge_RL</a> | ||
but using a triangle (instead of a sawtooth) as pwm reference signal. | ||
This enables an easy sampling of the current in the middle of the pwm period, which delivers with good approximation the mean current: | ||
Compare <code>meanCurrent.y</code> and <code>zeroOrderHold.y</code>. | ||
For discrete or quasi-continuous control it is essential to sample the correct mean current with low effort once during the pwm period. | ||
</p> | ||
</html>"), | ||
experiment( | ||
StopTime=0.1, | ||
Interval=0.0002, | ||
Tolerance=1e-06)); | ||
end HBridge_TrianglePWM_RL; |
1 change: 1 addition & 0 deletions
1
Modelica/Electrical/PowerConverters/Examples/DCDC/HBridge/package.order
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
HBridge_R | ||
HBridge_RL | ||
HBridge_TrianglePWM_RL | ||
HBridge_DC_Drive |
5 changes: 5 additions & 0 deletions
5
Modelica/Electrical/PowerConverters/Types/SingleReferenceType.mo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
within Modelica.Electrical.PowerConverters.Types; | ||
type SingleReferenceType = enumeration( | ||
Sawtooth "Sawtooth", | ||
Triangle "Triangle") | ||
"Enumeration defining the type of reference signal"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
PWMType | ||
ReferenceType | ||
SingleReferenceType | ||
Voltage2AngleType | ||
SoftStarterModeOfOperation |