# What is a suitable model for two-wheeled robots?

What is a suitable model for two-wheeled robots? That is, what equations of motion describe the dynamics of a two-wheeled robot.

Model of varying fidelity are welcome. This includes non-linear models, as well as linearized models.

• This question seems very broad. It would help if you link "equations of motion" to a wikipedia article (for example) that describes what it is. Also, you should specify the robot more specifically. For example, are there passive wheels? What are the types of the two wheels? etc. – Shahbaz Oct 25 '12 at 16:30
• Bicycle style or segway style? You should be more specific. – Paul Jun 17 '16 at 16:12

## 3 Answers

There isn't a lot of information here. Let's fix the wheels as separated by distance $b$, and each wheel has orientation $\theta_i$ with respect to the line joining them. Then assume each wheel can be independently driven with an angular velocity $v_i$.

If the wheels are independently driven, but fixed in direction, $\theta_1=\theta_2=90^\circ$, you have something like a differential drive (tank treads). It's worth noting that, assuming the wheels do not slip perpandicular to their orientation, you can solve for the motion of the robot base in closed form given velocity commands which are fixed over a small time duration (as is usually the case with robots under software control). The iCreate is such a platform, as are the smaller pioneers, and the Husky by Clearpath. Then the change in orientation of the base, labelled $\theta$ below, can be found in closed form. The usual model for these things, where $v_b$ is the base velocity and $\omega_b$ is the angular velocity of the base, is:

$$v_b = \frac{1}{2}\cdot(v_1+v_2)$$ $$\omega_b=\frac{1}{b}(v_2-v_1)$$

For a fixed time increment, $\delta t$, you can find the change in orientation, and linear distance traveled using these. Note that the robot travels along a circle in this time window. The distance along the circle is exactly $\delta t\cdot v_b$, and the radius of the circle is $R=\frac{b}{2}\cdot\frac{v_1+v_2}{v_2-v_1}$. That's enough to plug into these equations: circular segments -- particularly the chord length equation, which describes the distance the robot displaces from its original location. We know $R$ and $\theta$, solve for $a$.

So assuming the robot starts with orientation $0$, and position $(0,0)$, and moves along time window $\delta t$ with velocities $v_1$ (left wheel) and $v_2$ (right wheel), it's orientation will be: $$\theta_1=\frac{\delta t}{b}(v_2-v_1)$$ with position: $$p_x=\cos\left(\frac{\theta_1}{2}\right)\cdot\left(2 R \sin\left(\frac{\theta_1}{2}\right)\right)$$ $$p_y=\sin\left(\frac{\theta_1}{2}\right)\cdot\left(2 R \sin\left(\frac{\theta_1}{2}\right)\right)$$

Note that as $v_1\to v_2=v$ the limit is $$p_x=\delta t \cdot v$$ $$p_y=0$$

as expected.

Update why?.

Rearrange $p_x$ so that:

$$p_x = cos \left( \frac{v_2-v_1}{2b} \right) * 2 * \left( b\frac{v_1+v_2}{2(v_2-v1)} \right) * sin\left( \frac{v_2-v_1}{2b} \right)$$

$$p_x = cos \left( \frac{v_2-v_1}{2b} \right) * \frac{(v_2+v_1)}{2}* \frac{sin\left( \frac{v_2-v_1}{2b} \right)} {\frac{v_2-v_1}{2b}}$$

Now note that we have three limits as $v_2 \rightarrow v_1$.

$$cos \left( \frac{v_2-v_1}{2b} \right)\rightarrow 1$$

$$\frac{(v_2+v_1)}{2} \rightarrow v_1 == v_2$$

$$\frac{sin\left( \frac{v_2-v_1}{2b}\right)}{\frac{v_2-v_1}{2b}} \rightarrow 1 \text{ (see sinc function)}$$

This is covered all over the internet, but you might start here: http://rossum.sourceforge.net/papers/DiffSteer/ or here: https://web.cecs.pdx.edu/~mperkows/CLASS_479/S2006/kinematics-mobot.pdf

If the wheels are not fixed in direction, as in you can vary the speed and orientation, it gets more complicated. In that sense, a robot can become essentially holonomic (it can move in arbitrary directions and orientations on the plane). However, I bet for fixed orientation, you end up with the same model.

There are other models for two wheels, such as a bicycle model, which is easy to imagine as setting the velocities, and only varying one orientation.

That's the best I can do for now.

• Maybe I am a bit late but can not see why Px=dt*v if v1 = v2. We have sin(theta/2) as a part of multiplication therefore, when v1=v2 -> theta = 0, we get sin(0/2)=0 and as a consequence Px = 0. What I am missing? – Long Smith Mar 16 '17 at 13:18
• In practice, just use the equations if $\theta \neq 0$. To answer your question, I've updated the answer. – Josh Vander Hook Apr 30 '17 at 19:12

If you really want to dive into the mathematics of it, here's the seminal paper that unified and categorized most models for wheeled robots.

• I'm sorry, link-only answers are discouraged on StackExchange. Could you perhaps condense the content of that link into a few paragraphs and keep it here (along with the actual link, of course). This helps prevent link rot. – Manishearth Nov 25 '12 at 13:09
• Sure thing, I'll do that as soon as I have enough time for it this week. Sorry about that, I wasn't aware about this policy and thought the link would be useful as is. – georgebrindeiro Nov 26 '12 at 3:16
• Excellent paper - thanks for the link! Quite a long weekend as well :-) – uhoh Sep 21 '17 at 3:45

The answer to this is simple, but the other answers obfuscate the dynamics.

Differential drive robots can be modeled with unicycle dynamics of the form: $$\left[\begin{matrix}\dot{x}\\ \dot{y} \\ \dot{\theta} \end{matrix}\right] = \left[\begin{matrix}cos(\theta)&0\\sin(\theta)&0\\0&1\end{matrix}\right] \left[\begin{matrix}v\\\omega\end{matrix}\right],$$ where $x$ and $y$ are Cartesian coordinates of the robot, and $\theta \in (-\pi,\pi]$ is the angle between the heading and the $x$-axis. The input vector $\left[v, \omega \right]^T$ consists of linear and angular velocity inputs.

• -1 This is merely a transformation between different coordinates. It doesn't model the dynamics of the robot at all as requested in the question. The "obfuscation" of the other answers is because they take into account that there are two wheels to control and not some abstract input vector. Such a vector could be the result of a model as requested in the question. – Bending Unit 22 Jun 17 '16 at 17:44
• The model that I have presented addresses the prompt, adds to the discussion, and is, in fact, a model of the dynamics of a non-holonomic differential drive robot (though not necessarily two-wheeled, which is a strength). While the input velocity vector (aka twist) may be an abstraction, using the twist input is standard for many two-wheeled platforms. This does, however, highlight the fact that state space representations are arbitrary. Controlling wheel velocities is an abstraction from controlling wheel torques, which is itself an abstraction from controlling motor currents. – JSycamore Jun 20 '16 at 13:42