Skip to content

abdullahdangac/Differential-Drive-Robot-Simulations

Repository files navigation

Differential Drive Robot

A differential wheeled robot is a mobile robot whose movement is based on two separately driven wheels placed on either side of the robot body. It can thus change its direction by varying the relative rate of rotation of its wheels and hence does not require an additional steering motion.

Differential Drive Robot

Many mobile robots use a drive mechanism known as differential drive. It consists of 2 drive wheels mounted on a common axis, and each wheel can independently being driven either forward or backward.


Differential Drive Behavior

Robot by ICC

$v_r : linear$  $velocity$  $of$  $right$  $wheel$
$v_l : linear$  $velocity$  $of$  $left$  $wheel$
$v : linear$  $velocity$  $of$  $robot$;
$w : angular$  $velocity$  $of$  $robot$
$r : radius$  $of$  $curvature$;
$l : width$  $of$  $robot$;

By varying the velocities of the two wheels, we can vary the trajectories that the robot takes. Because the rate of rotation $w$ about the ICC must be the same for both wheels, we can write the following equations:

$$v_l = w(r - \frac{l}{2})$$

$$v_r = w(r + \frac{l}{2})$$

$$v = \frac{(v_r + v_l)}{2}$$

$$w = \frac{(v_r - v_l)}{l}$$

$$r = \frac{l}{2}\frac{(v_r + v_l)}{(v_r - v_l)}$$


ICC (Instantaneous Center of Curvature)

If the robot is moving in a curve, there is a center of that curve at that moment, known as the Instantaneous Center of Curvature (or ICC).

ICC Pose Update


ICC point formula:

ICC Point

$$x' = x - r\sin⁡\theta$$

$$y' = y + r\cos\theta$$



Rotation Matrix

In linear algebra, a rotation matrix is a transformation matrix that is used to perform a rotation in Euclidean space.

Rotation

new position of the robot rotated at an angle theta around the origin:

$$ \begin{bmatrix} x' \\ y' \end{bmatrix} = \begin{bmatrix} \cos\theta & -\sin⁡\theta \\ \sin⁡\theta & \cos\theta \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} $$


rotation matrix with ICC:

$$ \begin{bmatrix} x' \\ y' \\ \theta' \end{bmatrix} = \begin{bmatrix} \cos w\delta t & -\sin⁡ w\delta t & 0\\ \sin⁡ w\delta t & \cos w\delta t & 0\\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x - ICC_x \\ y - ICC_y \\ 0 \end{bmatrix} + \begin{bmatrix} ICC_x \\ ICC_y \\ 0 \end{bmatrix} $$


from here, pose update equations:

$$x' = \cos ⁡w\delta t (x - ICC_x) - \sin ⁡w\delta t (y - ICC_y) + ICC_x$$

$$y' = \sin⁡ w\delta t (x - ICC_x) + \cos⁡ w\delta t (y - ICC_y) + ICC_y$$

$$\theta' = \theta + w\delta t$$



Unicycle Model Robot

Unicycle robot, an idealised one-wheeled robot moving in a two-dimensional world, used as an example in control theory problems.

Unicycle Model


states:

$$ x = \begin{bmatrix} x \\ y \\ \phi \end{bmatrix} $$


axis velocities of unicycle robot:

$$\dot x = v\cos⁡\phi$$

$$\dot y = v\sin⁡\phi$$

$$\dot\phi = w$$


linear velocity $(v)$ and angular veloctiy $(w)$ for differential drive:

$$v = \frac{(v_r + v_l)}{2}$$

$$w = \frac{(v_r - v_l)}{l}$$


in that case, pose update equations for differential drive:

$$\dot x = \frac{1}{2} (v_r + v_l) \cos⁡\phi$$

$$\dot y = \frac{1}{2} (v_r + v_l) \sin⁡\phi$$

$$\dot\phi = \frac{1}{l} (v_r - v_l)$$



Euler's Method

The Euler method is a first-order method, which means that the local error (error per step) is proportional to the square of the step size, and the global error (error at a given time) is proportional to the step size.


$$\frac{dx}{dt} = f(x,t)$$

discretization:

$$\frac{\Delta x}{\Delta t} = f(x,t)$$

$\Delta x = x_{n+1} - x_n$

$\Delta t = t_{n+1} - t_n$$(uniorm$  $step$  $size)$

$$\frac{x_{n+1} - x_n}{\Delta t} = f(x_n,t_n)$$

update equation:

$$x_{n+1} = x_n + \Delta t f(x_n, t_n)$$



from here, discrete-time pose update equations for differential drive:

$$x' = x + \frac{1}{2} (v_r + v_l) \Delta t \cos⁡\phi$$

$$y' = y + \frac{1}{2} (v_r + v_l) \Delta t \sin⁡\phi$$

$$\phi' = \phi + \frac{1}{l} (v_r + v_l) \Delta t$$

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages