1 Introduction

Part I of this paper [1] presented a linear servo-constrained control law for balancing an autonomous bicycle, inspired by two driving rules: steer toward a fall (STF) and counter-steering (CST) [2,3,4]. Among them, STF means that the cyclist must turn the handlebars in the tilting direction to maintain the balance of the bicycle. CST is related to a counter-intuitive phenomenon that when riding a bicycle turning to the right, it must first turn to the left, and vice versa. By using the symmetry reduction theory in geometric mechanics and restricting the bicycle’s dynamics on the servo-constrained submanifold, the bicycle’s controlled motion can be described by a two-dimensional dynamic system. We studied the nonlinear dynamical behaviors of this system and identified the control parameters that ensure the bicycle’s motion stability in both uniform straight motion (USM) and uniform circular motion (UCM). Our theoretical results and numerical simulations showed that the linear control law not only enhances the bicycle’s stability but also explains the STF and CST driving rules based on stability analysis. We conclude the main contributions of Part I as follows:

  1. 1.

    A reduced bicycle dynamics model is established by using the Voronets equations, which is a completely nonlinear model with minimum dimension.

  2. 2.

    A linear control law for bicycle steering is proposed and a two-dimensional nonlinear model of the controlled bicycle is derived.

  3. 3.

    The stability and bifurcation behaviors of the relative equilibria of the two-dimensional nonlinear dynamic system are studied, and the theoretical results demonstrate that the linear control law not only enhances the stability of the bicycle in USM, but also allows it to be stabilized in UCM.

  4. 4.

    The phenomena of STF and CST can be clearly explained based on the stability analysis of the controlled bicycle dynamics.

In this paper, we experimentally verify the theoretical results developed in Part I by designing and building a powered automatic bicycle equipped with controller hardware. Historically, two common ways to stabilize and control a riderless bicycle in the literature are the moving mass control and the gyroscope control. The moving mass control can be achieved by adding a load mass moving laterally along a straight line [5] or by using an inverted pendulum structure on the bicycle’s saddle structure [6,7,8]. While this control method has advantages in achieving static balance [9, 10], it increases the weight of the bicycle and is only effective at low speeds. On the other hand, the gyroscope control utilizes the flywheel’s rotation to balance the bicycle, with typical devices including the control moment gyroscope (CMG) and reaction wheel [11,12,13,14,15,16,17,18,19]. The CMG generates a gyroscopic torque to balance the bicycle, and the most effective structure of the device is that the flywheel of the CMG should spin with respect to an axis parallel to the wheel’s spin axis and swing with respect to the bicycle’s yaw axis [20]. However, a single CMG generates not only the restoration torque component but also an additional unwanted torque component, so many researchers used a scissored-pair CMG to cancel out the unwanted torque [21,22,23]. The rotation axis of the reaction wheel is often set along the longitudinal direction of the bicycle wheel to generate a restoration torque [24,25,26]. The device can achieve static balance of the bicycle, but requires a large output torque, thus limiting its range of use.

In contrast to control strategies based on moving mass control and gyroscope control, the autonomous bicycle designed using a linear control law requires only a simple hardware structure for its controller. The main components of the autonomous bicycle consist of a bicycle body structure, a steering motor for controlling the handlebar angle, a speed motor with a servo system for maintaining a constant rear wheel rotation speed, a lower-level controller equipped with a programmable controller and various USB ports, and a six-axis attitude sensor for measuring the attitudes of the bicycle’s saddle structure. A PC computer is utilized for managing control instructions and data communications. A detailed description of the experimental system for the autonomous bicycle will be provided in Sect. 3.1.

As demonstrated in Part I of this paper, the physical parameters of the bicycle can be used to determine the control parameters of the linear control law, ensuring stable USM and UCM motion. However, in a real bicycle system, uncertainties arising from measurement errors of the bicycle’s physical parameters and the gyroscope sensor are inevitable, and these uncertainties can significantly impact the stability properties of the controlled bicycle. To address this concern, we will analyze the sensitivity of each physical parameter of the bicycle to its stability through a parameter sensitivity analysis. Our analysis reveals that the precision of the measured values of bicycle parameters is sufficient for determining the control parameters of the linear control law. Nevertheless, when the linear control law is applied to the experimental bicycle, we observe that while the experimental results qualitatively align with the theoretical predictions, the bicycle struggles to maintain the USM and UCM motion state. This difficulty arises due to drift error in the gyroscope sensor, which prevents accurate measurement of the lean angle of the bicycle at every moment.

Usually, the inertial devices, like the gyroscope sensor used in our experiments, cannot provide a reliable measurement for the actual lean angle [27]. Some researchers developed estimation algorithms based on the extended Kalman filter to estimate the real value of the lean angle [28]. In this paper, we choose another method to compensate for the measurement error, that is, we design a modified linear control law to make the bicycle stabilize in the desired motion state under a large disturbance from the gyroscope drift error. The main idea is to incorporate a time-varying intercept term in the linear control law. Based on the modified linear control law, we establish a three-dimensional reduced dynamics model that governs the controlled motion of the bicycle. Furthermore, we analyze the stability and bifurcation behaviors of the controlled bicycle dynamics under the modified control law. The results of numerical simulations and experiments demonstrate that the improved control law effectively eliminates the drift error of the gyroscope sensor, enabling the bicycle to precisely follow both the USM and UCM trajectories with the desired steer angle. Moreover, the experimental observations reveal the presence of a limit cycle motion, which is associated with the Hopf bifurcation behavior of the three-dimensional reduced dynamics model. The main contributions of Part II are as follows:

  1. 1.

    Based on a self-fabricated autonomous bicycle, the stability properties of the USM and UCM as well as the CST turning rule for the bicycle under the linear control law are well verified through experiments.

  2. 2.

    The effects of uncertainties in the real bicycle system on the stability of relative equilibria are analyzed.

  3. 3.

    A modified linear control law is proposed to compensate for the drift error of the gyroscope sensor, and a three-dimensional nonlinear model of the controlled bicycle is established. Its stability is studied through theoretical analysis, numerical simulation and experimental verification.

  4. 4.

    The Hopf bifurcation behavior is well exhibited in the bicycle system under a nonlinear control law.

The rest of this paper is organized as follows. In Sect. 2, we provide a concise summary of the theoretical results presented in Part I. The experimental setup and results are presented in Sect. 3. In Sect. 4, we investigate the sensitivity of the bicycle’s physical parameters and the uncertainties of the measurement sensors on the stability of the controlled bicycle’s motion. Section 5 introduces a modified linear control law to compensate for the gyroscope sensor’s drift error. This results in a three-dimensional dynamical system, whose stability and the bifurcation behavior is then analyzed. In Sect. 6, we conduct experiments to exhibit the bicycle’s motion under the modified control law. Finally, we draw conclusions in Sect. 7.

2 Brief summary of the theoretical results in Part I

To enhance readability, we provide a concise summary of the theoretical formula presented in Part I of this paper [1]. Table 1 shows the definitions of the symbols that appeared in Part I.

Table 1 Variables denotation

When the bicycle moves without slip on the horizontal ground, its configuration space is a seven-dimensional manifold Q with coordinates \({\varvec{q}}=(\theta ,\delta ,\phi _r,x,y,\psi ,\phi _f)^T\), where \(\theta \) is the lean angle, \(\delta \) is the steer angle, \(\phi _r\) and \(\phi _f\) are the rotation angles of the rear and front wheels, respectively, and \((x,y,\psi )\) represent the coordinates of the planar rigid body motion for the saddle structure. Figure 1 shows the definitions of \(\theta ,\delta \) and \(\phi _r\), where the arrows denote the positive directions of these angles. Let \(\varvec{\sigma }=(\theta ,\delta ,\phi _r)^T\) and \({\varvec{s}}=(x,y,\psi ,\phi _f)^T\), which correspond to the independent and dependent velocity components, respectively. The velocity constraints of the bicycle can be written as follows:

$$\begin{aligned} {\dot{s}}^a=-A^a_\alpha ({\varvec{q}}){\dot{\sigma }}^\alpha ,\,\,\,\,a=1,\ldots ,4, \end{aligned}$$
(1)

where Einstein’s summation convention is used for the indices \(\alpha =1,2,3\).Footnote 1

The Voronets equations governing the motion of the bicycle when subjected to steering torque \(\tau _\delta \) and rear wheel driving torque \(\tau _{\phi _r}\) can be expressed as follows:

$$\begin{aligned}{} & {} \frac{\text{ d }}{\text{ d }t}\frac{\partial L_c}{\partial {\dot{\sigma }}^\alpha }-\frac{\partial L_c}{\partial \sigma ^\alpha }+ A^a_\alpha \frac{\partial L_c}{\partial s^a}\nonumber \\{} & {} \quad + \frac{\partial L}{\partial {\dot{s}}^b}B^b_{\alpha \beta }{\dot{\sigma }}^\beta =\tau _\alpha ,\,\,\,\,\alpha =1,2,3, \end{aligned}$$
(2)

where \(L_c\) is the constrained Lagrangian, i.e., the restriction of the Lagrangian L on the constraint distribution \({\mathcal {D}}\) induced by the velocity constraints (1), \((\tau _1,\tau _2,\tau _3)=(0,\tau _\delta ,\tau _{\phi _r})\), and \(B^b_{\alpha \beta }\,(b=1,\ldots ,4,\,\alpha ,\beta =1,2,3)\) are curvature coefficients defined as follows:

$$\begin{aligned} B^b_{\alpha \beta }=\frac{\partial A^b_\alpha }{\partial \sigma ^\beta } -\frac{\partial A^b_\beta }{\partial \sigma ^\alpha }+A^a_\alpha \frac{\partial A^b_\beta }{\partial s^a} -A^a_\beta \frac{\partial A^b_\alpha }{\partial s^a}. \end{aligned}$$
(3)

According to the derivation in Part I, Eq. (2) can be transformed into the following form after combining similar terms:

$$\begin{aligned}{} & {} m_{\alpha \beta }({\varvec{r}})\ddot{\sigma }^\beta +c_{\alpha \beta \gamma }({\varvec{r}}){\dot{\sigma }}^\beta {\dot{\sigma }}^\gamma =P_\alpha ({\varvec{r}})+\tau _\alpha , \,\,\,\, \nonumber \\{} & {} \alpha , \beta , \gamma =1,2,3, \end{aligned}$$
(4)

where \({\varvec{r}}=(\theta ,\delta )^T\), \(m_{\alpha \beta }({\varvec{r}})\) represents the inertial mass matrix, \(c_{\alpha \beta \gamma }({\varvec{r}})\) corresponds to inertial gyroscopic force matrix, \(P_\alpha ({\varvec{r}})\) represents the generalized force induced by gravity. Since the forms of \(A^a_\alpha \,(a=1,\ldots ,4,\,\alpha =1,2,3)\), L and \(L_c\) are very complex, the full expressions of the coefficients in Eq. (4) are extremely lengthy, and cannot be listed in this paper. However, due to the symmetry inherited in the bicycle system, these coefficients take the following properties:

$$\begin{aligned} c_{333}({\varvec{r}})\equiv 0,\,\,P_3({\varvec{r}})\equiv 0. \end{aligned}$$
(5)

And the values of coefficients \(c_{\alpha 33}({\varvec{r}})\) and \(P_\alpha ({\varvec{r}})\) at the point \({\varvec{r}}={\varvec{0}}\) are given by

$$\begin{aligned} c_{\alpha 33}({\varvec{0}})=0,\,\,P_\alpha ({\varvec{0}})=0,\,\,\,\,\alpha =1,2. \end{aligned}$$
(6)
Fig. 1
figure 1

Definitions of the lean angle \(\theta \), steer angle \(\delta \) and rotation angle of the rear wheel \(\phi _r\)

By combining Eq. (4) with the symmetry of the bicycle system, we obtain a five-dimensional dynamic system on the reduced constraint space \({\mathcal {D}}/G\):

$$\begin{aligned} \dot{\varvec{\zeta }}={\varvec{Y}}(\varvec{\zeta }), \end{aligned}$$
(7)

where G is the symmetry group of the bicycle system on the horizontal ground, and \(\varvec{\zeta }=(\theta ,\delta ,{\dot{\theta }},{\dot{\delta }},{\dot{\phi }}_r)^T\) represents a set of coordinates of \({\mathcal {D}}/G\).

Remark 1

When \(\tau _{\delta }=\tau _{\phi _r}=0\), the dynamic system (7) is equivalent to those existing in the literature for the uncontrolled Whipple bicycle model [29,30,31]. One can refer to Sections 2.3 and 2.4 in Part I for more details about the uncontrolled bicycle dynamics.

The linear control law presented in Part I takes the following form:

$$\begin{aligned} \left\{ \begin{aligned}&\delta (t)=c_1\theta (t)+c_0, \\&{\dot{\phi }}_r(t)=\omega _0, \end{aligned} \right. \end{aligned}$$
(8)

where \({\varvec{p}}_c=(c_0,c_1,\omega _0)^T\) represents three independent control parameters. Equation (8) serves as two servo-constraints imposed to the bicycle system. By restricting the system (7) on the servo-constrained submanifold \({\mathcal {S}}\), we obtain a two-dimensional dynamic system governing the bicycle’s controlled motion:

$$\begin{aligned} \dot{{\varvec{v}}}={\varvec{Z}}({\varvec{v}}), \end{aligned}$$
(9)

where \({\varvec{v}}=(v^1,v^2)^T=(\theta ,{\dot{\theta }})^T\), \({\varvec{Z}}=(Z^1,Z^2)^T\), and

$$\begin{aligned} \left\{ \begin{aligned}&Z^1=v^2, \\&Z^2=\frac{h_1^{{\varvec{p}}_c}({\varvec{v}})}{m_{11}({\varvec{r}}({\varvec{v}})) +c_1m_{12}({\varvec{r}}({\varvec{v}}))}, \end{aligned} \right. \end{aligned}$$
(10)

where \({\varvec{r}}({\varvec{v}})=(v^1,c_1v^1+c_0)^T\), \(h_1^{{\varvec{p}}_c}({\varvec{v}})=\left( P_1({\varvec{r}})\right. \left. -c_{1\beta \gamma }({\varvec{r}}){\dot{\sigma }}^\beta {\dot{\sigma }}^\gamma \right) \big |_{\varvec{\zeta }=\varvec{\zeta }({\varvec{v}})}\), and \(\varvec{\zeta }({\varvec{v}})=(v^1,c_1v^1+c_0,v^2,c_1v^2,\omega _0)^T\).

We mainly focus on the relative equilibrium of the dynamic system (9), which takes a form \({\varvec{v}}_0=(\theta _0,0)^T\). Accordingly, the steady steer angle is given by \(\delta _0=c_1\theta _0+c_0\). Let us define \({\varvec{r}}_0=(\theta _0,\delta _0)^T\). The value of \(\theta _0\) and then that of \(\delta _0\) can be computed by using the following equation:

$$\begin{aligned} {P}_1({\varvec{r}}_0)-{c}_{133}({\varvec{r}}_0)\omega _0^2=0. \end{aligned}$$
(11)

Remark 2

When a constant actuation torque, instead of constant angular speed, is imposed to the rear wheel, this will lead to different results in the properties of the bicycle’s controlled dynamics. In this case, we can no longer obtain a two-dimensional servo-constrained submanifold, and the reduced dynamic system becomes three-dimensional with the coordinates \((\theta ,{\dot{\theta }},{\dot{\phi }}_r)\). Meanwhile, the reduced dynamic system cannot have a relative equilibrium in the form of \((\theta ,{\dot{\theta }},{\dot{\phi }}_r)=(\theta _0,0,\omega _0)\) unless the actuation torque is zero. Therefore, the bicycle’s stability in this case should be discussed in a much different way.

Depending on whether \(\delta _0\) is zero or not, the relative equilibrium \({\varvec{v}}_0\) corresponds to the bicycle’s USM or UCM steady motion. When \(c_1=0\), the system (9) always has a trivial relative equilibrium \({\varvec{v}}_0={\varvec{0}}\) related to the USM. Based on the stability analysis, we can characterize three regions (Region I, II, III) on the \(c_1-\omega _0\) plane for which \({\varvec{v}}_0={\varvec{0}}\) is exponentially stable. Among them, Region I complies with the STF driving rule and it can be expressed as follows:

$$\begin{aligned} \text {Region I}=\left\{ (c_1,\omega _0)\,\vert \,c_1<0,\,\omega _0>\omega _c\right\} , \end{aligned}$$
(12)

where \(c_1<0\) means that the bicycle always steer toward a fall in this region, and \(\omega _c\) is a critical velocity responsible for the lower speed limit to ensure the bicycle moving in a stable USM motion state:

$$\begin{aligned} \omega _c=\sqrt{\frac{P_{1,\theta }({\varvec{0}})+c_1P_{1,\delta }({\varvec{0}})}{c_1c_{133,\delta }({\varvec{0}})}}, \end{aligned}$$
(13)

where the expressions of \(P_{1,\theta }({\varvec{0}}),P_{1,\delta }({\varvec{0}}),c_{133,\delta }({\varvec{0}})\) are listed in Appendix A in Part I, and their values are only dependent on the physical parameters of the bicycle.

Remark 3

Åström et al. [4] provided an approximate expression for the critical speed \(\omega _c\) of a bicycle under a similar control law. However, due to oversimplification, their expression ignores the influence of many structural parameters of the bicycle on this critical speed. In contrast, Eq. (13) gives the complete expression of \(\omega _c\), showing for the first time how its value is affected by the various physical parameter of the Whipple bicycle. More importantly, we find that \(\omega _c\) is a supercritical pitchfork bifurcation point of the system (9), and when \(\omega _0\) is slightly less than \(\omega _c\), a pair of stable nontrivial relative equilibria related to the bicycle’s UCM exist.

Region II and Region III correspond to the bicycle’s backward and forward USM with positive \(c_1\), respectively. In these two regions, the bicycle’s USM is stabilized by steering to the opposite side of the fall direction. However, Region II is very small, and it is impossible to be achieved in practical control due to the uncertainty of the physical parameters. Region III requires a large value of \(c_1\), which means that a stronger ability should be assigned to the steering motor for the bicycle to move in this region. Therefore, although Region III exists theoretically, it is also difficult to achieve in practice unless the power of the steering motor is large enough.

Remark 4

For explaining the self-stabilization of an uncontrolled bicycle, Kooijman et. al [2] presented an as-yet-unproved claim that a stable bicycle must turn toward a fall. This claim seems to be proved by the theoretical results in associated with Region I, where the necessary condition for the bicycle stability is that the coupling of the leaning and steering should comply with the STF driving rule.

When \(c_0\ne 0\), the system (9) does not have a trivial relative equilibrium due to the lack of lateral symmetry. For point \({\varvec{r}}_0\) in the small neighborhood of zero, we can obtain an approximate solution of \({\varvec{r}}_0=(\theta _0,\delta _0)^T\) as follows,

$$\begin{aligned} \left\{ \begin{aligned}&\theta _0 =\frac{c_{133,\delta }({\varvec{0}})\omega _0^2 -P_{1,\delta }({\varvec{0}})}{c_1c_{133,\delta }({\varvec{0}})(\omega _c^2-\omega _0^2)}c_0, \\&\delta _0 =\frac{P_{1,\theta }({\varvec{0}})}{c_1c_{133,\delta }({\varvec{0}})(\omega _c^2-\omega _0^2)}c_0. \end{aligned} \right. \end{aligned}$$
(14)

Based on the mathematical properties of the coefficients involved in (14) and the control condition \(c_1<0\) and \(\omega _0>\omega _c\), we have

$$\begin{aligned} \theta _0c_0 >0, \,\,\,\,\delta _0c_0 <0. \end{aligned}$$
(15)

Thus, if \(c_0<0\) (\(c_0>0\)), i.e., the bicycle seems to have a bias toward right (left), then \(\theta _0<0\) and \(\delta _0>0\) (\(\theta _0>0\) and \(\delta _0<0\)). This means that the stable steady motion of the bicycle is a UCM toward left (right), corresponding to the CST driving rule.

3 Experimental setup and results

In this section, we will begin by introducing the experimental system of the autonomous bicycle, which we developed in-house. We will then proceed to verify the bicycle’s USM and UCM motion states using the linear control law (8). Additionally, we will validate the CST driving rule, as discussed in Section 4.2 of Part I, through experimental testing.

3.1 Description of the experimental system

Fig. 2
figure 2

Photograph of the autonomous bicycle

Figure 2 shows the picture of the self-made autonomous bicycle. Basically, the mechanical structure can be regarded as a classical Whipple bicycle consisting of four rigid bodies: a rear wheel, a saddle structure, a head structure, and a front wheel. Based on the definitions for the coordinate frames shown in Part I, we can define the geometric and mass parameters of the bicycle. For the Whipple bicycle model, there are 25 geometric and mass parameters, including the wheel base w, the trail c, the tilt angle of the steering axis \(\lambda \), the positions of the center of mass of the saddle and head structures \(x_k,z_k\,(k=s,h)\), the radii of the two wheels \(R_k\,(k=r,f)\), the masses of the four rigid bodies \(m_k\,(k=r,s,h,f)\), and the nonzero components of the inertia tensors of the four rigid bodies in their body-fixed frames \(I_{k,xx},I_{k,yy}\,(k=r,s,h,f)\) and \(I_{k,zz},I_{k,xz}\,(k=s,h)\). The values of these parameters are shown in Table 1 in Part I of this paper. For ease of reading, we present this Table 2.

Table 2 Values of the parameters for the powered autonomous bicycle: \(w=0.935\text {m}\), \(c=0.046\text {m}\) and \(\lambda =0.175\text {rad}\)

The autonomous bicycle is equipped with various electronic control components in addition to its mechanical structure. These include a small PC host (upper computer), a 48V@14AH lithium battery pack, two servo motor modules, an MPU6050 six-axis attitude sensor, and a bottom controller and interface circuit. The small PC host serves as the core unit of the entire system, responsible for control algorithm and information processing management. The 48V@14AH lithium battery pack, commonly used in commercial electric vehicles, provides power to the system.

The steering motor module and speed motor module are responsible for controlling the rotation of the bicycle’s handlebar and the speed of the rear wheel, respectively. The steering motor module utilizes a 7020Su drive with a power rating of \(50\text{ W }\) and a maximum angular velocity of \(1.047\text {rad}/\text {s}\). The speed motor module incorporates a built-in motor from a commercial electric vehicle, and its motor drive is also replaced with a 7020Su drive. The control signals of these two motor modules are communicated separately via the RS485 bus.

The low-level controller and interface circuit includes a PLC controller and a circuit board containing the power supply interfaces. The PLC controller is the core unit to play a role of communicating with the PC through the isolated USB to UART, with a communication speed of \(1\text{ Mbps }\). The physical cable is a USB2.0 A port line, which can be directly plugged into the USB port of the PC. Figure 3 shows the data collection and transmission process between PC host, PLC controller and motor modules.

Fig. 3
figure 3

System flowchart of the powered autonomous bicycle

Fig. 4
figure 4

Low-level PID algorithms for driving the steering motor and the speed motor

The process of controlling the bicycle balance is as follows. The lower PLC computer collects the measured position information (\(\delta ,\,\phi _r\)) and the measured lean angle \({\hat{\theta }}\). The PC host receives these data, and uses the measured lean angle \({\hat{\theta }}\) as the input, and feedbacks the desired steer angle \(\delta ^d=c_1{\hat{\theta }}_0+c_0\) and rear wheel speed \({\dot{\phi }}_r^d=\omega _0\) to the lower PLC computer to execute two commands: setting the steer angle as \(\delta ^d\) and setting the rear wheel speed as \({\dot{\phi }}_r^d\). In order to ensure the two motor modules execute accurately, low-level PID algorithms are needed to drive these two motors. As shown in Fig. 4, the steering motor is driven by a PD control law, and the speed motor is driven by a PI control law, respectively. In our experiments, these PID parameters are set as follows: \(K_p = 5000\) and \(K_d = 1000\) for the steering motor, and \(K_p = 1000\) and \(K_i = 150\) for the speed motor. In practice, the PID parameters can also be tuned to achieve precise execution of the linear control law (8). Only in this way can we treat (8) as two servo-constraints, and the dynamic modeling and stability analysis in Part I have practical significance.

3.2 Experimental results

Fig. 5
figure 5

Experimental results under the linear control law with the control parameters \({\varvec{p}}_c=(0\text {rad},-4, 7\text {rad}/\text {s})^T\): a evolution of the measured lean angle \({\hat{\theta }}\) with respect to time t; b evolution of the measured steer angle \(\delta \) with respect to time t; c test photographs at some different instants of time

For bicycle with physical parameters shown in Table 2, it can move without control in a self-stable motion state only if the angular velocity \(\omega _0\) is limited in a range \((\omega _{s1}, \omega _{s2})= (10.25,20.32)\text {rad}/\text {s}\). For the controlled bicycle, its critical velocity \(\omega _c\) responsible for the stable USM is given by

$$\begin{aligned} \omega _c=\sqrt{6.7342-\frac{129.9576}{c_1}}. \end{aligned}$$
(16)

Depending on the values of the control parameters \(c_0\), \(c_1\) and \(\omega _0\), the controlled bicycle will take different motion states. If \(c_0=0\) and \(\omega _0>\omega _c\), the bicycle will move in a stable USM motion state. If \(\omega _0\) is slightly less than \(\omega _c\), the dynamic system (9) will take a pair of stable nontrivial relative equilibria. In this case, the bicycle should move in a stable UCM motion state. If \(c_0\ne 0\), the value of the relative equilibrium and its stability will be influenced by the values of all the three control parameters.

In order to validate these theoretical results, we present three experiments in which we always set \(c_1=-4\). According to Eq. (16), the critical angular velocity of the three experiments take the same value as \(\omega _c=6.26\text {rad}/\text {s}\). For the first experiment, we set the control parameters with values as \({\varvec{p}}_c=(0\text {rad},-4, 7\text {rad}/\text {s})^T\). Clearly, the uncontrolled bicycle in this case will lose its self-stability since \(\omega _0\) is less than \(\omega _{s1}\). As the bicycle is equipped with the linear control law, it should be stabilized in a USM motion state. We call this experiment the USM-experiment.

The second experiment is called the UCM-experiment in which the control parameters are set as \({\varvec{p}}_c=(0\text {rad},-4, 6\text {rad}/\text {s})^T\). Clearly, the angular velocity \(\omega _0\) is slightly smaller than the critical angular velocity \(\omega _c\); thus, a pair of stable nontrivial relative equilibria exist. In this case, the controlled bicycle will enter a stable UCM state, even if its configuration is initially set in a straight line.

The purpose of the third experiment is to validate the CST turning rule. We call it CST-experiment in which the control parameters take two different sets of values. In the two sets, we fix \(\omega _0=7\text {rad}/\text {s}\) and \(c_1=-4\), but set \(c_0=\pm 0.1\text {rad}\), respectively. Setting the values of \(c_0\) with opposite signs means that the bicycle is expected to turn in different directions.

In these experiments, we always set the initial configuration of the bicycle along a straight line. In addition, an unmanned aerial vehicle (DJI Mavic 2 Pro) was used to record the bicycle’s motion. Supplementary materials [32] provide video movies related to the USM-experiment, UCM-experiment and CST-experiment, named as USM-LC-V, UCM-LC-V and CST-LC-V, respectively. In order to identify the bicycle’s motion, a small rectangular piece of paper is pasted on the upper surface of the saddle structure of the bicycle, and its center marks the path of the bicycle’s motion. In the following, we discuss the relevant experimental phenomena based on the data recorded by the measurement sensors.

The experimental results of the USM-experiment are shown in Fig. 5. The curves of measured lean angle \({\hat{\theta }}(t)\) and steer angle \(\delta (t)\) with respect to time are plotted in Fig. 5a, b, respectively. We can see that after an obvious perturbation in the first few seconds, both the values of lean and steer angles can restore to 0 at time \(t_1=7.3\text {s}\). However, this USM motion only lasts a few seconds, and both the lean and steer angles begin to deviate from 0 at \(t_2=10.8\text {s}\).

Figure 5c shows the configuration of the bicycle at some different instants of time. The red dotted line shown in Fig. 5c corresponds to the trajectory of the bicycle on the horizontal ground, which is an approximate straight line during the time interval \([7.33,11.33]\text {s}\). However, its subsequent motion obviously deviates from this straight line. Clearly, certain uncertainty in the real system has an important impact on the stability of the bicycle.

Fig. 6
figure 6

Experimental results under the linear control law with the control parameters \({\varvec{p}}_c=(0\text {rad},-4, 6\text {rad}/\text {s})^T\): a evolution of the measured lean angle \({\hat{\theta }}\) with respect to time t; b evolution of the measured steer angle \(\delta \) with respect to time t; c test photos at some different instants of time

For the UCM-experiment, Fig. 6a, b shows the experimental curves of the measured lean angle \({\hat{\theta }}(t)\) and steer angle \(\delta (t)\) over a longer period of time. We can see that both of them converge to nonzero steady values \({\hat{\theta }}_0\) and \(\delta _0\). Figure 6c shows the bicycle’s configuration captured by the unmanned aerial vehicle at some different instants of time. The trajectory of the bicycle corresponds to an approximate circle on the horizontal ground.

Clearly, difference between the experimental and theoretical results exists. Based on the theoretical prediction, the bicycle in the stable UCM motion state should take a constant lean angle as \(\pm 0.0935\text {rad}\) and a constant steer angle as \({\mp }0.3740\text {rad}\) under the control parameters. By selecting the data of \({\hat{\theta }}(t)\) and \(\delta (t)\) in the last 20 seconds of the experiment, we obtain the average values of these data as \({\hat{\theta }}_0=-0.1533\text {rad}\) and \(\delta _0=0.6131\text {rad}\), which cannot exactly agree with the theoretical values. This illustrates that the uncertainties in the experimental setup also influence the UCM motion.

Fig. 7
figure 7

Experimental results under the linear control law with control parameters \({\varvec{p}}_c=(0.1\text {rad},-4, 7\text {rad}/\text {s})^T\): a evolution of the measured lean angle \({\hat{\theta }}\) with respect to time t; b evolution of the measured steer angle \(\delta \) with respect to time t; c trajectory of the bicycle in the time interval \([45,70]\text {s}\)

Fig. 8
figure 8

Experimental results under the linear control law with control parameters \({\varvec{p}}_c=(-0.1\text {rad},-4, 7\text {rad}/\text {s})^T\): a evolution of the measured lean angle \({\hat{\theta }}\) with respect to time t; b evolution of the measured steer angle \(\delta \) with respect to time t; c trajectory of the bicycle in the time interval \([45,70]\text {s}\)

The experimental results related to the CST-experiment are shown in Figs. 7 and 8, respectively. For the case of \(c_0=0.1\text {rad}\), Fig. 7a, b plots the curves of the measured lean angle \({\hat{\theta }}(t)\) and steer angle \(\delta (t)\) with respect to time t, and Fig. 7c presents the trajectory of the bicycle within the time interval \([45,70]\text {s}\). Clearly, as t tends to \(+\infty \), \({\hat{\theta }}(t)\) and \(\delta (t)\) converge to a positive steady value \({\hat{\theta }}_0\approx 0.1105\text {rad}\) and a negative steady value \(\delta _0 \approx -0.3420\text {rad}\), respectively. The stable UCM motion is along a clockwise direction.

Compared to the case of \(c_0=0.1\text {rad}\), the experimental results in the case of \(c_0=-0.1\text {rad}\) will exhibit opposite tendencies. Figure 8a, b shows the evolutions of \({\hat{\theta }}(t)\) and \(\delta (t)\) with respect to time, respectively. Clearly, the lean angle of the bicycle converges to a negative steady value \({\hat{\theta }}_0\approx -0.1337\text {rad}\), while the steer angle converges to a positive value \(\delta _0\approx 0.4349\text {rad}\). Figure 8c shows that the bicycle’s motion converges to a stable UCM, but it moves along the anticlockwise direction.

The CST-experiment demonstrates that the bicycle’s motion can converge to a stable UCM motion, and it follows the CST steering rule, namely, \({\hat{\theta }}_0c_0 >0\) and \(\delta _0c_0<0\). Although these phenomena basically agree with our theoretical prediction, difference between the experimental and theoretical results exists. Firstly, the bicycle’s motion does not enter into an ideal closed circle trajectory. Secondly, the absolute values of steady lean angle and steady steer angle are obviously different between the two experiments, although theoretically they should be equal and take the absolute values as \(|\theta _0|=0.0936\text {rad}\) and \(|\delta _0|=0.2742\text {rad}\) according to our numerical simulations, respectively.

All three experiments demonstrate qualitative consistency between the experimental and theoretical results. However, they also reveal that the stability of the controlled bicycle is influenced to some extent by uncertainties inherent in the real-world bicycle system. In the following section, we will conduct an analysis to identify which specific uncertainties in the real system affect the stability of the controlled bicycle.

4 Error source analysis

Real bicycle systems inherently involve uncertainties, which may arise from various sources such as measurement methods used for determining bicycle’s physical parameters, or measurement sensors employed to identify the motion state of the bicycle system. These uncertainties can significantly impact the stability of the bicycle’s motion. In particular, the critical angular velocity \(\omega _c\), which plays a crucial role in determining the motion state of the bicycle and largely depends on its parameters, will be examined for sensitivity to each parameter. Subsequently, the influence of measurement sensors on the stability of bicycle motion will be analyzed based on the experimental results.

4.1 Sensitivity of bicycle’s parameters on \(\omega _c\)

As indicated by our theoretical analysis, the motion trajectory and the stability properties of the controlled bicycle are closely related to the critical velocity \(\omega _c\), whose value may be affected by the uncertainties in measuring the bicycle’s physical parameters. In this part, we will analyze the sensitivity of each physical parameter to the critical velocity \(\omega _c\).

For the Whipple bicycle model, there are 25 geometric and mass parameters. According to the concrete expression of \(\omega _c\), we find that the value of \(\omega _c\) is independent of the following ten parameters: \(I_{k,xx}\,(k=r,f)\) and \(I_{k,xx},I_{k,yy},I_{k,zz},I_{k,xz}\,(k=s,h)\). We define the remaining 15 dependent parameters into a parameter space given by \({\varvec{p}}=(p_1,\ldots ,p_{15})^T\), corresponding to w, c, \(\lambda \), \(R_r\), \(m_r\), \(I_{r,yy}\), \(x_s\), \(z_s\), \(m_s\), \(x_h\), \(z_h\), \(m_h\), \(R_f\), \(m_f\), \(I_{f,yy}\), respectively. As a result, \(\omega _c\) can be written as \(\omega _c=\omega _c({\varvec{p}})\). Following our previous work [30], a dimensionless index is used to quantify the sensitivity of each parameter \(p_i\) to \(\omega _c\):

$$\begin{aligned} L_{p_i}({\varvec{p}})=\frac{\partial \omega _c({\varvec{p}})}{\partial p_i}\cdot \frac{p_i}{\omega _c({\varvec{p}})}. \end{aligned}$$

Let us denote \({\varvec{p}}^0=(p_1^0,\ldots ,p_{15}^0)^T\) as the measured values of these 15 parameters of the experimental bicycle (see Table 2), and denote \(L_{p_i}^0=L_{p_i}(\varvec{p^0})\) as the values of \(L_{p_i}\) calculated at \({\varvec{p}}^0\). According to the continuity of \(L_{p_i}\), \(L_{p_i}^0\) quantifies the sensitivity of \(p_i\) in the neighborhood of \({\varvec{p}}^0\).

Table 3 Values of \(L_{p_i}^0\,(i=1,\ldots ,15)\) under \(c_1=-4\)

Table 3 lists the values of \(L_{p_i}^0\,(i=1,\ldots ,15)\) by assigning \(c_1=-4\). Clearly, \(\omega _c\) is insensitive about all other parameters except \(R_r\), \(x_h\) and w. Among them, \(L_{R_r}^0\) has the largest absolute value, and its negative sign means that \(\omega _c\) decreases as \(R_r\) increases.

Remark 5

Although \(R_r\) is the most sensitive parameter to \(\omega _c\), the value of \(R_r\omega _c\) is not so sensitive about \(R_r\). This can be explained by the following calculation:

$$\begin{aligned} \frac{\partial (R_r\omega _c)({\varvec{p}}^0)}{\partial R_r}\cdot \frac{R_r^0}{(R_r\omega _c)({\varvec{p}}^0)}=1+L_{R_r}^0=0.0120. \end{aligned}$$

The analysis above demonstrates that while \(R_r\) is a sensitive parameter for the critical angular velocity, it does not significantly affect the critical linear velocity of the bicycle. However, since we specify in this paper that the bicycle is directly driven by the angular velocity of the rear wheel, we use \(\omega _c\) in the sensitivity analysis, rather than \(R_r\omega _c\).

Fig. 9
figure 9

Curves of \(\omega _c\) obtained by changing each single parameter \(p_i\,(i=1,\ldots ,15)\), while remaining other parameters \(p_j\,(j\ne i)\) fixed at the values of \(p^0_j\)

Furthermore, we can numerically investigate how each parameter affects \(\omega _c\). For each parameter \(p_i\), we change its value within \([0.5p_i^0,1.5p_i^0]\) and remain other parameters \(p_j\,(j\ne i)\) fixed at \(p^0_j\), then compute the value of \(\omega _c\) by using Eq. (13) and setting \(c_1=-4\). Figure 9a–d shows how \(\omega _c\) varies with \({\Delta } p_i/p_i^0\), which changes within the range \([-0.5,0.5]\). The value of \(\omega _c\) obtained from the numerical investigation is also just sensitive to \(R_r\), \(x_h\) and w, agreeing with the finding from Table 3 for the dimensionless indices \(L_{p_i}^0\). In the following, we just use \(L_{p_i}^0\) to estimate the error of \(\omega _c\).

Denote by \(p_i^t\) the true value of \(p_i\), and \(\gamma _i=(p_i^t-p_i^0)/p_i^0\) the relative error of the parameter. The true values of all the parameters are designated as a point \({\varvec{p}}^t=(p_1^t,\ldots ,p_{15}^t)^T\) in the parameter space. By using the Taylor’s expansion formula, and neglecting the terms higher than the first order, we can approximately compute the relative error of \(\omega _c\) as

$$\begin{aligned} \left| \gamma _{\omega _c}\right|= & {} \left| \frac{\omega _c({\varvec{p}}^t)-\omega _c({\varvec{p}}^0)}{\omega _c({\varvec{p}}^0)}\right| \approx \left| \sum _{i=1}^{15}L_{p_i}^0\gamma _i\right| \\\le & {} \sum _{i=1}^{15}\left| L_{p_i}^0\right| \gamma _{i,\text {max}}. \end{aligned}$$

Thus, if the upper bound \(\gamma _{i,\text {max}}\) of \(\gamma _i\) is given, the maximum error of \(\gamma _{\omega _c}\) can be estimated. For the following parameters: w, c, \(\lambda \), \(R_r\), \(m_r\), \(m_s\), \(m_h\), \(R_f\), \(m_f\), we use high-precision measurement tools to obtain their values; thus, the corresponding \(\gamma _{i,\text {max}}\) of these parameters is estimated smaller than 0.01. Noting that the following parameters: \(x_s\), \(z_s\), \(x_h\), \(z_h\), \(I_{r,yy}\), \(I_{f,yy}\), are influenced by the mass distributions of the four bodies of the bicycle, we estimated their values from the bicycle’s CAD model; thus, these parameters may take relative large errors. We estimate that \(\gamma _{i,\text {max}}\) for \(x_s\), \(z_s\) and \(z_h\) less than 0.05, and that for \(x_h\) less than 0.025 (since the value of \(x_h^0\) is almost twice the values of \(x_s^0,z_s^0,z_h^0\)), and that for \(I_{r,yy},I_{f,yy}\) smaller than 0.2. Based on the above estimation for the uncertainty of each physical parameter, we roughly estimate the maximum relative error of the critical speed as \(\vert \gamma _{\omega _c}\vert \le 0.04\). Noting that the nominal value of \(\omega _c=6.26\text {rad}/\text {s}\) based on Table 2 and setting \(c_1=-4\), its real value should be limited in the range \([6.01, 6.51]\text {rad}/\text {s}\). For the USM-experiment where \(\omega _0 = 7\text {rad}/\text {s}\), this value is obviously greater than the upper bound of \(\omega _c\) caused by bicycle’s parameter uncertainty, so the bicycle must move in a stable straight line in the absence of other uncertainties. For the UCM-experiment where \(\omega _0 = 6\text {rad}/\text {s}\), this value is in the neighborhood of \(\omega _c\) and less than the lower bound of \(\omega _c\) caused by bicycle’s parameter uncertainty; thus, the bicycle must move in a UCM motion state in the absence of other uncertainties.

Noting that \(L_{p_i}^0\) varies with the control parameter \(c_1\), thus the value of \(\gamma _{\omega _c}\) will also change as \(c_1\) is assigned with a different value. Following the above procedure, we can compute the values of \(L_{p_i}^0\) at different \(c_1\), then estimate the maximum relative error \(\gamma _{\omega _c}\). Figure 10 shows how the upper bound of \(\gamma _{\omega _c}\) changes with the absolute value of \(c_1\). It is shown that even in the case of \(|c_1|=10\), the upper bound for \(\gamma _{\omega _c}\) is less than 0.08, implying that the relative error of \(\omega _c\) caused by the uncertainties of the bicycle’s parameters is small enough. Therefore, we can confirm that the value of \(\omega _c\) obtained from the nominal values of the bicycle parameters listed in Table 2 is accurate enough.

4.2 Error analysis for measurement sensors uncertainty

For the experimental bicycle system, uncertainty factors include the measurement errors associated with the measured lean angle \({\hat{\theta }}\), the steer angle \(\delta \) and the rear wheel rotation angle \(\phi _r\). In addition, it is also necessary to check whether the steering motor and the speed motor can accurately output the expected values allocated by the PLC controller.

In our experimental setup, we use high-precision rotary encoders to measure \(\delta \) and \(\phi _r\), while the value of \({\hat{\theta }}\) is measured by a low cost attitude sensor. If the measurement error exists in \({\hat{\theta }}\), it plays a role of inserting an additional intercept term in the linear control law. Therefore, even if the bicycle is controlled by the linear control law with \(c_0=0\), the measurement error will cause the bicycle to deviate from the straight trajectory. In the case of \(c_0\ne 0\), the additional intercept term caused by the measurement error will change the position of the relative equilibrium and thus change the circular trajectory of the bicycle in UCM motion state. The physical phenomena shown in the USM-experiment and UCM-experiment indicate that at least the gyroscope sensor is a major source of the measurement error.

Fig. 10
figure 10

Curve of the upper bound for the relative error \(\gamma _{\omega _c}\) with respect to the steer coefficient \(c_1\)

In addition to the measurement error from the gyroscope sensor, we should check whether the steering motor can accurately perform the linear control law and the rear wheel can be controlled at a given constant angular speed. For doing this, we characterize the steer error as \(\delta _e=\delta -c_1{\hat{\theta }}\), and plot the data obtained from the UCM-experiment in Fig. 11a. Except for the first few seconds, the magnitude of \(\delta _e\) is generally limited in a small range of \((-0.05\text {rad},0.05\text {rad})\), and oscillates around 0 (average value of \(\delta _e\) within the time interval \([20,100]\text {s}\) is about \(-1.7903\times 10^{-5}\text {rad}\)). Thus, we can confirm that the steering motor works well in the experimental setup. The uncertainty of the speed motor can be checked by plotting the curve of the rotation angle of the rear wheel \(\phi _r\) with respect to time t. As shown in Fig. 11b for the UCM-experiment, the curve is approximately a straight line except for the first few seconds. The average slope of the curve within the time interval \([20,100]\text {s}\) is about \(5.97\text {rad}/\text {s}\), which has only a \(0.5\%\) relative error compared to the given angular velocity \(\omega _0=6\text {rad}/\text {s}\). This means that the angular velocity of the rear wheel is accurately controlled by the speed motor.

Fig. 11
figure 11

Curves of the steer error \(\delta _e=\delta -c_1{\hat{\theta }}\) and rotation angle of the rear wheel \(\phi _r\) with respect to time t in the case of Fig. 6

Remark 6

In practice, the time delay of controllers caused by the transmission of signals (see Fig. 3) is difficult to avoid. Its effect on the dynamics and stability of the bicycle can also be attributed to the precision of the two servo motors executing the linear control law. The previous discussion demonstrates that the influence of time delay on the bicycle system can be negligible.

Based on the above analysis, we can confirm that the main source of the measurement errors comes from the gyroscope sensor in our experimental setup. This is a common problem when measuring the lean angle of a bicycle or motorcycle using inertial devices [27, 28]. In the following, we can estimate the drift error \(e_0\) of the gyroscope sensor based on the following assumptions: (1) in each experiment, \(e_0\) is a constant value that does not vary with the bicycle motion; (2) the measured value of the steady steer angle \(\delta _0\) is accurate enough; (3) the linear control law (8) can be accurately performed by the steering motor and the speed motor; (4) the influence of the measurement uncertainties of the bicycle’s physical parameters on its motion stability can be neglected. Based on these assumptions, we can use Eq. 11 to estimate the value of the steady lean angle \(\theta _0\) corresponding to the measured value of \(\delta _0\). The difference between the computed value of \(\theta _0\) and the measured value of \({\hat{\theta }}_0\) can then be roughly thought of the drift error \(e_0\). According to the experimental data of the UCM-experiment, we obtain \(\theta _0=-0.1799\text {rad}\) as \(\delta _0=0.6131\text {rad}\). Noting that the gyroscope sensor outputs \({\hat{\theta }}_0=-0.1533\text {rad}\), the drift error is then estimated as \(e_0={\hat{\theta }}_0-\theta _0=0.0266\text {rad}\).

Following the above procedure, we can also estimate the drift error of the gyroscope sensor in the CST-experiment. In the case of \(c_0=0.1\text {rad}\), the average values of the stable lean angle and steer angle are \({\hat{\theta }}_0=0.1105\text {rad}\) and \(\delta _0=-0.3420\text {rad}\). By substituting the value of \(\delta _0\) into Eq. (11), we obtain the corresponding lean angle as \(\theta _0=0.1197\text {rad}\). Consequently, the gyroscope drift error \(e_0\) is estimated as \(e_0={\hat{\theta }}_0-\theta _0=-0.0092\text {rad}\). In the case of \(c_0=-0.1\text {rad}\), we can obtain the average value of the measured lean angle as \({\hat{\theta }}_0=-0.1337\text {rad}\), and that of the measured steer angle as \(\delta _0=0.4349\text {rad}\). The computed value of \(\theta _0\) corresponding to the measured steer angle \(\delta _0\) is \(\theta _0=-0.1590\text {rad}\). Thus, the gyroscope drift error in this experiment is \(e_0={\hat{\theta }}_0-\theta _0=0.0253\text {rad}\). Based on the analysis for these experimental results, the drift error of the gyroscope sensor varies randomly in different experiments. In order to improve the control quality of the autonomous bicycle, the linear control law must be modified.

5 A modified linear control law

We have confirmed that the drift error from the gyroscope sensor has a significant impact on the stable motion of the bicycle, and its value varies randomly between different experiments. However, we can assume that the drift error remains constant within each experiment. To compensate for this error, we introduce a modified linear control law in this section, in which the intercept is considered as a time-varying term instead of a constant, and its specified value is adjusted in real-time using a saturation function. As the modified linear control law introduces a new control variable, the motion of the controlled bicycle is governed by a three-dimensional dynamical system. Similar to the approach used for the two-dimensional system, the values of the control parameters for the modified linear control law can be determined through stability analysis of the three-dimensional system. In this section, we will theoretically investigate how the bicycle controlled by the modified linear control law can achieve stable USM and UCM motion states. Additionally, we will explore an interesting phenomenon related to a kind of limit cycle motion behavior.

5.1 Modified linear control law and three-dimensional dynamic system

Note that the drift error from the gyroscope plays a role of inserting an additional intercept term into the linear control law. To compensate for the drift error, we can adjust the value of the intercept term based on the CST driving rule. Specifically, if the measured steer angle \(\delta \) is greater than its desired value \(\delta ^*\) (for USM, \(\delta ^*=0\), while for UCM, \(\delta ^*\) is a nonzero value), we should increase the intercept term, and vice versa. Consequently, we modify the linear control law as follows:

$$\begin{aligned} \left\{ \begin{aligned}&\delta (t)=c_1\theta (t)+{\tilde{c}}_0(t), \\&{\dot{\phi }}_r=\omega _0,\\&{\tilde{c}}_0(t)={\tilde{c}}_0(t_0) +\varepsilon \int _{t_0}^t\text {sat}\left( \frac{\delta (t)-\delta ^*}{\delta _1}\right) \text {d}t, \end{aligned} \right. \end{aligned}$$
(17)

where \({\tilde{c}}_0\) represents a time-varying intercept term with the initial value \({\tilde{c}}_0(t_0)\) at the initial time \(t=t_0\), i.e., the beginning of the control, and t is the current time. It is worth noting that the constant drift error of the gyroscope only affects the value of \({\tilde{c}}_0(t_0)\). Therefore, in the subsequent analysis, we can use \({\tilde{c}}_0(t_0)\) to emulate the drift error of the gyroscope. In addition, \(\delta ^*\) in Eq. (17) is the desired steer angle, \(\varepsilon ,\delta _1\) are two positive constants, and \(\text {sat}(\cdot )\) is a saturation function given by

$$\begin{aligned} \text {sat}(u)=\left\{ \begin{aligned}&u,\quad \text {if}\,\vert u\vert \le 1, \\&\text {sgn}(u),\quad \text {if}\,\vert u\vert >1. \end{aligned} \right. \end{aligned}$$
(18)

Clearly, the saturation function plays a role of limiting the variation rate of \({\tilde{c}}_0(t)\) in a range \([-\varepsilon ,\varepsilon ]\).

Combining Eqs. (17) with (9), we can obtain a three-dimensional augmented system governing the dynamics of the controlled bicycle under the modified linear control law. Defining the state variables of the three-dimensional system as \(\tilde{{\varvec{v}}}=({\tilde{v}}^{1},{\tilde{v}}^{2},{\tilde{v}}^{3})^T= (\theta ,{\dot{\theta }},{\tilde{c}}_0)^T\in {\mathcal {S}}\times {\mathbb {R}}\), we can express the dynamic equation of the three-dimensional system as

$$\begin{aligned} \dot{\tilde{{\varvec{v}}}}=\tilde{{\varvec{Z}}}(\tilde{{\varvec{v}}}), \end{aligned}$$
(19)

where \(\tilde{{\varvec{Z}}}=({\tilde{Z}}^{1},{\tilde{Z}}^{2},{\tilde{Z}}^{3})^T\), and

$$\begin{aligned} \left\{ \begin{aligned}&{\tilde{Z}}^{1}={\tilde{v}}^{2}, \\&{\tilde{Z}}^{2}=\frac{{\tilde{h}}_1(\tilde{{\varvec{v}}})}{m_{11}({\varvec{r}}(\tilde{{\varvec{v}}})) +c_1m_{12}({\varvec{r}}(\tilde{{\varvec{v}}}))}, \\&{\tilde{Z}}^{3}=\varepsilon \text {sat}\left( \frac{c_1{\tilde{v}}^{1}+{\tilde{v}}^{3}-\delta ^*}{\delta _1}\right) , \end{aligned} \right. \end{aligned}$$
(20)

where \({\varvec{r}}(\tilde{{\varvec{v}}})=({\tilde{v}}^1,c_1{\tilde{v}}^1+{\tilde{v}}^3)^T\), \({\tilde{h}}_1(\tilde{{\varvec{v}}})=\left( P_1({\varvec{r}})\right. \left. -c_{1\beta \gamma }({\varvec{r}}){\dot{\sigma }}^\beta {\dot{\sigma }}^\gamma \right) \big |_{\varvec{\zeta }=\varvec{\zeta }(\tilde{{\varvec{v}}})}\), and \(\varvec{\zeta }(\tilde{{\varvec{v}}})=({\tilde{v}}^1,c_1{\tilde{v}}^1+{\tilde{v}}^3,{\tilde{v}}^2,c_1{\tilde{v}}^2,\omega _0)^T\). It is worth noting that the second equation of (20) neglects the terms of \(\dot{{\tilde{c}}}_0(t)\) and \(\ddot{{\tilde{c}}}_0(t)\) induced by the modified control law since \(\varepsilon \) is small enough.

We denote by \(\tilde{{\varvec{v}}}_0=(\theta _0,0,{\tilde{c}}_{0,0})^T\) as the relative equilibrium of (19), where \(\theta _0\) and \({\tilde{c}}_{0,0}\) are two constants. Let us denote by \({\varvec{r}}_0=(\theta _0,\delta ^*)^T\), then \(\theta _0\) and \({\tilde{c}}_{0,0}\) are determined by the following equations:

$$\begin{aligned} \left\{ \begin{aligned}&{P}_1({\varvec{r}}_0)-{c}_{133}({\varvec{r}}_0)\omega _0^2=0, \\&c_1\theta _0+{\tilde{c}}_{0,0}-\delta ^*=0. \end{aligned} \right. \end{aligned}$$
(21)

Let \(\Omega _{\delta _1}=\left\{ \tilde{{\varvec{v}}}\in {\mathcal {S}}\times {\mathbb {R}}\,\big |\,\vert c_1{\tilde{v}}^{1}+{\tilde{v}}^{3}\vert \le \delta _1\right\} \) be a domain containing \(\tilde{{\varvec{v}}}_0\), in which the expression of \({\tilde{Z}}^{3}\) is smooth and can be simplified as follows:

$$\begin{aligned} {\tilde{Z}}^{3}(\tilde{{\varvec{v}}})=\frac{\varepsilon }{\delta _1}\left( c_1{\tilde{v}}^{1}+{\tilde{v}}^{3}-\delta ^*\right) . \end{aligned}$$

Therefore, the Jacobian matrix of (19) at \(\tilde{{\varvec{v}}}_0\) is calculated as

$$\begin{aligned} {\varvec{J}}(\tilde{{\varvec{v}}}_0)=\frac{\partial \tilde{{\varvec{Z}}}(\tilde{{\varvec{v}}}_0)}{\partial \tilde{{\varvec{v}}}}= \left( \begin{array}{ccc} 0 &{} 1 &{} 0 \\ -\frac{a_0({\varvec{r}}_0)}{a_2({\varvec{r}}_0)} &{} -\frac{a_1({\varvec{r}}_0)}{a_2({\varvec{r}}_0)} &{} -\frac{a_3({\varvec{r}}_0)}{a_2({\varvec{r}}_0)} \\ \frac{\varepsilon c_1}{\delta _1} &{} 0 &{} \frac{\varepsilon }{\delta _1} \end{array}\right) ,\nonumber \\ \end{aligned}$$
(22)

where

$$\begin{aligned} \left\{ \begin{aligned} a_0({\varvec{r}}_0)=&\left( c_{133,\theta }({\varvec{r}}_0)+c_1c_{133,\delta }({\varvec{r}}_0)\right) \omega _0^2 \\&\quad -P_{1,\theta }({\varvec{r}}_0)-c_1P_{1,\delta }({\varvec{r}}_0), \\ a_1({\varvec{r}}_0)=&\,2c_1\omega _0c_{123}({\varvec{r}}_0)+2c_{113}({\varvec{r}}_0)\omega _0, \\ a_2({\varvec{r}}_0)=&\,m_{11}({\varvec{r}}_0)+c_1m_{12}({\varvec{r}}_0), \\ a_3({\varvec{r}}_0)=&c_{133,\delta }({\varvec{r}}_0)\omega _0^2-P_{1,\delta }({\varvec{r}}_0). \end{aligned} \right. \end{aligned}$$
(23)

The expressions of coefficients \(a_0({\varvec{r}}_0), a_1({\varvec{r}}_0), a_2({\varvec{r}}_0)\) are the same as those defined in Eq. (50) in Part I.

5.2 Stability analysis and numerical verification

In this section, we will utilize the physical parameters of the bicycle (see Table 2) to discuss the stability of the bicycle’s motion in USM and UCM states. Once the values of the control parameters \(\tilde{{\varvec{p}}}_c=(c_1,\omega _0,\varepsilon ,\delta _1,\delta ^*)^T\) are specified, we can use Eq. (21) to obtain the value of the relative equilibrium \(\tilde{{\varvec{v}}}_0\) and analyze its stability. In order to achieve a USM motion under the modified linear control law, we set the control parameter \(\delta ^*=0\). In this case, we can prove that system (19) takes the following property:

Lemma 1

When \(\delta ^*=0\) is specified in the control parameter set \(\tilde{{\varvec{p}}}_c\), system (19) has a lateral symmetry and it always has a trivial relative equilibrium \(\tilde{{\varvec{v}}}_0={\varvec{0}}\), corresponding to a USM motion state.

Proof

When \(\delta ^*=0\), system (19) has the lateral symmetry, i.e., if \(\tilde{{\varvec{v}}}(t)\,(t_1<t<t_2)\) is its solution, so is \(-\tilde{{\varvec{v}}}(t)\,(t_1<t<t_2)\). Equivalently, the components \({\tilde{Z}}^1,{\tilde{Z}}^2,{\tilde{Z}}^3\) of the vector field \(\tilde{{\varvec{Z}}}\) have the following properties: \(\forall \tilde{{\varvec{v}}}\in S\times {\mathbb {R}}\), we have

$$\begin{aligned} {\tilde{Z}}^i(\tilde{{\varvec{v}}})=-{\tilde{Z}}^i(-\tilde{{\varvec{v}}}),\,\,\,\,i=1,2,3. \end{aligned}$$
(24)

Thus, \(\tilde{{\varvec{v}}}_0={\varvec{0}}\) must be a trivial relative equilibrium of system (19). According to the first equation of (17), the steer angle \(\delta _0\) at \(\tilde{{\varvec{v}}}_0\) should equal zero, corresponding to a USM motion state. \(\square \)

In order to determine the values of other control parameters in \(\tilde{{\varvec{p}}}_c\) for guaranteeing the stability of the USM motion state, we need to compute the eigenvalue \(\mu \) of \({\varvec{J}}\) at \(\tilde{{\varvec{v}}}_0={\varvec{0}}\). This can be obtained by solving the following characteristic equation:

$$\begin{aligned} \det \left( \mu {\varvec{I}}_3-{\varvec{J}}({\varvec{0}})\right) =\mu ^3+b_2\mu ^2+b_1\mu +b_0 = 0, \end{aligned}$$

where \({\varvec{I}}_3\) is the \(3\times 3\) identity matrix, and,

$$\begin{aligned} b_2=\frac{a_1}{a_2}-\frac{\varepsilon }{\delta _1},\,\, b_1=\frac{a_0}{a_2}-\frac{a_1\varepsilon }{a_2\delta _1},\,\, b_0=\frac{\varepsilon (c_1a_3-a_0)}{a_2\delta _1}.\nonumber \\ \end{aligned}$$
(25)

Here, we use \(a_0\), \(a_1\), \(a_2\) and \(a_3\) to represent the values of \(a_0({\varvec{0}})\), \(a_1({\varvec{0}})\), \(a_2({\varvec{0}})\), \(a_3({\varvec{0}})\), respectively, for simplifying the description. We have the following theorem to ensure that \(\tilde{{\varvec{v}}}_0\) is exponentially stable:

Theorem 1

For the self-fabricated autonomous bicycle with the physical parameters shown in Table 2, the trivial relative equilibrium \(\tilde{{\varvec{v}}}_0={\varvec{0}}\) under \(\delta ^*=0\) can be exponentially stable if the other control parameters satisfy the following conditions: (1) \((c_1,\omega _0)\in \text {Region I}\); (2) \(\varepsilon >0\), \(\delta _1>0\); (3) \(\varepsilon /\delta _1<\alpha _1\), where \(\alpha _1\) is a smaller root of the following equation:

$$\begin{aligned} \begin{aligned}&f\left( \frac{\varepsilon }{\delta _1}\right) =a_1a_2\left( \frac{\varepsilon }{\delta _1}\right) ^2 -(a_1^2+c_1a_2a_3)\\&\quad \left( \frac{\varepsilon }{\delta _1}\right) +a_0a_1=0. \end{aligned} \end{aligned}$$
(26)

Proof

According to the Hurwitz criterion,  \(\tilde{{\varvec{v}}}_0\) can be exponentially stable if and only if the following conditions are satisfied:

$$\begin{aligned} b_k>0,\,\,\, k=0,1,2,\,\,\text {and}\,\, b_2b_1>b_0. \end{aligned}$$

According to Eq. (23), we have \(c_1a_3-a_0=P_{1,\theta }({\varvec{0}})>0\), thus inequality \(b_0>0\) is always satisfied. Now, let us analyze the other conditions required by the Hurwitz criterion.

When \((c_1,\omega _0)\in \text {Region I}\), we always have \(a_k>0\,(k=0,1,2)\) (see Sect. 4.1 of Part I). According to (25), if \(b_2>0\) and \(b_1>0\) are satisfied, we should have \(\frac{\varepsilon }{\delta _1}<\min \left\{ \frac{a_1}{a_2},\,\frac{a_0}{a_1}\right\} \) in the case of \(\varepsilon >0\) and \(\delta _1>0\). Meanwhile, inequality \(b_2b_1>b_0\) can be written into a form as \(f\left( \frac{\varepsilon }{\delta _1}\right) >0\). Noting that the following inequalities exist:

$$\begin{aligned} (a_1^2+c_1a_2a_3)^2>(a_1^2+a_0a_2)^2\ge 4(a_1a_2)(a_0a_1). \end{aligned}$$

This condition ensures that (26) has two real roots:

$$\begin{aligned} \alpha _{1,2}=\frac{a_1^2+c_1a_2a_3{\mp }\sqrt{(a_1^2+c_1a_2a_3)^2-4a_1^2a_0a_2}}{2a_1a_2}.\nonumber \\ \end{aligned}$$
(27)

Therefore, the condition \(f\left( \frac{\varepsilon }{\delta _1}\right) >0\) induced by the inequality \(b_2b_1>b_0\) can be satisfied only if \(\frac{\varepsilon }{\delta _1}<\alpha _1\) or \(\frac{\varepsilon }{\delta _1}>\alpha _2\). In addition, we can easily verify that \(f(\frac{a_1}{a_2})<0\) and \(f(\frac{a_0}{a_1}) < 0\), meaning that \(\alpha _1<\frac{a_1}{a_2},\,\frac{a_0}{a_1}<\alpha _2\). To sum up the above analysis, we can conclude that under the conditions (1) and (2), the trivial relative equilibrium \(\tilde{{\varvec{v}}}={\varvec{0}}\) can be exponentially stable if and only if the condition \(\varepsilon /\delta _1<\alpha _1\) is satisfied. This proves the theorem. \(\square \)

Fig. 12
figure 12

Numerical solution of the system (19) under the modified control law (17) with the control parameters \(\tilde{{\varvec{p}}}_c=(-4,7\text {rad}/\text {s},0.01\text {rad}/\text {s},0.05\text {rad},0\text {rad})^T\) and initial condition \(\tilde{{\varvec{v}}}(t_0)=(0\text {rad},0\text {rad}/\text {s},-0.1\text {rad})^T\): a. evolutions of the lean angle \(\theta \), the steer angle \(\delta \) and the intercept term \({\tilde{c}}_0\) with respect to time t; b. trajectory \((x_r(t),y_r(t))\) of the contact point \(P_r\)

It is worth noting that \(\alpha _1\) just depends on the values of \(c_1\), \(\omega _0\) and the physical parameters of the bicycle. Once we have given the values of all the arguments except \(\omega _0\), we can think of \(\alpha _1\) as a function of a single variable of \(\omega _0\). Numerical investigation shows that \(\alpha _1\) is equal to zero when \(\omega _0=\omega _c\) and its value increases monotonically with \(\omega _0\). This means that the increase of \(\omega _0\) enhances the stability of the trivial relative equilibrium for given values of control parameters \(\varepsilon \) and \(\delta _1\). Conversely, for fixed values of \(\varepsilon \) and \(\delta _1\), we can define another critical angular velocity \({\tilde{\omega }}_c\) such that \(\alpha _1({\tilde{\omega }}_c)=\varepsilon /\delta _1\). It is clear that we should have \({\tilde{\omega }}_c > \omega _c\) since \(\alpha _1>0\). From Theorem 1, we have the following corollary to identify the stability of the trivial relative equilibrium.

Corollary 1

For the self-fabricated autonomous bicycle with the physical parameters shown in Table 2 and with the control parameters satisfying \(\delta ^*=0\) as well as the conditions (1) and (2) in Theorem 1, the trivial relative equilibrium \(\tilde{{\varvec{v}}}_0={\varvec{0}}\) is exponentially stable if and only if \(\omega _0>{\tilde{\omega }}_c\).

Let us choose \(\varepsilon =0.01\text {rad}/\text {s}\) and \(\delta _1=0.05\text {rad}\), and set \(c_1=-4\). By setting \(\alpha _1({\tilde{\omega }}_c)=\varepsilon /\delta _1\), we can use Eq. (27) to obtain \({\tilde{\omega }}_c=6.55\text {rad}/\text {s}>\omega _c\). Thus, the bicycle is expected to move in a straight forward motion if \(\omega _0>{\tilde{\omega }}_c\).

In order to simulate the situation that the bicycle can keep USM motion under the influence of gyroscope drift error, we set the initial condition of (19) as \(\tilde{{\varvec{v}}}(t_0)=(0,0,-0.1\text {rad})^T\) at \(t_0=0\). Here,  \({\tilde{c}}_0(t_0)=-0.1\text {rad}\) is used to imitate the gyroscope’s drift error. The angular velocity is set as \(\omega _0=7\text {rad}/\text {s}\), and the expected steer angle is set as \(\delta ^*=0\). Figure 12a shows the numerical solution of (19), where the red, blue and black lines represent the evolutions of the lean angle \(\theta (t)\), steer angle \(\delta (t)\) and intercept term \({\tilde{c}}_0(t)\), respectively. Clearly, all of them converge to zero as t tends to \(\infty \), meaning that the motion of the bicycle will finally converge to a stable USM. Figure 12b shows the trajectory of the contact point \(P_r\) of the rear wheel on the horizontal ground. At the beginning, the bicycle generates a steering motion satisfying the CST rule, then the trajectory converges to a straight line as \({\tilde{c}}_0(t)\) tends to zero. These numerical results mean that the bicycle under the modified linear control law can achieve a stable USM motion state even if drift error exists.

When \(\delta ^*\ne 0\), the system (19) does not have trivial relative equilibrium any more, and the relative equilibria in general may not be unique. Here, we focus on the relative equilibrium closest to \({\varvec{0}}\), and the bicycle under the modified control law moves in a UCM motion state.

Fig. 13
figure 13

Curves of relative equilibria and related physical quantities \(\kappa _{P_r}\) and \(\text {Re}(\mu )_{\max }\) with respect to the desired steer angle \(\delta ^*\) in the case of \(c_1=-4\), \(\omega _0=7\text {rad}/\text {s}\), \(\varepsilon =0.01\text {rad}/\text {s}\), \(\delta _1=0.05\text {rad}\)

Without loss of generality, we set the control parameters \(c_1=-4\), \(\omega _0=7\text {rad}/\text {s}\), \(\varepsilon =0.01\text {rad}/\text {s}\), \(\delta _1=0.05\text {rad}\), and change the value of \(\delta ^*\) in the range of \([-1,1]\text {rad}\). For each \(\delta ^*\), the relative equilibrium \(\tilde{{\varvec{v}}}_0=(\theta _0,0,{\tilde{c}}_{0,0})^T\) can be obtained based on Eq. (21), and the eigenvalues of the Jacobian matrix \({\varvec{J}}(\tilde{{\varvec{v}}}_0)\) can be numerically calculated by Eq. (22). The maximum real part of them is denoted by \(\text {Re}(\mu )_{\max }\). We can also use Eq. (48) in Part I to compute the curvature \(\kappa _{P_r}\) of the trajectory of the contact point \(P_r\). Figure 13a, b shows the curves of \(\theta _0,{\tilde{c}}_{0,0}\) and \(\kappa _{P_r},\text {Re}(\mu )_{\max }\) with respect to \(\delta ^*\), respectively. Clearly, all the relative equilibria are exponentially stable since \(\text {Re}(\mu )_{\max }<0\) for each \(\delta ^*\). Meanwhile, as \(\vert \delta ^*\vert \) increases, both \(\vert \theta _0\vert \) and \(\vert {\tilde{c}}_{0,0}\vert \) increase monotonically, but \(\kappa _{P_r}\) decreases monotonically. This agrees with the human riding experience that the larger the steer angle, the smaller the turning radius.

Fig. 14
figure 14

Numerical solution of the system (19) under the modified control law (17) with the control parameters \(\tilde{{\varvec{p}}}_c=(-4,7\text {rad}/\text {s},0.01\text {rad}/\text {s},0.05\text {rad},0.5\text {rad})^T\) and initial condition \(\tilde{{\varvec{v}}}(t_0)=(0\text {rad},0\text {rad}/\text {s},-0.1\text {rad})^T\): a. evolutions of the lean angle \(\theta \), the steer angle \(\delta \) and the intercept term \({\tilde{c}}_0\) with respect to time t; b. trajectory \((x_r(t),y_r(t))\) of the contact point \(P_r\)

Among those numerical investigation, we choose \(\delta ^*=0.5\text {rad}\) as an example to simulate the dynamical behavior of the controlled bicycle. The initial condition of the system (19) is set as \(\tilde{{\varvec{v}}}(t_0)=(0,0,-0.1\text {rad})^T\) at \(t_0=0\). Figure 14a shows the evolutions of the lean angle \(\theta (t)\), steer angle \(\delta (t)\) and intercept term \({\tilde{c}}_0(t)\) with respect to time. As t tends to \(\infty \), all of them converge to nonzero constants, corresponding to a nontrivial relative equilibrium. In particular, the steer angle \(\delta \) converges to \(\delta ^*\), meaning that the desired steer angle can be accurately controlled by the modified control law. Figure 14b presents the trajectory of the contact point \(P_r\), which shows that the bicycle’s motion converges to a stable UCM motion.

5.3 Hopf bifurcation at the critical velocity \({\tilde{\omega }}_c\)

When \(\delta ^*=0\), the controlled bicycle under the modified control law can keep in a USM motion state only if the control parameters are located in the region where the Hurwitz criterion is satisfied. As all the values of the control parameters except \(\omega _0\) are given, the stability of the USM motion just depends on \(\omega _0\). According to Corollary 1, the USM motion state will lose its stability if \(\omega _0 < {\tilde{\omega }}_c\). It is worth noting that the Jacobian matrix \({\varvec{J}}({\varvec{0}})\) of the system (19) at the trivial relative equilibrium \(\tilde{{\varvec{v}}}_0={\varvec{0}}\) also depends on \(\omega _0\) only. Therefore, we can take \(\omega _0\) as a bifurcation parameter to investigate the dynamical behavior of the bicycle in the neighborhood of \(\tilde{{\varvec{v}}}_0\). In this part, we will prove that the controlled bicycle exhibits a limit cycle motion when \(\omega _0\) is slightly smaller than \({\tilde{\omega }}_c\).

Without loss of generality, we still set \(c_1=-4\), \(\delta ^*=0\), \(\varepsilon =0.01\text {rad}/\text {s}\) and \(\delta _1=0.05\text {rad}\), such that \({\tilde{\omega }}_c=6.55\text {rad}/\text {s}\). In order to reveal the dynamical behavior of the three-dimensional system (19), we need to investigate the distribution of the eigenvalues of \({\varvec{J}}({\varvec{0}})\). When \(\omega _0\) is in the neighborhood of \({\tilde{\omega }}_c\), numerical investigation shows that \({\varvec{J}}({\varvec{0}})\) always has a pair of complex eigenvalues \(\mu _{1,2}(\omega _0)=\mu _r(\omega _0)\pm \text {i}\mu _i(\omega _0)\), and a negative real eigenvalue \(\mu _3(\omega _0)<0\). Figure 15 shows the curves of \(\mu _r\) and \(\mu _i\) with respect to \(\omega _0\). We can observe that \(\mu _r({\tilde{\omega }}_c)=0\), and that \(\text {d}\mu _r({\tilde{\omega }}_c)/\text {d}\omega _0\ne 0\). The distribution of the eigenvalues of \({\varvec{J}}({\varvec{0}})\) means that the trivial relative equilibrium losses its stability when \(\omega _0 < {\tilde{\omega }}_c\), while the complex eigenvalues \(\mu _{1,2}\) passes through the imaginary axis of the complex plane with nonzero velocity. Accordingly, a Hopf bifurcation may occur at \({\tilde{\omega }}_c\) [33].

Fig. 15
figure 15

Curves of the real part \(\mu _r\) and imaginary part \(\pm \mu _i\) with respect to \(\omega _0\) under the control parameters \(c_1=-4\), \(\varepsilon =0.01\text {rad}/\text {s}\), \(\delta _1=0.05\text {rad}\) and \(\delta ^*=0\text {rad}\)

Let us denote by \({\varvec{J}}_c({\varvec{0}})\) as the Jacobian matrix at the bifurcation point \({\tilde{\omega }}_c\), which takes a pair of pure imaginary roots \(\mu _{1,2}({\tilde{\omega }}_c)= \pm \text {i}\mu _i({\tilde{\omega }}_c)\). Denote by \({\varvec{u}}_1\in {\mathbb {C}}^3\) and \({\varvec{u}}_2\in {\mathbb {C}}^3\) as the complex eigenvectors of \({\varvec{J}}_c({\varvec{0}})\) and \({\varvec{J}}_c^T({\varvec{0}})\), respectively, which satisfy the following conditions:

$$\begin{aligned} \left\{ \begin{aligned}&{\varvec{J}}_c({\varvec{0}}){\varvec{u}}_1=\text {i}\mu _i({\tilde{\omega }}_c){\varvec{u}}_1, \,\,\,\,{\varvec{J}}_c^T({\varvec{0}}){\varvec{u}}_2=-\text {i}\mu _i({\tilde{\omega }}_c){\varvec{u}}_2, \\&\langle {\varvec{u}}_1,{\varvec{u}}_1\rangle =1,\,\,\,\, \langle \text {Re}[{\varvec{u}}_1],\text {Im}[{\varvec{u}}_1]\rangle =0,\,\,\,\, \langle {\varvec{u}}_2,{\varvec{u}}_1\rangle =1, \end{aligned} \right. \end{aligned}$$

where \(\langle {\varvec{u}}_i,{\varvec{u}}_j\rangle =\bar{{\varvec{u}}}_i^T{\varvec{u}}_j\) represents the inner product of two complex eigenvectors \({\varvec{u}}_i\) and \({\varvec{u}}_j\) on \({\mathbb {C}}^3\), \(\bar{{\varvec{u}}}_i^T\) represents the conjugate vector transpose of \({\varvec{u}}_i\), and \(\text {Re}[\cdot ]\) and \(\text {Im}[\cdot ]\) represent the real and imaginary parts of a complex vector (or a complex number), respectively.

For a three-dimensional nonlinear system (19), the mathematical property of the trivial relative equilibrium \(\tilde{{\varvec{v}}}_0={\varvec{0}}\) at the bifurcation point \({\tilde{\omega }}_c\) can be analyzed based on the value of the first Lyapunov coefficient \(\text {Ly}_1({\tilde{\omega }}_c)\). In order to compute its value, we first define multilinear mappings: \({\varvec{B}}(\cdot , \cdot ):{\mathbb {C}}^3\times {\mathbb {C}}^3\rightarrow {\mathbb {C}}^3\) and \({\varvec{C}}(\cdot , \cdot , \cdot ):{\mathbb {C}}^3\times {\mathbb {C}}^3\times {\mathbb {C}}^3\rightarrow {\mathbb {C}}^3\), where, for arbitrary complex vectors \({\varvec{w}}_i=[w_i^1,w_i^2,w_i^3]^T\in {\mathbb {C}}^3\,(i=1,2,3)\), they are given by

$$\begin{aligned} \left\{ \begin{aligned}&{\varvec{B}}({\varvec{w}}_1,{\varvec{w}}_2)=\frac{\partial ^2\tilde{{\varvec{Z}}}_c({\varvec{0}})}{\partial {\tilde{v}}^j\partial {\tilde{v}}^k}w_1^jw_2^k, \\&{\varvec{C}}({\varvec{w}}_1,{\varvec{w}}_2,{\varvec{w}}_3)=\frac{\partial ^3\tilde{{\varvec{Z}}}_c({\varvec{0}})}{\partial {\tilde{v}}^j\partial {\tilde{v}}^k\partial {\tilde{v}}^l}w_1^jw_2^kw_3^l, \end{aligned} \right. \end{aligned}$$

where \(\tilde{{\varvec{Z}}}_c\) represents the vector field \(\tilde{{\varvec{Z}}}\) of the system (19) at the bifurcation point \({\tilde{\omega }}_c\). Relating to the Jacobian matrix \({\varvec{J}}_c({\varvec{0}})\), we can then compute the following inner products of complex vectors:

$$\begin{aligned} \left\{ \begin{aligned}&NP_1=\langle {\varvec{u}}_2,{\varvec{C}}({\varvec{u}}_1,{\varvec{u}}_1, \bar{{\varvec{u}}}_1)\rangle , \\&NP_2=\langle {\varvec{u}}_2,{\varvec{B}}({\varvec{u}}_1,{\varvec{J}}_c^{-1}({\varvec{0}}){\varvec{B}}({\varvec{u}}_1, \bar{{\varvec{u}}}_1))\rangle , \\&NP_3=\langle {\varvec{u}}_2,{\varvec{B}}(\bar{{\varvec{u}}}_1, (2\text {i}\mu _i({\tilde{\omega }}_c){\varvec{I}}_3-{\varvec{J}}_c({\varvec{0}}))^{-1}{\varvec{B}} ({\varvec{u}}_1,{\varvec{u}}_1))\rangle . \end{aligned} \right. \end{aligned}$$

where \({\varvec{I}}_3\) is a \(3\times 3\) identity matrix. According to the definition of the first Lyapunov coefficient shown in [33], we have

$$\begin{aligned} \text {Ly}_1({\tilde{\omega }}_c)=\frac{1}{2\mu _i({\tilde{\omega }}_c)}\text {Re} \left[ NP_1-2NP_2+NP_3\right] , \end{aligned}$$
(28)

Noting that the system (19) has a lateral symmetry according to Lemma 1, all the second partial derivatives of vector field \(\tilde{{\varvec{Z}}}_c\) at \(\tilde{{\varvec{v}}}_0={\varvec{0}}\) must be zero, thus we have \({\varvec{B}}\equiv {\varvec{0}}\). Therefore, Eq. (28) can be simplified as follows:

$$\begin{aligned} \text {Ly}_1({\tilde{\omega }}_c)=\frac{1}{2\mu _i({\tilde{\omega }}_c)}\text {Re} \left[ NP_1\right] . \end{aligned}$$
(29)

In order to avoid the complex operation for the multilinear mapping involved in \({\varvec{C}}(\cdot , \cdot , \cdot )\), Kuznetsov [33] introduced a perturbation parameter \(\tau \in {\mathbb {R}}\) to disturb vector field \(\tilde{{\varvec{Z}}}_c\), and indicated that \(\text {Ly}_1({\tilde{\omega }}_c)\) can be obtained through computing the following coefficients:

$$\begin{aligned} \left\{ \begin{aligned}&\beta _1=\frac{\text {d}^3}{\text {d}\tau ^3}\bigg |_{\tau =0}\langle \text {Re}\left[ {\varvec{u}}_2\right] , \tilde{{\varvec{Z}}}_c\left( \text {Re}\left[ \tau {\varvec{u}}_1\right] \right) \rangle , \\&\beta _2=\frac{\text {d}^3}{\text {d}\tau ^3}\bigg |_{\tau =0}\langle \text {Im}\left[ {\varvec{u}}_2\right] , \tilde{{\varvec{Z}}}_c\left( \text {Im}\left[ \tau {\varvec{u}}_1\right] \right) \rangle , \\&\beta _3=\frac{\text {d}^3}{\text {d}\tau ^3}\bigg |_{\tau =0}\langle \text {Re}\left[ {\varvec{u}}_2\right] +\text {Im}\left[ {\varvec{u}}_2\right] ,\tilde{{\varvec{Z}}}_c\left( \text {Re}\left[ \tau {\varvec{u}}_1\right] + \text {Im}\left[ \tau {\varvec{u}}_1\right] \right) \rangle , \\&\beta _4=\frac{\text {d}^3}{\text {d}\tau ^3}\bigg |_{\tau =0}\langle \text {Re}\left[ {\varvec{u}}_2\right] -\text {Im}\left[ {\varvec{u}}_2\right] ,\tilde{{\varvec{Z}}}_c \left( \text {Re}\left[ \tau {\varvec{u}}_1\right] -\text {Im}\left[ \tau {\varvec{u}}_1\right] \right) \rangle . \end{aligned} \right. \end{aligned}$$
(30)

The first Lyapunov coefficient \(\text {Ly}_1({\tilde{\omega }}_c)\) can then be calculated by

$$\begin{aligned} \text {Ly}_1({\tilde{\omega }}_c)=\frac{1}{2\mu _i({\tilde{\omega }}_c)}\left( \frac{2}{3}(\beta _1+\beta _2)+\frac{1}{6}(\beta _3+\beta _4) \right) . \end{aligned}$$
(31)

If \(\text {Ly}_1({\tilde{\omega }}_c) <0\), the bifurcation point \({\tilde{\omega }}_c\) corresponds to a supercritical Hopf bifurcation in which a stable limit cycle motion exists when \(\omega _0\) is slightly less than \({\tilde{\omega }}_c\).

Theorem 2

For the self-fabricated autonomous bicycle with the physical parameters shown in Table 2, a supercritical Hopf bifurcation exists at \(\omega _0={\tilde{\omega }}_c\), namely, the controlled bicycle exhibits a stable limit cycle motion when \(\omega _0\) is slightly less than \({\tilde{\omega }}_c\).

Proof

Based on the concrete values of the control and physical parameters of the self-fabricated autonomous bicycle, we have \(\mu _i({\tilde{\omega }}_c)=0.68\). Correspondingly, the complex eigenvectors \({\varvec{u}}_1\) and \({\varvec{u}}_2\) related to a pair of pure imaginary roots \(\mu _{1,2}({\tilde{\omega }}_c)= \pm \text {i}\mu _i({\tilde{\omega }}_c)\) are given by

$$\begin{aligned} \left\{ \begin{aligned}&\text {Re}\left[ {\varvec{u}}_1\right] =[0.54,-0.18,-0.12]^{T},\,\,\,\\&\text {Im}\left[ {\varvec{u}}_1\right] =[0.27,0.37,0.67]^{T},\\&\text {Re}\left[ {\varvec{u}}_2\right] =[0.87,0.11,-0.40]^{T},\,\,\\&\,\text {Im}\left[ {\varvec{u}}_2\right] =[0.15,0.03,0.67]^{T}. \end{aligned} \right. \end{aligned}$$

Using the finite difference formula of the third derivative for Eq. (30), namely,

$$\begin{aligned} \beta _1= & {} \frac{1}{8h^3}\left\langle \text {Re}\left[ {\varvec{u}}_2\right] , \tilde{{\varvec{Z}}}_c\left( \text {Re}\left[ 3h{\varvec{u}}_1\right] \right) -3\tilde{{\varvec{Z}}}_c\left( \text {Re}\left[ h{\varvec{u}}_1\right] \right) \right. \\{} & {} \left. +3\tilde{{\varvec{Z}}}_c\left( \text {Re}\left[ -h{\varvec{u}}_1\right] \right) -\tilde{{\varvec{Z}}}_c\left( \text {Re}\left[ -3h{\varvec{u}}_1\right] \right) \right\rangle , \end{aligned}$$

and so on, where \(h\ll 1\) is a small increment, we have

$$\begin{aligned}{} & {} \beta _1=-21.61,\,\,\beta _2=-0.07, \\{} & {} \beta _3=-62.66, \,\, \beta _4=-2.94. \end{aligned}$$

According to Eq. (31), we have \(\text {Ly}_1({\tilde{\omega }}_c)=-18.73<0\), which means that a supercritical Hopf bifurcation occurs at \(\omega _0={\tilde{\omega }}_c\). Therefore, although the trivial relative equilibrium \(\tilde{{\varvec{v}}}_0={\varvec{0}}\) becomes unstable when \(\omega _0<{\tilde{\omega }}_c\), a stable limit cycle will exist if \(\omega _0\) is slightly less than \({\tilde{\omega }}_c\). \(\square \)

Fig. 16
figure 16

Numerical solution of the system (19) under the modified control law (17) with the control parameters \(\tilde{{\varvec{p}}}_c=(-4,6\text {rad}/\text {s},0.01\text {rad}/\text {s},0.05\text {rad},0\text {rad})^T\) and initial condition \(\tilde{{\varvec{v}}}(t_0)=(0\text {rad},0\text {rad}/\text {s},-0.1\text {rad})^T\): a evolutions of the lean angle \(\theta \), the steer angle \(\delta \) and the intercept term \({\tilde{c}}_0\) with respect to time t; b trajectory \((x_r(t),y_r(t))\) of the contact point \(P_r\)

In order to verify the above results, we set \(\omega _0=6\text {rad}/\text {s}<{\tilde{\omega }}_c=6.55\text {rad}/\text {s}\), and carry out numerical simulation for system (19) under the initial condition \(\tilde{{\varvec{v}}}(t_0)=(0,0,-0.1\text {rad})^T\) at \(t_0=0\). Figure 16a shows the evolutions of the lean angle \(\theta (t)\), steer angle \(\delta (t)\) and intercept term \({\tilde{c}}_0(t)\) with respect to time. As t increases, all of them converge to periodic solutions, corresponding to a stable limit cycle in the phase space. Figure 16b presents the trajectory of the contact point \(P_r\) on the horizontal plane. We can see that in the limit cycle motion, the bicycle turns corners with the direction changing periodically. But overall, the horizontal position of the bicycle shows a tendency to move along a certain direction. These results mean that although the variables \(\theta ,\delta ,{\tilde{c}}_0\) can return to the starting point within each period of the limit cycle, this periodic process produces nonzero displacements in the Lie group coordinates. Essentially, this phenomenon is related to the concept of geometric phase in geometric mechanics [34, 35].

Fig. 17
figure 17

Experimental results under the modified linear control law (17) with the control parameters \(\tilde{{\varvec{p}}}_c=(-4,7\text {rad}/\text {s},0.01\text {rad}/\text {s},0.05\text {rad},0\text {rad})^T\) and with the initial value of the intercept term \({\tilde{c}}_0(0)=-0.1\text {rad}\): a evolution of the measured lean angle \({\hat{\theta }}\) with respect to time t; b evolution of the measured steer angle \(\delta \) with respect to time t; c evolution of the intercept term \({\tilde{c}}_0\) with respect to time t; d trajectory \((x_r(t),y_r(t))\) of the contact point \(P_r\)

Fig. 18
figure 18

Experimental results under the modified linear control law (17) with the control parameters \(\tilde{{\varvec{p}}}_c=(-4,7\text {rad}/\text {s},0.01\text {rad}/\text {s},0.05\text {rad},0.5\text {rad})^T\) and with the initial value of the intercept term \({\tilde{c}}_0(0)=-0.1\text {rad}\): a evolution of the measured lean angle \({\hat{\theta }}\) with respect to time t; b evolution of the measured steer angle \(\delta \) with respect to time t; c evolution of the intercept term \({\tilde{c}}_0\) with respect to time t; d trajectory of the bicycle in the time interval \([30,60]\text {s}\)

Fig. 19
figure 19

Experimental results under the modified linear control law (17) with the control parameters \(\tilde{{\varvec{p}}}_c=(-4,6\text {rad}/\text {s},0.01\text {rad}/\text {s},0.05\text {rad},0\text {rad})^T\) and with the initial value of the intercept term \({\tilde{c}}_0(0)=-0.1\text {rad}\): a evolution of the measured lean angle \({\hat{\theta }}\) with respect to time t; b evolution of the measured steer angle \(\delta \) with respect to time t; c evolution of the intercept term \({\tilde{c}}_0\) with respect to time t; d trajectory of the bicycle in the time interval \([30,70]\text {s}\)

6 Experiments under the modified linear control law

In this section, we conduct experiments to verify the physical phenomena found from our theoretical analysis for the bicycle under the modified linear control law. Both the USM and UCM motion states will be exhibited and a stable limit cycle motion of the controlled bicycle is successfully revealed.

We conduct three experiments using control parameters consistent with the numerical examples presented in Sect. 5. Specifically, we set \(c_1=-4\), \(\varepsilon =0.01\text {rad}/\text {s}\) and \(\delta _1=0.05\text {rad}\), resulting in \({\tilde{\omega }}_c=6.55\text {rad}/\text {s}\). To test the robustness of the modified control law against gyroscope drift errors, we set the initial value of the intercept term as \({\tilde{c}}_0(t_0)=-0.1\text {rad}\) at \(t_0=0\). Generally, due to the presence of the drift error \(e_0\), the true intercept of the modified control law should be \({\tilde{c}}_0(t)+c_1e_0\).

The first experiment, called as USM-M-experiment, is conducted to verify the USM motion by setting \(\delta ^*=0\) and \(\omega _0=7\text {rad}/\text {s}>{\tilde{\omega }}_c\). In this case, the trivial relative equilibrium \(\tilde{{\varvec{v}}}_0={\varvec{0}}\) is stable, thus the bicycle motion should converge to a stable USM motion state. The experiment lasts about 36 seconds until the bicycle arrived at the boundary of the experimental site. Figure 17a–c shows the curves of the measured lean angle \({\hat{\theta }}\), steer angle \(\delta \) and intercept term \({\tilde{c}}_0\) with respect to time t. We can see that both \({\hat{\theta }}\) and \(\delta \) are subject to large disturbances at the initial stage, but after \(t\ge 20\text {s}\), the disturbances decreases. In particular, although the value of \(\delta \) goes into the neighborhood of 0, a relative large error exists in the measured value of \({\hat{\theta }}\). This means that the gyroscope sensor contains certain drift error. Figure 17d shows the trajectory of the contact point \(P_r\) of the rear wheel, which exhibits that the bicycle under the modified control law can achieve a long-distance stable USM motion state. Here, as the range of the bicycle’s motion is relatively large, it is not possible to capture the entire process of the bicycle using the unmanned aerial vehicle. Therefore, we utilize the experimental data of \({\hat{\theta }},\delta ,\phi _r\) and their numerical derivatives to solve the reconstruction equation (31) in Part I, and then calculate the trajectory \((x_r(t),y_r(t))\) of \(P_r\). However, the process of the bicycle converging to the USM was captured and presented in the video movie USM-MC-V in the supplementary materials [36].

When the bicycle moves in a USM motion state, the true steady value of the lean angle should be equal to \(\theta _0=0\). However, we see from Fig. 17a that \({\hat{\theta }}(t)\) converges to a negative constant \({\hat{\theta }}_0\) which approximately equals \(-0.0134\text {rad}\), corresponding to the gyroscope sensor with a drift error \(e_0=-0.0134\text {rad}\). On the other hand, due to the effect of the drift error, the control variable \({\tilde{c}}_0(t)\) should theoretically converge to a constant which equals \(-c_1e_0=-0.0536\text {rad}\) (since the true intercept term \({\tilde{c}}_0(t)+c_1e_0\) should converge to 0). Figure 17c shows that \({\tilde{c}}_0(t)\) indeed converges to the neighborhood of that value.

The second experiment, called as UCM-M-experiment, was carried out to examine the bicycle’s motion in a stable UCM state with a desired steer angle \(\delta ^*\). We set \(\omega _0=7\text {rad}/\text {s}\) and \(\delta ^*=0.5\text {rad}\). Theoretically, system (19) in this case has an exponentially stable nontrivial relative equilibrium which equals \(\tilde{{\varvec{v}}}_0=(\theta _0,0,{\tilde{c}}_{0,0})^T=(-0.1893,0,-0.2574)^T\).

Figure 18a–c presents the curves of the measured lean angle \({\hat{\theta }}(t)\), measured steer angle \(\delta (t)\) and time-varying intercept term \({\tilde{c}}_0(t)\) with respect to time. The experiment lasts 100 seconds. These three variables converge to constants approximately equal \({\hat{\theta }}_0=-0.1852\text {rad}\), \(\delta _0=0.5001\text {rad}\) and \(\hat{{\tilde{c}}}_{0,0}=-0.2408\text {rad}\), respectively, meaning that the bicycle’s motion converges to a stable UCM motion state. Figure 18d shows the trajectory of the bicycle on the horizontal plane within the time interval \([30,60]\text {s}\). Clearly, the trajectory forms an approximate cycle. The bicycle in the stable UCM motion was recorded in the video movie UCM-MC-V presented in supplementary materials [36].

Clearly, the error between \(\delta _0\) and \(\delta ^*\) is negligible, indicating that the steer angle converges to the desired value. However, due to the drift error of the gyroscope sensor, difference between the theoretical predicted values of \((\theta _0,{\tilde{c}}_{0,0})\) and the measured values of \(({\hat{\theta }}_0,\hat{{\tilde{c}}}_{0,0})\) exists. Basically, we can estimate the value of the drift error \(e_0\) in two ways: on the one hand, we have \(e_0={\hat{\theta }}_0-\theta _0=0.0041\text {rad}\) according to the experimental data of the lean angle; on the other hand, we have \(e_0=({\tilde{c}}_{0,0}-\hat{{\tilde{c}}}_{0,0})/c_1=0.0041\text {rad}\) based on the data of the intercept term. The values of \(e_0\) calculated by the two methods are the same, which indicates that the theoretical model is accurate enough.

The third experiment, called as LCM-M-experiment, was conducted to verify the bicycle’s limit cycle motion when \(\omega _0\) is slightly less than \({\tilde{\omega }}_c\). We set \(\omega _0=6\text {rad}/\text {s}\) and \(\delta ^*=0\text {rad}\). In this case, system (19) has an unstable trivial relative equilibrium \(\tilde{{\varvec{v}}}_0={\varvec{0}}\), but a stable limit cycle will occur. Figure 19d shows the trajectory of the bicycle within about one period of the limit cycle. We can see that the bicycle turns corners with the direction changing alternately. Although the variables \({\hat{\theta }},\delta ,{\tilde{c}}_0\) can return to the starting point within each period of the limit cycle, the horizontal displacement of the bicycle is nonzero, agreeing with the theoretical prediction shown in Fig. 16d. The bicycle in the stable limit cycle motion was recorded in the video movie LCM-MC-V presented in supplementary materials [36].

Figure 19a–c shows the curves of the measured values of lean angle \({\hat{\theta }}(t)\), steer angle \(\delta (t)\) and the time-varying intercept term \({\tilde{c}}_0(t)\) with respect to time t. The experiment lasts 120 seconds. Agreeing with the theoretical prediction, these three variables all exhibit a tendency to oscillate periodically, corresponding to a stable limit cycle in phase space. On the other hand, the up and down peaks of \(\delta \) are basically symmetrical around \(\delta =0\), meaning that the measurement accuracy of the steer angle is high enough. By observing Fig. 19a, c, we can find that the curves of \({\hat{\theta }}(t)\) and \({\tilde{c}}_0(t)\) are not symmetrical around zero coordinate axis. The reason is the existence of the drift error of the gyroscope sensor.

7 Conclusion

In conclusion, this paper presents experimental verification of the theoretical and numerical results obtained in Part I, while addressing uncertainties inherent in real bicycle systems. The experimental results are qualitatively consistent with the theoretical predictions, confirming the stability of the bicycle system under different control parameters for uniform straight motion (USM) and uniform circular motion (UCM), as well as adherence to counter-steering (CST) driving rule. Error source analysis reveals that the drift error of the gyroscope sensor is the major source of system error.

To compensate for the drift error, a modified linear control law is proposed, which incorporates a time-varying intercept term modulated by the CST driving rule. The three-dimensional equations governing the dynamics of the controlled bicycle are analyzed for stability, and the control parameters for stable USM and UCM states are determined. The modified control law enhances the robustness of the system against disturbances, and theoretical analysis suggests the possibility of a supercritical Hopf bifurcation leading to limit cycle motion with alternating direction changes and nonzero horizontal plane displacement.

Experiments conducted to verify the dynamical behaviors of the controlled bicycle under the modified control law demonstrate stable USM, UCM, and limit cycle motion states, which are consistent with the theoretical predictions. Overall, this paper not only confirms the theoretical results from Part I, but also presents an effective control method to handle uncertainties in real bicycle systems.

The study of this paper may also find possible applications in smart transportation. In this paper, we show that the control laws, whether linear or nonlinear, can be used as servo constraints to improve the dynamic quality of the original bicycle systems. When other intelligent algorithms are added, such as the error correction algorithm, the movement of the bicycle will be more flexible and intelligent. Clearly, the study of this paper can provide a crucial theoretical foundation for the realization of autonomous smart bicycles and hold significant practical significance for the future of smart transportation.