2.2.2. Fuzzy Logic Controller

An FLC uses the experience of an expert instead of the mathematical model of the system to control a plant, and it can deal with complex non-linear systems with unknown mathematical models. The controller produces a control signal using four blocks [34]: fuzzification, inference engine, rule base and defuzzification, as shown in Figure 3.

**Figure 3.** Components of the FLC.

The FLC is graphically shown in Figure 4. The fuzzification module converts the input values into fuzzy sets using the singleton fuzzification, which evaluates the membership value of the input value. The inference mechanism determines the values of the output fuzzy sets by using an "if–then" rule base, which describes the relationship between the input and output variables based on their linguistic terms. In Mamdani fuzzy systems, the rule base determines the output fuzzy set value taking the minimum value of the combination of two or more input fuzzy set values as a consequence of one rule in the rule base. Finally, the defuzzification module gets a scalar value by combining the scaled output fuzzy sets values.

**Figure 4.** Fuzzy logic controller algorithm.

The reduction of the number of fuzzy rules as long as they express a similar relationship decreases the computational effort and memory requirements used in the implementation of the controller [35]. Therefore, it is necessary to eliminate the less critical rules in order to obtain faster controller actions [36].

The defuzzification module is another component that can be modified in order to obtain a fast response of the controller. There are many defuzzification methods proposed in the literature [34]. The center of gravity method (CoG), also called the center of area method (CoA), is the most widely used of all the defuzzification methods. Nonetheless, this method has a very high computational effort. The CoG method calculates the area under the combined output fuzzy sets by sampling them between the minimum and maximum values of the output fuzzy sets, as shown in Figure 5a. The drawback of the CoG is that it requires more samples to obtain a more accurate output value. The output value of the CoG defuzzification method is given by (8).

$$u = \frac{\sum\_{i=1}^{n} \mu(x\_i)x\_i}{\sum\_{i=1}^{n} x\_i} \tag{8}$$

where *xi* represents a value between the minimum and maximum values of the scaled output fuzzy sets, and *n* represents the number of the samples.

**Figure 5.** Center of Gravity (**a**) and Center of Sums (**b**) defuzzification methods.

Another defuzzification method is the center of sums method (CoS), which is a fast method because of its computational simplicity [37]. This method calculates the average between the centroid and the area of each scaled output fuzzy set. The drawback of the CoS is that the intersecting areas are added twice, as shown in Figure 5b. The output value of the CoS defuzzification method is given by (9).

$$\mu = \frac{\sum\_{i=1}^{n} \mu(\overline{x}\_i) A\_i}{\sum\_{i=1}^{n} A\_i} \tag{9}$$

→

where *xi* and *Ai* represent the centroid and the scaled area of the output fuzzy set *i*, and *n* represents the number of the output fuzzy sets.

### *2.3. Sun Position and Heliostat Angles*

Due to the fact that the relative position of the sun in the sky changes throughout the day, it is necessary to use a solar tracker in order to know the location of the sun at any time. The position of the sun with respect to the observer can be described by a reference system of horizontal coordinates using

two angles: the azimuth angle and the elevation angle [1]. The angles of the solar vector *S* are denoted by *As* and *Es*, respectively, as shown in Figure 6a. The azimuth angle is measured in relation to the South (0◦), and it is negative to the East (−90◦) and positive to the West (90◦). The elevation angle of the sun ranges from the horizon (0◦) to the zenith (90◦).

**Figure 6.** Solar vector (**a**) and vectors and angles of the heliostat (**b**).

For the heliostat to reflect the solar irradiance towards the central receiver, the heliostat surface normal vector → *N* must be the bisector of the angle formed by the fixed vector pointing to the receiver from the reflective surface of the heliostat → *T* and the solar vector [1] (Figure 6b). The azimuth and elevation angles of the solar vector are given by the Grena [38] algorithm, which has a maximum error of 0.0027◦. The solar position algorithm takes the geographical coordinates of the heliostat and the current date and time of the day as input data. The algorithm also uses the monthly average local values of temperature and atmospheric pressure to calculate the atmospheric refraction correction of the elevation angle of the sun. The azimuth and elevation angles of the target vector are obtained by using spherical coordinates. The normal vector is obtained by the addition of the unit vectors of the solar and target vectors.

$$
\overrightarrow{\mathcal{N}} = \left( \begin{array}{cc} \triangle\_x + \mathcal{T}\_x & \mathcal{S}\_y + \mathcal{T}\_y & \mathcal{S}\_z + \mathcal{T}\_z \end{array} \right) \tag{10}
$$

where *S* ˆ and *T* ˆ are given by (11) and (12).

$$S = \begin{pmatrix} \sin(A\_s)\cos(E\_s), & \cos(A\_s)\cos(E\_s), & \sin(E\_s) \end{pmatrix} \tag{11}$$

$$\hat{T} = \left( \begin{array}{cc} \sin(A\_l)\cos(E\_l), & \cos(A\_l)\cos(E\_l), & \sin(E\_l) \end{array} \right) \tag{12}$$

Finally, the azimuth and the elevation angles of the normal vector are given by (13) and (14).

$$A\_h = \tan^{-1} \left( \frac{\vec{N}\_y}{\vec{N}\_x} \right) \tag{13}$$

$$E\_{\rm li} = \tan^{-1} \left( \frac{\overrightarrow{N}\_z}{\sqrt{\overrightarrow{N}\_x^2 + \overrightarrow{N}\_y^2}} \right) \tag{14}$$
