## 2 Analysis and Design of a Sun Tracking Control System
### LBS Control Design  
We apply the LBS control to the sun tracking control system. The control system (Figure 5) includes a LBS, reference tracking controller and a path follow tracking controller. The reference tracking controller for azimuth and elevation is based on the value (\(\mathbf{u_{1}}\)) which is the output of EW or SN, and is also a kind of proportional-integral controller, a case of a PID controller where D = 0. The controller attempts to minimize the error by adjusting the tracking control inputs. PI controllers are fairly common, since derivative action is sensitive to measurement noise, however the absence of an integral term may prevent the system from reaching its target value due to the control action. Generally, stability of response is required and the process must not oscillate for any combination of tracking conditions and setpoints, though sometimes marginal stability (bounded oscillation) is acceptable or desired. Two basic requirements are regulation (disturbance rejection--staying at a given setpoint) and command tracking (implementing setpoint changes)--they refer to how well the controlled variable tracks the desired value. We apply Equations (3) and (4) to find a static output feedback controller for the azimuth/elevation tracking system to achieve the minimum error \(\mathbf{y}_{1}\). The path follow tracking controller depends on the value (\(\mathrm{u_{2}}\)) of the output of the sun trajectory, converting counts of the encoder to maneuver the tracker. The tracker position encoder uses the reed switch to detect the stroke length of the actuator in elevation and displacement of the motor in the azimuth to calculate the solar tracker position. The elevation and azimuth angle of the solar tracker are stored in pulse counts per hour. The analog and digital conversion module is for converting the signal  
Figure 4: Concept of sun tracking control system. of the sun position sensor to a digital signal. The motor control module receives the microprocessor command to start or stop the azimuth and elevation motor. We apply Equations (5) and (6) to find an open loop controller for the azimuth/elevation tracking system to achieve the minimum error \(\mathbf{y}_{2}\). The LBS determines the controllers to be applied to track the sun. The supervisor inputs the \(\mathbf{u}_{1}\), \(\mathbf{u}_{2}\), \(\mathbf{y}_{1}\) and \(\mathbf{y}_{2}\) to calculate the switch \(\boldsymbol{S}\) value. When \(\boldsymbol{S}=0\), the supervisor applies controller 2. Conversely when, \(\boldsymbol{S}=1\), the supervisor applies controller 1. It is stated as follow  
\[\text{S}=\text{F}(u_{1},u_{2}),\forall S=0\to controller2;\forall S=1\to control2 \tag{7}\]  
\[wma\_SUM(t)=\sum_{i=1}^{5}w_{i-1}\times SUM_{i-1} \tag{8}\]  
The SUM is the sum of the sun position sensor which is E, W, S, and N. The wma_SUM is the 5 elements triangle weighted moving average. If the value of the sum is large than its setpoint, \(\boldsymbol{S}\) equals 0. The controller will change to the path following tracking controller. If the value of the sum is less than its setpoint, then \(\boldsymbol{S}\) equals 1. The controller will change to the reference tracking controller. Figure 6 shows the LBS controller programming flow. After the START state, the LBS computes the sum of the sensor, if the sum is larger than the minimum of sun light (Lmin) and sum of triangle weighted moving average (wma_SUM) is smaller than the setpoint of fluctuation (SP), then the tracking system uses the reference-tracking controller. Otherwise, the tracking system uses the path follow tracking controller. Figure 5: Logic-based Supervisor (LBS) control in a sun tracking system. The reference tracking control (Figure 7) applies the proportional-integral (PI) control. The PI control algorithm computes the difference of the sun position sensor value (u\({}_{1}\)) and makes the decision that the tracker should move to face the sun until the position of u\({}_{1}\) is minimum. Q is the deadband of the difference of the sun position sensor value.