# Vehicle Rollover Warning and Control Based on Attitude Detection and Fuzzy PID
## 3 Selection of the Control Strategy
### Upper-Level Control Strategy  
#### 3.1.1 Selection of the Control Algorithm  
PID control algorithm is a traditional control algorithm, which is commonly used in various industrial automatic control owing to its simple principle and easy implementation. A schematic of this process is shown in Figure 5.  
\[(t)=K_{p}\bigg{(}e(t)+\frac{1}{T_{i}}\int_{0}^{t}e(t)dt+T_{d}\frac{de(t)}{dt} \bigg{)} \tag{15}\]  
Here, \(u(t)\) represents the output value of the controller; \(r(t)\), \(e(t)\), and \(y(t)\) represent the input, output, and deviation values, respectively; \(K_{P}\), \(T_{i}\), and \(T_{d}\) denote the scale factor, integration time, and differentiation time, respectively. The effectiveness of the output curve can be improved by adjusting the magnitudes of the \(K_{P}\), \(T_{i}\), and \(T_{d}\), values. The optimal solution for the control parameters of this system can be obtained by rectifying the PID parameters to achieve a better PID control effect. For a hydraulic braking system, its dynamic response is poor, the control effect is not ideal, and PID control is prone to overshooting and oscillation. Although fuzzy control can suppress oscillation, it is susceptible to large steady-state errors. Therefore, PID and fuzzy control algorithms were combined to devise a fuzzy-PID control algorithm, which can use the fuzzy inference method to achieve the self-adjusting of PID parameters and achieve a good control effect with little overshoot, short adjustment time, and small steady-state error. A schematic of the fuzzy-PID control algorithm is shown in Figure 6. A two-dimensional fuzzy controller is used to compare the actual value of the LTR with the desired one; deviation \(e\) and deviation change rate \(ec\) are the input signals of the fuzzy controller; the  
Figure 4: Flow chart of anti-rollover control system. Figure 5: Schematic of PID process. output signals are \(\Delta K_{p}\), \(\Delta K_{i}\), and \(\Delta K_{d}\), based on which the parameters are adjusted. The output parameter of the control system is the braking torque of the target wheel. Based on the vehicle and kinematic parameters, the theoretical domains of \(e,ec\), and \(u\) were set to [(6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16)], and the fuzzified domains are \(E\), \(EC\), and \(U\). The number of fuzzy quantities is generally selected as 5-10. Here, seven fuzzy quantities were selected, that is, seven linguistic variables, where the fuzzy subsets of \(E\), \(EC\), and \(U\) were {NB, NM, NS, ZO, PS, PM, PB} each, the fuzzy subsets of fuzzy subsets are {NB, NM, NS, ZO, PS, PM, PB}, and each fuzzy subset is defined as NB (negative large), NM (negative medium), NS (negative small), ZO (zero), PS (positive small), PM (positive medium), and PB (positive large). The affiliation function also impacts the stability of the control system. The control scheme is stable when the trend of the affiliation function curve is smooth; the sensitivity and resolution are good when the change in the affiliation function curve is significant. The input deviation \(E\) and the deviation rate of change \(EC\) were selected as triangular affiliation functions, as shown in Figure 7. The output quantities \(\Delta K_{p}\), \(\Delta K_{i}\), and \(\Delta K_{d}\) were selected as Gaussian affiliation functions, as shown in Figure 8. Fuzzy inference rules form the core of a fuzzy controller, which consists of many different combinations of fuzzy conditions [(2)]. A dual-input and triple-output controller was used, which has seven fuzzy linguistic variables for each parameter, and its number of control rules per parameter is listed in Tables 2-4. In the tables, the row is the deviation E, the column is the deviation rate of change EC, and the intersection of the rows is a rule; then, each parameter has 49 rules. Figure 6: Schematic of Fuzzy-PID control. Figure 7: Triangular membership function.