2.4.1. Controller Parameters

The algorithms of the FLC and PID controller were designed for the position control of the DC motors at no load. Both controllers were tuned to accomplish with the design parameters of 10 ms sampling time and 100 ms of rising time without overshoot for the smallest change in the reference signal in order to reduce the energy consumed by the DC motors when the heliostat is moving [27].

Figure 12 shows the block diagram of the FLC. It is a two-input and one-output controller, three fuzzy sets in each input and output signal, a rule base with nine "if–then" rules, a Mamdani inference engine and the CoS defuzzification method. Additionally, there are two processing blocks due to the di fference between the fuzzy sets values and the values of the input and output signals. The processing values are given by (15)–(17).

$$
\varepsilon \ast = \frac{\varepsilon}{\pi} \tag{15}
$$

$$d\sigma \ast = \frac{d\varepsilon T\_s}{\pi} \tag{16}$$

$$
u\* = 
u V\_{\text{max}}\tag{17}$$

where *e*∗, *de*∗ and *u*∗ represent the processing values of the input and output signals, and *Vmax* represents the maximum voltage signal of the DC motors.

**Figure 12.** Block diagram of the fuzzy logic controller.

The values of the fuzzy sets and the rule base of the FLC are shown in Figure 13 and Table 1, where the negative, middle, and positive values are denoted by the linguistic variables *N*, *Z* and *P*, respectively. The number and values of the fuzzy sets were selected in order to the control signal of the FLC can modify the position of the DC motor due to the smallest change of the error with a low computational e ffort. The symmetric shape of the fuzzy sets allows the controller to modify the direction of rotation of the DC motors with the same amplitude of the control signal, which corresponds to the values of the error and change of error.

**Figure 13.** Fuzzy sets of the fuzzy logic controller.

**Table 1.** Rule base of the fuzzy logic controller.


The resulted control surface of the FLC is presented in Figure 14, showing the relationship between the inputs and the output as a consequence of the values of the fuzzy sets, the if–then rule base, and the CoS defuzzification method. The output value of the defuzzification varies from −1 to 1; therefore, using Equation (17), the DC motor supply voltage ranges from −*Vmax* to *Vmax*.

**Figure 14.** FLC control surface.

For the PID controller, the transfer function of the DC motor is estimated by using the step signal response method in order to obtain the control gains of the PID controller to comply with the design parameters. The angular velocity can be approximated by using a discrete derivative term, as shown in Equation (7). The angular velocity is given by (18).

$$\alpha(n) = \frac{\theta(n) - \theta(n-1)}{T\_s} \tag{18}$$

The step response of the DC motor and the transfer function parameters are shown in Figure 15, where ω = 0.5369 rads = 5.126 rpm is approximately the rated speed reported in the DC motor datasheet, as shown in Table 3.

**Figure 15.** Step response of the DC motor.

The obtained mathematical model of the DC motor at no load is described by (19).

$$G\_{M}(\mathbf{s}) = \frac{\Theta\_{M}(\mathbf{s})}{V\_{aM}(\mathbf{s})} = \frac{0.31275}{\mathbf{s}^{2} + 13.68925\mathbf{s}}\tag{19}$$

Finally, the control gains of the PID controller were obtained by using the Matlab Sisotool Toolbox. A rising time of 0.075 s and an overshoot of less than 5% were chosen as conditions of the output signal of the PID controller in order to accomplish with the design requirements and produce a smooth control signal to reduce the energy consumption for the DC motors. The control gains of the PID controller are shown in Table 2.

**Table 2.** Control gains of the PID controller for the DC motor at no load.


The transfer functions of the DC motors connected to the heliostat axes were also obtained with the same method. The mathematical models of the azimuth and elevation axes are described by (20) and (21), respectively.

$$G\_A(s) = \frac{\Theta\_A(s)}{V\_{aA}(s)} = \frac{0.01316}{s^2 + 4.03225s} \tag{20}$$

$$\Theta\_E(s) = \frac{\Theta\_E(s)}{V\_{aE}(s)} = \frac{0.02417}{\text{s}^2 + 7.40740\text{s}}\tag{21}$$
