Control-aware Scheduling for Time-triggered ... - Semantic Scholar

1 downloads 0 Views 271KB Size Report
determined by Integer Linear Programming (ILP). This ILP approach considers all system constraints as well as appli- cation deadlines and determines the ...
Control-aware Scheduling for Time-triggered Automotive Systems Martin Lukasiewycz TUM CREATE Singapore

Dip Goswami, Reinhard Schneider, Samarjit Chakraborty TU Munich Munich, Germany

[email protected]

{reinhard.schneider, dip.goswami, samarjit.chakraborty}@rcs.ei.tum.de ABSTRACT This paper presents a schedule optimization approach for control applications in time-triggered automotive systems. Here, both sampling periods an bus as well as operating system schedules are optimized concurrently for a given architecture, a set of applications, and task mapping. Two conflicting optimization goals are considered: the control performance and the load of the system. For a given set of sampling periods of the applications, the optimal schedule is determined by Integer Linear Programming (ILP). This ILP approach considers all system constraints as well as application deadlines and determines the starting times of tasks and a bus configuration for the FlexRay protocol. In order to optimize the control performance directly, the control performance is approximated by a linear or quadratic function. The experimental results give evidence of the efficiency of the proposed methodology. For a set of three control applications and two additional non-critical applications, a set of Pareto-optimal solutions is determined.

∀a ∈ A : select sampling period ha Defined: ILP Solver: Pminimize: J = a∈A Ja (ha , τa ) subject to: ∀a ∈ A : τa ≤ da

Architecture

Applications A

feasible schedule S exists

no

Deadlines da

Task Mapping yes

no

termination yes

Optimal schedule S

1.

INTRODUCTION

Modern top-of-the-range cars consist of up to 80 Electronic Control Units (ECU) and multiple buses and gateways. Novel bus systems and design paradigms are necessary to cope with this growing complexity and growing number of safety-critical control applications. With the introduction of the FlexRay bus [3], fully time-triggered automotive system are enabled. In contrast to a asynchronous scheduling [4], a synchronous system [6] leads to significantly lower end-to-end delays and no jitter. Applications that are executed periodically benefit from these time-triggered architectures, leading to an improved control quality due to the deterministic behavior. At the same time, simulation, integration, and testing efforts are reduced significantly due to the predictability of the system. These properties make such time-triggered systems ideal candidates for next-generation automotive architectures, e.g., in electric vehicles. Contributions of the paper. In this paper, a framework based on Integer Linear Programming (ILP) is outlined that Supported in part by the National Research Foundation (NRF), Singapore. Copyright is held by the author/owner(s). EMSOFT’11, October 9–14, 2011, Taipei, Taiwan. ACM 978-1-4503-0714-7/11/10.

Figure 1: Control-aware optimization flow.

performs schedule synthesis for time-triggered systems, considering control applications. The schedule and sampling periods are optimized concurrently in terms of control performance and system load. The proposed optimization flow is illustrated in Figure 1.

2.

OPTIMIZATION APPROACH

Control Applications. We consider distributed control applications as illustrated in Figure 2. In general, a feedback control system performs three tasks: (1) measure the states x(t), (2) compute the control input u(t), and (3) apply this control input to the actuator. These three tasks are executed in the system as sensor task, controller task, and actuator task. In a distributed control, delays are introduced not only by the task execution times but also by the transmission times that derive from the communication over the network. In general, a smaller delay τa of a control application a leads to a better control performance in terms of settling time, stability, etc. On the other hand, the sampling period ha has also an impact on the control performance. We consider the

(a) Architecture, Application, and Task Mapping:

x(t) ˙ = Ax(t) + Bu(t) System

Hold ta

Controller tc

N etwork

Sample ts

ECU1

ECU2

ts1

ts2 ta

N etwork

ECU3 m3 tc m2

m1

F lexRay

(b) Schedule S:

Figure 2: Distributed control feedback system.

delay τa (≤ da ) period ha

following commonly used quadratic performance ts1 function for each control application, ts2 N Z (k+1)ha X 2 Ja (ha , τa ) = [u(t) + x(t)0 x(t)]dt, (1) kha

m2

m1

where N is the total number of samples under consideration. A small Ja equals a good control performance. Optimization Flow. The proposed optimization flow is illustrated in Figure 1. In an outer loop, a sampling period ha for each control application a ∈ A is selected. If the number of available sampling periods and applications is low, this might be done as exhaustive search. In case the number of applications or sampling periods is high, heuristic approaches like Evolutionary Algorithms (EAs) might be applied. For each set of sampling periods, an ILP is applied to determine the optimal schedule in terms of control performance. For this purpose, the performance function in Eq. 1 is approximated by a linear or quadratic function (using Quadratic Programming (QP)). The outer loop is terminated after a given number of iterations or when the optimal schedule S is found. System Model. A system as illustrated in Figure 3 (a) is assumed and translated to an ILP formulation. As bus system, the FlexRay bus is used. For the operating systems of the Electronic Control Units (ECUs), a non-preemptive scheduler based on eCos [2] and the preemptive Last In First Out (LIFO) scheduler in OSEKtime [5] are used. Finally, a generic formulation constrains the end-to-end delay for each path in an application. The scheduling is performed at task-level, compliant with the automotive-specific AUTOSAR [1] and FlexRay specification. The used formulation has the following advantages: (1) The models of each component are generated separately, (2) an incremental scheduling of legacy systems is possible, and (3) there are no restrictions on the maximal end-to-end delays or distributions of applications across a communication cycle. A corresponding schedule S for the system in Figure 3 (a) is illustrated in Figure 3 (b). Experimental Results. Experimental results were carried out for are system consisting of 4 ECUs, connected via a FlexRay bus. Three open-loop unstable control plants were considered (which might be typical time-critical automotive applications such as brake-by-wire, engine control, or adaptive cruise control). Application a1 has the higher degree of instability compared to a2 and a3 . Hence, we choose the periods as follows: • ha1 ∈ {5ms, 10ms,20ms} and • ha2 , ha3 ∈ {5ms, 10ms, 20ms, 40ms}.

ts1

ECUt2a

ts2

ts1 ta

ts2

F lexRay tc

m3

m2

ECU3

m1

tc

m3

m2

Figure 3: Example of an architecture and task mapping of a given application, see (a). A schedule S is defined by the starting times of all tasks and a bus schedule, see (b). The schedule has to respect the deadline and the goal is to minimize the delay such that the control performance is optimized. ·104 2.4 performance J

k=0

ECU1

dominated pareto optimal

h = (20 40 40) h = (20 20 40)

2.2 h = (20 40 20)

2

h = (20 20 20) h = (5 20 20)

0.4

0.45

0.5

0.55

0.6

ECU load Figure 4: Control performance J versus utilization of the ECUs. This enabled an exhaustive search in the outer loop of the optimization flow in Figure 1, leading to 46 possible combinations of sampling periods. Concurrently, two non-critical applications a4 and a5 have to be scheduled (the deadlines are da4 = da5 = ∞). The entire runtime of the optimization took 4143 seconds, resulting in the Pareto-front in Figure 4.

3. [1] [2] [3] [4] [5] [6]

REFERENCES

AUTOSAR. AUTomotive Open System ARchitecture. http://www.autosar.org. eCos. embedded Configurable operating system. http://ecos.sourceware.org/. FlexRay Consortium. FlexRay Communications Systems Protocol Specification. http://www.flexray.com. M. Lukasiewycz, M. Glaß, P. Milbredt, and J. Teich. FlexRay Schedule Optimization of the Static Segment. In Proc. of CODES+ISSS 2009, pages 363–372, 2009. OSEK/VDX. Time Triggered Operating System. http://www.osek-vdx.org/. H. Zeng, W. Zhengzheng, M. Di Natale, A. Ghosal, P. Giusto, and A. Sangiovanni-Vincentelli. Scheduling the flexray bus using optimization techniques. In Proc. of DAC 2009, pages 874–877, 2009.

m1

Suggest Documents