# Transmission Power Control in Wireless Sensor Networks Using Fuzzy Adaptive Data Rate
## 3 Adaptive Fuzzy Control Algorithm and Analysis of Power Consumption
### Fuzzy Control Algorithm Design  
Fuzzy logic system is a method of reasoning that resembles human reasoning. The approach of FL imitates the process of decision making in humans that involves all intermediate possibilities between binary logic. Several fuzzy control approaches have been applied to the industry with several important theoretical and successful results [33; 34; 35; 36; 37; 38]. The control approach based on human experience is acting in fuzzy controls by expressing the control requirements and elaborating the control signal in terms of IF-THEN rules in which \(i\)th rule can be represented as  
\[\text{Rule }i\text{: IF (antecedent) THEN (consequent)} \tag{6}\]  
where the antecedent (premise) refers to the found-out situation, and the consequent (conclusion) refers to the measures which should be made on the decision. Mamdani [39] and Sugeno [40] are two well established types of Fuzzy Inference Systems (FIS). In this study, the Mamdani fuzzy inference is adopted to create a control system for adaptive data rate. In a Mamdani system, the output of each rule is a fuzzy set which means it has advantages of expressive power and interpretable rule consequent, while Sugeno does not [41]. Therefore, Mamdani FIS is adopted in this paper. Although Segeno has better effectiveness than Mamdani, the proposed system decreases the computational complexity by using a look-up table to obtain the final output value from a fuzzy controller. Because multiple factors affect wireless transmission, the relation of PER and SNR does not always fit to theory. This study proposes a low-power control algorithm based on Mamdani fuzzy controller to solve time-varying and nonlinear problems. The system can  
Figure 5: Relationship between PER and SNR in different data rates. \begin{table}
\begin{tabular}{c c c c} \hline \hline  & **Data Rate 50 kbps** & **Data RATE 100 kbps** & **Data Rate 200 kbps** \\ \hline PER & \(\sim\)1\% & \(\sim\)1\% & \(\sim\)1\% \\ SNR & 5.22 dB & 7.09 dB & 7.59 dB \\ Transmission Power & 10 dBm & 12 dBm & 13 dBm \\ Power Consumption & 35.64 uC & 15.93 uC & 7.72 uC \\ Saving Rate & \(\backslash\)\(\backslash\) & 55.30\% & 78.34\% \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Comparison table in different parameters. achieve a more precise corresponding result and better control effect with larger range of setting the MF or more designing rules. However, the proposed system needs to implement the fuzzy controller into the target device. Considering the storage space of the device, we chose suitable parameters of membership function by observing the long-time testing data collected in the past. The following five linguistic values are used, VL (Very Low), L(Low), M(Medium), H(High), and VH (Very High). To conquer time-varying interference, this study uses error count and error interval as the inputs of a fuzzy control system. The corresponding membership functions are illustrated in Figure 6. Error count is the number of errors in 128 moving windows, which can also be expressed as PER; when it has 1 error in 128-windows, PER would be 0.78% and it becomes 1.56% after receiving another error in 128-windows which exceeds the control objective of the system. As a result, there are more membership function overlaps at the range of 1 to 3, the place which is more sensitive and needs a precise control, when designing the membership function of error count. Error interval is calculated by the interval away from the latest error. These input parameters can represent communication quality and stability. The membership functions for output are illustrated in Figure 7. The output value, guard, is adopted for limiting the upper bounds of data rate and transmission power. The corresponding twenty-five fuzzy rules are presented in Table 6. It keeps RSSI away from sensitivity for getting a promotion in communication quality when errors are close to H or VH and error interval is close to L or VL.