# Lane Detection Algorithm Using LRF for Autonomous Navigation of Mobile Robot
## 5 Tracking Control Algorithm  
This algorithm is a stable tracking control algorithm to progressively control the Cartesian trajectory from the start point to the target point of an off-trajectory robot using the mobile robot's present location and position and the location of the target point. The location of the robot is expressed using three degrees of freedom as in Equation (18) where x and y denote the robot's coordinates, which can be obtained via the encoder values of the motors on both sides, and \(\theta\) denotes the robot's eye direction.  
\[P_{k}=[x,y,\theta]^{T} \tag{18}\]  
Further, all terms of Equation (14) are time functions. Therefore, they can be expressed as \(x(t)\), \(y(t)\), and \(\theta(t)\), and \(\theta(t)\) can be obtained using Equation (15).  
\[\theta(t)=\tan^{-1}\left(\frac{\dot{y}(t)}{\dot{x}(t)}\right) \tag{19}\]  
The motions of the mobile robot are controlled with linear and angular velocities. The mobile robot's kinematics is defined by using the Jacobian matrix J.  
\[\dot{P}=Jq \tag{20}\]  
where \(q\) denotes \(\left[\begin{array}{ccc}v&w\end{array}\right]^{T}\) and \(J\) is \(\left[\begin{array}{ccc}\cos\theta&\sin\theta&0\\ 0&0&1\end{array}\right]^{T}\). This kinematics algorithm can be applied commonly to all non-omnidirectional robots. This algorithm requires the locations  
Figure 9: Total system flow.  
of the current and target points in order to control a mobile robot. The system calculates \(P_{c}\), the difference between the two points, using Equation (20) [37].  
\[P_{e}=T_{e}(P_{r}-P_{c}) \tag{21}\]  
where \(T_{e}\) is \(\left[\begin{array}{ccc}\cos\theta_{c}&\sin\theta_{c}&0\\ -\sin\theta_{c}&\cos\theta_{c}&0\\ 0&0&1\end{array}\right]\) and \(\theta_{c}\) denotes the present direction angle of the robot.  
Finally, the linear and angular velocities required for the robot to move up to the target point can be calculated via Equation (18).  
\[q=\left(\begin{array}{c}v_{d}\cos\theta_{e}-v_{c}\\ \omega_{d}-\omega_{c}\end{array}\right) \tag{22a}\]  
\[v_{d}=\pm\sqrt{\dot{x}_{r}^{2}(t)+\dot{y}_{r}^{2}(t)} \tag{22b}\]  
\[\omega_{d}=\frac{\ddot{y}_{r}(t)\dot{x}_{r}(t)-\ddot{x}_{r}(t)\dot{y}_{r}(t)} {\dot{x}_{r}^{2}(t)+\dot{y}_{r}^{2}(t)} \tag{22c}\]  
where \(v_{d}\omega_{d}\) denote the linear and angular velocities required to reach the target point, \(v_{c}\omega_{c}\) represent the present linear and angular velocities, and \(\omega_{c},y_{r}\) denote the coordinates of the target point.  
Figure 10 shows the structure of the following controller. \(p_{r}(t)\) represents the target position and \(p_{c}(t)\) represents the current position of the mobile robot. Through the error matrix, which is the difference \(p_{e}\) between the current position and the target position, \(q\) composed of the required linear velocity and angular velocity is obtained. The third box \(T\) is converted to fit the hardware considering the structure of the hardware. The coordinates of the mobile robot reflecting the required speed are combined with the Jacobian \(J\) and changed to the current speed which is accumulated and feedback to the current position.