8Fig. 10.(a) Overshoot controller with/withoutjitters(b) Overshoot controller eliminatingthe jitter problemOvershoot controller: degradation <strong>and</strong> solutionObservation 12: The problem presented above <strong>and</strong> its solutioncan be split into several tasks, like analysis <strong>and</strong> modellingof the new control algorithm, implementation of the controlalgorithm, etc. An interesting issue is how synchronized actuationinstants can be <strong>for</strong>ced in the kernel. For example, asolution could be to use a periodic task <strong>for</strong> computing u k <strong>and</strong>another periodic task <strong>for</strong> applying u k at the required <strong>time</strong>.Another solution could be to en<strong>for</strong>ce synchronized executionsat the kernel level, using the EDF tick counter. Moreover,since different solutions to the jitter problem such as [29]or [30] could have also been applied, students more confidentor interested in specific fields can select the solution that bettermeets their preferences.IV. TENTATIVE WORK PLAN AND ITS APPLICATION TO ASPECIFIC COURSEThe previous section has detailed some of the steps requiredto successfully carry out the lab activity presented in this paper.This section summarizes them in order to propose a tentativework plan that is divided into several sessions, each one beinga two-hour lab.S1 - Introduction: Introduction to the activity, <strong>and</strong> simulationof the open-loop response after obtaining the statespace<strong>for</strong>m of the RCRC circuit from the circuit differentialequations (1) (consider r<strong>and</strong>om values <strong>for</strong> R <strong>and</strong> C). Here itis assumed that state-space notation is chosen.S2 - Problem specification (a): This session should beused to specify the problem in terms of the levels <strong>for</strong> thereference signal <strong>and</strong> <strong>for</strong> discrete controller design, whichincludes selecting the sampling period <strong>and</strong> closed loop polelocations, if pole placement is used. Other control approaches,like optimal control, could also be used.S3 - Problem specification (b): To complement the previoussession, observers should also be designed <strong>and</strong> simulated.The outcome of this session should be the complete simulationsetup.S4 - Basic implementation (a): Build the RCRC circuit<strong>and</strong> verify its dynamics in open-loop. Start the controller implementationin a periodic hard real-<strong>time</strong> task in the processingplat<strong>for</strong>m.S5 - Basic implementation (b): Finish the controllerimplementation <strong>and</strong> test its correctness.S6 - Multitasking (a): Incorporate a noisy task in thesimulation setup to evaluate the effects of jitter. This stepwould require to use, <strong>for</strong> example, the TrueTime simulator.S7 - Multitasking (b): Incorporate the noisy task in theimplementation <strong>and</strong> validate the previous simulation results.S8 - Advanced implementation (a): If degradation in controlper<strong>for</strong>mance is detected in the previous session, simulateadvanced control algorithms or adopt real-<strong>time</strong> techniques tosolve or reduce the jitter problem.S9 - Advanced implementation (b): Implement the previoussolutions <strong>and</strong> validate them.Note that the program timing, layout <strong>and</strong> the set of coveredtopics should be adapted to particular needs/background of thetarget audience or to the goals of the specific curriculum. Forexample, the proposed activity has been introduced as a partof the curriculum of the 2-year master degree on Automatic<strong>Control</strong> <strong>and</strong> Industrial Electronics in the Engineering Schoolin Vilanova i la Geltrú (EPSEVG) of the Technical Universityof Catalonia (<strong>UPC</strong>) [34]. In particular, since 2007, theexperiment was tailored to become part of the laboratory <strong>for</strong>the <strong>Control</strong> Engineering course, which covers continuous <strong>and</strong>discrete linear <strong>time</strong> invariant (LTI) control systems, as well asnon-linear control systems, all using state-space <strong>for</strong>malism.Sessions S1 to S5 were adopted <strong>for</strong> the laboratory of thediscrete LTI control systems part.The <strong>Control</strong> Engineering course can be followed by studentseither in the first semester of the first year or in the firstsemester of the second year. Students choosing the secondoption simultaneously attend a course on real-<strong>time</strong> systems.There<strong>for</strong>e, within the same classroom, not all the students arefamiliar with real-<strong>time</strong> systems. To overcome this apparentdrawback, teams of three students were <strong>for</strong>med containing atleast a student with competence on real-<strong>time</strong> systems. Withinsuch heterogeneous teams in terms of skills <strong>and</strong> theoreticalbackground, it was observed that students took their responsibilities<strong>and</strong> team-work was significantly improved.As in every course edition, after finishing the discrete LTIcontrol systems part, a short <strong>and</strong> simple questionnaire is givento the students to let them evaluate several aspects of this partof the course. The question Do the laboratory activities permitto better underst<strong>and</strong> the theoretical concepts? is the only onerelated to the laboratories. Looking at the students answers,<strong>and</strong> taking into account that be<strong>for</strong>e introducing the presentedexperiment the lab activities were focused on the simulation of
9an inverted pendulum, the percentage of students appreciatingthe practical part has increased significantly. Although thest<strong>and</strong>ard course evaluation indicates this positive trend, amore complete evaluation tailored to the introduction of thisexperiment is required.V. CONCLUSIONSThis paper has presented a laboratory activity to be integratedin the education curriculum of embedded controlsystems engineers. The activity consists of a real-<strong>time</strong> controllerof a RCRC electronic circuit. The potential benefits,competences to be acquired, <strong>and</strong> expected learning outcomes<strong>for</strong> students have been presented. The selection of the plant <strong>and</strong>processing plat<strong>for</strong>m has been discussed. Extensive details ofa sample implementation have been presented <strong>and</strong> a tentativework plan <strong>for</strong> carrying out the activity has been provided.In summary, the proposed activity poses several real challengesto the students that can be met by putting togetherinterdisciplinary skills (electronics, real-<strong>time</strong> systems, controltheory, programming) towards a single goal: building a workingsystem.REFERENCES[1] D. J. Jackson <strong>and</strong> P. Caspi, “Embedded systems education: future directions,initiatives, <strong>and</strong> cooperation”, SIGBED Rev., vol. 2, no. 4, pp. 1-4,Oct. 2005.[2] K.-E. Årzén, A. Blomdell, <strong>and</strong> B. Wittenmark, “<strong>Lab</strong>oratories <strong>and</strong> real<strong>time</strong>computing: integrating experiments into control courses,” IEEE<strong>Control</strong> Systems Magazine, vol. 25, no. 1, pp. 30-34, Feb. 2005.[3] G. Buttazzo, “Research trends in real-<strong>time</strong> computing <strong>for</strong> embeddedsystems”, ACM SIGBED Review, vol. 3, no. 3, Jul. 2006.[4] P. Horacek, “<strong>Lab</strong>oratory experiments <strong>for</strong> control theory courses: Asurvey,” Annual Reviews in <strong>Control</strong>, vol. 24, pp. 151162, 2000.[5] M. Moallem, “A laboratory testbed <strong>for</strong> embedded computer control,”IEEE Transactions on Education, vol. 47, no. 3, pp. 340-347, Aug. 2004.[6] D.-J. Lim, “A laboratory course in real-<strong>time</strong> software <strong>for</strong> the control ofdynamic systems”, IEEE Transactions on Education, vol. 49, no. 3, pp.346-354, Aug. 2006.[7] M. Huba <strong>and</strong> M. Simunek, “Modular approach to teaching PID control,”IEEE Transactions on Industrial Electronics, vol. 54, no. 6, pp. 3112-3121, Dec. 2007.[8] VxWorks operating system from WindRiver, http://www.windriver.com/[9] R. Marau, P. Leite, M. Velasco, P. Martí, L. Almeida, P. Pedreiras, <strong>and</strong>J. M. Fuertes, “Per<strong>for</strong>ming flexible control on low cost microcontrollersusing a minimal real-<strong>time</strong> kernel”, IEEE Transactions on IndustrialIn<strong>for</strong>matics, vol. 4, no. 2, pp. 125-133, May 2008.[10] F. Salewski, D. Wilking, <strong>and</strong> S. Kowalewski, “Diverse hardware plat<strong>for</strong>msin embedded systems lab courses: a way to teach the differences”,SIGBED Rev., vol. 2, no. 4, pp. 70-74, Oct. 2005.[11] Evidence srl., http://www.evidence.eu.com/[12] <strong>Real</strong>-<strong>time</strong> Linux Foundation, Inc., http://www.real<strong>time</strong>linuxfoundation.org/[13] J. A. Stankovic <strong>and</strong> K. Ramamritham, “The spring kernel: a newparadigm <strong>for</strong> real-<strong>time</strong> operating systems,” SIGOPS Oper. Syst. Rev.,vol. 23, no. 3, pp. 54–71, 1989.[14] K. M. Zuberi, P. Pillai, <strong>and</strong> K. G. Shin, “Emeralds: a small-memoryreal-<strong>time</strong> microkernel,” in 7th ACM symposium on Operating SystemsPrinciples, pp. 277–299, 1999.[15] P. Gai, G. Lipari, L. Abeni, M. di Natale, <strong>and</strong> E. Bini, “Architecture <strong>for</strong>a portable open source real-<strong>time</strong> kernel environment,” in Proceedings ofthe Second <strong>Real</strong>-Time Linux Workshop <strong>and</strong> H<strong>and</strong>’s on <strong>Real</strong>-Time LinuxTutorial, Nov. 2000.[16] E. Mumolo, M. Nolich, <strong>and</strong> M. Noser, “A hard real-<strong>time</strong> kernel <strong>for</strong> motorolamicrocontrollers,” in 23rd International Conference on In<strong>for</strong>mationTechnology Interfaces, Jun. 2001.[17] P. Gai, L. Abeni, M. Giorgi, <strong>and</strong> G. Buttazzo, “A new kernel approach<strong>for</strong> modular real-<strong>time</strong> systems development,” in 13th IEEE EuromicroConference on <strong>Real</strong>-Time Systems, Jun. 2001.[18] D. Henriksson <strong>and</strong> A. Cervin, “Multirate feedback control using theTiny<strong>Real</strong>Time kernel,” in Proceedings of the 19th International Symposiumon Computer <strong>and</strong> In<strong>for</strong>mation Sciences, Antalya, Turkey, Oct. 2004.[19] OSEK/VDX Portal, http://www.osek-vdx.org/.[20] G. Buttanzo, Hard <strong>Real</strong>-Time Computing Systems: Predictable SchedulingAlgorithms <strong>and</strong> Applications, Norwell, MA, USA: Kluwer AcademicPublishers, 1997.[21] Eclipse portal, http://www.eclipse.org/.[22] Microchip portal, http://www.microchip.com/.[23] Scilab/Scicos portal, http://www.scilab.org/.[24] MathWorks portal, http://www.mathworks.com/.[25] D. Hercog, B. Gergic, S. Uran, <strong>and</strong> K. Jezernik, “A DSP-based remotecontrol laboratory,” IEEE Transactions on Industrial Electronics, vol. 54,no. 6, pp. 3057-3068, Dec. 2007.[26] K. Ogata, Modern <strong>Control</strong> Engineering, 4th Edition, Prentice Hall, 2001.[27] C. L. Liu <strong>and</strong> J. W. Layl<strong>and</strong>, “Scheduling algorithms <strong>for</strong> multiprogrammingin a hard-real-<strong>time</strong> environment,” Journal of the Association <strong>for</strong>Computing Machinery, vol. 20, no. 1, pp. 46–61, Jan. 1973.[28] K.-E. Årzén, A. Cervin, J. Eker, <strong>and</strong> L. Sha, “An introduction to control<strong>and</strong> scheduling co-design,” in 39th IEEE Conference on Decision <strong>and</strong><strong>Control</strong>, 2000.[29] J. Skaf <strong>and</strong> S. Boyd, “Analysis <strong>and</strong> synthesis of state-feedback controllerswith timing jitter,” IEEE Transactions on Automatic <strong>Control</strong>, vol.54, no. 3, pp. 652-657, March 2009.[30] P. Balbastre, I. Ripoll, J. Vidal, <strong>and</strong> A. Crespo, “A task model to reducecontrol delays,” <strong>Real</strong>-Time Systems, vol. 27, no. 3, pp. 215-236, Sep.2004.[31] C. Lozoya, M. Velasco, <strong>and</strong> P. Martí, “The one-shot task model<strong>for</strong> robust real-<strong>time</strong> embedded control systems”, IEEE Transactions onIndustrial In<strong>for</strong>matics, vol. 4, no. 3, pp. 164-174, Aug. 2008.[32] D. Henriksson, A. Cervin, <strong>and</strong> K.-E. Årzén, “TrueTime: simulation ofcontrol loops under shared computer resources,” in 15th IFAC WorldCongress, 2002.[33] Y. Wu, E. Bini, <strong>and</strong> G. Buttazzo, “A framework <strong>for</strong> designing embeddedreal-<strong>time</strong> controllers”, in 14th IEEE International Conference on Embedded<strong>and</strong> <strong>Real</strong>-Time Computing Systems <strong>and</strong> Applications, Aug. 2008.[34] EPSEVG School portal, http://www.epsevg.upc.edu/.