% ***************************************************************************
% COPYRIGHT BY DAVE JEWELL AND T.E. MARLIN 1994
% FILNAME : DATA2BY2.M
% Version 2.0
% LAST UPDATED : December, 1994
% DISCRIPTION OF FILE :
% THIS M-FILE CONTAINS THE DATA FOR THE PROCESS, DISTURBANCE AND INITIAL 
% CONTROLLER CONFIGURATION
% ***************************************************************************

clear;

ml_ver                          % sets variable ver_sion that indicates
				% MATLAB version being used (professional or student)

NOISEYN=0;                      % NOISE CONTROL; ON=1, OFF=0
Kn=[0.001 0.001];               % MAGNITUDE OF NOISE; FOR NOISE1 AND NOISE2
BETA=[0.5 0.5];                 % AUTO-REGRESSIVE COMPONENT OF NOISE MODEL
delt=0.25;                      % PROCESS SAMPLING INTERVAL
tend=100;                       % END OF SIMULATION TIME

   maxstep=3000;                % MAXIMUM NUMBER OF ITERATIONS
   maxinhorz = 10;              % MAXIMUM SAMPLE NUMBER IN DMC INPUT  HORIZON
   maxouthorz= 16;              % MAXIMUM SAMPLE NUMBER IN DMC OUTPUT HORIZON

if ver_sion == 1                % CHECK THE MATLAB VERSION
   maxstep = 10000;             % ALLOW BIGGER PROBLEM WITH PROFESSIONAL
   maxinhorz = 20;
   maxouthorz= 40;
end

DISTYN=1;                       % GLOBAL DISTURBANCE SWITCH FOR SIMULATION; ON=1
tSTEP=0.1*tend;                 % TIME STEP DISTURBANCE OCCURS
MAGSTEP=-0.04;                  % SIZE OF STEP DISTURBANCE
EXECUTION=0;                    % INDICATES IF SIMULATION HAS BEEN RUN; NO=0
SAVEGRAPH=0;                    % TOGGLE FOR SAVING GRAPHS TO METAFILE OPTION; ON=1
cv1name='CV 1';
cv2name='CV 2';
mv1name='MV 1';
mv2name='MV 2';

% INITIAL CONTROLLER CONFIGURATION
config=[1,2;                    % CONTROLLER OUTPUT DESIGNATION TO FINAL ELEMENT (HW# address)
	10.4,-6.8;              % PROPORTIONAL GAIN
	9.0,6.1;                % INTEGRAL TIME
	0,0;                    % DERIVATIVE TIME
	0.98,0.02;              % CONTROLLER SET POINT
	0.0,0.0;                % TIME THAT SET POINT IS IMPLEMENTED
	0,0];                   % MANIPULATED VARIABLE STEP SIZE FOR PRC


% PROCESS DATA

Kp=[0.0747 -0.0667;0.1173 -0.1253];     % PROCESS GAIN
tau1=[12 15;11.75 10.2];                % PROCESS TIME CONSTANT 1
tau2=[0 0;0 0];                         % PROCESS TIME CONSTANT 2
tauA=[0 0;0 0];                         % PROCESS LEAD TIME CONSTANT
DT=[3 2;3.3 2];                         % PROCESS DEAD TIME
gamma=round(DT./delt);

% DISTURBANCE DATA

Kd=[0.70;1.3];                          % DISTURBANCE GAIN
Dtau1=[14.4;12];                        % DISTURBANCE TIME CONSTANT 1
Dtau2=[0;0];                            % DISTURBANCE TIME CONSTANT 2
DtauA=[0;0];                            % DISTURBANCE LEAD TIME CONSTANT
DDT=[5;3];                              % DISTURBANCE DEAD TIME
Dgamma=round(DDT./delt);

% INITIAL VALUES FOR PROCESS VARIABLES, FINAL CONTROL ELEMENTS AND SET POINTS
initcv=[0.98,0.02];
initmv=[8.53,13.53];
contoutmax=[20 20];   % MAXIMUM CONTROLLER OUTPUT FOR ANTI-RESET WINDUP
contoutmin=[0 0]; % MINIMUM CONTROLLER OUTPUT FOR ANTI-RESET WINDUP

%  CALL DATA FOR DMC CONTROLLER

dmc_data

