The classical Smith predictor [1] relies on the accurate model of the system. Previously, we have found the model of the system as:
$$ \begin{equation} G(s)=e^{-7s}\frac{147}{20.1s+1} \end{equation} $$
We will use this model to compensate for the delay so that it will not cause instability in the system.

Fig. 1 The schematic of the classical Smith predictor. TC means Time Constant or First Order. TDTC means Time Delay and Time Constant which is simply an alternative term for First Order Plus Time Delay (FOPTD).
The Smith predictor relies on the accuracy of the developed model. The Smith predictor knows the duration of the time delay from the model. Therefore, it can remove the delay from the feedback. See Fig. 1. The easiest way to understand how a Smith predictor works is by picturing what is happening when the model perfectly matches the plant.

Fig. 2 The Simulink diagram of the classical Smith predictor. Use the two manual switches to switch between the constant-gain feedback control and the Smith predictor. Notice that we need to first know the current room temperature. The room temperature is 29.4.
The following file is the Simulink file of Fig. 2:
Before running the Simulink program, we need to know the room temperature. Use this m-file to measure the room temperature. Update the two constant values that represent the room temperature.
Finally, we can run the program. Run twice, once for the constant-gain feedback experiment, and once more for the Smith predictor experiment. As the results, there will be two MAT- files: datalog1.mat and datalog2.mat. These are the examples:
Make sure to adjust the switches properly before each run. After that, use the codes below to generate the plot in Fig. 3.
clc
clear
close all
load datalog1.mat % This is the data without the Smith predictor
load datalog2.mat % This is the data with the Smith predictor
tnom = nominal(1, :);
u1nom = nominal(2, :);
u2nom = nominal(3, :);
T1nom = nominal(4, :);
T2nom = nominal(5, :);
T1_targetnom = nominal(6, :);
tsmith = smith(1, :);
u1smith = smith(2, :);
u2smith = smith(3, :);
T1smith = smith(4, :);
T2smith = smith(5, :);
T1_targetsmith = smith(6, :);
figure
subplot(2,1,1)
hold on
plot(tnom, T1nom, 'r')
plot(tsmith, T1smith, 'b')
plot(tnom, T1_targetnom, '--g', 'LineWidth', 2)
ylabel('Output')
xlabel('Time')
xlim([0 tnom(floor(end/2))])
legend('Constant-gain feedback', 'Smith Predictor', 'location', 'best')
subplot(2,1,2)
hold on
plot(tnom, u1nom,'r-.', 'LineWidth', 2)
plot(tsmith, u1smith,'b-.', 'LineWidth', 2)
plot(tnom, repmat(0, 1, length(tnom)), '--g', 'LineWidth', 2)
plot(tnom, repmat(1, 1, length(tnom)), '--g', 'LineWidth', 2)
xlabel('Time (s)')
ylabel('Input')
xlim([0 tnom(end)])
xlim([0 tnom(floor(end/2))])
legend('Constant-gain feedback', 'Smith Predictor', 'location', 'best')

Fig.3 Comparisons between the constant-gain feedback control and the Smith predictor. Notice how the control actions of the Smith-predictor are mostly still within the allowable range.
Can we demonstrate instability with our system? First, let us return to the root-locus plot of the delayed system:

From the root-locus plot, the selected gain (0.2) already causes instability to the system since at least one closed-loop pole is now in RHP. We say “at least” because the number of the closed-loop poles depends on the order of our Padé approximation. For a second-order Padé approximation, all (two) closed-loop poles are in RHP since they must be complex conjugates.
However, this is not reflected in our system since our system remains stable. Why?