Anda di halaman 1dari 4

CS 424 Real-Time Systems Homework 2 Due: 10/25/12 in class 1.

Fault Tolerance a) A sensor S could be unreliable and might send different values to different receivers R1, R2 and R3. The origin of the failure is known to be due to random physical failures such as bit flipping. How can we protect against such sensor faults. That is, working receivers will use the correct value. b) A sensor S measurement is distorted by environmental interference. For example, a magnetic compass is interfered by a near by strong magnetic field. How can protect against such sensor faults? 2. Exact Schedulability a) Write a program in python or java code to perform exact schedulability analysis. Should take in a list of processes, execution times, and period Page 3 This program should print out the answer step by step. Use this program to perform schedulability analysis. b) Given 4 tasks T1: {c1 = 3, p1 = 10}, T2: {c2 = 6.5, p2 = 25}, T3: = {c3 = 10, p3 = 30}, and T4 = {c4 = 1, p4 = 90} 3. Blocking Sa Sb Sc a) What are the blocking time of each task, B1, B2, B3 and B4, T1 2 1 assuming that priority ceiling protocol is used. T2 9 3 b) Given your blocking times and the following run, and deadlines are the T3 8 6 T4 4 7 5 tasks schedulable? T1: {c1 = 3, p1 = 25}, T2: {c2 = 5, p2 =35}, Page 3 T3: {c3 = 10, p3 =60}, T4: {c4 = 11, p4 = 80} 4. PID Tuning Experimental tuning procedure First set derivative gain and integral gain to zero. Slowly increase the proportional gain until the device oscillates around the set point with a speed that is satisfactory. 0 At this point, the real part of the eigenvalue is: 4a) ______ frequency the imaginary part of the eigenvalue determines the 4b) ______ of oscillation Slowly increase the derivative gain until the device settles down at the setpoint. At this point, negative the real part of the eigenvalue is 4c) ______ If there is steady-state error, slightly increase the integral gain until the steady state error is corrected and yet not causing serious oscillations. This means that negative the real part of the eigenvalues is still 4d) ______ . Fine tuning increase If the motion movement towards setpoint is too slow, we can 4e)______ the proportional gain reduce or 4f)______ derivative gain, dont play with integral gain! integral If there is steady-state error, we can add a little of 4g)______ gain. increase If the motion overshoots the setpoint and oscillates, we can 4h)______ the derivative gain or proportional integral gain and 4j)______ gain reduce 4i)______

5. Add PID controller, pick the gains and show that you can control in using Matlab Simulink Note: You need to show your Simulink diagram with your PID controller parameters and cut and paste a screen shot of the simulation from the scope on angle
0 .1 *9 .8 m a rb l e s co s T ri g o n o m e tric F u n cti o n L /2 P ro d u ct 0 .4 Sum Sum 1 fri ctio n vo l t to flo w ra te 1 1 s fl o w ra te to wa te r i n th e ta n k g 9 .8 -0 .0 3 Sum 2 M o m e m t o f i n e rti a 1 /(0 .5 *0 .4 *0 .4 ) 1 s a n g u a r a cc to a n g ve l 1 s ve l to a n g l e ang le

This feedback just models the friction of the system!

Note that the angle has a limit due to the table that restricts the beams movement

task: T1 Time Now: 1.0 task: T1 Time Now: 11.0 task: T2 Time Now: 17.5 task: T1 Time Now: 20.5 task: T3 Time Now: 30.5 task: T1 Time Now: 33.5 task: T1 Time Now: 40.5 task: T2 Time Now: 47.0 task: T1 Time Now: 51.0 task: T3 Time Now: 61.0 task: T1 Time Now: 64.0 task: T2 Time Now: 70.5 task: T1 Time Now: 73.5 task: T1 Time Now: 80.5 These tasks are scheludable

2. Exact Schedulability

Deadline: Deadline: Deadline: Deadline: Deadline: Deadline: Deadline: Deadline: Deadline: Deadline: Deadline: Deadline: Deadline: Deadline:

10 20 25 30 30 40 50 50 60 60 70 75 80 90

3. Blocking

a) What are the blocking time of each task, B1, B2, B3 and B4, assuming that priority ceiling protocol is used. For do that we need to apply this formula to get the solution: B = max{CS(k,S)| i,k in Use(S), pr(k)<pr(i)<=C(S)} B1 = 9 B2 = 8 B3 = 7 B4 = 0 b) Given your blocking times and the following run, and deadlines are the tasks schedulable? T1: {c1 = 3, p1 = 25} T2: {c2 = 5, p2 =35} T3: {c3 = 10, p3 =60} T4: {c4 = 11, p4 = 80} Task 1: R11 = 3 + 9 < 25 schedulable Task 2: R21 = c1 + c2 + b2 = 16 R22 = c2 + b2 + Ceiling[r21/T1]*c1 = 16 < 35 schedulable Task 3: R31 = c1 + c2 + c3 + b3 = 3+5+10+7 = 25 R32 = c3 + b3 + Ceiling[r31/p1]*c1 + Ceiling[r31/p2]*c2 = R32 = 10 + 7 + 1*3 + 1*5 < 60 schedulable Task 4: R41 = c1 + c2 + c3 + c4 = 29 R42 = c4 + Ceiling[r41/p1]*c1 + Ceiling[r41/p2]*c2 + Ceiling[r41/p3]*c3 R42 = 11 + 2*3 + 1*5 +1*10 = 32 R43 = c4 + Ceiling[r42/p1]*c1 + Ceiling[r42/p2]*c2 + Ceiling[r42/p3]*c3 R43 = 11 + 2*3 + 1*5 +1*10 = 32 schedulable

Anda mungkin juga menyukai