% onoff.m - I/O characteristics of on-off controllers
% RMM, 2 Nov 07

aminit;					% initialize macros

%
% On-off control
%
figure(1); clf; subplot(331); hold on;
amaxis([-1 1 -1 1]);			% set axes so that units scale

% Add axes (no labels)
arrow([-1 0], [1 0], AM_normal_arrowsize, 'LineWidth', AM_ref_linewidth);
arrow([0 -1], [0 1.1], AM_normal_arrowsize, 'LineWidth', AM_ref_linewidth);
axis off;

% Plot the curve
plot([-0.8 0], [-0.7 -0.7], 'b-',  [0 0.8], [0.7 0.7], 'b-', ...
  'LineWidth', AM_data_linewidth);

% Add axis labels
amtext(-0.2, 1.0, '{\itu}');
amtext(0.9, -0.2, '{\ite}');

amprint('onoff.eps');

%
% Dead zone
%
figure(2); clf; subplot(331); hold on;
amaxis([-1 1 -1 1]);			% set axes so that units scale

% Add axes (no labels)
arrow([-1 0], [1 0], AM_normal_arrowsize, 'LineWidth', AM_ref_linewidth);
arrow([0 -1], [0 1.1], AM_normal_arrowsize, 'LineWidth', AM_ref_linewidth);
axis off;

% Plot the curve
plot([-0.8 -0.3 -0.3 0.3 0.3 0.8], [-0.7 -0.7 0 0 0.7 0.7], 'b-', ...
  'LineWidth', AM_data_linewidth);

% Add axis labels
amtext(-0.2, 1.0, '{\itu}');
amtext(0.9, -0.2, '{\ite}');

amprint('deadzone.eps');

%
% Hysteresis
%
figure(3); clf; subplot(331); hold on;
amaxis([-1 1 -1 1]);			% set axes so that units scale

% Add axes (no labels)
arrow([-1 0], [1 0], AM_normal_arrowsize, 'LineWidth', AM_ref_linewidth);
arrow([0 -1], [0 1.1], AM_normal_arrowsize, 'LineWidth', AM_ref_linewidth);
axis off;

% Plot the curve
plot([-0.8 0.3 0.3 0.8], [-0.7 -0.7 0.7 0.7], 'b-', ...
  [-0.8 -0.3 -0.3 0.8], [-0.7 -0.7 0.7 0.7], 'b-', ...
  'LineWidth', AM_data_linewidth);
arrow([-0.3 0.11], [-0.3, 0.1], AM_normal_arrowsize, ...
  'FaceColor', 'b', 'EdgeColor', 'b');
arrow([0.3 -0.11], [0.3, -0.1], AM_normal_arrowsize, ...
  'FaceColor', 'b', 'EdgeColor', 'b');

% Add axis labels
amtext(-0.2, 1.0, '{\itu}');
amtext(0.9, -0.2, '{\ite}');

amprint('hysteresis.eps');
