The fuzzy PI control algorithm studied in this paper combines a fuzzy controller with a PI controller in a dual-input and dual-output configuration. The fuzzy controller utilizes fuzzy reasoning based on the real-time error, , and the error change rate of the system, , to derive the correction amount, and , for PI control parameters, so as to adjust the PI parameters in real time. This section presents the PI controller and the fuzzy controller.
2.4.1. PI Controller Design
Closed-loop control is carried out for the vehicle speed and yaw angle during the control of the tractor’s driving process. The control block diagram is shown in
Figure 5.
In
Figure 5,
,
and
,
are the control parameters of the PI controller for the vehicle speed loop and the yaw angle loop, respectively;
and
are the vehicle speed and yaw angle input for the command, respectively;
and
denote the actual vehicle speed and yaw angle calculated based on the inverse kinematics of the motor feedback speed, respectively;
and
are the motor speed of the left- and right-drive wheels calculated by the control system, respectively; and
and
denote the actual motor speeds as feedback.
The motor control in
Figure 5 adopts a closed-loop vector control scheme for permanent magnet synchronous motors, as shown in
Figure 6.
The transfer function of motor speed closed-loop control is shown in Equations (12) and (13):
where
is the speed loop proportional coefficient;
is the speed loop integral coefficient;
is the current loop proportional coefficient;
is the current loop integral coefficient;
is the equivalent q-axis inductance, with the unit of H;
is the resistance of the permanent magnet synchronous motor, with the unit of Ω;
is the rotor permanent magnet flux, with the unit of Wb;
is the number of motor poles;
is the number of motor poles;
is the torque coefficient; and
is the speed closed-loop transfer function.
The parameters of the motor and the closed-loop control parameters are shown in
Table 2.
Thus, based on the motor transfer function and the
Figure 5 control diagram, the transfer function of the closed-loop control system for the tractor is established, as shown in Equations (14)–(19):
where
is the vehicle speed loop proportional coefficient;
is the vehicle speed loop integral coefficient;
is the yaw angle loop proportional coefficient;
is the yaw angle loop integral coefficient;
and
are the intermediate variables;
is the open-loop transfer function of the vehicle speed loop;
is the closed-loop transfer function of the vehicle speed loop;
is the open-loop transfer function of the yaw angle loop; and
is the closed-loop transfer function of the yaw angle loop.
It can be seen from the transfer functions of the vehicle speed loop and the yaw angle loop that the system is a nonlinear time-varying cross-coupled dual-input dual-output control system. Setting one of the loops to zero during parameter tuning has a minimal impact on the tuning loop; the two interact with each other during the actual operation of the tractor. After multiple simulations, the control parameters of the vehicle speed loop are determined to be = 0.2 and = 35, while for the yaw angle loop the control parameters are = 0.2 and = 35.
2.4.2. Fuzzy Controller Design
On the basis of the PI controller, the fuzzy controller is employed to perform fuzzy inference on the error and the error change rate of the system, and fuzzy decisions are made according to fuzzy rules, ultimately obtaining the output of the PI control parameter increment [
25]. Taking the vehicle speed loop as an example, the PI controller in
Figure 4 is transformed into the fuzzy controller, and the fuzzy control block diagram is shown in
Figure 7:
In
Figure 7,
represents the system error;
represents the rate of change of the error; and
and
represent the PI parameter increments output by the fuzzy controller.
During the control process of the fuzzy controller, the observed system data need to be fuzzified. After multiple simulations and experimental validations of the tractor model established in this paper, the actual ranges of the error,
, and the rate of change of the error,
, for the vehicle speed loop are determined to be [−1, 1] and [−150, 150], respectively, which are taken as the domains of the error and the rate of change of the error. After several simulation trials, the ranges of
and
are determined to be [0, 0.7] and [0, 60], respectively, which are subtracted from the initial domain adjusted in the previous section. The above domains are discretized into seven levels, namely {NB, NM, NS, ZO, PS, PM, PB}, where N represents negative, P represents positive, ZO represents zero, and S, M, and B represent small, medium, and large, respectively [
26,
27,
28]. The membership functions of the error,
, and the rate of change of the error,
, use Gaussian functions, while the membership functions of
and
use triangular functions. The membership functions of the error,
and
, are shown in
Figure 8.
The control strategy of fuzzy rules summarizes the adjustment strategy of the system according to the response of experienced personnel to the system; therefore, suitable fuzzy rules need to be established based on the response of the distributed tractor to adjust the PI controller parameters.
The following are the principles of the fuzzy controller to be established in this paper [
29,
30]:
(1) When the error, , is large, larger and smaller should be output to accelerate the response speed of the system.
(2) When the error, , is small, and should be reduced to decrease the system overshoot.
(3) When the rate of change of the error, , is large, and should be appropriately reduced to decrease the oscillation caused by the integral component.
(4) When the error, , and the rate of change of the error, , are of medium size, the values of and remain basically unchanged to ensure the responsiveness and stability of the system.
According to the above principles, fuzzy control rule tables for
and
are established as shown in
Table 3 and
Table 4, respectively.
The logical definition represented in
Table 3 and
Table 4 are as follows: if the error,
, is PB and the error change rate of the system,
, is PM, then
and
are PB and NB, respectively.
Since the control quantity output by the fuzzy controller is the combination of different membership function curves, which cannot be directly applied to the controlled variable, it is therefore necessary to determine a value from the output variables of the fuzzy controller, which is then specified as a clear variable. The weighted average method is used in this paper to defuzzify the arrays between membership function curves. The fuzzy arrays between membership function curves,
, are divided into n different discrete pieces of data. Each piece of data,
, is multiplied by its corresponding membership degree,
, and then the sum obtained by adding them is divided by the sum of the membership degrees to obtain the defuzzified output value,
, as shown in Equation (20):
Under the domain of the error,
, and the error change rate of the system,
, the output surface is illustrated in
Figure 9, and it can be seen that its output is a nonlinear and continuously changing surface.
PI control parameters acting on the speed loop of the distributed dual-wheel tractor are obtained by adding its initial values,
and
, to the increment values,
and
, from the fuzzy control output, as shown in Equation (21):