This section introduces the novel fuzzy frame update policy. The arbitration of RFID communication is a stochastic process of unknown behaviour. Therefore, fuzzy logic is an efficient tool to model the process of identifying RFID tags. Fuzzy control for RFID anticollision protocols was first introduced in [
7], where a fuzzy system was used to give an intuitive value of the frame size. This work presents a Fuzzy Rule Based System (FRBS), which obtains the value of the pointer slot
p to only accurately examine the frame size when appropriate. This solution is combined with a timeminimising function to update the value of
L at slot
p. The resulting proposed policy lowers the average time required to read one sensor packet from one tag compared to existing strategies. The three parts of the proposed policy (frame size calculation, frame size examination, and frame break condition) are presented next.
4.1. Frame Size Calculation to Minimise ${T}_{R}(N,L)$
The first part of the policy sets the value of
L to minimise the expected time to receive one sensor data packet from one tag in a frame. For this purpose, the sensor data read time
${t}_{R}(n,L)$ is defined as the expected time to identify one tag among
n in a frame of size
L and read one sensor data packet:
where
${c}_{s}(n,L)$,
${c}_{k}(n,L)$, and
${c}_{i}(n,L)$ are defined as the expected value of the number of single, collision, and idle slots in a frame, respectively. The duration of the slots,
${T}_{s}$,
${T}_{p}$,
${T}_{k}$, and
${T}_{i}$, are set according to the standard
and
where
${T}_{command}$ is the duration of the reader command Qc, QA, or QR, referred as
${T}_{Qc}$,
${T}_{QA}$, and
${T}_{QR}$, respectively.
The parameters
${T}_{EPC}$ and
${T}_{RN16}$ correspond to the duration of the
$EPC$ and RN16 tag messages, respectively. These two parameters are calculated as a function of the TagtoReader synchronisation time
${T}_{Preambl{e}_{TR}}$, the length of each parameter, and the tag data rate
$D{R}_{t}$, calculated as
The parameter
$BLF$ refers to the Backscatterlink frequency. Thus,
and
The length of the sensor data packet
${T}_{data}$ is calculated by taking a commercial UHF RFID accelerometer sensor tag as a reference [
6]. According to the sensor data sheet, each accelerometer data packet contains 10 bytes of data.
The reader transmits one QA or Qc command in the first slot of each frame. Then, it transmits consecutive QR commands in the following slots of the frame until it reaches the last slot of the frame. Assuming a frame with sufficiently large
L,
${T}_{command}$ =
${T}_{QR}$ is applied in Equations (
2), (
4), and (
5) when one frame is analysed.
The duration of the reader commands Qc, QA, QR,
$Re{q}_{RN}$, and ACK are calculated as
and
The duration of the Read command
${T}_{Read}$ is calculated using a commercial UHF RFID accelerometer sensor tag as a reference [
6]. Thus,
The parameters
${T}_{FSyn{c}_{RT}}$ or
${T}_{Preambl{e}_{RT}}$ correspond to the ReadertoTag synchronisation time as defined in [
1], and the reader data rate
$D{R}_{r}$ is obtained as
where
${T}_{symbo{l}_{0}}$ =
$Tari$, and
${T}_{symbo{l}_{1}}$ = 1.5·
$Tari$.
$Tari$ represents the reference time interval for a symbol0 (FM0 symbol) transmission.
Next, the value of
L minimising
${t}_{R}(n,L)$ is obtained by evaluating an RFID system with
n tags and one reader. In this system, we can apply a a binomial distribution
${P}_{r}(n,L)$ [
9] to approximate the probability that
r tags among
n select one slot along a frame of size
LAdditionally,
${p}_{s}(n,L)$,
${p}_{k}(n,L)$, and
${p}_{i}(n,L)$ correspond to the probabilities that only one tag, more than one tag or no tag, respectively, occupy a slot [
7]. In order to obtain the expected number of idle, single, and collision slots in a frame with a size
L sufficiently large, we can apply a Poisson distribution with mean
$\rho $ =
n/
L [
9].
${c}_{i}(n,L)$ is approximated with
$r=0$ in Equation (
18) by
${c}_{s}(n,L)$ is approximated with
$r=1$ in Equation (
18) by
Then,
${c}_{k}(n,L)$ is approximated by
By substituting Equations (
19), (
20), and (
21) into (
1), and applying
$\frac{n/\rho}{n/\rho 1}$≈1, the following expression is obtained
Computing the derivative of
${t}_{R}\left(\rho \right)$ in Equation (
1) with respect to
$\rho $ yields
Then, by posing
$\frac{d{t}_{R}\left(\rho \right)}{d\rho}$ = 0, we obtain the following equation
By solving Equation (
24), the value of
$\rho $ that minimises
${t}_{R}\left(\rho \right)$ is obtained:
where
$W\left(x\right)$ is the Lambert Wfunction. Finally, the optimal frame size which minimises
${t}_{R}(n,L)$ is
where
$\rho $ is obtained from Equation (
25).
The value of
$\rho $ in Equation (
25) is evaluated and presented in
Figure 2 as a function of
${T}_{i}/{T}_{k}$. It can be appreciated that
$\rho $ decreases when the difference between
${T}_{i}$ and
${T}_{k}$ grows, which results in an increasing
L. In conclusion, a higher difference in the values of
${T}_{i}$ and
${T}_{k}$ (with
${T}_{i}$ ≤
${T}_{k}$) will result in a higher
L. This result is coherent regarding the process of RFID tags identification and sensor data reading. If the duration of collision slots is much higher than that of idle slots, then it is necessary to increase
L to reduce the number of collision slots. This occurs at the expense of an increase in the number of idle slots. However, because idle slots are much shorter than collision slots, this is an acceptable effect.
The previous analysis and Equation (
26) demonstrate that the frame size calculation of the proposed policy is timingaware. This means that the calculation is made as a function of the number of tags
n and the timing parameters (ultimately the duration of the reader commands and tags responses) of the RFID scheme.
4.2. Frame Size Examination: Pbp
The second part of a frame update policy refers to the slot where
L is examined. The FbF strategy is not efficient in the case of large frames filled with many collisions because the reader must wait until the frame has finished to update the frame size, which increases the identification time [
11]. The SbS strategy involves the calculation of
L at every single slot of the frame. As a consequence, one drawback of this solution is that it could overload a system with limited resources. Finally, the PbP strategy provides the flexibility of breaking the current frame before it ends, which maintains a low computational complexity in the reader. Therefore, the proposed policy applies a PbP strategy where the value of the pointer slot is dynamically updated using fuzzy logic.
The proposed policy applies a fuzzy rulebased system (FRBS) to adjust the value of the pointer efficiently. Consequently, the current
L and the tag collision rate
$co\_rate$ are modelled as fuzzy sets to adaptively update the value of the pointer. A zerothorder Takagi–Sugeno–Kang fuzzy system with a complete ANDcomposed rule [
29] is proposed. The membership functions that we have used to codify the input variables are trapezoidal (see
Figure 3) and the
tnorm minimum is used to implement the AND operator. Among the traditional shapes of membership functions (triangular, trapezoidal, Gaussian, generalized bell, and sigmoid), trapezoidal membership functions have been selected due to their representation simplicity, which allows faster calculations. The proposed system has two inputs, as follows:
Q: codifies the current value of this parameter which determines L, where $Q\in \mathbb{N}$ and $0\le Q\le 20$.
$co\_rate$: codifies the tag collision rate up to the current slot. This is defined by $co\_rate={c}_{k}/slot\_index$, and $0\le co\_rate\le 1$.
Additionally, the variable slot_index represents the reader’s internal counter, which keeps track of the present slot in the current frame.
The output p represents the slot where L must be examined. Specific values for membership functions and consequents in the rule base have been adjusted experimentally. The rules were designed also experimentally, considering the typical behaviour of an RFID system: on the one hand, more collisions (higher $col\_rate$) require us to promptly examine L (smaller output p); while on the other hand, a smaller frame size (smaller Q) requires the examination of L in a later time slot (higher output p). The experimental values for the membership functions and the rules have been obtained by evaluating different ranges and selecting the one with the best performance in ${t}_{R}$.
Figure 4 shows the surface representation of the proposed FRBS that determines the output
p, normalised to
L = 16. To illustrate an example, for the inputs
Q = 10 and
$co\_rate$ = 0.3, the output is
p =
L/9. Then, the new value of the pointer slot is
p = round(
${2}^{Q}$/9) = round(
${2}^{10}$/9) = 114.
4.4. The Proposed Fuzzy Frame Slotted Aloha Protocol
The novel FFSA protocol is introduced in this work, which applies the previously presented DFSA policy: determines the frame size minimizing
${t}_{R}(n,L)$ (
Section 4.1), examines the frame size following a
$PbP$ strategy (
Section 4.2), and starts a new frame with the condition to lower
${t}_{R}(n,L)$ (
Section 4.3). FFSA is compliant with the EPC C1G2 standard, meaning that it meets the specific communication timing requirements and uses poweroftwo values for
L. As a consequence, this policy can be used to identify commercial sensor tags.
In order to calculate the frame size in Equation (
26), FFSA applies the traditional Mean Minimum Square Error (MMSE) estimator [
26] to calculate
$\widehat{n}$ as
MMSE has been applied in FFSA due to its computational simplicity while providing a relatively low estimation time.
The pseudocode of FFSA is presented in Algorithm 1. Initially, the reader sets the value of
$\rho $ with Equation (
25) according to the RFID system timing parameters, and starts the identification procedure by broadcasting Qc. Each tag selects a slot in the frame to transmit its
$RN16$, and the reader updates the variables
${c}_{s}$,
${c}_{k}$, and
${c}_{i}$ accordingly. When the reader reaches the last slot of the frame, the remaining tag population size is estimated with Equation (
29). Then a new frame is started by broadcasting QA, specifying the new frame size as
${Q}_{n}=lo{g}_{2}((\widehat{n}{c}_{s})/\rho ),{L}_{n}={2}^{round\left({Q}_{n}\right)}.$ At every slot,
$col\_rate$ is calculated and
p is set as the current slot if
$col\_rate$ = 1. If the current slot is a pointer, the reader calculates
$\widehat{n}$ with Equation (
29) and sets
${L}_{n}$ with. Then, it obtains
${t}_{{R}_{c}}$ and
${t}_{{R}_{n}}$ with Equations (
27) and (
28). If the condition
${t}_{{R}_{n}}$ <
${t}_{{R}_{c}}$ is satisfied, a new frame is started and
p is updated with the FRBS. Otherwise, the reader broadcasts QR to proceed to the next slot. The sensor tags reading process ends when there are no collision slots in the current frame and the frame is terminated.
Algorithm 1: Pseudocode of Fuzzy Frame Slotted Aloha (FFSA) protocol, reader operation. 
 1:
Initialization: ${L}_{c}$=16, $slot\_index$=1, calculate $\rho $ with Equation ( 25)  2:
Broadcast Qc  3:
while 1 do  4:
read slot and update ${c}_{i},{c}_{s},{c}_{k}$  5:
if $slot\_index$ = ${L}_{c}$ and ${c}_{k}=0$ then  6:
break  7:
end if  8:
if $slot\_index$ = ${L}_{c}$ then  9:
$\widehat{n}=$$MMSE$(${c}_{s},{c}_{k},{c}_{i}$)  10:
${Q}_{n}=lo{g}_{2}((\widehat{n}{c}_{s})/\rho )$, ${L}_{n}={2}^{round\left({Q}_{n}\right)}$, ${L}_{c}$=${L}_{n}$  11:
broadcast QA  12:
else  13:
$co{l}_{}rate$ = ${c}_{k}$/$slot\_index$  14:
if $co{l}_{}rate$=1 then  15:
p = $slot\_index$  16:
end if  17:
if $slot\_index$ = p then  18:
$\widehat{n}=$$MMSE$(${c}_{s},{c}_{k},{c}_{i}$)  19:
${Q}_{n}=lo{g}_{2}((\widehat{n}{c}_{s})/\rho )$, ${L}_{n}={2}^{round\left({Q}_{n}\right)}$  20:
if ${t}_{S{R}_{n}}$ < ${t}_{S{R}_{c}}$ then  21:
p = FRBS($co{l}_{}rate$,${Q}_{n}$), ${L}_{c}$=${L}_{n}$  22:
broadcast QA  23:
else  24:
$slot\_index$ = $slot\_index$ +1  25:
broadcast QR  26:
end if  27:
else  28:
$slot\_index$ = $slot\_index$ +1  29:
broadcast QR  30:
end if  31:
end if  32:
end while
