Motion Control and Velocity-Based Dynamic Compensation for Mobile Robots

The design of motion controllers for wheeled mobile robots is often based only on the robot’s kinematics. However, to reduce tracking error it is important to also consider the robot dynamics, especially when high-speed movements and/or heavy load transportation are required. Commercial mobile robots usually have internal controllers that accept velocity commands, but the control signals generated by most dynamic controllers in the literature are torques or voltages. In this chapter, we present a velocity-based dynamic model for differential-drive mobile robots that also includes the dynamics of the robot actuators. Such model can be used to design controllers that generate velocity commands, while compensating for the robot dynamics. We present an explanation on how to obtain the parameters of the dynamic model and show that motion controllers designed for the robot’s kinematics can be easily integrated with the velocity-based dynamic compensation controller. We conclude the chapter with experimental results of a trajectory tracking controller that show a reduction of up to 50% in tracking error index IAE due to the application of the dynamic compensation controller.


Introduction
A common configuration for mobile robots is the differential drive, which has two independently driven parallel wheels and one (or more) unpowered wheel to balance the structure [1]. For several years differential-drive mobile robots (DDMR) have been widely used in many applications because of their simple configuration and good mobility. Some applications of The above-mentioned works applied a dynamic model that has linear and angular velocities as inputs, which illustrates the interest on such kind of dynamic model. In such context, this chapter explains the velocity-based dynamic model and its mathematical properties, which are useful for the design of controllers that compensate for the robot dynamics. It also illustrates how to design a trajectory tracking motion controller based on the robot's kinematics, and how to integrate it with a velocity-based dynamic compensation controller.

Dynamic model
The classical equation to represent the dynamics of mobile robots can be obtained via Lagrangian formulation, resulting in [22].
where q ¼ q 1 q 2 … q n Â Ã T is the vector of generalized coordinates of the system with n degrees of freedom, M q ð Þ∈ R nÂn is the matrix of inertia, V m q; _ q ð Þ∈ R nÂn is the matrix of Coriolis and centrifugal forces, F m _ q ð Þ∈ R nÂ1 is the vector that represents viscous friction, G m q ð Þ ∈ R nÂ1 is the vector of gravitational torques, τ d ∈ R nÂ1 is the disturbance vector, τ ∈ R rÂ1 is the vector of input torques, where r is the number of inputs, B q ð Þ∈ R nÂr is the input transformation matrix, λ ∈ R mÂ1 is the vector that represents restriction forces, and A q ð Þ∈ R mÂn is the matrix associated to such restrictions. Two well known properties of such model are [9,22]: 1. M q ð Þ is a symmetric and positive definite matrix, that is, M q ð Þ ¼ M q ð Þ T > 0;
The above properties are widely used on the development and stability analysis of controllers for mobile robots, as shown in [8,9,22,23]. But, such controllers generate torque commands, not velocities, as usually accepted by commercial robots. The conversion from torque to velocity commands requires knowledge of the actuation system of the robot (model of its motors and its speed controllers). On the other hand, a controller designed from a velocitybased dynamic model generates linear and angular velocities that can be directly applied as commands for mobile robots.
In such a context, now the dynamic model for the DDMR proposed in [16] is reviewed. For convenience, we first present its equations again. Then, the dynamic model is written in such a way that it becomes similar to the classical dynamic equation based on torques. Figure 1 depicts a DDMR with the variables of interest. There, u and ω are, respectively, the linear and angular velocities, G is the center of mass, h is the point of interest (whose position should be controlled) Figure 1. The differential drive mobile robot (DDMR). u and ω are, respectively, the linear and angular velocities, G is the center of mass, h is the point of interest with coordinates x and y in the XY plane, ψ is the robot orientation, a is the distance from the point of interest to the point in the middle of the virtual axle that links the traction wheels (point B), b is the distance between points G and B, and d is the distance between the points of contact of the traction wheels to the floor.
with coordinates x and y in the XY plane, ψ is the robot orientation, a is the distance from the point of interest to the point in the middle of the virtual axle that links the traction wheels (point B), b is the distance between points G and B, and d is the distance between the points of contact of the traction wheels to the floor. The complete mathematical model is written as [16].
As shown in [21], by rearranging its terms the Eq. (4) can be written as or, in a compact form, as where v r ¼ u r ω r ½ T is the vector of reference velocities, v ¼ u ω ½ T is the vector containing the actual robot velocities, and the matrices H 0 and c v ð Þ, and the vector Δ are given by Let us rewrite c v ð Þ by adding and subtracting the term iθ 3 u to its fourth element (where so that the term c v ð Þv can be written as The role of the term i ¼ 1rad 2 =s is to make the units consistent to allow us to split c v ð Þ into two matrices, while keeping the numerical values unchanged. Now, let us define v 0 ¼ iu ω ½ T as the vector of modified velocities, so that The terms in the vector of modified velocities are numerically equal to the terms in the vector of actual velocities v, only its dimensions are different. By rewriting the model equation, the following matrices are defined: Finally, the dynamic model of a DDMR can be represented by or , that is, the dimensions of the resulting vector v r are kept unchanged. The model represented by Eq. (13) is mathematically equivalent to the one proposed in [16] and used in [7], where it was validated via simulation and experiments. Nevertheless, the model presented here is written in such a way that some mathematical properties arise. Such properties, which are presented and discussed in the next session, can be applied on the design and stability analysis of dynamic controllers.

Dynamic parameters and model properties
To calculate the dynamic parameters of the vector θ, one has to know physical parameters of the robot, like its mass, its moment of inertia, friction coefficient of its motors, etc. The equations describing each one of the parameters θ i are where m is the mass of the robot, I z is its moment of inertia at G, R a , k b and k a are the electrical resistance, the electromotive constant, and the constant of torque of its motors, respectively, B e is the coefficient of friction, I e is the moment of inertia of each group rotor-reduction gearwheel, r is the radius of each wheel, and b and d are distances defined in Figure 1. It is assumed that the internal motor controllers are of type PD (proportional-derivative) with proportional gains k PT > 0 and k PR > 0, and derivative gains k DT ≥ 0 and k DR ≥ 0. It is also assumed that the inductances of the motors are negligible, and both driving motors are identical.
Obtaining accurate values of all physical parameters of a robot might be difficult, or even not possible. Therefore, it is useful to discuss an identification procedure to directly obtain the values of the dynamic parameters θ. Such procedure is explained in Section 3.2.
It is interesting to point out that the dynamic model adopted here considers that the robot's center of mass G can be located anywhere along the line that crosses the center of the structure, as illustrated in Figure 1. This means that the formulation of the proposed dynamic model is adequate for robots that have a symmetrical weight distribution between their left and right sides. Because most differential drive robots have an approximately symmetrical weight distribution (with each motor and wheel on either left or right sides), such assumption does not introduce significant modeling errors on most cases. It should also be noticed that θ i > 0 for i ¼ 1; 2; 4; 6. The parameters θ 3 and θ 5 can be negative and will be null if, and only if, the center of mass G is exactly in the center of the virtual axle, that is, b ¼ 0. Finally, in [21], it was shown that the model parameters θ 1 to θ 6 cannot be written as a linear combination of each other, that is, they are independent.

Model properties
The mathematical properties of the dynamic model (12) are: The matrix H is symmetric and positive definite, or H ¼ H T > 0; 2. The inverse of H exists and is also positive definite, or ∃ H À1 > 0; The matrix H is constant if there is no change on the physical parameters of the robot; and there is no change on the physical parameters of the robot; To analyze the above mathematical properties, first recall that θ i > 0 for i ¼ 1; 2; 4; 6. Properties 1 and 2 can be confirmed by observing that H is a diagonal square matrix formed by θ 1 and θ 2 .
F v 0 ð Þ is also a diagonal square matrix formed by θ 4 and θ 6 þ θ 5 =i À θ 3 ð Þ iu. Property 3 holds if θ 6 > À θ 5 =i À θ 3 ð Þ iu. Property 4 holds if there is no change on the physical parameters of the robot (i.e., if there is no change on the robot's mass, moment of inertia, etc.). C v 0 ð Þ is a square matrix formed by θ 3 ω and Àθ 3 ω, whose transpose is also its negative, which proves property 5. Property 6 holds if there is no change on the physical parameters of the robot and θ 6 ≫ | θ 5 =i À θ 3 ð Þ iu|. Finally, the proof for property 7 is given in [21].

Identified parameters
The values of the dynamic parameters θ can be estimated via an identification procedure, described as follows. Let a system be represented by the regression model where θ is the vector of parameters and Y is the system output. The least squares estimate of θ is given by where b θ is the vector with the estimated values of θ and W is the regression matrix. By rearranging (4) and ignoring uncertainty, the dynamic model can be represented by where In order to obtain an estimate for the values of θ, each robot needs to be excited with speed reference signals u r ; ω r ð Þ, while the actual values of its velocities u; ω ð Þand accelerations _ u; _ ω ð Þ are measured and stored. In our case, the excitation signals consisted of a sum of six sine waves with different frequencies and amplitudes. All data were stored and the regression model was assembled so that the vector Y and the matrix W had all values obtained in each sampling instant. Subsequently, the value of θ for each robot was calculated by least squares method.
In order to verify the assumptions that θ 6 ≫ | θ 5 =i À θ 3 ð Þ iu| and θ 6 > À θ 5 =i À θ 3 ð Þ iu, we have analyzed the dynamic parameters of five differential drive robots obtained via identification procedure. The analysis was done considering the parameters of the following robots: a Pioneer 3-DX with no extra equipment (P3), a Pioneer 3-DX with a LASER scanner and omnidirectional camera (P3 laser ), a robotic wheelchair while carrying a 55 kg person (RW 55 ), a robotic wheelchair while carrying a 125kg person (RW 125 ), and a Khepera III (KIII). The Khepera III robot weighs 690 g, has a diameter of 13 cm and is 7 cm high. Its dynamic parameters were identified by Laut and were originally presented in [24]. By its turn, the Pioneer robots weigh about 9 kg, are 44 cm long, 38 cm wide, and 22 cm tall (without the LASER scanner). The LASER scanner weighs about 50% of the original robot weight, which produces an important change in the mass and moment of inertia of the structure. Finally, the robotic wheelchair presents an even greater difference in dynamics because of its own weight (about 70 kg) and the weight of the person that it is carrying. The dynamic parameters for the above-mentioned robots are presented in Table 1.
The value of u is limited to 0:5 m=s for the Khepera III robots, to 1:2 m=s for the Pioneer robots, and to 1:5 m=s for the robotic wheelchair. Therefore, using the values presented in Table 1  can verify that the conditions of θ 6 > À θ 5 =i À θ 3 ð Þ iu and θ 6 ≫ | θ 5 =i À θ 3 ð Þ iu| are valid for all sets of identified parameters. Therefore, the dynamic model of the above-mentioned robots can be represented as in (12), with properties 1-7 valid under the considered conditions.

Controller design
To illustrate the usefulness of the modified model and its properties, in this section we show the design of a trajectory tracking controller and a dynamic compensation controller. The controller design is split in two parts, as in [7]. The first part is based on the inverse kinematics and the second one compensates for the robot dynamics. The use of the dynamic model properties is shown on the second part.
The control structure is shown in Figure 2, where blocks K, D, and R represent the kinematic controller, the dynamic compensation controller, and the robot, respectively.

Kinematic controller
The same kinematic controller presented in [7,21] is shown here. It is a trajectory tracking controller based on the inverse kinematics of the robot. If only the position of the point of interest h ¼ x y ½ T is considered, the robot's inverse kinematics can be written as  The inverse kinematics described by Eq. (19) is valid only for a 6 ¼ 0. This is the reason why we prefer to adopt this model instead of the classical unicycle model, as discussed earlier. Considering (19), the adopted control law is T is the vector of desired velocities given by the kinematic controller; It is important to point out that the orientation of a DDMR is always tangent to the path being followed. Moreover, the desired trajectory defines the desired linear speed u d , which means that the robot will be moving either forward or backwards. Therefore, it is not necessary for the controller to explicitly control the robot's orientation to make it successfully follow a trajectory with a desired orientation.
For the stability analysis of the kinematic controller, it is supposed a perfect velocity tracking, which allows equating (19) and (20) under the assumption of u u d and ω ω d , which means that the dynamic effects are, at this moment, ignored. Then, the closed-loop equation is obtained in terms of the velocity errors, which is Now, the output error vectorh (21) can be written as which has an unique equilibrium point at the origin. To conclude the stability analysis of such Th > 0 is considered as the Lyapunov's candidate function. Its first time derivative is Regarding these results, one can immediately conclude that the system characterized so far has a globally asymptotically stable equilibrium at the origin, which means that the position errors x t ð Þ ! 0 andỹ t ð Þ ! 0 as t ! ∞. This result will be revisited latter, after adding a dynamic controller to the system in order to implement the whole control scheme.
Remark. Considering the case in which the reference is a fixed destination point, instead of a trajectory, the robot reaches such a point and stops there. Assuming u u d and ω ω d , Eq. (20)

Dynamic compensation controller
Now, the use of the proposed dynamic model and its properties is illustrated via the design of a dynamic compensation controller. It receives the desired velocities v d from the kinematic controller and generates a pair of linear and angular velocity references v r for the robot servos, as shown in Figure 2. First, let us define the vector of modified velocities v 0 d as and the vector of velocity errors is given byṽ 0 ¼v 0 d À v 0 .
Regarding parametric uncertainties, the proposed dynamic compensation control law is , k u > 0 and k ω > 0 are gain constants, l u ∈ R and l ω ∈ R are saturation constants, andω ¼ ω d À ω andũ ¼ u d À u are the current velocity errors. The term Tṽ 0 ð Þ provides a saturation in order to guarantee that the commands to be sent to the robot are always below the corresponding physical limits, considering that v 0 d and _ v 0 d are bounded to appropriate values.
In this chapter, we consider that the dynamic parameters are exactly known, that is, b θ ¼ θ.

This means that
The analysis considering parametric error is presented in [7,21].
Using the Lyapunov candidate function V ¼ 1 2ṽ 0 T Hṽ 0 > 0, and considering that the dynamic parameters are constant, one has _ V ¼ Àṽ 0 T HTṽ 0 ð Þ Àṽ 0 T Cṽ 0 Àṽ 0 T Fṽ 0 : Observing property 5, of antisymmetry of C, the derivative of the Lyapunov function can be written as _ V ¼ Àṽ 0 T HTṽ 0 ð Þ Àṽ 0 T Fṽ 0 : According to Property 1, H is symmetric and positive definite. The terms of Tṽ 0 ð Þ have the same sign of the terms ofṽ 0 . Property 3 states that F is symmetric and positive definite if θ 6 > À θ 5 =I À θ 3 ð Þ Iu, condition that was shown to hold for our robot. Therefore, one can Regarding the kinematic controller, it has been shown [7] that a sufficient condition for the asymptotic stability is where A ¼ cos ψ Àa sin ψ sin ψ a cos ψ ! : Becauseṽ t ð Þ ! 0, the condition (28) is asymptotically verified for any value ofh. Consequently, the tracking control errorh t ð Þ ! 0, thus accomplishing the control objective.
To sum up, by using a control structure as shown in Figure 2 with a dynamic compensation controller given by Eq. (25), different motion controllers can be applied. In our example, the trajectory tracking controller given by Eq. (20) was used. This is the system that we have implemented and for which we present some experimental results in Section 5.

Experimental results
In this section, we present some experimental results using a Pioneer 3-DX, from Adept Mobile Robots. In all experiments, the robot starts at position 0:0; 0:0 ð Þ m with orientation 0 , and should follow an 8-shape trajectory also starting at 0:0; 0:0 ð Þ m. The trajectory to be followed by the robot is represented by a sequence of desired positions h d and velocities _ h d , both varying in time. The reference path is illustrated in Figure 3.
We have implemented the control structure shown on Figure 2 using the control laws given by Eqs. (20) and (25). In total, we have executed 10 experiments for each controller, from now on referred to as KC (kinematics controller) and DC (dynamic compensation). In the case of KC, the robot receives as commands the values v d calculated by the kinematics controller and there is no dynamic compensation. On the other hand, in the case of DC, the dynamic compensation controller is active and the robot receives as commands the values of v r calculated by the dynamic compensation controller. We have repeated the experiments for four cases: KC with load, KC without load, DC with load, and DC without load. The load consists of a weight of 24:8 kg placed on top of the robot, while the original weight of the robot is 10:4 kg.
The following parameters were used in all experiments: a ¼ 0:15 m, sample time of 0.1 s (this is the sample time of the Pioneer 3-DX); controller gains k x ¼ 0:1, k y ¼ 0:1, k u ¼ 4, k w ¼ 4, and saturation constants l x ¼ 0:1, l y ¼ 0:1, l u ¼ 1, l w ¼ 1. The robot used in the experiments is a Pioneer 3-DX without LASER scanner, therefore the parameters used in the dynamic compensation controller are the ones in column P3 from Table 1. Figure 4 illustrates the results of 2 experiments, both without load. Figure 4(a) shows the 8shape path followed by the robot without load when controlled by KC and DC. Robot path was recovered through its odometry. One can notice that the path followed by the robot is slightly different under KC or DC. The robot's linear and angular velocities also change along the path, as shown in Figure 4(b).
A better visualization of the tracking error is given by Figure 5, which shows the evolution of the distance error during the experiments without load. The distance error is defined as the  instantaneous distance between the desired position h d and the actual robot position h. It can be noticed that the distance error is similar for KC and DC in the first part of the path. At the beginning of the experiment, the tracking error increases quite a lot, reaching almost 1:0 m. This happens because the robot needs to accelerate from zero to catch up with the reference trajectory. After a few seconds, the error starts to decrease and around 25 À 30 s, the robot follows the trajectory at normal speed. From this point on, it is clear that the average error is smaller when the DC is active. Figure 6(a) shows the 8-shape path followed by the robot when carrying the load and controlled by KC and DC. One can notice that the path followed by the robot is slightly different under KC or DC, and there is more distortion in the path when compared to the case in which the robot carries no load. The robot's linear and angular velocities also change along the path, as shown in Figure 6(b), and are very similar to the previous case.
The tracking error is given by Figure 7, which shows the evolution of the distance error during the experiments with load. As before, the robot needs to accelerate from zero to catch up with the reference trajectory, which causes the tracking error to increase in the first part of the experiments. But, in this case, the error in the first part of the experiment is actually higher for DC. This happens because the dynamic parameters used in the dynamic compensation controller remained unchanged during all experiments, with and without load. This means that the case in which the robot is carrying load is unfavorable for the dynamic compensation controller because the dynamics is not properly compensated, causing the error to increase. Even so, after about 30 s, the tracking error of DC gets smaller than the error for KC. To evaluate the performance of the system we have calculated the IAE performance index, is the instantaneous distance error and t 2 À t 1 is the period of integration. The average and standard deviation values of IAE for all experiments are reported in Table 2. There, IAE tot was calculated considering t 2 ¼ 75 s and t 1 ¼ 0, that is, for the total period of each experiment. By its turn, the value of IAE 30 was calculated only for the   final 30 seconds of each experiment, that is, considering t 2 ¼ 75s and t 1 ¼ 35s. Therefore, IAE 30 gives a good indication of the performance of the system after the error due to initial acceleration have faded out. From the results highlighted in bold in Table 2, it is clear that the performance of the system with the dynamic compensation controller is better in the long run because the correspondent values of IAE 30 are about 50% of those for the kinematic controller. This is true even for the case in which the robot is carrying load.
It is important to emphasize that the dynamic parameters used in the dynamic compensation controller remained unchanged during all experiments, which means that the dynamics is not properly compensated when carrying load. This is illustrated by the fact that IAE tot is bigger when the dynamic compensation is active and the robot is carrying load. Even so, in our experiments the performance was better in the long run when the dynamic compensation controller remained active.
One should notice that an increase in controller gains k x and k y could result in better performance (smaller tracking error), especially when the robot is carrying load. Nevertheless, we kept the same values of controller gains during all experiments to be able to compare the results.

Conclusion
In this chapter, we illustrate that the performance (in term of IAE) of a motion control system for a mobile robot can be up to 50% better under certain conditions when dynamic compensation is included. Such dynamic compensation can be implemented as shown in Figure 2, in which Eq. (25) is used with parameters identified via the procedure described in Section 3.2.
It is worth mentioning that the values of controller gains used in the experiments here reported were not optimum. The values of the gains were chosen empirically so that we could compare different cases. Optimization of controller gains can be executed to reduce tracking error, energy consumption, or a weighted combination of both, as shown in [25]. This means that the performance of the overall system could potentially be better than reported here.
We also presented a formulation of a dynamic model for differential-drive mobile robots, and discussed its mathematical properties. When compared to the classical dynamic model based on torques, the model used in this chapter has the advantages of accepting velocities as inputs, is the instantaneous distance error, and t 2 À t 1 is the period of integration. For IAE tot , t 2 ¼ 75 s and t 1 ¼ 0. For IAE 30 , t 2 ¼ 75 s and t 1 ¼ 35 s. Table 2. Average and standard deviation of IAE performance index calculated for experiments with and without load (lower value is better, highlighted in bold). and modeling the dynamics or the robot's actuators. We have shown that such model and its properties are useful on the design and stability analysis of a dynamic compensation controller for a differential-drive mobile robot. Moreover, because the mathematical structure of (12) is similar to the classical torque-based model, classical strategies for controller design [8,26] can be adapted for designing controllers for mobile robots using the model presented in this chapter.
The dynamic model presented in this chapter can be used in connection with other kinematic controllers designed for commercial mobile robots, even in the context of coordinated control of multi-robot formations [27]. This integration requires no change on the original controller equations since the dynamic model accepts the same velocity commands as commercial robots. We invite the interested reader to download our toolbox for MATLAB/Simulink ® , which include blocks to simulate the differential-drive kinematics and dynamics, a kinematic controller and two dynamic compensation controllers, one of which being the one presented in this chapter [28].