Construction and Control of the Bipedal Walking Robot

. This article describes the design and testing of a walking robot. In the first stage, the mechanical behaviour of human ’s lower limbs during the walk was observed and described to acquire data for the development of a simplified algorithm to control the legs of a walking robot. The second phase was the designing stage of the bipedal walking. Each robotic leg was equipped with six servo-drives. A gyroscope module with an accelerometer was used to measure the current position of the robot’s structure in space. The controller of a walking robot was developed and programmed based on Arduino Mega. The control algorithm stabilises the robot in an upright position. Potentiometers placed in the axes enabled measurements of angular positions of individual servos during the movement and were used to control walking. The programming of the movement is done through a smartphone which communicates with the robot's main controller using Bluetooth. Finally, the article describes the testing of the developed bipedal walking robot, documenting satisfactory results in walking.


Introduction
In recent years, the interest in building robots which can directly cooperate with humans has increased significantly. Such robots can be used for many personal and entertainment purposes. Therefore in recent years, a lot of studies have been conducted on bipedal walking robots [1][2][3][4]. Numerous research institutes and companies have begun building robots resembling. Such robots are mostly designed to operate inside home. These robots move on wheels or walk in a manner similar to humans, and sometimes should be able to walk up the stairs. Such ability can be easily designed if the robot's legs resemble the human limbs. This is because our legs and the mechanics of walking have been evolving for millions of years in order to adapt to movement on two legs in a rocky outdoor environment. Therefore, from the engineering point of view, it is much easier to use a design developed and validated "by the nature" itself.
The aim of this article is to present the design of a robot's structure that resembles human lower limbs. To this end, the human leg movements have been studied, measured and observations were reapplied in control of the robot's artificial limbs. The main scientific problem is to develop the smooth walk of the robot. Special attention was given to the problem of the robot stabilisation, which was solved by using a position feedback linkage. An accelerometer and a gyroscope have been installed in the robot, in order to deliver the feedback information about the current position of the robot's structure in the space. The construction and investigations of a two-legged robot may also be the starting point for further investigations, for example in the design of lower limb prostheses and rehabilitation exoskeletons.

Analysis of the human walk mechanism
In order to model the robot movement to resemble human gait, the mechanism of human legs and walk were observed and investigated. The simplest way of human walking which can be applied in robots is "static walking", characterised as a locomotion of a biped, in which the feet are lifted alternately, while one foot is at all times on the ground. During the movement it must be assured that the centre of the robot's mass is always located above the foot area, this is why such movement is called "static". Our analysis has begun with the identification of individual joints of the lower limbs, and their possible movement parameters. Using the Kutzbach-Grubler formula, the mobility of the human lower limb can be calculated as equal to 30 [5]. Although such high mobility is feasible, it would require the use of 30 independent drives, which would lead to unacceptable complications in mechanics and in control. Therefore, the reduction of degrees of freedom of robot legs was necessary. To this end the analysis of possible two-leg movement has been made by different investigators.   1 illustrates the idea of a Poincaré map for walking motions for a planar bipedal walking robot with knees. The walk is a result of a periodic cycle, consisting of two steps: one made by the left foot and the second one made by the right foot. This cycle is repeated starting from posture A to posture H. Another approach to the development of bipedal walking, based on the reference [5], may be proposed using three planes of the human body, shown in Fig.2.
Thanks to the definition of these planes, it is possible to describe individual movements of the human body. Bending and straightening movements are carried out in the sagittal plane. The frontal plane enables abduction and addition. In the transverse plane, rotational movements take place. The first most complex point in terms of movement is the hip joint. The hip joint enables rotational movements, bending and straightening as well as abduction and adduction, hence it moves in all three planes. The next complicated joint is the knee joint, whose movements are limited to bending and straightening in the sagittal plane. The ankle joint is the last one necessary for proper movement, thanks to which bending and straightening movements are possible, as well as small movements allowing the body to deflect in the frontal plane. Fig. 3. Phases of human locomotion [12].
Paper [12] provides a synthetic yet critical overview of the key biomechanical principles of human bipedal walking and their current implementation in robotic platforms (see Fig. 3).
Having analysed the material from the basic overview of human limbs movements, it was resolved that the robot should be designed with 6 degrees of freedom per limb. The phases of such robot movements are shown in Fig. 4.

Mechanical construction of the walking bipedal robot
The mechanical drawing of the designed robot is shown in Fig. 5. Every leg is composed of 5 elements: the foot, the ankle, the knee, the thigh and the hip, responsible for the sagittal and frontal movements. The limbs are connected by the robot body, which is supposed to mirror the human body based on the pelvis.
The robot's elements i.e. the body and the legs are composed of rigid mechanical elements and standard, commercially available elements, like bearings, screws, orcs etc. We have made the rigid elements and special load-bearing using the Fused Deposition Modelling (FDM) method of 3D printing [6]. Polylactide (PLA) [7] is chosen which is characterised by its full biodegradability and low density. The use of 3D printing has reduced costs, but also limited the use of disjoint connections due to the possibility of creating most intricate shapes; it has also allowed reducing the mass of the entire construction by about 25% compared to aluminium.
The overall dimensions of the design are: 46 cm high, 15 cm wide, with a mass of only 1,400 g. All elements are designed to enable the connection of servo-drives. TowerPro MG996R servo-drives have  been used in the construction. These are standard servo-motors with a mass of 55 g and a torque of 0.9 Nm. The high moment of the servomechanism of such small elements is obtained by using multi-stage gears embedded in the servo-motor structure. The photos of the assembled robot are shown in Fig. 6.

Walking robot control
In Fig. 7 the block diagram of the robot control system is shown. The main controller is based on Arduino Mega module with AVR ATmega 2560 [8] microcontroller, which is the main element of the controller system. It has 54 digital input/output pins (14 of which can be used as PWM outputs), 16 analogue inputs, 4 UARTs, USB connection, a power jack and an ICSP header. The Mega is compatible with most shields designed for the Arduino Duemilanove or Diecimila. The control module is equipped with sensors built into the interior of the integrated circuit MPU6050 [9], which use the I2C interface to communicate with the microcontroller. It contains two sensors: a 3-axis accelerometer and a 3-axis gyroscope. The MPU system is equipped with DMP (Digital Motion Processor) unit hardware, which allows data to be converted into a position relative to the Earth. The sensor generates the calculated data in the form of a 16bit number for each measurement. The use of this type of sensor allowed reading the deviations of the robot from the equilibrium position. In this way, depending on the size of deflection, appropriate servo-drives are actuated to keep the structure of the robot in a stable position.
The whole robot is powered by a Li-Pol type battery with a nominal voltage of 7.4V. The servomotors operate at 6V and inverters have been used to stabilise the voltage at this level. All elements used in the control system are shown schematically in Fig. 8. The robot's control system was designed with widely available electronic units. The robot's remote control was enabled by the software working on a mobile phone with Android operating system. This software was written in the MIT App Inventor grammar programming environment. Using the software one can choose how the robot will move, by sending appropriately coded information through Bluetooth communication link. The screen generated by the software on smartphone is shown in Fig.9. The software sends to the robot the following orders: Generate a walk, Squat, Stand up straight and Maintain balance. Moreover, the smartphone screen shows basic information about robot's current condition. The robot can perform four types of operation: walking, squatting, standing up and maintaining balance. The mode is selected by sending appropriate command to the main controller from a mobile phone via the HC-06 Bluetooth module. The HC-06 module communicates with Arduino Mega (the main controller) by serial UART [10] transmission. The main controller reads the operation which may be 1, 2, 3 or 4.
The simplified robot control algorithm is shown in Fig.10. Selecting "Generating a walk" in the application shown in Fig.9 sends the value of variable operation equal to 1. As a result, the control algorithm enters and executes the part of the algorithm responsible for executing the walk (grey blocks in Fig.  10). This movement is divided into two phases. The first phase is the movement of the left leg forward while the right leg is kept backwards. This phase allows the robot to perform the step with the left foot. In the second phase of this block, the right leg moves forward while the left leg is kept backwards. In order to perform the appropriate motion of servo drives the algorithm with pulse width modulations (PWM) output signal is used. However, in order to improve the quality of robot's stabilisation and walking not only 3 main drives were used, but also additional three per leg, which allowed tilting the robot sideways while walking.
The potentiometers applied in joints allowed to read the current angular position of the robot's legs during movements. The legs' positions are sent to a desktop computer through UART communication. The angular positions in time (for individual joints) are presented on a screen and may be recorded as well. Fig. 11 shows the photos of robot's motion phases during two steps, starting from the right leg and ending with the left leg step.    The main scientific problem of the paper was to develop an algorithm for the robot movement control. Its development proved to be a serious challengebecause the direct implementation of the phases of limbs movements presented in Fig. 3 and Fig.  4 into the control algorithm was insufficient for the robot to walk. The problems related to the movement control of biped robot are described in detail in the paper [13]. The design of the control algorithm started by giving boundary conditions of motion to avoid unexpected displacement of servos. The first problem encountered was the drift characteristic of the gyroscope and the noise of the accelerometer signal. These problems were solved by using a filter whose task was to combine the signal from the accelerometer and the gyroscope with the Kalman filter. Another situation to be solved was the frequency of measurements of tilts from the equilibrium position by the MPU 6050 module, it was necessary to create threads in the algorithm that allowed reading information at a given time interval, allowing for stabilisation of the structure and simultaneous drive of the engines. The selected results are presented in diagrams. The joints in the ankle, knee and hip were responsible for the sagittal plane movement. Their angular position change in time for one of the limbs is shown in Fig. 12, 13, and 14. Figures 12 to 16 show the angular position patterns for four such steps.

Investigations Results
The servo position control system controlled the position of every servo-drive during the movement, using the potentiometer mounted in every axis.
Potentiometers deliver the feedback signals, thanks to which a given servo position is obtained. During the walking also movements in the frontal plane were used. The human motor apparatus enables this through the hip joint and to a small extent the ankle joint. The articulated reflection of these joints is presented in Fig.  15 and 16.  In order to a make clear analysis of the charts presented above, the time periods in individual signals are listed in Table 1 with explanations.

Conclusion
Based on the literature overview in the field of walking robots, we have been developing our own bipedal walking robot and its control algorithms that are simple and efficient. The control laws are typically linear. This algorithm enables basic walking on a flat terrain. However, in rough terrain and in the presence of disturbances, it was concluded that the construction requires six degrees of freedom on each leg. The obtained results can be seen on a movie available on the website of the Department of Mechatronic Devices at the Poznań University of Technology [14]. The developed robot's structure is well suited for testing of different control algorithms that allow performing the basic walking activity. Our robot is the base for future research and development of new solutions, which may also support the lives of people with disabilities of lower limbs. The presented design is planned to be improved in the future. The improvements are likely to include an interesting area of possible future developments focused on energy consumption, as presented in paper [15].