4.5  Lab 5,simulation of motion of a 2 degree of freedom car trailer

  4.5.1  Problem description
  4.5.2  Part A. Derivation of equations of motion (slip condition)
  4.5.3  Part 2
  4.5.4  Conclusion
  4.5.5  Appendix

4.5.1  Problem description



4.5.2  Part A. Derivation of equations of motion (slip condition)

The following diagram shows the forces on trailer


To derive the equations of motion for the trailer body, we use \(F=ma\) and then resolve forces in the vertical direction and horizontal directions along the fixed body coordinates centered on the c.g. of the trailer. We also use the moment equation on the trailer as it is a rigid body.

In the following analysis, the following assumptions are made

  1. Angle \(\theta \) is small
  2. Force \(F_{h}\) is small
  3. Spring displacement \(\delta _{s}\) is small
  4. \(U\) is constant
  5. slip angle \(\alpha _{t}\) is small
  6. the no-slip condition is not used in the derivation. In other words, we can no longer assume that \(V=br\) as we did in the class problem.

To be able to use \(F=ma,\) we need to first make the velocity, acceleration and force diagrams. We are only interested in forces, velocity and acceleration of the c.g. of the trailer, since that is the body we will generate equations of motions for. The car itself will not be involved. We will also use kinematics constraint at connection point between the trailer and the car in order to generate an extra equation to solve for the unknown spring displacement \(\delta _{s}\) as will be shown below.


Resolving forces In the vertical direction (vertical relative to fixed body coordinates) we obtain

\begin{align*} \sum F_{y} &= ma_{y}\\ F_{t}+k\delta _{s}\cos \theta -F_{h}\sin \theta &= m\left ( \dot{V}+rU\right ) \end{align*}

Resolving forces In the horizontal direction gives

\begin{align*} \sum F_{x} &=ma_{x}\\ k\delta _{s}\sin \theta +F_{h}\cos \theta &=m\left ( \dot{U}-rV\right ) \end{align*}

Taking moments around an axis through the c.g. of the trailer gives

\begin{align*} \sum M &= I_{g}\dot{r}\\ \left ( k\delta _{s}\cos \theta \right ) a-F_{t}b-F_{h}\sin \theta a &=I_{g}\dot{r} \end{align*}

It is also clear that (by definition) that the yaw rate \(r\) is related to the angle \(\theta \) by\[ r=\frac{d\theta }{dt}\]

To solve for \(\delta _{s}\), which is an unknown in the above equations, we need an additional equation. We are run out of equations using \(F=ma\), so we must resolute to using a kinematic (constraint) equation. At the point of the connection between the trailer and the car, the speed of the spring displacement as seen by the car, must be the same as the speed of the connection as seen by the trailer. Hence this gives

\[ \frac{d\delta _{s}}{dt}=-\left ( V\cos \theta +U\sin \theta +ar\right ) \]

Therefore, we have a total of 5 equations

\begin{align} F_{t}+k\delta _{s}\cos \theta -F_{h}\sin \theta & =m\left ( \dot{V}+rU\right ) \tag{1}\\ k\delta _{s}\sin \theta +F_{h}\cos \theta & =m\left ( \dot{U}-rV\right ) \tag{2}\\ \left ( k\delta _{s}\cos \theta \right ) a-F_{t}b-F_{h}\sin \theta a & =I_{g}\dot{r}\tag{3}\\ r & =\dot{\theta }\tag{4}\\ \dot{\delta }_{s} & =-\left ( V\cos \theta +U\sin \theta +ar\right ) \tag{5} \end{align}

Now we apply the assumptions that \(\theta \) is small, hence the above reduces to

\begin{align} F_{t}+k\delta _{s}-F_{h}\theta & =m\left ( \dot{V}+rU\right ) \tag{1}\\ k\delta _{s}\theta +F_{h} & =m\left ( \dot{U}-rV\right ) \tag{2}\\ k\delta _{s}a-F_{t}b-F_{h}\theta a & =I_{g}\dot{r}\tag{3}\\ r & =\dot{\theta }\tag{4}\\ \dot{\delta }_{s} & =-\left ( V+U\theta +ar\right ) \tag{5} \end{align}

Another assumption is that\(F_{h}\) is very small, and also \(\delta _{s}\) is very small. Hence the products \(F_{h}\theta \) and \(\delta _{s}\theta \) vanish from the above equations resulting in

\begin{align} F_{t}+k\delta _{s} & =m\left ( \dot{V}+rU\right ) \tag{1}\\ F_{h} & =m\left ( \dot{U}-rV\right ) \tag{2}\\ k\delta _{s}a-F_{t}b & =I_{g}\dot{r}\tag{3}\\ r & =\dot{\theta }\tag{4}\\ \dot{\delta }_{s} & =-\left ( V+U\theta +ar\right ) \tag{5} \end{align}

Now we apply the assumption that \(U\) is constant, hence \(\dot{U}=0\) and hence equation (2) above can be removed as it provides no information. In the above, \(F_{t}=C_{t}\alpha _{t}\), and \(\alpha _{t}=\tan ^{-1}\left ( \frac{br-V}{U}\right ) .\) Hence \(F_{t}=C_{t}\alpha _{t}=C_{t}\tan ^{-1}\left ( \frac{br-V}{U}\right ) =\) \(C_{t}\frac{br-V}{U}\) assuming small slip angle.

Therefore, the final equations are

\begin{align} F_{t} & =C_{t}\frac{br-V}{U}\tag{1A}\\ \dot{V} & =\frac{F_{t}}{m}+\frac{k\delta _{s}}{m}-rU\tag{2A}\\ \dot{r} & =-\frac{F_{t}b}{I_{g}}+\frac{k\delta _{s}a}{I_{g}}\tag{3A}\\ \dot{\theta } & =r\tag{4A}\\ \dot{\delta }_{s} & =-\left ( V+U\theta +ar\right ) \tag{5A} \end{align}

And the above equations is what will be solved to generate \(V,r,\theta ,\delta _{s}\). This completes the first part of the assignment.

Part A. Extra. Derivation of equations of motion (no-slip condition)

In addition to the above, the no-slip condition case was implemented in order to be able to compare the result from the above against. The no-slip condition implies \(V=br\). Hence \(F_{t}=0\). Now, solving for \(F_{t}\) from equation (2A) above, and substitute the result into (3A) this gives

\[ m\left ( \dot{V}+rU\right ) -k\delta _{s}=F_{t}\]

Hence (3A) becomes

\begin{align*} \dot{r} & =-\frac{\left ( m\left ( \dot{V}+rU\right ) -k\delta _{s}\right ) b}{I_{g}}+\frac{k\delta _{s}a}{I_{g}}\\ \dot{r}I_{g} & =-mb\left ( \dot{V}+rU\right ) -bk\delta _{s}+k\delta _{s}a \end{align*}

But \(\dot{V}=b\dot{r}\) hence the above becomes

\[ \dot{r}\left ( I_{g}+mb^{2}\right ) +r\left ( mbU\right ) -\left ( b+a\right ) k\delta _{s}=0 \]

Therefore, for the no-slip condition, the following are the 3 equations to solve

\begin{align} \dot{r} & =\frac{-r\left ( mbU\right ) +\left ( b+a\right ) k\delta _{s}}{I_{g}+mb^{2}}\tag{1B}\\ \dot{\theta } & =r\tag{2B}\\ \dot{\delta }_{s} & =-\left ( V+U\theta +ar\right ) \tag{3B} \end{align}

Now the slip and the no-slip conditions can be compared using the user interface more easily.

4.5.3  Part 2

In the class, we found that, when the no-slip assumption was used (i.e. \(V=br\)), then the trailer was stable as long as \(I_{g}<mab\). In this assignment, we are asked not use the no-slip condition, and the goal now is to find if the trailer will become unstable as well when \(I_{g}<mab\) and if it will become stable when \(I_{g}\geq mab.\)

The simulation was run for the following values of \(I_{g}\) \[ I_{g}=\left [ 0.8,0.9,1.0,1.1,1.2\right ] mab \]

The results are shown below, followed by a conclusion. The simulation was run for around 20 seconds in order to obtain a plot that looked reasonable.

Results of simulation (slip condition on)

In all of these results, the yaw rate (\(r\left ( t\right ) \)) is shown as the \(I_{g}gain\) value is increased from \(0.8\) to \(1.2\). All other parameters are as specified in the handout.


Result of simulation (Extra, no-slip condition)

In addition to the slip-on model we did above, the no-slip condition was also simulated. We know that this condition will make the trailer unstable if \(I_{g}>mab\), and this was done just for verification. The results are similar to the above.


4.5.4  Conclusion

The results of the simulation when the slip condition is applied shows that the trailer will become unstable when \(I_{g}>mab\). This result matches the results obtained in class using stability analysis when the no-slip condition was used.

The only difference in results between using the no-slip (class analysis) and using the slip condition, is that, when \(I_{g}>mab,\) it took longer time for the trailer with the no-slip condition turned off, to reach the same yaw rate as when the no-slip condition is turned on (class).  I.e. the trailer will in both cases become unstable, but the trailer become unstable more rapidly when the no-slip condition is used. The reason is that the tire force is no longer available to reduce the yaw movement, since when no-slip condition is used, the force on the trailer tire is removed. Having this force there, the trailer will take longer time to reach the same yaw rate.

So, in conclusion, the trailer will become unstable when \(I_{g}>mab\) and this simulation has verified the result found in class.

4.5.5  Appendix

Mathematica Used for the following simulation of a simple car trailer stability analysis.


Mathematica notebook lab5.nb

 process[u, m, L, abRatio, IgGain, Ct, v0, r0, \[Theta]0, \[Delta], f, maxt, 
 {{u, 79.2, "speed U km/hr"}, 10, 200, 1, Appearance -> "Labeled", 
  ImageSize -> Small}, 
 {{m, 1800/2.2, "mass kg"}, 1, 1000, 1, Appearance -> "Labeled", 
  ImageSize -> Small}, 
 {{L, 7*0.3048, "trailer length m"}, 1, 10, 0.1, Appearance -> "Labeled", 
  ImageSize -> Small}, 
 {{abRatio, 0.85, "a/b ratio"}, 0.1, 0.9, 0.1, Appearance -> "Labeled", 
  ImageSize -> Small}, 
 {{IgGain, 0.8, "\!\(\*SubscriptBox[\(I\), \(g\)]\) gain"}, {0.8 -> 0.8, 
   0.9 -> 0.9, 1 -> 1, 1.1 -> 1.1, 1.2 -> 1.2, 1.3 -> 1.3}, 
  ControlType -> SetterBar, ImageSize -> Small}, 
 {{Ct, 210*4.448*180/Pi, "\!\(\*SubscriptBox[\(C\), \(t\)]\) N/rad"}, 30000, 
  100000, 1000, Appearance -> "Labeled", ImageSize -> Small}, 
 {{f, 1, "spring f (Hz)"}, 0.1, 3, 0.1, Appearance -> "Labeled", 
  ImageSize -> Small}, 
 {{maxt, 10, "simulation time (sec)"}, 0.1, 40, 0.1, Appearance -> "Labeled", 
  ImageSize -> Small}, 
 Control[{{noslip, False, "Apply no-slip condition"}, {False, True}, 
   ControlType -> Checkbox, ImageSize -> Small}], 
 Text["Initial conditions"], 
 {{v0, 0, "V(0) km/hr"}, 0, 10, 1, Appearance -> "Labeled", 
  ImageSize -> Small}, 
 {{r0, 0, "r(0) degree/sec"}, 0, 7, 1, Appearance -> "Labeled", 
  ImageSize -> Small}, 
 {{\[Theta]0, 2, "\[Theta](0) degree"}, 0, 7, .1, Appearance -> "Labeled", 
  ImageSize -> Small}, 
 {{\[Delta], 0, "\!\(\*SubscriptBox[\(\[Delta]\), \(s\)]\)(0) mm"}, 0, 100, 1, 
   Appearance -> "Labeled", ImageSize -> Small}, 
 SynchronousUpdating -> False,(*important to have this*) 
 ContinuousAction -> False, 
 Initialization :> 
   process[uu0_, m_, L_, abRatio_, IgGain_, c_, vv0_, 
     rr0_, \[Theta]\[Theta]0_, \[Delta]\[Delta]0_, f_, maxt_, noslip_] := 
    Module[{b = 1./(1 + abRatio), a, k = m*(2.*Pi*f)^2, u0 = uu0*1000/3600., 
      v0 = 
       vv0*1000/3600., \[Theta]0 = \[Theta]\[Theta]0* 
        Pi/180., \[Delta]0 = \[Delta]\[Delta]0/1000., r0 = rr0*Pi/180., F, 
      eq1, eq2, eq3, eq4, t, r, v, \[Theta], \[Delta], Ig, sol, data}, 
     a = L - b; 
     F = c (b r[t] - v[t])/u0; 
     Ig = IgGain m a b; 
     If[noslip == False, { 
       eq1 = v'[t] == F/m + (k \[Delta][t])/m - r[t] u0; 
       eq2 = r'[t] == (k \[Delta][t] a )/Ig - (F b)/Ig; 
       eq3 = \[Theta]'[t] == r[t]; 
       eq4 = \[Delta]'[t] == -(v[t] + u0 \[Theta][t] + a r[t]); 
       sol = 
        First@DSolve[{eq1, eq2, eq3, eq4, v[0] == v0, 
           r[0] == r0, \[Theta][0] == \[Theta]0, \[Delta][ 
             0] == \[Delta]0}, {v[t], r[t], \[Theta][t], \[Delta][t]}, t] 
       }, { 
       eq1 = r'[t] == (-r[t] (m b u0) + (b + a) k \[Delta][t])/(Ig + m b^2); 
       eq2 = \[Theta]'[t] == r[t]; 
       eq3 = \[Delta]'[t] == -(b r[t] + u0 \[Theta][t] + a r[t]); 
       sol = 
         DSolve[{eq1, eq2, eq3, 
           r[0] == r0, \[Theta][0] == \[Theta]0, \[Delta][ 
             0] == \[Delta]0}, {r[t], \[Theta][t], \[Delta][t]}, t] 
       {Plot[Chop@Evaluate[r[t] /. sol]*180/Pi, {t, 0, maxt}, 
         PlotRange -> All, Frame -> True, 
         FrameLabel -> {{"r(t) (deg/sec)", None}, {"t (sec)", 
            "r(t) vs. time"}}, ImagePadding -> {{40, 10}, {40, 40}}, 
         ImageSize -> 250, AspectRatio -> 0.8] 
          Plot[Chop@Evaluate[\[Theta][t] /. sol]*180/Pi, {t, 0, maxt}, 
           PlotRange -> All, Frame -> True, 
           FrameLabel -> {{None, None}, {"t (sec)", 
              Row[{"\[Theta] in deg vs. time"}]}}, 
           ImagePadding -> {{40, 10}, {50, 40}}, ImageSize -> 180] 
          Plot[Chop@Evaluate[\[Delta][t] /. sol], {t, 0, maxt}, 
           PlotRange -> All, Frame -> True, 
           FrameLabel -> {{None, None}, {"t (sec)", 
              Row[{"spring displacement (mm) vs. time"}]}}, 
           ImagePadding -> {{40, 10}, {50, 40}}, ImageSize -> 180] 
       }, Frame -> All, Spacings -> 0