## 3 Development of a Dynamic Model of the Robotino with Bond Graphs
### Planning of Motion  
The purpose of the **Reference** component is to define the path of a plane curve that the center \(C\) of the Robotino's bottom should follow, as well as the direction of its motion, and to generate the control signals for wheels driving. As an example of the curve, we use a (geometric) rose that is described by the following pair of Cartesian coordinates [87]:  
\[\begin{array}{c}X_{Cref}=ampl\cdot\cos(k\phi)\cos(\phi)\\ Y_{Cref}=ampl\cdot\cos(k\phi)\sin(\phi)\end{array}\Bigg{\}}. \tag{26}\]  
If parameter \(k\) = 3, then (26) describes a rose with three petals of amplitude \(ampl\) = 2 m (Figure 29a). We choose this relatively simple path because it will force Robotino to change the direction of its motion fairly often, and we can see whether the model we are developing simulates this motion correctly.  
To describe the path shown in Figure 29a, we define parameter \(\phi\) as follows:  
\[\phi=a\cdot t+5\pi/6, \tag{27}\]  
where \(a\) is a parameter, and \(t\) denotes the time. Note that, initially, \(X_{C}\) = 0, \(Y_{C}\) = 0, and the curve starts in the fourth quadrant with \(ampl\) of 2.0 m. To pass over all three petals, it needs \(\pi\) radians. Thus, if \(a\) = 0.1, it needs approximately 31.4 s for one complete cycle.  
Differentiating (26) and (27) with respect to time, we find the expressions for the world velocity components of the Robotino center \(C\) along the reference path:  
\[\begin{array}{c}v_{CXref}=\frac{dX_{Cref}}{dt}=ampl\cdot a\cdot(-k\sin(k \phi)\cos(\phi)-\cos(k\phi)\sin(\phi))\\ v_{CYref}=\frac{dX_{Cref}}{dt}=ampl\cdot a\cdot(-k\sin(k\phi)\sin(\phi)+\cos( k\phi)\cos(\phi))\end{array}\Bigg{\}}. \tag{28}\]  
The direction of motion is defined by assuming that the **Chassis** axis \(x\) is tangential to the reference path at the current position of the **Chassis** center \(C\) (Figure 29b). The corresponding angle \(\varphi\) is determined by:  
\[\tan\Bigl{(}\varphi_{ref}\Bigr{)}=\frac{v_{CYref}}{v_{CXref}}. \tag{29}\]  
Figure 29: Robotino path: (**a**) in the form of a rose; (**b**) the direction of motion; (**c**) **Reference** functions.  
We find the reference angular velocity of the chassis by differentiating (29) with respect to time:  
\[\omega_{ref}=\cos^{2}\left(\varphi_{ref}\right)\frac{d}{dt}\left(\frac{v_{CYref }}{v_{CXref}}\right)=a\cdot\frac{2k^{2}\sin^{2}(k\phi)+\left(k^{2}+1\right)\cos ^{2}(k\phi)}{k^{2}\sin^{2}(k\phi)+\cos^{2}(k\phi)}. \tag{30}\]  
Now, to find angle \(\varphi_{ref}\) as a continuous function of \(\phi\), and thus of time \(t\), we may integrate (30) using a suitable initial value, i.e.,  
\[\varphi_{ref}=\int\limits_{0}^{t}\omega_{ref}dt. \tag{31}\]  
We chose a rose with three petals as the reference path because it is relatively easy to generate using the equations above, and because it forces the center of the Robitino's base to follow the curved path and continuously change its camera viewing direction to be tangential to the path.  
The component **Reference** (Figure 29c) implements the above functional relationships consisting of the input function (27), the chassis center position (26), and the linear (28) and angular velocity functions (30), as well as the rotation angle (31). The outputs of these functions are forwarded to the drivers shown in Figure 25.