You are on page 1of 11

2013HZ12362: Prakash Katudia

Q1 : Hard Realtime System Chosen is the Flight Controller This system looks like the following In the above real time system. The plant is a helicopter ,it has one velocity components. This system uses sampling rate of 180 hz.After initialization the system executes a do loop at the rate of one iteration at every 1/180 sec. The system takes 30milisecs to initialize Processors we would need atleast two processors one to run computation logic another, another as the data link between sensor and controller . The same datalink can be used to communicate to the plant, however if possible a separate processor can be used for the datalink to the plant. Resources State Estimator(Sensor) Plane(Plant) Flight Controller Software structure for Flight Controller is Systen initializes After initialization at every 1/180(=~5milisecs) sec cycle do ->Read state estimator data,validate the read data (T1) ->compute the control laws ofi nner yaw control loop using the state estimator values validated above(T2) ->output resultant commands(T3)

->carry out built in test(T4) ->wait till next cycle begins <-30ms for inirilization-> J0 J1 J2 J3 J4..Jn The jobs discussed below are for task T1 The periodic computations(T1) can be stated in terms of release time of the jobs computing the control law. Lets name the jobs as J0, J1, J2..Jn The release time Ji is 30+5*I milisecs Each job must complete before the release of the next job. In this case Jis relative deadline is 5milisecs Jis absolute deadline is 30+((i+1)*5) ms We have four periodic tasks running. The jobs for T1 are going to be indicated as J11, J12J1n. The jobs for T2, T3 and T4 are similarly represented. In our sample real time systems we are assuming we donot need to respond to any external events, so we donot have any aperiodic or sporadic tasks in our model. Now for the model for our periodic tasks T1,T2,T3 and T4 we need to find the utilization of each task and the utilization of the system . 0 1 2 3 4 5 6 7 8 9(time in miliseconds) J11 J21 J31 J41 J12 J22 J32 J42 From the above we can say T1 : p1(Period of T1) 5ms, e1(Execution time) 1ms T2: p2 = 5ms, e2=1ms T3: p3 =5ms, e3= 1ms T4: p4= 5ms, e4=1ms H = hyper period = LCM(5,5,5,5) = 5ms So the pattern repeats after every 5ms. u1= utilization of T1 = e1/p1 = 1/5 = 0.2

u2= utilization of T2 = e2/p2 = 1/5 = 0.2 u3= utilization of T3 = e3/p3 = 1/5 = 0.2 u4= utilization of T4 = e4/p4 = 1/5 = 0.2 Utilization of the system = u1+u2+u3+u4 = 1 The jobs for task T2 are dependent on the jobs for task T2, the ones for T3 are dependent on T2 and T4 jobs are dependent on T3 So the precendence constraint is as follows (35,1]---a (36,1]---a (37,1]---a (38,1)

J11 J21 J31 J41 Suggested scheduling algorithm for this model is static clock driven scheduling as all the tasks involved are periodic tasks as all the hard deadlines are known. We can calculate the schedule onetime and use it .

You might also like