A new approach of a path-tracking system of a differential drive robot for an arbitrary set of waypoints using sliding mode control Authors: Amin Danial Asham Published: 2026 ABSTRACT Autonomous differential-drive robots are typically controlled to follow a desired path. This path may be defined by a continuous curve or set of waypoints. Few studies have examined cases in which a path is defined by an arbitrary set of waypoints. This paper introduces a new approach to a path-tracking system for an arbitrary set of waypoints using a sliding mode control (SMC) system. This approach is based on a nonlinear kinematic model of the tracking error derived in this research for a differential-drive robot. Based on the derived error model, a sliding mode controller is introduced to drive the tracking error to zero. The stability of the system was also investigated. In addition, the effects of robot dynamics were incorporated into the proposed controller without prior knowledge of the exact parameters of the robot. Simulations were conducted to compare the proposed control system with a widely used approach to demonstrate the effectiveness of the proposed controller in tight maneuvers, particularly at directional discontinuity and/or sharp turns. The proposed technique was verified through real-time experimental tests using a differential drive robot. 1. Introduction Autonomous robots have a wide range of applications in various fields. These robots are typically used to track desired paths. If paths are drawn as lines and detected by sensors, this is called the line-following approach, as in [1]. For paths defined by smooth curves or waypoints, this approach is called the path-tracking approach. The path is planned based on the environment in which the robot is moving. Path-tracking algorithms are more complex than line-follower systems. A line-follower system can be viewed as a special case of a path-tracking system. In [2], a kinematic model was developed for the path-tracking error of a differential-drive robot. Based on this model, the target velocities are calculated to reduce the tracking error to zero. These target velocities are applied to the robot to track the desired path. However, the effect of robot dynamics was ignored by assuming that the robot was capable of perfectly tracking the target velocities. In addition, the desired path in [2] is a piecewise continuous function of time and not a set of waypoints. Moreover, the proposed controller has a cross-track error (perpendicular lateral distance from the desired path) in the case of a desired path with directional discontinuity. The kinematic controller introduced in [2] is widely used in the literature, as in [3–6]. In [3], a backstepping control approach was introduced to address the dynamics of real robots. In this approach, a dynamic controller was added to achieve the target velocities from the kinematic controller introduced in [2]. The control scheme introduced in [3] has been used widely by several researchers. That is, the target velocities were generated as in [2] and another controller was used to drive the real velocities of the robot to follow the target velocities. Different controllers have been introduced to achieve accurate tracking of target velocities, such as those in [4–6]. In [4], a modified PID controller was used to track the target velocities of a tracked vehicle. However, the proposed controller was not experimentally verified in a real vehicle. In [5], SMC was used to control the robot velocities to follow the target velocities. In addition, fuzzy logic was used to change a certain gain to reduce the chattering effect of the sliding mode control. In [6], a control scheme similar to that in [5] was employed. The control scheme consists of a kinematic controller and an integral SMC as a dynamic controller to deal with robot dynamics and uncertainties. The controller parameters were optimized using sequential quadratic programming (SQP). It was shown in [6] that the performance of the SMC is better than that of the modified PID controller [4]. All former approaches are derivatives of the control scheme introduced in [3]. This type of path tracking is primarily used for continuous, smooth paths. Various approaches have been proposed in the literature [7–12]. All these approaches are for continuous paths. Some approaches use fuzzy-based controllers [8,9]. Nonlinear model predictive control with neural networks was introduced in [10]. Even for discrete reference points, curve-fitting techniques have been used to obtain continuous smooth paths [7,11]. A feedback linearization method was used in [12], in which the derivation of the control laws assumed a differentiable path. A few researchers have introduced waypoint path-tracking algorithms [13–15]. In [13], the path was composed of a smooth polynomial connecting the waypoints. However, in [14], the proposed approach was a point-to-point control technique. The robot is controlled to reach each waypoint. However, no specific path existed between any two successive waypoints. In other words, the controller has no cross-track error measures to eliminate. This case was solved in [15], where the desired path was defined by a set of waypoints connected to each other with straight segments. A modified version of the kinematic controller introduced in [2] was developed in [15] by adding a cross-track error measure to be eliminated using the modified controller. This technique outperforms that in [2] for turns with directional discontinuities. However, another controller must be used to achieve the desired linear and angular velocities calculated using this modified kinematic controller. Moreover, the angular velocity control signal produced by this controller exhibits fluctuations that may limit its applicability in real-world applications. In addition, this controller does not perform tight maneuvers during sharp or directional discontinuous turns. In this paper, a new approach for the path tracking of an arbitrary set of waypoints is introduced. This approach is based on the nonlinear kinematic model of the differential-drive robot derived in Section 2. An SMC scheme is introduced in Section 3, in which a sliding surface is selected to ensure that the tracking error approaches zero. The effect of robot dynamics is incorporated into the introduced controller. In Section 4, the proposed controller is tested through simulations and verified using a differential-drive robot. Finally, the conclusions of the results and future work are discussed in Section 5. The main contribution of this research is the introduction of a new control approach for an arbitrary set of waypoints. This approach is based on a single sliding mode control method, taking into account both the kinematics and dynamics of the system. The proposed controller performs tight maneuvers at directional discontinuities and/or sharp turns (where a turning angle is considered sharp if it is ≥ π/2 radians) while accurately following the straight segments connecting the waypoints. 2. Kinematic mathematical model In this section, the kinematic model of a differential-drive mobile robot is used as a foundation for the proposed path-tracking controller. While the basic pose kinematics rely on standard coordinates transformations the primary focus here is the derivation of a specialized error state model. This formulation, based on cross-track and angular errors, is explicitly tailored for tracking an arbitrary set of waypoints and allows the system to be treated as a single-input model for the subsequent sliding mode control design. 2.1. Standard differential-drive kinematics The main objective is to drive a differential-drive robot to follow a path defined by an arbitrary set of waypoints, as shown in Fig 1. The robot must tightly follow straight segments that connect the waypoints. Fig 1 shows there are two frames: a fixed frame F−frame attached to the ground and a robot frame R−frame attached to the robot. The origin of the R−frame is located at point p, which is in the middle of the distance w between the powered wheels. The R−frame is rotated with respect to the F−frame with pose angle θ(t). The angular velocity of the robot is ω(t)=θ˙(t). The linear velocity ϑ(t) of the robot is in the x−axis direction of the R−frame. Differential drive robot. All the quantities \(pFx,pFy,θ,e,d, ω, ϑ,vR,and vL are functions of time t, which is omitted for simplicity. The coordinates of the point p in the fixed frame are XpFt. The desired path is defined as a sequence of desired waypoints in the fixed frame. These waypoints are connected by straight segments. The coordinates of the kth waypoint PD(k)in the F−frame are (DFx(k),DFy(k)). As shown in Fig 1, the cross-track error e(t) is the perpendicular distance between the point p and the segment connecting the current waypoint PD(k)and the previous waypoint PD(k−1). The angle between the segment connecting waypoints PD(k) and PD(k−1) and the x−axis of the fixed frame is φ. The distance between point p and the kth waypoint PD(k) is xkDF-xpFt2+ykDF-ypFt2. The angle between d(t) and the x−axis in the F−frame is θD(t). The linear velocity ϑ(t) and the angular velocity ω(t) are calculated as follows [16]: where vR(t) and vL(t) are the right and left linear velocities in m/s for the right and left wheels, respectively. The robot moves in the positive direction of the x−axis in the R−frame. That is, ϑ(t)≥0, in other words, both vR(t) and vL(t) never simultaneously become negative. If the maximum achievable speed by the powered wheels is ϑm, then: Consequently, both the linear and angular velocities of the robot can be expressed as: where ωm is the maximum achievable angular velocity and ωn(t) is the normalized angular velocity; hence, |ωn(t)|≤1. ϑn(t) is the normalized linear velocity where ϑn(t)=(1−|ωn(t)|). From Eq. (1) and Eq. (3), we get: In the following subsection, a mathematical formulation of the cross-track and angular errors is introduced. 2.2. Proposed kinematic error model The cross-track error e(t) in Eq. (5) is obtained from the dot product of two vectors, (−sin(φ),cos(φ))T and xkDF-xpFt,ykDF-ypFtT, where (−sin(φ),cos(φ))T is the unit vector perpendicular to the segment connecting the current waypoint PD(k)and the previous waypoint PD(k−1). Whereas the angular error eθ(t) is defined as in Eq. (6), which is a modified version of the angular error in [15]. From Eq. (5), we get e˙(t) as follows: Since \(pFx˙(t)=ϑ(t)cos(θ(t)) and \(pFy˙(t)=ϑ(t)sin(θ(t)), then from Eq. (7), we get e˙(t) as follows: From Fig 1, θD(t)=tan−1(DFy(k)−pFy(t)DFx(k)−pFx(t)), then from Eq. (6), we get: Then from Eq. (8) and Eq. (9), the proposed kinematic error model, incorporating cross-track and angular errors, can be expressed as follows: From Eq. (10) and Eq. (3), the kinematic model becomes a single-input system with input control signal ω(t). Based on the kinematic model shown in Eq. (10), a control law is developed in the following section to obtain e(t)→0 and eθ(t)→0 as t→∞. 3. Proposed path-tracking control system In this section, a kinematic controller based on the SMC technique is proposed. This controller pushes the system to move on a certain sliding surface in the error state space e−eθ. This surface is chosen such that the tracking errors vanish with time. Hereafter, time variable t is omitted without ambiguity for simplicity. For example, e(t) is written as e, and so on. 3.1. Control law The proposed kinematic controller is a sliding mode controller. This controller has a sliding surface σ in the state space e−eθ defined as follows: where en=e/em and eθn=eθ/eθm are the normalized cross-track and angular errors, respectively. emand eθm are the normalizing constants for the error e and angular error eθ, respectively. em and eθmcan be interpreted as the maximum allowed errors for both the cross-track and the angular errors, respectively, at which the controller takes the maximum action. 1/em and 1/ eθm represent the relative weights of both the cross-track and the angular errors, respectively. Consequently, these relative weights determine which error (cross-track or angular) has a greater impact on σ and hence on the control output. The error with higher impact will be prioritized for minimization. The proposed controller’s strategy is to push the system states (e and eθ) towards the surface σ=0. On the surface σ=0, both e and eθ tend to zero as t→∞ as proven by Theorem 1. Theorem 2 introduces a control law that pushes the states to surface σ=0 in finite time whenever σ≠0, ensuring that the states remain on surface σ=0. Theorem 3 is similar to Theorem 2 after considering robot dynamics. Theorem 1: In case of σ=0 both e, eθ→0 as t→∞. Proof: In the case of σ=0 and from Eq. (11), eθn can be expressed as follows: From Fig 1, φ−θD(t)=−sin−1(e/d), and substituting Eq. (12) into Eq. (10), the rate of change of the error is given by Eq. (13). Let Ve be a Lyapunov function candidate, defined as Ve=(1/2)e2. Then V˙e=e˙e. Multiplying both sides of Eq. (13) with e, we find that e˙e<0 and hence, V˙e<0 for all e≠0. Consequently, e→0 and hence, from Eq. (12) eθ→0 as t→∞. Therefore, the proof is complete. As shown in Theorem 1, for σ=0 the system is asymptotically stable because the errors vanish as time t passes, as shown in Fig 2. State Plane en−eθn. In the second and fourth quarters the error e→0. On σ=0, eθn=−en and hence, eθn→0 as en→0. At this point, a control signal is required to push the system to σ=0. In Theorem 2, a control law is proposed that pushes the system towards σ=0. Theorem 2: The Control law in Eq. (14) guarantees the reachability of the sliding surface in finite time and remains on it. where Proof: From Eq. (10), Eq. (3), and Eq. (11), σ˙ can be obtained as follows: Since Therefore, sign(N′)=sign (σ). We have three cases as follows: Case 1: |N|>D AND sign(N)=−sign(σ) In this case, as shown in Eq. (14), ωn=0. Therefore, from Eq. (15), we obtain: Case 2: D′=D+sign(N′)*N=0 This case occurs, when |N|=D AND sign(N)=−sign(σ). From Eq. (14), ωn=sign(σ). Therefore, Case 3: |N|1 (as a special case of |ωn|>1 when D′=0), since |ω| cannot be greater than ωm, therefore ωn must be clipped such that |ωn|=1. Consequently, the control signal is set to be ωn=sign(σ), then from Eq. (3), Eq. (15) becomes: In the case of |ωn|>1 (as a special case of |ωn|>1 when D′=0), since |ω| cannot be greater than ωm, therefore ωn must be clipped such that |ωn|=1. Consequently, the control signal is set to be ωn=sign(σ), then from Eq. (3), Eq. (15) becomes: In the case of |ωn|<1, the control signal is ωn=N′/D′, as shown in Eq. (14). By substituting for ωn in Eq. (15), we obtain: In the case of |ωn|<1, the control signal is ωn=N′/D′, as shown in Eq. (14). By substituting for ωn in Eq. (15), we obtain: Since ϑn≤1 , therefore sign(Nϑn−(c|N|+D|σ|)sign(σ))=− sign(σ). Let Vσ be a Lyapunov function candidate, where Vσ=(1/2)σ2. Then, V˙σ=σσ˙. At t=0, the initial value of Vσ, where σ≠0, is Vσo. The time required to reach σ=0 (Vσ=0) is tf. In case 1, V˙σ=−|N||σ|=−|N|2Vσ<−D2Vσ. tf is obtained by integrating ∫0tfVσ−12V˙σdt<∫0tf−2Ddt. Thus, tf<2Vσo /D. Therefore, the system states are pushed to σ=0 in a finite time. In case 2, V˙σ=−D|σ|. tf is obtained by integrating ∫0tfVσ−12V˙σdt=∫0tf−2Ddt. Thus, tf=2Vσo /D. Thus, the system states are forced to σ=0 in a finite time. In case 3, we have three cases as follows In the first case, tf is obtained from ∫0tfVσ−12V˙σdt=∫0tf−2Ddt to be tf=2Vσo /D, which is a finite time. For the other two cases, in Eq. (16), V˙σ≤−234DVσ34. Subsequently, by integrating ∫0tfVσ−34V˙σdt≤∫0tf−234Ddt, we obtain tf≤254(Vσo)14/D. Therefore, at any instant σ≠0, the system states are always pushed back to σ=0in a finite time. Therefore, the system is maintained on the sliding surface σ=0. Thus, the proof is complete. To eliminate the known chattering phenomenon associated with the sliding mode control technique, the sign() function is approximated as in Eq. (17) [17]: where δ is a small positive scalar. While the mechanical inertia of the DC motors inherently acts as a low-pass filter against high-frequency vibrations, applying raw discontinuous chattering directly to the motor driver circuits causes excessive wear and inductive heating. Therefore, the continuous approximation in Eq. (17) is utilized to smooth the control reference mathematically, protecting the driver electronics and preventing the excitation of unmodeled high-frequency electrical dynamics. The proposed path-tracking approach is based on the kinematic model introduced in Eq. (10). In this approach, the states of the system are pushed to move on the sliding surface σ=0.Theorem 1 shows that tracking errors e and eθ approach zero as t→∞ on the sliding surface. Theorem 2 introduces a control law that guarantees the reachability of the sliding surface in finite time whenever σ≠0 and maintains the system there. In the following subsection, the effects of robot dynamics are investigated. 3.2. The effect of the system dynamics So far, the effects of system dynamics have been ignored. If the axis of rotation passes through a point sufficiently close to the center of mass of the robot, and the linear and rotational velocities of the robot are not high (specifically limited to 70 cm/s and 10 rad/s, respectively), the Coriolis and centrifugal forces can be neglected. However, these motors are typically DC motors with negligible inductances [18]. The dynamics of the differential drive robot [18,19] coupled with the dynamics of the DC motors can be modeled as follows: where M and J represent the total equivalent mass and the moment of inertia of the robot, wheels, and motors, respectively. Bω and Bϑ represent the friction and back EMF of the motors for rotational and linear motions, respectively. VR and VL are the voltages applied by the controller to the right and left motor, respectively. Aω and Aϑ are constants that depend on the physical parameters of the motors and the robot such as back EMF and torque constants, armature resistances, masses, moment of inertia, distance between wheels, and wheel radii. Therefore, owing to the dynamics in Eq. (18), the angular and linear velocities require time to reach the required values to maintain the motion on the sliding surface. At the current instant to, the normalized linear and rotational velocities are ϑon and ωon, respectively. The new linear and rotational velocities corresponding to the voltages newly applied to the motors by the controller are ϑn and ωn, respectively. Then the actual velocities ωn′ and ϑn′ at the instant to+τ, where τ is the sampling period, can be calculated as follows: where μl and μr represent the linear and rotational dynamics of the robot, respectively. By substituting ωn′ and ϑn′ from Eq. (19) for ωn and ϑn in Eq. (15), respectively. Thus, we obtain the actual σ˙, as expressed in Eq. (20), which represents the rate of change in σ considering robot dynamics. Then the control law in this case can be defined as follows: The following theorem shows that the reachability of the sliding surface σ=0 is assured using the control law in Eq. (21). Theorem 3: The Control law in Eq. (21) guarantees the reachability of the sliding surface in finite time and remains on it. Proof: From Eq. (21), we have the following cases: Case 1: |N|>0 AND sign(N)=−sign(σ) In this case, from Eq. (21) ωn=0. Consequently, in the next samples ωon=0 and ϑon=1. Hence, σ˙=N. Therefore, sign(σ˙)=sign(N)=−sign(σ). Case 2: D′=0. This case occurs, when |N|=D AND sign(N)=−sign(σ). From Eq. (21), ωn= sign(σ). Consequently, in the next samples ωon=sign(σ) and ϑon=0. Hence, σ˙= −Dsign(σ)e−μrτ−Dsign(σ)(1−e−μrτ)=−Dsign(σ), Therefore, sign(σ˙)=−sign(σ). Case 3: D′>0 In this case, no prior knowledge of the exact values of μr and μl is needed; only the lower bound μmin is required. Because μmin≤min(μr,μl), then D/D′≥1 and hence, substituting for ωn from Eq. (21) into σ˙ in Eq. (20) yields sign(σ˙)=−sign(σ). Therefore, the system states are pushed to σ=0, where the tracking error approaches zero as time approaches infinity. Let Vσ be a Lyapunov function candidate, where Vσ=12σ2. Then, V˙σ=σσ˙. At t=0, the initial value of Vσ, where σ≠0, is Vσo. The time required to reach σ=0 (Vσ=0) is tf. In case 1: V˙=−|N||σ|≤−ϵ|σ|=−ϵ2V, where 0<ϵ≤|N|. Thus, tf≤2Vσo /ϵ. Therefore, the system states are pushed to σ=0 in a finite time. In case 2: V˙=−D|σ|=−D2V. Therefore, tf=2Vσo /D. Thus, the system states are forced to σ=0 in a finite time. In case 3: as shown in theorem 2, when |ωn|>1 it is clipped to be ωn=sign(σ). Thus, we have the following cases: Similar to theorem 2, in the first case, tf=2Vσo /D, which is a finite time. For the other two cases, V˙σ≤−234DVσ34. Subsequently, by integration tf≤254(Vσo)14/D. Therefore, at any instant σ≠0, the system states are always pushed back to σ=0 in a finite time. Therefore, the system is maintained on the sliding surface σ=0. Thus, the proof is complete. 3.3. Path handling The desired path is defined by a set of waypoints as shown in Fig 1. These waypoints are connected by straight segments. These waypoints are targeted sequentially. The path handler module shown in Fig 3 calculates φ, e, eθ, and φ−θ. The angle φ between the segment connecting the targeted waypoint PD(k) and the previous waypoint PD(k−1) is calculated as follows: Control system. The tracking errors e, and eθ are calculated using Eq. (5) and Eq. (6), respectively. The path handler changes the targeted waypoint using the following algorithm until the last waypoint PD(km) is reached, where the index of the last waypoint is km. At the beginning, the waypoint index k is initiated by setting k=1. At the beginning, the waypoint index k is initiated by setting k=1. The distance d is calculated by d=(DFx(k)−pFx)2+(DFy(k)−pFy)2. The distance d is calculated by d=(DFx(k)−pFx)2+(DFy(k)−pFy)2. If (k>1) thenIf (d≤dtol AND k1) then If (d≤dtol AND k