diff --git a/VirtualFCS/Control/BatteryManagementSystem.mo b/VirtualFCS/Control/BatteryManagementSystem.mo
index ceaa588..7653def 100644
--- a/VirtualFCS/Control/BatteryManagementSystem.mo
+++ b/VirtualFCS/Control/BatteryManagementSystem.mo
@@ -2,8 +2,8 @@ within VirtualFCS.Control;
model BatteryManagementSystem "Implement algorithms for the control of battery systems."
parameter Real N_s "Number of Cells in Series";
- parameter Real lowerVoltageLimit = N_s * 2;
- parameter Real upperVoltageLimit = N_s * 3.6;
+ parameter Modelica.Units.SI.Voltage lowerVoltageLimit = N_s * 2;
+ parameter Modelica.Units.SI.Voltage upperVoltageLimit = N_s * 3.6;
VirtualFCS.Control.ChargeCounter chargeCounter annotation(
Placement(visible = true, transformation(origin = {25, -1}, extent = {{25, -25}, {-25, 25}}, rotation = 0)));
Modelica.Electrical.Analog.Interfaces.NegativePin pin_n_battery annotation(
@@ -47,4 +47,4 @@ equation
Icon(graphics = {Rectangle(fillColor = {50, 50, 50}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}}), Text(origin = {2, 72}, lineColor = {255, 255, 255}, extent = {{-26, 22}, {26, -22}}, textString = "Load"), Text(origin = {0, -52}, lineColor = {255, 255, 255}, extent = {{-44, 34}, {48, -36}}, textString = "Battery"), Text(origin = {104, 146}, lineColor = {0, 0, 255}, extent = {{-26, 22}, {84, -80}}, textString = "%name"), Text(origin = {62, 24}, lineColor = {255, 255, 255}, extent = {{-44, 34}, {26, -24}}, textString = "SOC_init"), Text(origin = {106, -52}, lineColor = {255, 255, 255}, extent = {{-44, 34}, {-8, 10}}, textString = "Q")}, coordinateSystem(extent = {{-150, -100}, {150, 100}}, initialScale = 0.1)),
Diagram(coordinateSystem(extent = {{-150, -100}, {150, 100}})),
Documentation(info = "
The BatteryManagementSystem component is responsible for protecting the battery pack. It ensures that the pack is not overcharged or overdischarged to dangerous state-of-charge levels. It also limits the maximum charging and discharging current the battery pack can support."));
-end BatteryManagementSystem;
\ No newline at end of file
+end BatteryManagementSystem;
diff --git a/VirtualFCS/Control/EMS_FC.mo b/VirtualFCS/Control/EMS_FC.mo
index 5d6bc40..dafff76 100644
--- a/VirtualFCS/Control/EMS_FC.mo
+++ b/VirtualFCS/Control/EMS_FC.mo
@@ -1,7 +1,7 @@
within VirtualFCS.Control;
block EMS_FC
- parameter Real ramp_up(unit = "1/s") = 20 "FC stack current ramp up rate";
+ parameter Modelica.Units.SI.TimeAging ramp_up = 20 "FC stack current ramp up rate";
Modelica.Blocks.Math.Abs abs1 annotation(
Placement(visible = true, transformation(origin = {70, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.Constant OFF(k = 0) annotation(
diff --git a/VirtualFCS/Control/EnergyManagementSystem.mo b/VirtualFCS/Control/EnergyManagementSystem.mo
index 985c07c..f441015 100644
--- a/VirtualFCS/Control/EnergyManagementSystem.mo
+++ b/VirtualFCS/Control/EnergyManagementSystem.mo
@@ -1,11 +1,13 @@
within VirtualFCS.Control;
block EnergyManagementSystem "Implement algorithms to control the energy and power distribution in a hybrid system."
- parameter Real I_nom_FC_stack(unit = "A") = 100 "FC stack nominal operating current";
- parameter Real ramp_up(unit = "1/s") = 20 "FC stack current ramp up rate";
+ parameter Modelica.Units.SI.Current I_nom_FC_stack = 100 "FC stack nominal operating current";
+ parameter Modelica.Units.SI.TimeAging ramp_up = 20 "FC stack current ramp up rate";
+ parameter Real SOC_lower_limit(unit = "1") = 0.2 "SOC lower limit";
+ parameter Real SOC_higher_limit(unit = "1") = 0.8 "SOC lower limit";
Modelica.Blocks.Sources.Constant shut_down(k = 0) annotation(
Placement(visible = true, transformation(origin = {-70, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
- Modelica.Blocks.Logical.Hysteresis hysteresis(pre_y_start = true, uHigh = 0.8, uLow = 0.2) annotation(
+ Modelica.Blocks.Logical.Hysteresis hysteresis(pre_y_start = true, uHigh = SOC_higher_limit, uLow = SOC_lower_limit) annotation(
Placement(visible = true, transformation(origin = {-70, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.Constant setFuelCellCurrent(k = -I_nom_FC_stack) annotation(
Placement(visible = true, transformation(origin = {-70, -40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
@@ -37,4 +39,4 @@ equation
annotation(
Icon(graphics = {Rectangle(fillColor = {50, 50, 50}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}}), Text(origin = {-8, 121}, lineColor = {0, 0, 255}, extent = {{-54, 17}, {54, -17}}, textString = "%name")}, coordinateSystem(initialScale = 0.1)),
Documentation(info = "The EnergyManagementSystem component is designed to manage the flow of power between the fuel cell stack, battery, vehicle load, and balance-of-plant load. It splits the load according to pre-defined energy management rules, which are implemented within the bounds of the battery management system and the fuel cell control unit.
This model implements a simple energy management algorithm for a hybrid fuel cell & battery system. The model reads the state-of-charge (SOC) of the battery. If it is less than a lower threshold value, then a signal is sent to activate the fuel cell with a given electric current. The rate at which current can be demanded from the fuel cell is limited by a slew rate. "));
-end EnergyManagementSystem;
\ No newline at end of file
+end EnergyManagementSystem;
diff --git a/VirtualFCS/Control/PumpSpeedControl.mo b/VirtualFCS/Control/PumpSpeedControl.mo
index 8b5cf61..e8e5ecd 100644
--- a/VirtualFCS/Control/PumpSpeedControl.mo
+++ b/VirtualFCS/Control/PumpSpeedControl.mo
@@ -2,9 +2,7 @@ within VirtualFCS.Control;
block PumpSpeedControl
parameter Real k = 1 "Control Gain";
- parameter Real Td = 0.1 "Time Constant of Derivative Block";
- //parameter Real k = 1 "Control Gain";
- //parameter Real Td = 1 "Time Constant of Derivative Block";
+ parameter Modelica.Units.SI.Time Td = 0.1 "Time Constant of Derivative Block";
Modelica.Blocks.Continuous.LimPID limPID(Td = Td, initType = Modelica.Blocks.Types.Init.InitialOutput, k = k, yMax = 1, yMin = 0) annotation(
Placement(visible = true, transformation(origin = {-30, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput setMassFlow annotation(
diff --git a/VirtualFCS/Control/PumpSpeedControlCooling.mo b/VirtualFCS/Control/PumpSpeedControlCooling.mo
index d2cbe8a..025d8ba 100644
--- a/VirtualFCS/Control/PumpSpeedControlCooling.mo
+++ b/VirtualFCS/Control/PumpSpeedControlCooling.mo
@@ -2,8 +2,8 @@ within VirtualFCS.Control;
block PumpSpeedControlCooling
parameter Real k = 1 "Control Gain";
- parameter Real Td = 0.1 "Time Constant of Derivative Block";
- parameter Real Ti = 0.1 "Time Constant of Integral Block";
+ parameter Modelica.Units.SI.Time Td = 0.1 "Time Constant of Derivative Block";
+ parameter Modelica.Units.SI.Time Ti = 0.1 "Time Constant of Integral Block";
Modelica.Blocks.Interfaces.RealInput setMassFlow annotation(
Placement(visible = true, transformation(origin = {-100, 40}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-110, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput getMassFlow annotation(
diff --git a/VirtualFCS/Control/VoltageLimiter.mo b/VirtualFCS/Control/VoltageLimiter.mo
index 8893aae..fe65b8a 100644
--- a/VirtualFCS/Control/VoltageLimiter.mo
+++ b/VirtualFCS/Control/VoltageLimiter.mo
@@ -1,8 +1,8 @@
within VirtualFCS.Control;
model VoltageLimiter "Enforce voltage limits on battery cells."
- parameter Real upperVoltageLimit(unit = "V") = 3.6 "Upper Voltage Limit";
- parameter Real lowerVoltageLimit(unit = "V") = 2.0 "Lower Voltage Limit";
+ parameter Modelica.Units.SI.Voltage upperVoltageLimit = 3.6 "Upper Voltage Limit";
+ parameter Modelica.Units.SI.Voltage lowerVoltageLimit = 2.0 "Lower Voltage Limit";
Modelica.Electrical.Analog.Interfaces.PositivePin pin_p_battery annotation(
Placement(visible = true, transformation(origin = {196, 0}, extent = {{10, -10}, {-10, 10}}, rotation = 0), iconTransformation(origin = {110, 190}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
Modelica.Electrical.Analog.Interfaces.NegativePin pin_n_battery annotation(
@@ -68,4 +68,4 @@ equation
Icon(graphics = {Rectangle(origin = {-100, 100}, fillColor = {50, 50, 50}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {300, -300}}), Text(origin = {2, 137}, lineColor = {255, 255, 255}, extent = {{-74, 31}, {74, -31}}, textString = "Battery"), Text(origin = {-4, -101}, lineColor = {255, 255, 255}, extent = {{-74, 31}, {74, -31}}, textString = "Load"), Text(origin = {-7, 253}, lineColor = {0, 0, 255}, extent = {{-181, 45}, {181, -45}}, textString = "%name")}, coordinateSystem(extent = {{-200, -200}, {200, 200}}, initialScale = 0.1)),
Diagram(coordinateSystem(extent = {{-200, -200}, {200, 200}})),
Documentation(info = "The voltage limiter block enforces user-defined upper and lower voltage limits for battery cells and packs. "));
-end VoltageLimiter;
\ No newline at end of file
+end VoltageLimiter;
diff --git a/VirtualFCS/Electrical/DCConverterSwitch.mo b/VirtualFCS/Electrical/DCConverterSwitch.mo
index 48657bf..97ca314 100644
--- a/VirtualFCS/Electrical/DCConverterSwitch.mo
+++ b/VirtualFCS/Electrical/DCConverterSwitch.mo
@@ -101,4 +101,4 @@ The DC/DC converter is characterized by:
where underlined voltages and currents represent complex phasors