# Remote Control of a Mobile Robot for Indoor Patrol
## 3 Fuzzy Control  
In the first part of this study, we explored how the mobile robot is designed to track a moving object in complex environments. Figure 5 shows the dynamic tracking control scheme with fuzzy controller. The procedure of dynamic tracking is shown in Figure 6. There are two inputs of the proposed fuzzy steering controller, which are the horizontal position of the target in a frame of captured image and the distance between the moving target and the WMR. The output of the system is the turning angular velocity of the wheeled mobile robot. Figure 7 shows membership functions \(X\) of the horizontal position of the target in a frame of captured image; its fuzzy sets are L, MI and R, which represent left, intermediate, and right, respectively. Figure 8 shows membership functions  
Figure 4: Relative coordinate of target with respect to wheeled mobile robot (WMR).  
Figure 3: Side view of camera [17].  
of the vertical position \(Y\) of the target in a frame of captured image. Its fuzzy sets are N, M and F, which represent near, medium and far, respectively. The fuzzy sets of the left wheel speed (the output variable is \(D\)) are LS, LMS, LMM, LMF, LM, LFS, LFM, LFF, and LF, which represent a turn that is very slow, greatly slow, medium slow, minimally slow, medium, minimally fast, medium fast, fast and very fast, respectively. Membership functions of the left wheel speed are shown in Figure 9, where the value of wheel speed is the digital input code of the wheel's motor. Definition of the right wheel speed is similar. Table 1 illustrates the fuzzy rules of the left wheel speed for the fuzzy steering controller. Fuzzy rules of the right wheel speed can be obtained by a similar design process.  
Figure 5: Dynamic tracking control scheme with fuzzy controller.  
Figure 6: The flowchart of dynamic tracking.  
Figure 8: Membership functions of the vertical position of a moving target in an image frame.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{X} & \multirow{2}{*}{**N**} & \multirow{2}{*}{**M**} & \multirow{2}{*}{**F**} \\ \hline L & LMS & LMF & LS \\ MI & LMM & LM & LFF \\ R & LFM & LFS & LF \\ \hline \end{tabular}
\end{table}
Table 1: Fuzzy rules of the left wheel speed for the fuzzy steering controller of dynamic tracking.  
Figure 7: Membership functions of the horizontal position of a moving target in an image frame.  
Figure 9: Membership functions of the left wheel speed w.r.t. moving target position.  
In this second part of the study, a fuzzy control scheme is designed to drive the WMR in an indoor patrol situation. The WMR is controlled by a sensor signal which provides distance information to the robot such that the robot can be driven and moved along a wall. In wall following, a safety distance between the robot and the wall is predefined. The robot moves along the wall and keeps a constant distance from the wall. Installed on the robot are two infrared (IR) sensors, which are located at the right and left sides of the robot. Each IR sensor points 45 degrees away from the heading angle, and are marked as SR_L and SR_R, as shown in Figure 10. The measured distance from the SR_R is dR and the distance measured by the SR_L is dL. Control sequence of indoor patrol is shown in Figure 11.  
Figure 11: Flowchart of indoor patrol [17].  
Figure 10: Sensors and input variables of the WMR [17].  
In fuzzy steering controller, the inputs are two IR detecting signals and the output of the system is the turning angular velocity of the robot. Fuzzy sets of the left IR sensor are LF, LM and LC, which represent fast, medium, and slow, respectively. For the fuzzy sets of the left wheel, speeds are LS, LMS, LMM, LMF, LM, LFS, LFM, LFF, and LF, which represent turning very slow, greatly slow, medium slow, minimally slow, medium, minimally fast, medium fast, fast and very fast, respectively. The fuzzy rules for the indoor patrol controller of the left wheel speed are shown in Table 2.