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).
Particularly, we will demonstrate how to use the 'findMatiMadBoundry' function included in the toolbox. The theory behind the analysis technique used here can be found in:
W.P.M.H. Heemels, A.R. Teel, N. van de Wouw and D. Nešic, "Networked Control Systems with Communication Constraints: Tradeoffs between Transmission Intervals, Delays and Performance," IEEE Transactions on Automatic Control , 55(8), p. 1781-1796, 2010
Contents
Define the 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];
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. To do so, we will first initialize an ncs object by specifying the number of inputs and outputs the plant has. Then we will specifiy the plant, controller and network properties using the variables defined above.
hncs = ncs(2,2);
hncs = hncs.setPlant(Ap,Bp,Cp);
hncs = hncs.setController('C-LTI uWired',Ac,Bc,Cc,Dc);
In the command above we specified 'uWired' when the controller was set. This means that the controller is directly connected to the actuators and the controller commands can be continuously applied to the plant. Next we will specifiy the network nodes and protocol wer are intrerested in.
hncs_RR = hncs.setNetwork('nodesU',{blkdiag(1,1),blkdiag(1,1)}); hncs_RR = hncs_RR.setNetwork('nodesY',{blkdiag(1,0),blkdiag(0,1)}); hncs_RR = hncs_RR.setNetwork('protocol','RR'); hncs_TOD = hncs_RR.setNetwork('protocol','TOD');
The network node specification above indicates that each of the plant outputs share network access. The first node contains the first plant output and the second node contains the second node output. How the nodes are granted access to the network is determined by the protcol specified.
Notice that we did not set the transmission intervals and delays. Although this can also be done, the findMatiMadBoundry function we will use in this example does not depend on these parameters so they do not need to be specified.
NOTE: Creating an NCS variable be also done using the ncsEditor. To open the ncsEditor simply type 'ncsEditor' into the command prompt. Since the matrix variables are defined in the workspace, we can directly input the matrix names into the fields of the ncsEditor GUI.
Plot Stability Regions
Finally, to generate the data for plotting the stability regions we simply plug each of the ncs variables into the following function
[Mati1,Mad1] = hncs_RR.findMatiMadBoundry; figure; [Mati2,Mad2] = hncs_TOD.findMatiMadBoundry;
SYSTEM DATA: Number of Nodes: 2 Protocol: RR Controller: Continuous-time Dynamic Feedback (uWired) Channels Transmitted: Only outputs STABILITY DATA: Generating MATI MAD tradeoff curve ... MATI MAD tradeoff curve complete! -------------------------------------------------------------- SYSTEM DATA: Number of Nodes: 2 Protocol: TOD Controller: Continuous-time Dynamic Feedback (uWired) Channels Transmitted: Only outputs STABILITY DATA: Generating MATI MAD tradeoff curve ... MATI MAD tradeoff curve complete! --------------------------------------------------------------


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.
The above analysis can also be done via the ncsEditor GUI by loading the NCS from ncsExamples.mat into the GUI and clicking on the 'Verify Stability' button.