Chapter 2 On-line Time-delay Estimation Design
2.2 NCS and time-delay measurement
The general NCS in the closed-loop model is shown in Fig. 2.1, where
t and
1t
2 are the time delays induced in the network structure for the controller-to-actuator direction and the sensor-to-controller direction, respectively. Basically, the induced network delay varies according to the network load, scheduling policies, number of nodes, and different protocols. Network delay systems are also different from general linear time delay systems, where there is an assumption that the delay on the former is constant or bounded. NCS with time-varying characteristics makes modeling and design more difficult. The total time delay can be categorized into three classes based on the parts where they occur: (1) the client node, (2) the network channel, and (3) the remote node. Time delay at the client node is mainly in the preprocessing time, which is the sum of the computation, encoding, waiting, total queuing, and blocking time.Network time delay includes the total transmission time of a message and its propagation delay, which depends on the message size, data rate, and length of the network cable. Time delay at the remote node is mainly in the post-processing time, as shown in Fig. 2.1.
Fig. 2.1 The NCS block diagram
Fig. 2.2 The experimental setup
Figure 2.2 shows the structure of the present remote NCS which includes the controller in the remote node and the client for the remote-controlled device or plant.
The client and the remote nodes communicate with each other from a distance through the Ethernet network. The client consists of two parts in the present experimental setup. The first part is the gateway. This is implemented in a computer with USBCAN, which is designed to communicate between the Ethernet network and the CAN bus. The second part is the local servo motor controller implemented on TI TMS320F2812 DSP with a speed-control mode. The data communication protocol adopts the TCP to construct the position loop for the remote control (Cheng et al., 2007). As shown in Fig. 2.2, the communication network can be modeled as the time
delay on the forward-command direction for actuators (t1) and on the feedback direction for sensors (t2). Therefore, the network time delay includes both the total transmission time of a message and the transformation time of the package from CAN to Ethernet data. The total time delay (RTT) can be expressed as tp = t1 + t2 (Fig. 2.2).
Fig. 2.3 The package transition diagram
These two protocols, Ethernet and CAN, cannot communicate with each other directly. Thus, message packages have to be processed through a gateway, as shown in Fig. 2.2. When data are transmitted to the remote node from the local hardware DSP, the type and the transmission data in a data frame should be set up in advance (Fig.
2.3). These data are then included into the CAN package and transmitted to the gateway through the CAN network, as indicated in step 1 of Fig. 2.3. After the gateway has received the package from the CAN network, the data of the CAN package will be included in the Ethernet package and the Ethernet network may thus transmit the package directly (step 2 in Fig. 2.3). When the remote node has received the package from the Ethernet network, part of the CAN package will be extracted from the Ethernet package and the data defined by users can be further obtained. In the end, the data frame will be analyzed and transmitted (step 3 of Fig. 2.3). By following the procedure (1) (2) (3), the message of the local DSP can be transmitted to a remote node. On the contrary, when data are transmitted to the remote node from the DSP, both transmission data in the data frame should be set up in the CAN package.
The CAN message is then included in the Ethernet package and part of the data will be transmitted to the gateway through the Ethernet network (step 4 of Fig. 2.3). After the gateway receives the package from the Ethernet network, the data from the CAN
package will be extracted from the Ethernet package. The CAN network will be utilized to transmit this package to DSP (step 5 of Fig. 2.3). After DSP receives the package from the CAN network, the data frame in the CAN package will be extracted.
This is step 6 in following the procedure (4) (5) (6) shown in Fig. 2.3.
The network time delay for the present experiments includes the following cases:
(1) NCTU Laboratory NCTU Laboratory and (2) NCTU Laboratory Hukuo (the two places are 15 Km apart). The computer used for this network transmission has the following specifications: Intel® Pentium CPU 1.60 GHz, 496 MB of RAM, Realtek RTL8139/810x Family Fast Ethernet NIC Network Card, and Windows XP Professional Version 2002 OS with SP2. The local area network (LAN) is used with the time delay between the application layer of the client and remote nodes. In addition, the RTT measurement is crucial in obtaining accurate delay measurements periodically.
Technically, the Windows Forms Timer component in the operating system is single threaded and is limited to an accuracy of 55 ms. A higher resolution performance counter of the DSP timer with an accuracy of 1 ms is used to measure network delay between the remote and the client nodes. We measured the time delay from two different clients within the NCTU Laboratory, and from two different clients located each in the NCTU Laboratory and Hukuo, separately, as shown in Fig. 2.4 (a) and (b).
The delay time in the integrated Ethernet and the CAN Bus within a 20 ms sampling period was measured, as shown in Fig. 2.4. Only a very small time delay (around 3–15
ms) was recorded because the transmission speed of the intranet was at 100 Mbps and
there was only a relatively short route within the NCTU Laboratory. From the NCTU Laboratory to Hukuo, the delay time increases because the transmission procedure takes more routes and switches. Experimental results as shown in Fig. 2.4 indicate that the application environment greatly affects the induced delay time in NCS. Moreover, as distance increases, the delay time of a network increases as more nodes are involved.0 2 4 6 8 10 12 14 16 18 20
Fig. 2.4 Measured Internet delays (a) NCTU Lab - NCTU Lab and (b) NCTU Lab - Hukuo