210 likes | 305 Views
Anton Cervin. Lund University Sweden. Enrico Bini. Scuola Superiore Sant’Anna, Pisa, Italy. Delay-Aware Period Assignment in Control Systems. Matlab routine available at: http://retis.sssup.it/~bini/. Real-Time Systems Symposium, 2008. t 1. t 2. t n. Overview. CPU. T 1. T 2. T n.
E N D
Anton Cervin Lund University Sweden Enrico Bini Scuola Superiore Sant’Anna, Pisa, Italy Delay-Aware Period Assignment in Control Systems Matlab routine available at: http://retis.sssup.it/~bini/ Real-Time Systems Symposium, 2008
t1 t2 tn Overview CPU T1 T2 Tn • n independent plants to be controlled by n controllers • one CPU to schedule them Problem: assign the periods {Ti} such that overall control cost is minimized We find an analytical solution!!!
The execution of a controller • a set of ncontrol tasks {t1,...,tn} • scheduled by FP • A task ti is modeled by (Ci, Ti), where: • Ci is the worst-case computation time; • Ti is the period; • Ui=Ci/Ti is the utilization; • Rij is the job response time; • no deadline is enforced.
We make a linearization The cost of a controller The cost is standard Linear Quadratic Gaussian (LQG) that is It applies to any other domain where period, delay minimization is required
“The cost Ji is ” Let Ji(T,D) be any smooth cost function, Ti0 and Di0 be nominal values of period and delay of ti (for example Ti0=Di0=Ci) • make a linear approx of Ji at (Tik,Dik) and we set aik and bik as the partial derivative of Ji; • Solve (very efficiently) the linear problem and set Tik+1 as the solution and Dik+1 accordingly • Go back to 1. The linear cost The convergence is not demonstrated, but always obtained.
Modeling the delay In control, Di is the separation between sampling and actuation How do we model Di as function of T1,...,Tn? • separation from activation to completion varies job by job • Di=Ri? Overestimate, no expression func of Ti • Di=Riub? Exists expression of Ti, larger • overestimate • Di=avgj{Rij}? good estimate, no expression Average response time seems the good one
(2,4) 7 5 6 6 (3,6) The delay approximation We claim that average Rij is “something like” • seems a good approximation of avgj{Rij} • it’s the resp time if hp tasks were fluid • if, a posteriori, we see good performance then it’s a good delay approximation
Seto et al [RTSS96] solved with bi=0 Formalization of the problem We aggregate the overall cost by sum Ji Notice we don’t care of classic FP schedulability!
Lagrange multipliers + Partial differentiation + Luck = Analytical solution of the problem Solution of the problem At pag. 296, Equations (34)--(37), you can see the expression of the solution
The priority assignment • RM is not guaranteed to be optimal. • What is the control-optimal assignment? Intuition: since the cost is • large bi high priority to ti • two “orthogonal” problems: priority assignment (based on bi) and period assignment (based on ai) Since we found the analytical (fast) solution, then we can try to enumerate all possible (n!) priority orderings
Introducing experiments • Tested methods: • FirstVertex, by Bini, Di Natale [RTSS05] • RiApprox, this method • Seto96(1), by Seto et al [RTSS96], U=1 • Seto96(Ulub), Seto96, U=Ulub
One experiment • Matlab code available on my homepage • priority assigned by brute force (n!)
One experiment • Matlab code available on my homepage • priority assigned by brute force (n!)
Quality of delay approx • random Ci, ai, bi, nÎ{3,7,19} • We compute periods according • RiApprox • For all tasks we evaluate Riapprox/Riavg • Riavg is computed by simulating • the schedule • on x axis, tasks by decreasing pri Riapprox/Riavg highest lowest task priority
Quality of delay approx Riapprox/Riavg highest lowest task priority
Comparing the costs • cost is LQG (not synthetic) • 3 kinds of plant generated randomly • 2 stable poles • 2 stable pole, 1 unstable • 3 stable/ustable poles • reference is Ti=Di=Ci • costs are normalized with reference 2 stable poles 2 stable, 1 unstable poles 3 stable, unstable poles
Comparing the costs 2 stable poles 2 stable, 1 unstable poles 3 stable, unstable poles
Future works • Extension in presence of a virtual processor. • More efficient priority assignment. • A delay sequence of 2, 4, 2, 4, 2, 4,... may not perform the same as a constant delay of 3. Account for it.
? ?
cost/Seto96(1) bi magnutude (sensitivity to delay) Quality of delay approx 2 • 5 tasks • random Ci, ai • we increased the average bi • cost is synthetic • reference is Seto(1)