## 3 Control Methods
### Fuzzy Inference System  
Fuzzy set theory is used to specify how a crisp measurement fits into a linguistic description. It is considered a generalization of classic set theory, as it represents uncertainty and memberships. Fuzzy logic maps a degree of membership of a system to a fuzzy set using classic Boolean logic. However, it resembles human-like reasoning with the usage of linguistic variables and decision-making processes with uncertainty [53]. FISs rely on a previously defined knowledge base coming from an expert. They evaluate a statement that relates an antecedent with an implication. These types of systems can represent mathematical complex systems with a simple set of rules model with fuzzy sets [54].  
Longitudinal control with FIS require the previous design and validation of appropriate membership functions (MFs). Related research has proposed the usage of uniformly distributed triangular MFs to model the normalized error as input and identical triangular functions with shoulder functions for the brake/throttle as output [55]. However, an uneven distribution and form of MF is proposed to model inter-vehicle distance and the speed error [56]. Similarly, a set with a high number of unevenly distributed MFs was used to capture the behavior of the longitudinal model of a vehicle in [57]. Those guidelines provided insight on how to design the longitudinal FIS-based controller. Three FIS were designed, one for each state of the traffic light. The green light FIS uses the simplest set of MFs and rules. The yellow FIS and red FIS have a greater number of linguistic variables for the inputs. Even and uneven distributions for the MFs were used to better represent the behavior of every physical variable.  
The following MFs are used to represent the physical variables involved in the longitudinal navigation control system: \(\hat{x}\), \((X)\), and \(\tau\). \(L_{s}\) is not fuzzified, as the light status is a Boolean value. Inputs \(\hat{x}\) and \(X\) are modeled with Gaussian, Gaussian combination, S, and Z MFs. The longitudinal speed of the CEV is normalized to a \([-1,1]\) interval. Long-term motor braking can cause reverse motion in the vehicle. Hence, positive and negative values are considered. The maximum speed \(\hat{x}_{max}\) of the 3-DOF model is not reachable in urban environments. Thus, the speed limit of the road is used as higher and lower boundaries with an \(\varepsilon\) tolerance such that  
\[\hat{x}_{norm}=\frac{\hat{x}}{(1+\varepsilon)\hat{x}_{lim}} \tag{18}\]  
The relative location \((X_{r})\) of the CEV respect the intersection \((X_{I})\) is also normalized in a \([-1,1]\) range. The normalization distance of the location is either the SPaT coverage \((d_{SPaT})\) range or the maximum distance in which a visual sensor can detect the traffic light status \((d_{sensor})\).  
\[X_{r}=\frac{X_{I}-X}{\max(d_{SPaT},d_{sensor})} \tag{19}\]  
The output \(\tau\) uses triangular, linear S, and Z MFs. The maximum motor torque \(\tau_{max}\) is used to normalize \(\tau\) in a \([-1,1]\) interval. Defuzzification is performed using the Mamdani method.  
\[\tau_{norm}=\frac{\tau}{\tau_{max}} \tag{20}\]  
Three different FISs are used to generate the desired longitudinal behavior of the CEV, one for each of the traffic \(L_{s}\): green, yellow, and red. A multiplexer selects the appropriate system according to the data provided by SPaT.