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
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
where
Ac=zeros(2); Bc=[0 1; 1 0]; Cc=[-2 0 ; 0 8]; Dc=[0 -2; 5 0];
Finally we define the network we are considering
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 l=2; % integer number of nodes
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 'hncs' Class Variable
Now we are ready to create a hncs class variables. Since we want to compare two different protocols, we must create two seperate hncs varibales. This is done using the following command:
Output Feedback
hncs1 = hncs(Ap,Bp,Cp,Ac,Bc,Cc,Dc,Sy,Su,'TOD',l); hncs2 = hncs(Ap,Bp,Cp,Ac,Bc,Cc,Dc,Sy,Su,'RR',l);
For the output feedback case, we use all the varaibles we defined earlier to define our NCS. However, if we wanted to model state feedback we would use the following command:
State Feedback
hncs3 = hncs(Ap,Bp,Cp,[],[],[],Dc,Sy,[1 1],'TOD',l); hncs4 = hncs(Ap,Bp,Cp,[],[],[],Dc,Sy,[1 1],'RR',l);
Notice that for the state feedback case, the Ac, Bc, and Cc matrices are blank, which results in the control law
which is state feedback, given that . To ensure
, the Su must be a vector of only 1's. These conditions are necessary to correctly model the state feeback case.
This completes the definition of our Hybrid NCS model. Now we are ready to run functions using these hncs variables.
Generate Stability Data
Finally, to generate the data for plotting the stability regions we simply plug each of the hncs variables into the following function:
[Hmati1,Tmad1] = plotNcsStablilityRegion(hncs1); [Hmati2,Tmad2] = plotNcsStablilityRegion(hncs2); [Hmati3,Tmad3] = plotNcsStablilityRegion(hncs3); [Hmati4,Tmad4] = plotNcsStablilityRegion(hncs4);
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'); plot(Hmati3,Tmad3,'g'); plot(Hmati4,Tmad4,'k'); legend('TOD - Output FB','RR - Output FB', ... 'TOD - State FB','TOD - State 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. Furthermore, using output feedback does not severly degrade the robustness compared to using state feedback.