You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 line
9.8KB

  1. %&tex
  2. \chapter{Discussion}
  3. \label{chap:discussion}
  4. \section{Complexity}
  5. The goal of this thesis is to investigate how the design method for the embedded software in a cyber-physical system can be applied to the physical part.
  6. The setup of the design method and applying that method in the case study pointed out that there is an enormous difference between the cyber and physical part.
  7. This difference in presents itself in development cost and system complexity.
  8. \subsection{System States}
  9. Almost every complex system that is produced today contains software.
  10. Software is often the reason that the complex system can exist in the first place.
  11. Where software can have millions of states, configurations and variables, hardware is often limited to a dozen of states.
  12. It is possible to say that the concept of scale does not exist for software as it does for hardware.
  13. For example, for a traffic simulation in software can be done with ten or one thousand cars.
  14. If the code is number of cars is specified in a variable, the developer only has to replace 10 with 1000 and restart the simulation.
  15. Scaling that simulation in hardware from ten to even twenty cars probably doubles the cost of the project.
  16. And it is not even close to one thousand cars.
  17. The software can be scaled until the simulation runs out of resources, which is a hardware limitation.
  18. % \textcite{tanenbaum_structured_1984} states: "Hardware and software are logically equivalent.
  19. % Any operation performed by software can also be built directly into the hardware [and] any instruction executed by the hardware can also be simulated in software.
  20. % The decision to put certain functions in hardware and others in software is based on such factors as cost, speed, reliability, and frequency of expected changes."
  21. % As the size and cost scale proportionally with the complexity of the hardware i.e. the simulation needs an additional 990 physical cars, complexity is often moved to software.
  22. For the current case study, the complex part is also moved to the software.
  23. Building a controller is possible in hardware, but significantly more difficult.
  24. Especially as the SCARA includes path planning.
  25. Even this relatively small project resulted in a software with more than 100 states.
  26. A large part of the software design is to decided how the states are represented in memory.
  27. And while developing the software is created based on these decisions.
  28. This is why design method incorporate short feedback cycles, changes in the design could result in rewriting of code.
  29. Looking at the mechanical states of the SCARA.
  30. In the basic implementation there are only six states.
  31. Each of these states are energy states, and can be represented with SI-units.
  32. Similar to software it is possible to change this representation, but it is preferred to stay close to the laws of physics.
  33. The biggest difference with software states is that the energy states exchange energy bi-directional.
  34. The system becomes tightly coupled and adding new states to the system does change its behavior.
  35. This makes it that the dynamic system has to be modelled and designed as a whole.
  36. The behavior of software is deterministic, a certain input always results in the same output.
  37. Any other part of the software that used that output does not change the behavior of the software that wrote the output to memory.
  38. This means that the system, in contrary to the dynamic system, is not tightly coupled.
  39. The design methods do also use this to their advantage as it is possible to implement and test the software in parts.
  40. %This is also apparent in the case study.
  41. %There are about 6 mechanical states for the SCARA.
  42. %In general, these mechanical states are represented in SI-units.
  43. %With that the units corresponding directly to a energy state in the physical system.
  44. %The control software for the SCARA contains easily more than 100 states.
  45. %In the most basic representation these states are just values in memory.
  46. %How these values are interpreted is a design decision.
  47. %This makes a design method that accounts for these fast number of states a necessity.
  48. % On the other hand, \textcite{folkertsma_energy-based_2017} shows that good understanding of hardware states can make a system less complex.
  49. \subsection{Cost of Change}
  50. The cost of change is also something that has some interesting differences.
  51. The "soft" in software gives the impression that it is easier to change \autocite{sheard_718_1998}.
  52. This does not mean that rewriting the software is cheap.
  53. Depending on the design change it is likely that the costs for software are higher than for a change in a hardware prototype.
  54. Making a hardware change on every already produced units is off course enormous.
  55. But if hardware design changes are done before production starts there is not the problem of scale.
  56. It is therefore also very common that a design process incorporates multiple prototypes\footnote{This does not imply that multiple prototypes is efficient or cheap.}, but the software is seldom completely rewritten.
  57. It often occurs that a proof of concept for hardware design is mocked up from existing components.
  58. And are often constructed with 3D-printers, tape, laser cutters and other rapid prototyping.
  59. Updating a motor is just replacing the old one.
  60. Exchange the stepper driver on the breadboard is done in minutes.
  61. However, the corresponding software driver has to be updated or replaced.
  62. This can be hours of work.
  63. The cost of change in software is directly dependent on the change.
  64. If the change is performed it can be rolled out to all other instances of the software for free.
  65. It does not scale with the number of systems.
  66. For the traffic simulation example from the previous section, any upgrade of the cars has to be done only once in software.
  67. If all there are actual cars that have to be updated ten, twenty or a thousand times, the cost are enormous.
  68. \subsection{Difference in Design method}
  69. Both of the previous sections give an example of strong differences between the approach for software and hardware.
  70. The different nature of hardware and software dictate a different design philosophy.
  71. For hardware it is important to understand the interaction between the energy states.
  72. For software it is important to define the representation of the memory states.
  73. Maybe hard- and software are not the correct definitions here.
  74. A system with energy states should be observed and simulated as a holistic system.
  75. Where the level of detail can be increased throughout the design phase.
  76. \section{Design Flow}
  77. \rro{\textcite{sheard_718_1998} discusses:}
  78. \rroi{Mechanical solutions are inherent simpler than software solution}
  79. \rro{Huge difference in states}
  80. \rroi{Mechanical part of prototype has 3 states}
  81. \rroii{2 angles, 1 marker angle (given that is still operating correctly)}
  82. \rroii{Double it for each angular velocity: making it 6}
  83. \rroi{Each embedded part of the stepper drivers have more than 30 states}
  84. \rroii{With two drivers it gives it easily 10 times more states already}
  85. \rroi{Software itself has more than 40 states}
  86. \rro{Mechanical states are linked}
  87. \rroi{Software engineer has to implement and link the states}
  88. \rro{Mechanical states/behavior is always limited by the law of physics.}
  89. \rroi{We cannot make mechanics al large as we want}
  90. \rro{Software has almost no scaling limitations}
  91. \rroi{Can have gigantious amounts of states}
  92. \rroi{States can be changed separately}
  93. \rroi{Only limitations are always the computing power}
  94. \rroi{Real-time limitations are occuring when we want to keep up with physics}
  95. \rro{Mechanics that reach the same complexity as software where this design method would be usefull is something that never fits in a Thesis.}
  96. \rroi{Probably only on industrial scale}
  97. \rro{The "soft" in software is based on that it can be changed, improved, tweaked.}
  98. \rroi{This does not mean that it is cheap or easy}
  99. \rroi{During prototyping/development it probably cheaper to make a change to the hardware}
  100. \rroi{From the point of production, software becomes cheaper to change than hardware}
  101. \rro{Humans design and build hardware, humans design software but a machine builds it.}
  102. \rroi{Therefore, any flaws that come to light during hardware build is spotted way easier.}
  103. \section{Features vs Subsystems}
  104. \rro{Original method is based on features and implementing them one by one}
  105. \rroi{Software can implement a single feature, where the output can be tested}
  106. \rroi{A single hardware feature cannot be tested as connecting another feature changes the output}
  107. \rroii{Difference between a power-connection and a singal-port}
  108. \rroi{Smallest division in hardware is a subsystem}
  109. \section{Interesting concepts}
  110. \rro{Some features are required for multiple design options}
  111. \rroi{Implementing them earlier does not contribute to the cost of switching design.}