Comparing the TOD and RR Protocol Stability Regions - Example

This example shows how to compare the robustness of a given control setup which operates under either the Try-Once-Discard (TOD) network protocol or the Round Robin (RR) network protocol. The robustness is compared by means of generating a tradeoff plot between the maximally allowable transmission interval (MATI) and maximally allowbale delay (MAD).

Contents

Define the Network Control System

The plant is a model of a batch reactor, which the dynamics are linearized and given in continuous-time as

$$ \dot{x}_p=A_px_p +B_p\hat{u} $$

$$ y = C_px_p $$

where

Ap=[1.38     -0.2077     6.715   -5.676;
    -0.5814  -4.29         0      0.675;
    1.067     4.273     -6.654    5.893;
    0.048     4.273      1.343   -2.104];

Bp=[0       0;
    5.679   0 ;
    1.136  -3.146;
    1.136   0 ];

Cp=[1 0 1 -1;
    0 1 0  0];

Next we define the controller, which is given as

$$ \dot{x}_c=A_cx_c +B_c\hat{y} $$

$$ u = C_cx_c + D_c\hat{y} $$

where

Ac=zeros(2);

Bc=[0 1;
    1 0];

Cc=[-2 0 ;
    0  8];

Dc=[0 -2;
    5  0];

Where sy=[1 1] indicates that both outputs of the plant are wired directly to the input of the controller and Su=[0 0] indicates that both outputs of the controller are shared on the network. Lastly, l=2 means that the two outputs which are shared on the network are divided into two nodes.

Create 'ncs' Object

Now we are ready to create a ncs object. Since we want to compare two different protocols, we must create two seperate ncs objects. It is easiest to use the 'ncsEditor' to create these objects. To open the ncsEditor simply type 'ncsEditor' into the command prompt.

Once the 'ncsEditor' is opened, first input Ap,Bp and Cp into the plant parameters and then select 'C-LTI Dynamic Feedback' in the drop down menu Next input Ac,Bc,Cc,and Dc into the controller parameters. The transmission interval, delay and dropout boxes can be filled with 0. Check the box next to Comm Constraints an click 'Edit Nodes' and define two nodes where node1 has u01,u02 and y01 and node2 has u01,u02 and y02 then click 'save'. Chose the protocol as RR and click 'File > Export' and name the ncs as hncs_RR and change the protocol to TOD and click 'File > Export' and name this ncs as hncs_TOD.

load exampleNcs

Generate Stability Data

Finally, to generate the data for plotting the stability regions we simply plug each of the ncs variables into the following function

Sy = [1 1];      %[y1 y2 ... yN] where yi is 1 for networked, 0 for wired
Su = [0 0];      %[u1 u2 ... uM] where yi is 1 for networked, 0 for wired

[Hmati1,Tmad1] = hncs_RR.findNcsStablilityTradeoff([0 0],[1 1]);
[Hmati2,Tmad2] = hncs_TOD.findNcsStablilityTradeoff([0 0],[1 1]);

Plot Stability Region Comparision

Now we can plot the resulting data to see the comparision between the two protocols

plot(Hmati1,Tmad1,'r');
hold on;
plot(Hmati2,Tmad2,'b');
legend('TOD - Output FB','RR - Output FB')
title('Tradeoff Curves')
xlabel('MATI','interpreter', 'latex')
ylabel('MAD', 'interpreter', 'latex')

This plot indicates that the NCS is robustly stable in the region lying below the line drawn in the graph. From this comparision it is clear that the TOD protocol is more robust than the RR protocol.