International Journal of Innovative Computing, Information and Control Volume 6, Number 4, April 2010

c ICIC International °2010 ISSN 1349-4198 pp. 1–10


CIMS Research Center Tongji University NO.4800Cao’AnRoad, Jiading District, Shanghai, 201804, China [email protected] 2

College of Electric Power and Automation Engineering Shanghai University of Electric Power NO2103PingliangRoad, Yangpu District, Shanghai, 200090, China

Received June 2009; revised December 2009 Abstract. With increasing demand of improving control performance in resource limited networked control system, many scheduler comes out to solve the problem of multicontrol-loops sharing a control network. In this paper, a feedback scheduler which consists of a monitor, a controller and an actuator was proposed to manage the problem. And correspondent experiment based on Truetime, an event-based simulator for control and real-time systems co-design, was designed and implemented. Preliminary simulation results show that the feedback scheduler suggested is effective and significantly impact the control performance of NCS. Keywords: Truetime, NCS, feedback scheduler, Ethernet

1. Introduction. Nowadays networked control systems (NCS) have been one of the main research fields in academic as well as other industrial applications for many decades. NCS have taken the form of a multidisciplinary area. With the development of communication network, computer technology, especially the concept of remotely controlling a system, networked control systems then came into the world. Its classic definition can be as follows: When a traditional feedback control system is closed via a communication channel, which may be shared with other nodes outside the control system, is called an NCS (See [?]). Also it can be defined as a closed-loop feedback control system through a real-time network. More and more control system components are connected in the application such as actuators, sensors, and controllers (See [?]). Besides the complex devices connected to the network, control system becomes increasingly complex both from the control and computer science perspective, even seemingly simple embedded control system which this paper focuses on often contain a multi-tasking real-time kernel and support networking. Unlike other control system, NCS use network which can effectively reduce the complexity of systems, with nominal investments and less wiring. Most common seen NCS consists of several subsystems in each of which contains a sensor, an actuator, a controller by itself as depicted as Figure1. We can see that NCS is different from common control system. And they are the distributed control system based on the real-time communication networks. In order to make NCS have certain basic capabilities, NCS should have some basic components: information acquisition (sensors), command (controllers), and communication and control (actuator). When it comes to communication layer, being the backbone of the NCS, reliability, security, ease of use, and availability, are the main focus when choosing the communication or data transfer 1



type. Lots of communication modes are available from CAN to Ethernet. It can specify the transmission rate, the medium access control protocol (CSMA/CD, CSMA/CA, round robin, FDMA, or TDMA). In this paper, CSMA/CD was chosen to do the simulation.

Figure 1. Most common NCS Many computer-controlled systems are distributed systems. Because of its communication network connecting the various subsystems, it gives rise to networked control loops. The controllers are often implemented as one or several tasks on a microprocessor with a time operating system. Then the CPU time and the communication bandwidth can hence be viewed as shared resources for which the tasks complete. There are many important research topics in NCS area. The network gives the control system time delay that is the latency between the sampling of the inputs to the controller and the generation of the outputs. A wide branch focuses on different control algorithm and network scheduling to investigate the true effects of timing non-determinism on control performance, which is also this paper’s emphases (See [?],[?]). The study of network structure required to provide a reliable secured communication channel with enough bandwidth, and the development of data communication protocols for control system are another two important research topics concerning NCS. 2. Truetime. In this paper, a toolbox called Truetime made by Lund Institute University, Sweden, based on Matlab/Simulink is used to simulate the temporal behavior of a multi-tasking real-time kernel containing controller tasks (See [?]). With Truetime, it is also possible to simulate the timing behavior of communication networks used in networked control systems. This paper mainly used it to experiment with new more flexible dynamic scheduling approaches to improve the performance of networked control system. There are two main simulink blocks in the Truetime toolbox: computer block and network block. The input signals are assumed to be discrete, except the signals connect to A/D port which may be continuous, and all the output signals are discrete. Both of them are event-driven, and the event can be internal correspond to clock interrupts or external correspond to external interrupts which may be caused by signals arriving at the port. Users can use programming language C++ or Matlab language to create tasks in the blocks so as to control processes. Using Truetime, every node at the network can be a computer simulated by computer block with a simple but flexible real-time kernel, A/D and D/A converters, a network interface and external interrupt channels, as shown in Figure2. All of these including tasks and interrupt handlers are realized by user-written code functions, either in C++ or as Matlab m-files. Creating tasks in computer block is very important and necessary in Truetime simulation environment. It can simulate not only periodic activities, such as controller and I/O tasks, but also aperiodic activities, such as communication tasks and



event-driven controller. Inside computer blocks, besides creating tasks, there are external interrupt triggered when the signal of corresponding channel changes value, and internal interrupt associated with timers. Both of them which are much the same as tasks but have higher priority level, can also be user-defined as well as interrupt handlers to server the interrupt. Another important block is network block which is also similar to the real-time kernel model. See Figure2. It is used to be as simulated transmission of messages executed when messages enter or leave the network. A message contains information about the sending and the receiving computer node, arbitrary user data, the length of the messages, and optional real-time distributes such as a priority or a deadline. There are several easy choices for users on the medium access control process like CSMA/CD, CSMA/CA, FDMA, TDMA or round robin. This paper chooses CSMA/CD to research the scheduling method.

Figure 2. Computer Block and Network Block As NCS now is a very hot research topic in the world, there are two recently developed Matlab-based analysis tools for real-time control system. One is Truetime, and the other one is called Jitterbug. (See [?]) Jitterbug is also a Matlab-based toolbox which allows computation of a quadratic performance criterion for a linear system under various timing conditions. However, its use is to assume the knowledge of sampling period and latency distributions which is difficult to obtain without access to measurements from the true target system under implementation. So this paper resorts to simulation by using toolTruetime. With all the advantage Truetime has, it is possible to do much co-simulation. However, it still has its innate disadvantages. One general limitation is that it is just a research tool rather than a tool for system developers. It has its specific code function format which is really hard to directly simulate production code. Finally, it’s a tool based on Matlab-an expensive commercial tool. 3. Ethernet for Control and Some Problems on NCS. In this paper, we take the standard Ethernet(10MBps) without any modifications or enhancements as our research focus for control network. Ethernet nowadays is becoming a prime network control candidate due to two important and obvious reasons: its availability and its flexibility. Almost all the computers today with a network adapter can be connected into Ethernet. This fact translates into remote control because of easily access into Internet and low equipment cost because of its standardization. With its flexibility, Ethernet is able to transmit message from a minimum size of 72 bytes to a maximum of 1500 bytes over a length of 2500 meters. (See [?]). However, it also has its own specific limitations. One major limitation is that it is not created to guarantee the delivery of time-critical information. That is, Ethernet has nondeterministic nature of communication. Ethernet uses carrier sense multiple access with collision detection (CSMA/CD) as its medium access control to resolve contention in case of simultaneous data transmission. In addition, Ethernet



does not support message prioritization. There is no guarantee that a particular message will not collide and eventually be dropped. Using Ethernet for control network in a NCS, due to its nature of disadvantages, we are unable to bound network transmission delay. In this paper, we present a feedback scheduler to use the network bandwidth effectively and minimize the collision as much as possible. NCS are used in reality because of its obvious advantages, like modularity, low costs, reduced weight, decentralization of control, integrated diagnosis, simple installation, quick and easy maintenance, and so on. However, as we using network into a control system, we may face some new challenges because network imposes a communication constraint. Only one sensor can report its message to the network at a time. Each message waiting for transmission from the information source connected to the communication media can be successfully transmitted only when the network is vacancy or the message has the higher priority. It inevitably leads to the information transmission delays which may be fixed or random. This delay makes the time of data arriving no longer determinable and regular, cause the loss of data, and make the data no longer complete. Sometimes these delays may cause the system can’t acquire the expected control purposes. In general, the time delays can significantly degrade the performance of a control system or even destabilize it. Network delays are sums of several small delays, for example, medium access delay, transmission delay, congestion delay, etc. and their values depend on the network architecture, protocols, operating conditions and so on. In this paper, we consider the end-to-end time delay between sensors, actuators, and controllers. From the Figure3 below, we can see how network delay distributed on the network (See [?], [?]).

Figure 3. network delay distributed diagram As the figure3 shows, the sum of network delay can be summarized as: τ = τkca + τksc + τ sc + τ ca + τc + τs + τa


τc : computation delay coming from Controller time-consuming, mostly depends on control algorithm used τ ca : latency delay for control signal to queue up for network transmission τ sc : latency delay for feedback signal to queue up for network transmission τkca : transmission delay produced in Ethernet from controller to actuator at the k th sample time τksc : transmission delay produced in Ethernet from sensor to controller at the k th sample time τa : latency delay waiting for being adopted by actuator. Since actuator block in Truetime



is event-driven, here we can easily know that τa =0. τs : latency delay waiting for being sampled by controller. Since controller block in Truetime is also event-driven, here we can easily know that τs =0. Since τc is far less than others, we can just choose to ignore its value in this equation to simplify it. Note that τ ca and τ sc are the latency queuing up for being transmitted by network. They are transmitted by MAC protocols and gain the access of common bus. They contain the time competing for vacancy channels. So during the analysis even design of NCS, we merge τ ca and τ sc into τkca and τksc . Then the equation can be as: τ = τkca + τksc


Considering the whole control system, it is equivalent. As so many talented scholars in this area, there are now two main methods to reduce the network delay: take much more suitable and useful control algorithm into controller, and more advanced message scheduling algorithm at network layer (See [?],[?]). There are already many researches on the control algorithm which is a well-developed area. In this paper, we only focus our eyes on network scheduling algorithm to research its effect on the whole control performance. A feedback scheduler that consists of a monitor, a controller and an actuator is proposed. The purpose of this scheduler is how to improve network utilization rate, to allocate the resource of bandwidth reasonably, to meet different kind of needs of various data, to enhance the performance of the whole close-loop control system, under the limitation of network resource, such as bandwidth. Generally speaking, it is to guarantee the transmission of real-time data and ensure the fairness of non-realtime data transmission (See [?]). 4. Scheduling algorithms. Network scheduler, in order to adjust the control period dynamically, uses previous network condition to predict the next network condition and which control loop is urgent. As long as there are less data messages in the control network—Ethernet, there will be less data collision. It is similar to CPU real-time scheduling since they all have the resource constraints. The only difference between them is that network scheduling cannot be preemptive. However, we can still resort to CPU scheduling since it is earlier researched and network scheduling has just been proposed after NCS introduced. In this section, we briefly describe a real-time network scheduling algorithm: RM scheduling algorithm . 4.1. RM scheduling algorithm. Liu and Layland brought forward RM (Rated Monotonic) scheduling algorithm based on priority aiming at real-time system (See [?]). Because network scheduling cannot be preemptive, Wei Zhang improves RM algorithm so as to use it in networked control system and also he works out sufficient condition to the system stability and network schedulability. RM scheduling algorithm is a kind of static algorithm, which distributes bandwidth or priority of every node off-line and stays still during the whole running time. It is based on sampling period to determine the priority. The shorter of the sampling period, the higher priority of the correspondent packets have. When more than one message competes for the limited resource, the messages will be sent according to their priority prescribed. (See [14]-[16]) Lemma 4.1. A set of N independent, pre-emptive, periodic tasks can be feasibly scheduled by RM algorithm if its total utilization U satisfies(i=1,2,. . . ,N):




c1 c2 c3 ci b1,i + + + ... + + ≤ i(21/i − 1) h1 h2 h3 hi hi


where ci is the transmission time for each of the ith process, hi is the period of task, b1,i is the blocking time when task is blocked by lower priority task in the worst case as follows: b1,i = max cj j=i,1...N


RM scheduling algorithm for multiple-control loop is proposed such that the integrated performance is optimized. In the lemma above, independent means the initiation and completion of different tasks do not depend on each other, preemptive means the currently executing task is preempted by a newly arrived task with shorter period. Otherwise, Lemma1 can be used to test the schedulability of NCS connected by the same network medium. In this paper, we use Truetime as simulation and design tool to research on scheduling algorithm. The computer block of Truetime is connected to the network in the function ttInitNetwork by assigning a node identification number and the interrupt handler to be executed when a message arrives at the node. In the ttInitKernel function, the kernel is initialized by specifying the number of A/D and D/A channels and the scheduling policy. The built-in priority function prioFP specifies fixed-priority scheduling. Also, there are other predefined scheduling policies include rate monotonic scheduling algorithm (prioRM ), earliest deadline first (prioEDF ), and deadline monotonic (prioDM ) scheduling. 4.2. Feedback Scheduler Architecture. A dynamic scheduler based on feedback control is proposed to solve the problem of non-deterministic availability of communication resource in networked control system. From the control prospective, the control performance can be largely degraded by the network non-deterministic time delay. From the scheduling prospective, the network resource may be under-utilized. To address these problems, using monitor to obtain current network bandwidth and network-induced transfer error, the new network bandwidth can be computed out, and the sampling period according to the network-induce error can be adjusted. Mainly this feedback scheduler consists of a monitor, a controller, and an actuator. The controller is dynamically adjusted according to the data obtained by monitor. (See Figure 4) The parameters above are demonstrated as following: U(k)· · · The total utilized bandwidth at the k period, that is U (k) =

n X

Ui (k)



Ui (k) · · · The control loop i utilized bandwidth at the k period, that is Ui (k) =

Ci (k) Ti (k)


Where Ci (k) is the execution time of k th data package at ith control loop and Ti (k) is the k th sampling period, ei (k) · · · the ith control loop transmission error at k th sampling period Us · · · the reference value of network bandwidth



Figure 4. Architecture of a networked control system equipped with a feedback scheduler The problem of managing network time-delay can be stated as dynamically adjusting the sampling periods to achieve the tradeoff between control performance and available communication resource. As far as concerned, the methodology of feedback scheduling above shown in Fig4 is suggested to maximize the control performance and network utilization rate. The monitor interfaces with the control network and measures the variation of the network. It is time-driven to activate the feedback scheduler. It periodically obtains the current network status, including current network bandwidth U (k) and network transmission error ei (k). As long as the U (k) is different to the preset bandwidth, the adjustment will be computed by controller using this offset between the feedback and preset. And then it is transmitted to the actuator. The actuator makes its decision based on the controller, acting as an interface with the control loop to adjust its sampling period. It makes use of the adjustment to predict available network bandwidth next period U (k + 1). And then according to the predicted value and transmission error ei (k) , a new sampling period is computed to meet the requirement of network dynamic workload. From feedback control view, this feedback scheduler can be viewed as a controller too. To state more clearly, the controlled variable is the control loop’s period which is also measured output. And the manipulated variable is the network utilization which is also control input. The reference value of network bandwidth Us can be decided by specific application. The feedback input value is current total utilized bandwidth U (k) . 4.2.1. available network bandwidth prediction. Using this feedback scheduler, we can predict the network bandwidth next sampling period. In this paper, we denote the input of controller inside the feedback scheduler as Du (k), and choose proportional control policy. That is, Du (k) = Us − U (k) ∆U (k + 1) = Ku Du (k)

(7) (8)

Ku is the gain of this proportional regulator. ∆U (k+1) is the estimated value of network bandwidth. Once produced, it will be put forward to the actuator as its input. The actuator works out the available network bandwidth according to the value of ∆U (k + 1). It can be demonstrated in the mathematical equation as follows:



U (k + 1) = U (k) + ∆U (k + 1)


It will make a decision whether to take an action to update the control period according to output of the actuator. 4.2.2. network bandwidth configuration. Network transmission error ei reflect the realtime and reliability of data package transmission in the network. It is a very important measure gauge of network performance. In this paper we use a bandwidth allocation algorithm based on network transmission error and the estimated value of available network bandwidth, to adjust bandwidth occupied by every control loop dynamically. The bandwidth allocation algorithm is as follows: 1) If all the transmission errors of every control loop are 0, that is n X |ei (k)| = 0 (10) i=1

Then, For every control loop, their requirement of bandwidth can be assumed as the same. So the prediction value of available bandwidth can be allocated to every control loop equally. 1 U (k + 1) (11) n 2) If all the transmission errors of every control loop are not 0, that is: For every control loop, their requirement of bandwidth is different to each other. Whoever has a bigger value of — ei (k) — has more urgent requirement for the network resource. Under this situation, the bigger value of ei (k) of control loop has, the more network resource it will get. Ui (k + 1) =

|ei (k)| Ui (k + 1) = Pn U (k + 1) i=1 |ei (k)|


3) If several parts of control loops have transmission error value of 0, other parts are not. Then, considering control loops who have a transmission error value of 0, their requirement for network resource is correspondingly lower than others. Under the precondition of stability, we can decrease the sampling frequency as much as possible. That is: Timax · · · sampling frequency of ith control loop q · · · the numbers of control loops who has a transmission error value of 0 zj · · · control loop who has a transmission error value of 0, it has ezj = 0 So, according to the definition of network bandwidth, Uzj (k + 1) =

Czj (k + 1) Tzmax j


But, when it comes to the control loop who has ei (k) 6= 0, it is denoted as ezs 6= 0, zs ∈ {1, 2, · · · , n}, s = 1, · · · , n − q. According to the principle (the bigger value of ei (k), the more network resource allocated), then the network bandwidth can be allocated as: q

X |ez (k)| (U (k + 1) − Uzj (k + 1)) Uzs (k + 1) = Pn s i=1 |ei (k)| j=1 Also, sampling frequency of every control loop can be computed out as:



Ti (k + 1) =

Ci (k + 1) Ui (k + 1)

i = 1, · · · , n



5. Experiment. During this section, we evaluate the performance of the proposed feedback scheduler through considering networked control of a plant over Ethernet using Truetime tool. To illustrate the effect of feedback scheduler on networked control system, two Direct Current (DC) motor systems inside two control loops were chosen to construct NCS. The transfer function of DC motor is G(s) = 1000/(s2 +s) , and the controller inside the control loop is PI (Proportional Integrated Controller) well-designed pre-runtime to control the DC-motor. The Ethernet typical data rate is chosen as 10Mb/s, and the data packet size is 8 bytes. We assume that controller structure of two control loops are the same, also controller and actuator are event-driven. The simulation time is 6s. We make two Simulink structures using different scheduler under Matlab environment to learn the performance. One is directly using predefined rate monotonic scheduling algorithm (prioRM ) while the feedback scheduler is added to the other structure. As shown in Figure5 and Figure6 are the control performance results from two different kind of scheduling policy.

Figure 5. control performance of using RM scheduling policy

Figure 6. control performance of using feedback scheduler From Figure5 and Figure6, we learn that the control performance below is much more satisfactory though not so perfect because of some inevitable interference. The plant



performs well thanks to the good scheduling of limited network resources. Still there are much resource is wasted. In general, the control performance is improved all along the simulation. 6. Conclusions. This paper presents a feedback scheduler using Truetime, an eventbased simulator for control and real-time systems co-design, to improve the control performance of NCS. The simulations are well and easily designed to show us the result. Different scheduling policies would have yielded different execution and transmission patterns, and hence different control performance. However, with this scheduler, there are inevitably data collisions when two or many control loops decide to sample and send data into Ethernet at the same time. We can further go on research by adding some scheduling or improving the scheduler. More and more control applications become much complex and share a control network with limited network resource. This gives rise to an increasing requirement to cope with the integration of feedback control and network scheduling. In this direction, we will attempt to develop much more effective control algorithms to compensate the sampling period jitter in the future. REFERENCES [1] M.-Y. Chow and Y. Tipsuwan, Network-based control systems: A tutorial,Proc. IEEE IECON’01, vol. 3, Denver, CO, Nov. 29 -Dec. 2,2001, pp. 1593-1602. [2] Rachana A. Gupta and Mo-Yuen Chow, Overview of Networked Control Systems,Networked Control Systems, Springer London, 1-23. [3] M.S. Branicky, S.M. Phillips, W. Zhang, Scheduling and feedback co-design for networked control systemsProceedings of 41st IEEE conference on decision and control, , Las Vegas, Nevada USA, December, 2002, pp. 670-675. [4] A. Cervin, J. Eker, B. Bernhardsson, and K.-E. ˚ arzn, Feedback-feedforward scheduling of control tasks. Real-Time Systems, 23,pp. 25-53, 2002. [5] Johan Eker and Anton Cervin, A Matlab Toolbox for Real-Time and Control Systems Co-Design, 6th International Conference on Real-Time Computing Systems and Applications, Hong Kong, P.R. China, Decemember 1999. [6] Anton Cervin, Dan Henriksson, Bo Lincoln, Karl-Erik ˚ arzn, Jitterbug and Truetime: Analysis tools for Real-time Control Systems, 2nd Workshop on Real-Time Tools, Copenhagen, Denmark, August 2002 [7] Pau Mart, Jos Ypez, Manel Velasco, Ricard Vill, Josep M. Fuertes, Managing Quality-of-Control in Network-Based Control Systems by Controller and Message Scheduling Co-Design, IEEE transactions on industrial electronics, vol.51, NO.6, December 2004, 1159-1167. [8] John A. Stankovic, Chenyang Lu, Sang H. Son and Gang Tao, The Case for Feedback Control RealTime Scheduling, Real-Time Systems,1999.Proceedings of the 11th Euromicro Conference, 11-20. [9] Feng Xia, Xiaohua Dai, Zhi Wang, and Youxian Sun, Feedback Based Network Scheduling of Networked Control Systems, Proc. 5th ICCA, Budapest, Hungary (2005). [10] C. Lu, J. Stankovic, G. Tao, S.H. Son, Feedback control real-time scheduling: framework, modeling, and algorithms, Real-time Systems, 23:1/2 (2002) 85-126. [11] Yong Ho Kim, Hong Seong Park, Wook Hyun Kwon, A scheduling method for network-based control systems, American Control Conference, Philadelphia, Pennsylvania, IEEE Press, 1998.718-722. [12] Tanez P G,Parrott J T,Moyne J R,Tilbury D M., The implications of ethernet as a control network, Globe Powertrain Conference, Ann Arbor USA:IEEE Press,2002. [13] C.L. Liu, J.W. Layland, Scheduling algorithms for multiprogramming in a hard real time environment, Journal of Association for Computing Machinery, 20 (1973) 46-61. [14] Yin Xunhe, Li Bin, Cui Qingquan and Jia Lijun, Research on Fuzzy Dynamical Dispatch Algorithm of Networked Control System, Journal of Beijing Jiaotong University, Vol.33, No.2, Apr.2009 [15] Wu Zhibin, Liang Shaohua, Wu Chunxue and Feng Bin, Study on Ethernet NCS Response time Guarantee Mechanism, Control and Automation, Vol.23, No.1, Dec. 2007 [16] Wang Zijun, Xu WeiSheng, Wang Zhongjie, Wu Qidi, Research on the Deterministic Delay Calculus Theroy of Control Networks, Acta Electronica Sinica, Vol34, No.2, Feb. 2006


communication layer, being the backbone of the NCS, reliability, security, ease ..... of 41st IEEE conference on decision and control, , Las Vegas, Nevada USA,.

271KB Sizes 1 Downloads 47 Views

Recommend Documents

bandwidth, and the development of data communication protocols for control system are another two ... Matlab-based analysis tools for real-time control system.

Physically-Based Vibrotactile Feedback for Temporal ... - mobileHCI
Sep 18, 2009 - selects a company and gives his device a twist to quickly feel the trend from ... social networking context, enabling users to transmit directly the.

Physically-Based Vibrotactile Feedback for Temporal ... - mobileHCI
Sep 18, 2009 - back design is one way to provide both compelling and informative feedback ... desktop environment, such as browsing the internet or watching vi- deos. ... Our example 'overView' application enables the interaction with.

Feedback during Web-Based Homework: The Role of ...
Abstract. Prior work has shown that computer-supported homework can lead to ... laptop program for 7th and 8th grade students and their teachers. A study .... The pre- and post-test and homework assignments consisted of 10 problems each.

A Rate Feedback Predictive Control Scheme Based ...
based on a Back Propagation (BP) neural network technique. We consider a ... predictive technique to predict the congestion situation in computer networks, but.

A Flow Scheduler Architecture
in the research community leading to the development of many queueing ... with a flow scheduler architecture for improving the delay performance of small ..... Here the flow size is the size of data generated by the application, not including.