Springer International Publishing Switzerland 2015
Peter Hintenaus Engineering Embedded Systems 10.1007/978-3-319-10680-9_1
1. Models and Experiments
An embedded system is a computer systemsoftware and hardwarethat interacts with its physical environmentmainly without human intervention. It acquires its inputs from its physical environment via sensors; it impinges its outputs on this environment using actuators. When we set out to devise such a system we not only have to consider the software and the (digital) hardware, but also more importantly the properties of the sensors and actuators, and of the real world beyond this interface. The sensors and actuators and the apparatus they interface with might not be available. Either they may not exist at a certain stage of development or it may be too expensive or even impossible to furnish every single developer with a prototype of the system under development.
Instead of the real thing we use models as substitutes. A model is an approximate description of some realityan abstraction from realitycovering what we believe at the time of model-creation to be the essentials. When developing an embedded system we have to model the behavior of the sensors, the actuators, and of the physical reality behind. We will abstract from the software and hardware by using appropriate models of computation. Many of the systems we are building have to satisfy precise timing constraints; they become real-time systems. The processors we use for building these systems often have very limited support for debugging software. Turning to a simulation system such as the Simulink software instead, allows us to analyze the system under development and the interaction with its modeled environment at a level of detail impossible when developing on real hardware. When we are satisfied with the interactions between the models we are not done however. We have to quiz nature whether she agrees with our beliefs on how things workwe have to build a prototype and observe its behavior; we have to perform well thought-out experiments. In case some of the experiments produce unsatisfactory results we have to incorporate our new-found knowledge into our models by refining them and start all over.
1.1 Hierarchy of Systems
The control unit of an industrial robot, for example, has to solve the equations of motion for the robot several times per second in order to make the robot move its hand along a given path while performing the desired change of the orientation of the piece it holds. The motor drive powering one of the robots joints in turn has to move through a sequence of angular positions at precise points in time and with a given angular velocity at each position. The robot itself usually is part of a larger production cell. The cell controller coordinates the interaction of the cells machinery by distributing the measurements taken by the cells sensors and by providing coordinated commands to the cells machines.
The controller for the motor drive has to deal with the physics of the motor, mainly electromagnetism and some mechanics. The robot controller is mostly concerned with the kinematics and the dynamics of the robot. It has to respect the limits imposed by the actual mechanism it controls. The kinematics deals with the geometry of the movements to be performed, while the dynamics considers the masses involved and the forces and torques necessary for the movements. The cell controller relies on the systems down the hierarchy to deal with the involved physics directly; for programming it we must respect the times necessary for the the required actions only.
This type of hierarchy is typical for large embedded systems. Each layer in such a hierarchy asks for the use of specialized platforms and specialized methods in the implementation of systems at that level.
1.2 The Bottom LayerControl and Measurement
In this book, we focus exclusively on the systems at the bottom. Besides communication with the system-level above, a system at the bottom of the hierarchy typically implements a single function. In many cases, the type of function falls into one of the two broad categories, either controlling some process or providing measurements.
Often the process to be controlled converts energy from one form into another, for instance from chemical into mechanical as in combustion engines, from electrical into mechanical as in electric motors, or from one form of electrical energy into another form of electric energy as in photovoltaic inverters. Other processes requiring control are for example flows of substances, such as the flow of some liquid in a brewery.
A system populating the bottom layer typically must interact with its environment with a very high rate and at precise points in time. Sometimes the allowed error is less than a nanosecond. Such precision is not attainable in software, therefore specialized periphery, often in the form of application specific coprocessors operating with some degree of autonomy, is used to relieve the main processor from directly dealing with this interaction. Furthermore, power consumption should be low. Often such a system must operate off a small energy storage like a battery. Even when the system runs off the mains high power consumption produces large amounts of waste heat. When a number of systems have to operate in a confined space removal of the waste heat may be a challenge. Physical size and costs force us to build systems with a minimum number of hardware components. The amount of memory integrated together with the processors and the peripheral devices onto a single semiconductor chip determines to a large extent the size and the cost of the chip. An interface to memory devices external to the processor chip demands an increased number of connections, and therefore a more costly package for the chip. Unless the application absolutely needs large memories, we minimize the systems memory footprint and work with the memory resources provided on the processor chip. Lack of memory also keeps us from using complex operating systems. Quite often we work without an operating system at all. The little systems programming required, such as interrupt handling or scheduling, becomes part of the application.
1.3 Models of Physical Reality
Whenever feasible applying the laws of physics will give us very precise models. When these models become intractable or when we lack knowledge for applying the laws of physics, statistical inference may come to our rescue producing models from observations alone.
1.3.1 Models Based on First Principles
The laws of physics constitute mankinds beliefs about the behavior of inanimate objects. Before formulating these laws, physicists throughout the centuries have made quantitative observations of the behavior of nature; they have measured physical quantities. Next they have imagined conjectures fitting the measurements within the precision of the observations. Once a conjecture has been formulated, physicists can use the conjecture to make predictions about the behavior of nature. The more the predictions match with the associated measurements, the more accepted the conjecture becomes until it is established as a law of physics. A single contradictory observation, however, provided the measurement uncertainty is small enough, topples a law of physics, as nature is always right. At times the then accepted laws in different fields of physics have produced contradictory predictions; the current physical knowledge at that time has been inconsistent. Eventually, physicists have developed more refined theories replacing the older laws. At the end of the nineteenth century for example, electrodynamics, the theory describing electrical and magnetic phenomena and Newtonian mechanics were the accepted theories. Both theories were supported with vast numbers of experiments. However, these two theories provided contradictory predictions. In 1905, Einstein, based on the work by H.A. Lorentz and H. Poincar introduced a new theory for mechanics, special relativity, resolving these contradictions (Einstein ). Newtonian mechanics survived as a very good approximation describing the behavior of macroscopic bodies moving at moderate speeds.