diff --git a/GPS_pw_modeling.mo b/GPS_pw_modeling.mo index a3aa8eea19291feecedf7df4ec36fedc14c8faf7..a93104a4c9ded12e26d236fa3d757d92c842fb2a 100644 --- a/GPS_pw_modeling.mo +++ b/GPS_pw_modeling.mo @@ -1,5 +1,5 @@ package GPS_pw_modeling - model GPS_pw_simulator + model GPS_pw_simulator_old //parameters parameter Integer required_satellites = 4; //number of satellites required for sufficient accuracy @@ -219,31 +219,38 @@ package GPS_pw_modeling Icon(graphics = {Rectangle(fillColor = {0, 201, 223}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}}), Text(origin = {-40, 66}, extent = {{-14, 12}, {14, -12}}, textString = "ON"), Text(origin = {-13, -58}, lineColor = {30, 33, 177}, extent = {{-75, 66}, {109, -94}}, textString = "GPS device"), Text(origin = {-97, 45}, extent = {{59, -43}, {9, -5}}, textString = "Visible SV"), Text(origin = {26, -24}, extent = {{-22, 12}, {60, -32}}, textString = "Position available"), Text(origin = {34, 30}, extent = {{-32, 0}, {54, -12}}, textString = "pw consumption")}, coordinateSystem(initialScale = 0.1)), experiment(StartTime = 0, StopTime = 1000, Tolerance = 1e-6, Interval = 0.002), __OpenModelica_simulationFlags(lv = "LOG_STATS", s = "dassl")); - end GPS_pw_simulator; + end GPS_pw_simulator_old; + model test_GPS - GPS_pw_modeling.GPS_pw_simulator_2 gPS_pw_simulator_2 annotation( + GPS_pw_modeling.GPS_pw_simulator GPS_pw_simulator1 annotation( Placement(visible = true, transformation(origin = {90, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); - Modelica.Blocks.Sources.BooleanTable const_on annotation( - Placement(visible = true, transformation(origin = {-30, -20}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); - Modelica.Blocks.Sources.IntegerConstant stellites_constant(k = 12) annotation( - Placement(visible = true, transformation(origin = {-16, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); - Modelica.Blocks.Sources.BooleanTable slow_and_fast(table = {1}) annotation( + Modelica.Blocks.Sources.BooleanTable const_on(table = {5, 71, 80, 81, 90, 91, 100, 101, 110, 111, 120, 261, 270, 271, 280, 281, 290, 291}) annotation( Placement(visible = true, transformation(origin = {50, 80}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.IntegerConstant stellites_constant(k = 5) annotation( + Placement(visible = true, transformation(origin = {-10, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Modelica.Blocks.Sources.BooleanTable slow_and_fast(table = {10, 70, 90, 91, 110, 111, 130, 131, 150, 151, 1840, 1841, 1850, 1851, 1860, 1861, 1870, 1871, 1880, 1881, 1890, 1891, 1900, 1971, 1980, 1981, 1990, 1991, 2000, 2001}) annotation( + Placement(visible = true, transformation(origin = {-10, 80}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); Modelica.Blocks.Sources.IntegerTable satellites(table=[0,5;100,3; 200,4]) annotation( - Placement(visible = true, transformation(origin = {30, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + Placement(visible = true, transformation(origin = {50, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); equation - connect(satellites.y, gPS_pw_simulator_2.visible_satellites) annotation( - Line(points = {{42, 50}, {78, 50}, {78, 50}, {80, 50}}, color = {255, 127, 0})); - connect(gPS_pw_simulator_2.on_signal, slow_and_fast.y) annotation( - Line(points = {{86, 60}, {86, 60}, {86, 80}, {62, 80}, {62, 80}}, color = {255, 0, 255})); + connect(const_on.y, GPS_pw_simulator1.on_signal) annotation( + Line(points = {{62, 80}, {86, 80}, {86, 60}, {86, 60}}, color = {255, 0, 255})); + connect(satellites.y, GPS_pw_simulator1.visible_satellites) annotation( + Line(points = {{62, 50}, {80, 50}, {80, 50}, {80, 50}}, color = {255, 127, 0})); annotation( - experiment(StartTime = 0, StopTime = 400, Tolerance = 1e-6, Interval = 0.0008), + experiment(StartTime = 0, StopTime = 300, Tolerance = 1e-6, Interval = 0.0006), __OpenModelica_simulationFlags(lv = "LOG_STATS", s = "dassl")); end test_GPS; - model GPS_pw_simulator_2 + + + + + + + model GPS_pw_simulator // not modeled hot start ///////////////// // parameters // @@ -430,7 +437,8 @@ package GPS_pw_modeling annotation( Icon(graphics = {Rectangle(fillColor = {115, 210, 22}, fillPattern = FillPattern.Solid, extent = {{-96, 96}, {96, -96}}), Text(origin = {-40, 70}, extent = {{-20, 8}, {20, -8}}, textString = "turn_on"), Text(origin = {-51, 7}, extent = {{-17, 9}, {91, -15}}, textString = "visible_satellites"), Text(origin = {50, 41}, extent = {{-72, 15}, {22, -9}}, textString = "power_consumption"), Text(origin = {22, -41}, extent = {{-50, 11}, {50, -11}}, textString = "position_avaialble")}), experiment(StartTime = 0, StopTime = 400, Tolerance = 1e-6, Interval = 0.0008)); - end GPS_pw_simulator_2; + end GPS_pw_simulator; + annotation( uses(Modelica(version = "3.2.1"))); diff --git a/report/img/control1.png b/report/img/control1.png index da54e32fba20f3121250bc259cc6ac53f0740d59..a9d3ecdcd885db943e776a7c672f4592ddd7e5f4 100644 Binary files a/report/img/control1.png and b/report/img/control1.png differ diff --git a/report/img/control2.png b/report/img/control2.png index e8cb61a24208d82b6311b3de7ad3386af72e4278..4da875aaaa934be616eb71351016a684d1288461 100644 Binary files a/report/img/control2.png and b/report/img/control2.png differ diff --git a/report/img/position1.png b/report/img/position1.png index 339e4d19f51fb95d8c032f59a5e49138049a075b..5e8d9d47fa1802f7cb01358522f508e9b012a40a 100644 Binary files a/report/img/position1.png and b/report/img/position1.png differ diff --git a/report/img/position2.png b/report/img/position2.png index 60c3e40fd5f0e8f80106a4a19fd8c28dffe92ccb..7d3088e0ce73f37be66655b580529bfc56a6ce45 100644 Binary files a/report/img/position2.png and b/report/img/position2.png differ diff --git a/report/sections/04-Examples.tex b/report/sections/04-Examples.tex index a49c01defc3914b849dd64fbe1790d7a549ef929..99518a53ec260ae560dc9b38a4dfdeb7bdc8a6b3 100644 --- a/report/sections/04-Examples.tex +++ b/report/sections/04-Examples.tex @@ -72,9 +72,25 @@ In this second simulation we show an outage of the position measure availability \end{figure} \subsubsection{Visible satellites} -In this third scenario it is shown a possible way the number of visible satellites can influence the availability of the position. +In this third scenario it is shown a possible way the number of visible satellites can influence the availability of the position. In figure~\ref{fig:control3} are shown the number of visible satellites and the control signal that turns on the GPS antenna. We simulate an satellites outage at $time=100$ where the number of visible satellites becomes 3 which is not sufficient for providing any positioning. The device before that tracks the 5 visible satellites and starts samling the position every 10 seconds for one second. After the satellite outage it instead stays turned on trying to fetch more sateliites. This happens only at the time instant 200 where the number of visible satellites becomes 4. After having updated again the ephemeris data the device is able to start sampling again the position, as shown in figure~\ref{fig:position3}. -%thisr example run with +\begin{figure}[h] + \begin{center} + \includegraphics[width=0.70\columnwidth]{./img/control3.png} + \caption{Turn\_ON signal and visible satellites for the antenna in simulation 3. + \label{fig:control2} + } + \end{center} +\end{figure} + +\begin{figure}[h] + \begin{center} + \includegraphics[width=0.70\columnwidth]{./img/position3.png} + \caption{Availability of the position measure in simulation 3. + \label{fig:position2} + } + \end{center} +\end{figure}