Keywords

1 Introduction

1.1 Literature Review

Control of a two-wheeled vehicle which kinematic are similar to the inverted pendulum is much more difficult than statically stable vehicles. The control system need to take into account following parameters: influence of center of gravity and load changing, possibility to quiqly changing direction and velocity of movement, possibility to stay in a stable position.

Authors of [1] propose to use of the fuzzy controller. Unfortunately, this is a complicated procedure that requires the adequate number of fuzzy sets, resulting in a significant amount of memory consumption. The more conventional way of regulation is to use a classical PID controller [2] whose characteristic are determined by matching the appropriate coefficient that give a specific response to the value speed of change and time of deviation from equilibrium.

To allow driving with a change of direction, a more advanced PID controller, cascaded, must be used [3]. The similar type of regulation was applied in the case described by the authors: At the input of the controller P is given the set speed from smartphone and current speed of the vehicle. The output is corrected the set tilt angle of the robot, which hits the input of the PD controller and is compared to the actual deviation from the vertical. A PWM signal is sent to the output and controls the DC motors. In addition, there is a third controller (P) which maintains the same speed of both wheels. The key element in designing the self-stabilizing device is the appropriate selection of regulator settings. The current position of the device is read from the signal received from the gyroscope and the accelerometer.

Article [4] presents evolutionary approaches for designing inverted pendulum (RIP) controller including genetic algorithms (GA), particle swarm optimization (PSO), and ant colony optimization (ACO) methods.

Article [5] described stabilization problem from the biomechanical point of view. Authors of [6] detailed described is a human-sized dynamically stable mobile robot that balances on a single ball. They performed several tests, that demonstrate the ballbot balancing and locomotion capabilities. The paper illustrates also some interesting human–robot physical interaction behaviors that can be achieved as a result of the ballbot’s dynamic stability.

Article [7] presented control of Bicyrobo, which is an unstable system associated with many sources of uncertainties due to un-model dynamics, parameter variations, and external disturbances. Authors used robust and optimal control technique. The authors of [8] presented an unusual application of the problem presented in the article. They described inverted pendulum by placing the pendulum on top of a quadrotor aerial vehicle. The issues related to energy consumption in the operation of the inverted pendulum are discussed in the paper [9]. In publication the dynamic model of a wheeled inverted pendulum is analyzed from a controllability and feedback linearizability point of view [10]. This allowed to control the position and speed of the system.

The issue of the use of the inverted pendulum mechanism for applications in education is presented in the publication [11]. The device described by those citing the said work may have similar applications. For tests of this type of devices, vision systems can also be used, as shown in [12, 13].

On the basis of the literature, it can be concluded that the inverted pendulum as a mechanism is an interesting object from the control point of view. The authors decided to build a device with a modified structure, which would allow to study the influence of an additional moving, hanging mass placed in the upper part.

2 Mobile Platform Structure

2.1 Mechanical Parts

The aim of the publication was to build a mobile platform in an inverted pendulum arrangement, which would be equipped with a hanging mass constituting an additional disturbance. Devices built in this way can be used in the future to move elements at high heights in warehouses in the conditions of limited maneuvering space. The functional purpose of the proposed mobile platform is to compensate for the influence of moving masses on the various heights.

The built-in robot consists of the rectangular plates that form of four levels (Fig. 1). To the bottom plate (first level) two DC motors integrated with the gear are attached. On the second level there are parts of the control system: motor driver modules and the main PCB contain of the microcontroller and inertial sensors. The third level was designed for power supply: There is a battery, power switch, two voltage converters and two fuses. To the fourth plate based on the thin-walled angle bars with dimensions 30 x 30 mm, which allows realization testing of the device. The total height of the model is 129 cm and the weight is equal to 1.5 kg.

Fig. 1.
figure 1

The 3D model of the mobile self-balancing platform.

2.2 Electronic Controller

Genuino 101 is used as the main module that manages the entire electronics of the built robot (Fig. 2). It is equipped with a 32-bit dual-core Intel microcontroller based on ARC architecture, clocked at 32 MHz. As the IMU sensors Authors used 6-axis accelerometer and gyroscope. The DC motors are controlled by L298 bridges. The system is powered by a lithium-polymer battery with nominal voltage 11.1 V. The DC motors are supplied with 9 V voltage. This treatment reduced the current drawn and allowed stabilizing the system dynamics during the battery discharging.

The control system are equipped with Bluetooth module HC-06 to communicate with mobile devices.

Fig. 2.
figure 2

The electronic controller scheme.

The current data e.g. angle of inclination, wheel speed, set speed, are sent through UART interface with a maximum available speed of 250000 baud/s, to minimize the slowdown of the working program. These data are updated with a frequency of 10 Hz.

2.3 Control Algorithm

The robot’s built-in software allows two-wheel balancing and driving at a set speed with the turn option. To make this possible, it is necessary to read and process the data from the sensors and the appropriately calculated PWM signal sent to the motors. In addition, for security purposes, to smartphone the data is sent about the battery powering device charge status.

The structure of the program is based on the multitasking architecture and its divided into five subprograms. In order to no microcontroller load, each thread, depending on the priority level, is realized with an different frequency.

The main thread, with the highest priority, is realized at a frequency equal to 100 Hz. This is the most important and most comprehensive part of the software. Initially, signals from the accelerometer and the gyroscope are read and appropriately converted according to a predefined measuring range. Next, on the base of accelerometer signal, current angle is calculated. For the reduction of noise, the average of the last four readings is calculated. The next step, the pretreated data is modified by the complementary filter formula - the final angle value is derived from the gyro and accelerometer fusion. The complementary filter [5, 14] can be described by the following formula:

$$ \theta_{f} (k) = a[\theta_{f} (k - 1) + \omega_{g} (k) \cdot dt] + [1 - a][\theta_{a} (k)] $$
(1)

where: θf(k), θf(k − 1) - output angles; a – complementary filter coefficient; ωg(k) - angle velocity from gyroscope; θa(k) – angle from accelerometer; dt – signal sampling period.

For the entire procedure of obtaining the current angle described above, the interrupt handler function (used to read signals from the encoders) is disabled. This is the most important part of the entire code. When the interrupt handler function is re-enabled, the set speed and the current speed are updated and the proportional speed controller is induced to calculate the set swing. Then the angle deviation is calculated and depending on its size and character (forward/backward tilt) the program selects the instruction, introducing the appropriate correction: determining the direction of rotation of the motors and inducing the proportional-derivative angle controller. Before the calculated PWM signal is sent to the motor controllers, it is additionally corrected by the proportional controller of driving direction which compare speeds on the both wheels.

Other threads ale responsible for:

  • calculating current speed,

  • receiving values from the smartphone,

  • sending data to the computer,

  • sending battery charge value via Bluetooth to the smartphone.

3 Research Methodology and Experimental Investigation

The physical properties of the object like moment of inertia and kind of used drive are influenced on object behavior. The main aim of the research was to check the impact of changing the center of gravity. In described here case, these settings were dependent on: the diameter of the wheels, DC motors dynamics (velocity, torque), the mass of the entire system, center of gravity location. The controllers settings were taken experimentally and have not been changed during investigations. The individual controller coefficients were equal to:

  • proportional velocity controller: kp = 0.072,

  • PD angle controller: kp = 35,5; kd = 3,5,

  • proportional controller of the driving direction: kp = 17.

As an additional element, the wooden panel with a weight of about 200 g was used, which gave the total weight of the whole set of about 1.7 kg.

Fig. 3.
figure 3

Stabilization with a static load assembled on height 40 cm

Fig. 4.
figure 4

Stabilization with a static load assembled on height 52.5 cm

Fig. 5.
figure 5

Stabilization with a static load assembled on height 65 cm

Fig. 6.
figure 6

Stabilization with a static load assembled on height 77.5 cm

Fig. 7.
figure 7

Stabilization with a static load assembled on height 90 cm

The above graphs (Fig. 3, 4, 5, 6 and 7) have shown the robot’s balance with additional mass. During the initial stage, the readings of the deviation angle were recorded during free balancing. The first four graphs show that the robot is within the range of −0.5 to 0.5°, while in the case of placing the mass at 90 cm from the ground, the angle of deviation from the vertical regularly exceeds this value, remaining in the range of ±0.7°.

After about twenty seconds (second stage), the external force was applied to the construction, resulting in a dynamic deflection of less than 6° from the home position (about 0°), thus resulting in a steady-state knock out. At that point, the time measuring of its return to a relatively stable state began. The return period to the steady state started at the time of the peak deviation from the vertical and ended when the deviation point was not over ±1°. On the graphs can be seen that the period of system stabilization increases with the lifting of additional mass. With the mass hanging height equal to 90 cm, the device was unable to return to a stable state. Collected data are shown in the Table 1.

Table 1. Height of the assembled load combined with stabilization period of time

In order to better illustrate the tests results, Authors prepared the graph which show the change of the period T as a function of the assembly load height h (Fig. 8). This relationship can be approximated using the exponential function:

$$ {\text{T }} = \, 0,0112{\text{e}}0,1062{\text{h}} $$
(2)
Fig. 8.
figure 8

Stabilization time depending on mass height assembly

The curve on Fig. 9 can be characterized by the logarithmic function. The stabilization period of the system increased in relation to the change in altitude of additional load. At a height of 90 cm, the robot has too high moment of inertia (to all structure), which disqualifies the possibility to return to steady state.

To complete tests, authors examined the behavior of the system after mounting the load at a height equal to 115 cm. The results was show on Fig. 9.

Fig. 9.
figure 9

Stabilization with a static load assembled on height 115 cm

After four seconds, robot lost his stability and his vertical deviation increased to over 6o. In this case the allowable mounting height of the additional mass has been exceeded and therefore system cannot balancing correctly.

The presented here robot can be characterized and described from the kinematic point of view as a type of the pendulum. During movement, the center of gravity is constant. However, a behavior of the system has been changed, when another physical pendulum is attached to it (Fig. 10). During the swing of the additional mass, the center of gravity of the robot changes dynamically. The object became highly nonlinear.

Fig. 10.
figure 10

Mobile platform with assembled pendulum

The additional mass (load) was connected to robot frame by used of plastic rod 400 mm length). Authors checked following values of additional mass: 10, 20 and 50 g. The following graphs show system behavior (Fig. 11, 12 and 13).

Fig. 11.
figure 11

Stabilization with hanging load - 10 g

Fig. 12.
figure 12

Stabilization with hanging load - 20 g

Fig. 13.
figure 13

Stabilization with hanging load - 50 g

In the first phase of the graph, for about 25 s, free balancing is shown (without external distortion). It can be seen that the device, despite of the small movements of attached pendulum, is able to maintain a stable position without major problems. The second phase, which started about twenty-five seconds, Authors extortion pendulum to swinging with an angle equal to 45°. All graphs show sudden, significant deviations from the vertical position. However, the waveforms in each case is slightly different: in the first two graphs (Fig. 11, 12), after the initial sharp deviation, the oscillations regularly increase to the certain level. When it is reached, the oscillations are suppressed to about 4° and then increase again. In the case with the attached mass of 20 g weight, can be seen a faster transition to the damping phase (the time of initial increasing is shorter). A different characteristic is observed in the system with an additional mass of 50 g (Fig. 13). The run is extremely irregular. Between deviations for 7° appear much smaller swings, with values less than 3°. This is probably due to the difference in frequencies of deviations in pendulum and the platform. Another feature that distinguishes this waveform from previous ones is the reached value after attenuation, which is only 2.4°. Nevertheless, in the next phase, the deviations of the system are again increasing, which, like in previous cases, stops at values from 5° to 6°, with a tendency of slight increase (with increasing mass). When the load increases, the limit of deviation also increases after which the attenuation starts.

Authors checked also the system properties with the additional mass equal to 100 g. The result was quite different (Fig. 14).

Fig. 14.
figure 14

Stabilization with hanging load - 100 g

After free, undisturbed balancing, lasting about twenty seconds, the swings of the system exceeded over 6° (Fig. 15). The loading of physical pendulum by mass of 100 g makes it impossible to keep the device in a relatively stable position, because the slightest swing causes significant shifts in center of gravity. In addition, after manually stabilizing the object, an attempt was made to tilt the pendulum to the angle of equal to 30°. At this value the center of gravity of the system changed dynamically and the robot was unable to stay on the wheels (resulting - immediate fall).

4 Conclusion

This article describes the stabilization of two-wheeled mobile platform with the variable center of gravity and swinging mass hanging to the platform frame.

The first step of tests was to increase the height of the additional mass. It has been shown that, when the center of gravity of the model is raised, its stabilization time increases logarithmically. For described here system the maximum value of the load hanging is 90 cm height. After exceeding this value, the system lose its equilibrium point and is no able to return to it.

The second step was to examine the behavior of the system after mounting an additional pendulum. The graphs show that even with the small mass of the pendulum, imbalance results in a lack of stability.

The built-in mobile platform can be used in two ways. The device can be supplemented with gripping elements, thanks to which it will be possible to move elements at high heights in spaces with limited maneuvering space, e.g. in warehouses. The structure of the steering gear allows for the compensation of the changing center of gravity of the steering gear. Another application is the use of the platform for research purposes.