# Ackermann Steering Angle

Given the position of the vehicle ($$x,y$$) at different time points, the speed of the vehicle (m/s), the direction the vehicle is facing (heading — in degrees), the track width of the vehicle, and the wheelbase of the vehicle, how can I calculate the steering angle of the vehicle?

I tried following the approximation detailed in Ackerman Steering relating to vehicle heading but got very weird inner and outer steering angles.

If anyone can give me a few hints, I would greatly appreciate it!

• If you show your working as to why your results are weird then we might be able to help. – user207455 Jul 20 '19 at 9:16
• Oh, sorry! Well take my heading vector <259.9359375, 260.6359375, 261.0359375> and calculate the steering angle using a 5 meter wheelbase and a 3 meter track width, we get <81.84434488 81.66116341 81.43259016>. However, when I calculate the inner and outer steering angles, I get <-81.09485919 -81.27749805 -81.50588565> and <66.09170338 65.93558165 65.7411003 > respectively. Note, the speed vector is <3.25085069 3.33385069 3.43185069>. Does this help or do you want more context? – DarkDrassher34 Jul 20 '19 at 13:00

Here is a derivation. Let us denote by $$l$$ the segment of length $$l$$ representing the wheel base, and by $$w$$ the segment of length $$w$$ representing the track of the rear wheels, perpendicular to $$l$$. Their intersection is the point $$P$$.

Choose a world Cartesian coordinate system $$O\, \vec{e}_1 \, \vec{e}_2$$ and another coordinate system $$P \, \vec{E}_1 \, \vec{E}_2$$ attached to the vehicle, cantered at the point $$P$$ and with two vectors $$\vec{E}_1$$ and $$\vec{E}_2$$ of length one, such that vector $$\vec{E}_1$$ is aligned with the wheel base $$l$$ and vector $$\vec{E}_2$$ is aligned with the track $$w$$. Observe that $$\vec{E}_1$$ is perpendicular to $$\vec{E}_2$$.

Consider the vector $$\vec{p} = \vec{OP}$$, which is the position vector of point $$P$$ with respect to the world system $$O\, \vec{e}_1 \, \vec{e}_2$$. Decompose $$\vec{OP} = \vec{p} = x\, \vec{e}_1 + y\, \vec{e}_2$$

Let $$\theta$$ be the angle between the vectors $$\vec{e}_1$$ and $$\vec{E}_1$$, i.e. $$\theta$$ is the angle between the horizontal axis $$O\, \vec{e}$$ and the line $$P\, \vec{E}_1$$. Then, since $$\vec{E}_1$$ is of length one, we can decompose it in the world system as $$\vec{E}_1 = \cos(\theta)\, \vec{e}_1 + \sin(\theta)\, \vec{e}_2$$ Since $$\vec{E}_2$$ is perpendicular to $$\vec{E}_1$$ $$\vec{E}_2 = - \,\sin(\theta)\, \vec{e}_1 + \cos(\theta)\, \vec{e}_2$$ The position and orientation of the vehicle, which change with time $$t$$, are uniquely determined by the functions \begin{align} &x = x(t)\\ &y = y(t)\\ &\theta = \theta(t) \end{align}

The velocity of the point $$P$$ relative to $$O\, \vec{e}_1\,\vec{e}_2$$ is $$\frac{d \vec{p}}{dt} = \frac{dx}{dt}\, \vec{e}_1 + \frac{dy}{dt}\, \vec{e}_2$$ If we denote the magnitude of this velocity (the magnitude is called speed) by $$s = s(t) = \sqrt{ \left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2}$$, the restriction that the rear wheels do not slip implies that the orthogonal projection of the velocity $$\frac{d \vec{p}}{dt}$$ along the the segment $$w$$ (which coincides with the line $$P \, \vec{E}_2$$) is zero. Therefore $$\frac{d \vec{p}}{dt}$$ is always aligned with the vector $$\vec{E}_1$$ and therefore $$\frac{d \vec{p}}{dt} = s\, \vec{E}_1$$ or in more detail $$\frac{d \vec{p}}{dt} = \frac{dx}{dt}\, \vec{e}_1 + \frac{dy}{dt}\, \vec{e}_2 = s\, \cos(\theta)\, \vec{e}_1 + s\, \sin(\theta)\, \vec{e}_2$$ which component-wise yields \begin{align} &\frac{dx}{dt} = s\, \cos(\theta)\\ &\frac{dy}{dt} = s\, \sin(\theta) \end{align} Our next step is to look at the steering. Denote the other end of the segment $$l$$, representing the wheel base, by $$Q$$ (that is the end of segment $$l$$, opposite to point $$P$$). As with $$P$$, let $$\vec{q} = \vec{OQ}$$ be the position vector of point $$Q$$ in the world coordinates. By vector addition $$\vec{OQ} = \vec{OP} + \vec{PQ}$$ i.e. $$\vec{q} = \vec{p} + l\, \vec{E}_1$$ The velocity of $$\vec{q}$$ is $$\vec{v} = \frac{d\vec{q}}{dt} = \frac{d\vec{p}}{dt} + l\, \frac{d\vec{E}_1}{dt}$$ If $$v = |\vec{v}|$$ is the magnitude (i.e. speed) of $$Q$$ in the world system, on one hand we can decompose $$\vec{v} = v \, \cos(\phi)\, \vec{E}_1 + v \, \cos(\phi)\, \vec{E}_2$$ On the other hand, $$\frac{d\vec{p}}{dt} = s \, \vec{E}_1$$ and \begin{align} \frac{d\vec{E}_1}{dt} &= \frac{d}{dt}\Big(\cos(\theta)\, \vec{e}_1 + \sin(\theta)\, \vec{e}_2\Big) = -\,\sin(\theta)\,\frac{d\theta}{dt}\, \vec{e}_1 + \cos(\theta) \,\frac{d\theta}{dt}\,\vec{e}_2\\ &= \frac{d\theta}{dt}\,\Big(-\,\sin(\theta)\, \vec{e}_1 + \cos(\theta)\,\vec{e}_2\Big)\\ &= \frac{d\theta}{dt}\, \vec{E}_2\end{align} which yields $$v \, \cos(\phi)\, \vec{E}_1 + v \, \sin(\phi)\, \vec{E}_2 = \,\,\vec{v}\,\, = \frac{d\vec{p}}{dt} + l\, \frac{d\vec{E}_1}{dt} = s \, \vec{E}_1 + l\,\frac{d\theta}{dt}\, \vec{E}_2$$ i.e. $$v \, \cos(\phi)\, \vec{E}_1 + v \, \sin(\phi)\, \vec{E}_2 = s \, \vec{E}_1 + l\,\frac{d\theta}{dt}\, \vec{E}_2$$ or component-wise \begin{align} &v \, \cos(\phi) = s\\ &v \, \sin(\phi) = l\,\frac{d\theta}{dt} \end{align} So putting together the component-wise equations of the velocities at $$P$$ and $$Q$$ we get the differential equations \begin{align} &\frac{dx}{dt} = s\, \cos(\theta)\\ &\frac{dy}{dt} = s\, \sin(\theta)\\ &\frac{d\theta}{dt} = \frac{v}{l} \, \sin(\phi) \\ &v \, \cos(\phi) = s \end{align} By solving the fourth equation for $$v = \frac{s}{\cos(\phi)}$$ and plugging the result in the third equations $$\frac{d\theta}{dt} = \frac{v}{l} \, \sin(\phi) = \frac{s}{l\,\cos(\phi)} \, \sin(\phi) = \frac{s}{l} \, \tan(\phi)$$ we obtain the system of differential equations get the differential equations \begin{align} &\frac{dx}{dt} = s\, \cos(\theta)\\ &\frac{dy}{dt} = s\, \sin(\theta)\\ &\frac{d\theta}{dt} =\frac{s}{l} \, \tan(\phi) \end{align}

• So, in essence. The steering angle can be approximated by taking the arctangent of the change in heading over the change in time times the wheelbase divided by the speed (magnitude) of the vehicle? – DarkDrassher34 Jul 21 '19 at 11:33
• @DarkDrassher34 Yes, exactly. But for that you need to know $\frac{d\theta}{dt}$, which can be found by solving the first two equations for $s$ and $\theta$, knowing $\frac{dx}{dt}$ and $\frac{dy}{dt}$, and then differentiating $\theta$ – Futurologist Jul 21 '19 at 13:20
• @DarkDrassher34 Are you trying to design controls for this system? Basically do you want to make the vehicle closely follow a prescribed trajectory by selecting properly the functions $s=s(t)$ and $\phi = \phi(t)$ (how to control the speed and how much to steer the front wheels)? – Futurologist Jul 21 '19 at 13:25
• I forgot to mention I also have access to the time in ms. Which means I can just differentiate the heading, right? The main goal of the study is to accurately plot vehicle movement, if that helps. – DarkDrassher34 Jul 21 '19 at 13:45
• @DarkDrassher34 Yes, if you have access to $\theta(t)$ and the time $t$ you can directly calculate $$\phi(t) = \text{arctan}\left(\frac{l}{s(t)}\, \frac{d\theta}{dt}(t)\right)$$ – Futurologist Jul 21 '19 at 13:59

I use a single-Track model

(„METHODE ZUR ERSTELLUNG UND ABSICHERUNG EINER MODELLBASIERTEN SOLLVORGABE FÜR FAHRDYNAMIKREGELSYSTEME Michael Graf“)

the velocity components given in inertial system are:

$$\begin{bmatrix} V_x \\ V_y \\ \end{bmatrix}=v\begin{bmatrix} \cos(\psi+\beta) \\ \sin(\psi+\beta) \\ \end{bmatrix}$$

where $$\psi$$ is the heading angle and $$\beta$$ is the side slip angle

the sideslip angle $$\alpha_v$$ an the front wheel is:

$$\alpha_v=\delta-\beta-\frac{l_v\,\dot{\psi}}{v_x}=\delta-\beta-\frac{l_v\,\dot{\psi}}{v\,\cos(\beta)}\tag 1$$

where $$\delta$$ is the steering angle.

because the side slip angle $$\beta$$ and the sideslip angle $$\alpha_v$$ are small,you get for equation (1)

$$0=\delta-\frac{l_v\,\dot{\psi}}{v}\tag 2$$

solving equation (2) for $$\dot{\psi}$$ :

$$\dot{\psi}=\frac{v}{l_v}\,\delta$$

Edit:

$$\alpha_v=\delta-\kappa=\delta-\left(\beta+\arctan{\frac{\dot{\psi}\,l_v}{v_x}}\right)\,,\quad\,, \text{where v_x=v\cos(\beta)}$$

• This is helpful! Thanks for being diligent. – DarkDrassher34 Jul 21 '19 at 11:34
• please look again I edit my document. – Eli Jul 21 '19 at 15:26