Real-Time Systems. Design Principles for Distributed Embedded Applications. Herman Kopetz. Second Edition (811374), страница 38
Текст из файла (страница 38)
5.4.3.Example: Let us analyze the required temporal accuracy intervals of the RT images thatare used in a controller of an automobile engine (Table 5.1) with a maximum rotationalspeed of 6,000 revolutions per minute (rpm). There is a difference of more than six ordersof magnitude in the temporal accuracy intervals of these RT images. It is evident that thedacc of the first data element, namely the position of the piston within the cylinder, requiresthe use of state estimation.point of observationsending taskcommunicationreceiving taskFig. 5.6 SynchronizedactionsWCET sendWCCOMpoint of useWCET recreal-time5.4 Temporal Accuracy5.4.2119Classification of Real-Time ImagesParametric RT Image.
Assume that an RT image is updated periodically by a stateobservation message from the related RT entity with an update period dupdate(Fig. 5.7) and assume that the transaction is phase aligned at the sender. If thetemporal accuracy interval dacc satisfies the conditiondacc >ðdupdate þ WCETsend þ WCCOM þ WCETrec Þ;then we call the RT image parametric or phase insensitive.A parametric RT image can be accessed at the receiver at any time withouthaving to consider the phase relationship between the incoming observation message and the point of use of the data.Example: The RT transaction that handles the position of the accelerator pedal (observation and preprocessing at sender, communication to the receiver, processing at the receiverand output to the actuator) takes an amount of time:WCETsend þ WCCOM þ WCETrec ¼ 4 ms:Because the accuracy interval of this observation is 10 ms (Table 5.1), messagessent with periods less than 6 ms will make this RT image parametric.If components are replicated, then care must be taken that all replicas access thesame version of a parametric RT image, otherwise the replica determinism (seeSect.
5.6) will be lost.dacc of real-time image of current cyclesending taskcommunicationreceiving taskpoints ofobservationWCETsendWCCOMpoint of use of the RTimage of the currentcycle may be any timeduring this intervalpoint of useWCETrecdupdateRT image of current cycleRT image of next cyclereal-timeFig. 5.7 Parametric real-time imageTable 5.1 Temporal accuracy intervals in engine controlRT image within computerMax.
changePosition of piston within cylinder6,000 rpmPosition of accelerator pedal100%/sEngine load50%/sTemperature of the oil and the coolant10%/minAccuracy0.11%1%1%dacc3 ms10 ms20 ms6s1205 Temporal RelationsPhase-Sensitive RT Image: Assume an RT transaction that is phase-aligned at thesender. The RT image at the receiver is called phase sensitive ifdacc bðdupdate þ WCETsend þ WCCOM þ WCETrec Þanddacc >ðWCETsend þ WCCOM þ WCETrec ÞIn this case, the phase relationship between the moment at which the RT image isupdated, and the moment at which the information is used, must be considered.In the above example, an update period of more than 6 ms, e.g., 8 ms, would makethe RT image phase sensitive.Every phase-sensitive RT image imposes an additional constraint on the scheduling of the real-time task that uses this RT image.
The scheduling of a task thataccesses phase-sensitive RT images is thus significantly more complicated than thescheduling of tasks using parametric RT images. It is good practice to minimize thenumber of RT images that are phase-sensitive. This can be done, within the limitsimposed by dupdate, by either increasing the update frequency of the RT image, or bydeploying a state-estimation model to extend the temporal accuracy of the RTimage. While an increase in the update frequency puts more load on the communication system, the implementation of a state-estimation model puts more load onthe processor.
A designer has the choice to find a tradeoff between utilizingcommunication resources and processing resources.5.4.3State EstimationState estimation involves the building of a model of an RT entity inside an RTobject to compute the probable state of an RT entity at a selected future instant andto update the corresponding RT image accordingly.
The state estimation model isexecuted periodically within the RT object that stores the RT image. The controlsignal for the execution of the model is derived from the tick of the real-time clockthat is associated with the RT object (see Sect. 5.3.2). The most important futureinstant where the RT image must be in close agreement with the RT entity is tuse, theinstant where the value of the RT image is used to deliver an output to theenvironment. State estimation is a powerful technique to extend the temporalaccuracy interval of an RT image, i.e., to bring the RT image into better agreementwith the RT entity.Example: Assume that the crankshaft in an engine rotates with a rotational speed of3,000 rpm, i.e., 18 /ms. If the time interval between the instant of observation, tobs, of theposition of the crankshaft and the instant of use, tuse, of the corresponding RT image is500 ms, we can update the RT image by 9 to arrive at an estimate of the position of thecrankshaft at tuse.
We could improve our estimate if we also consider the angular acceleration or deceleration of the engine during the interval [tobs, tuse].5.4 Temporal Accuracy121An adequate state estimation model of an RT entity can only be built if thebehavior of the RT entity is governed by a known and regular process, i.e., a wellspecified physical or chemical process. Most technical processes, such as the abovementioned control of an engine, fall into this category. However, if the behavior ofthe RT entity is determined by chance events, then, the technique of state estimationis not applicable.Input to the State Estimation Model. The most important dynamic input to the stateestimation model is the precise length of the time interval [tobs, tuse].
Because tobsand tuse are normally recorded at different nodes of a distributed system, a communication protocol with minimal jitter or a global time-base with a good precision is aprerequisite for state estimation. This prerequisite is an important requirement inthe design of a field bus.If the behavior of an RT entity can be described by a continuous and differentiable function v(t), the first derivative dv/dt is sometimes sufficient in order to obtain areasonable estimate of the state of the RT entity at the instant tuse in the neighborhood of the instant of observation:vðtuse Þ vðtobs Þ þ ðtuse tobs Þdv = dtIf the precision of such a simple approximation is not adequate, a more elaborateseries expansion around tobs can be carried out. In other cases a more detailedmathematical model of the process in the controlled object may be required.
Theexecution of such a mathematical model can demand considerable processingresources.5.4.4Composability ConsiderationsAssume a time-triggered distributed system where an RT entity is observed by thesensor node, and the observation message is then sent to one or more nodes thatinteract with the environment. The length of the relevant time interval [tobs, tuse] isthus the sum of the delay at the sender, given by the length [tobs, tarr], and the delayat the receiver, given by the length [tarr, tuse], (the communication delay is subsumed in the sender delay). In a time-triggered architecture, all these intervals arestatic and known a priori (Fig. 5.8).point ofobservation tobspoint ofarrival tarrpoint ofuse tuselatency at sender dsendFig.
5.8 Latency at senderand receiverlatency at receiver drecreal-time1225 Temporal RelationsIf the state estimation is performed in the RT object at the receiver, then anymodification in the delay at the sender will cause a modification of the time intervalthat must be compensated by the state estimation of the receiver.
The receiversoftware must be changed if a latency change takes place inside the sender node. Todecrease this coupling between the sender and the receiver, the state estimation canbe performed in two steps: the sender performs a state estimation for the interval[tobs, tarr] and the receiver performs a state estimation for the interval [tarr, tuse].
Thisgives the receiver the illusion that the RT entity has been observed at the point ofarrival of the observation message at the receiver. The point of arrival is then theimplicit timestamp of the observation, and the receiver is not affected by a schedulechange at the sender. Such an approach helps to unify the treatment of sensor datathat are collected via a field bus as well as directly by the receiving node.5.55.5.1Permanence and IdempotencyPermanencePermanence is a relation between a particular message arriving at a node and the setof all related messages that have been sent to this node before this particularmessage. A particular message becomes permanent at a given node at that pointin time when the node knows that all related messages that have been sent to it priorto the send time of this message have arrived (or will never arrive) [Ver94].Example: Consider the example of Fig.