Вы находитесь на странице: 1из 73

Biped Walking Humanoid

B.E. (CIS) PROJECT REPORT


By
Zubair Ahmed

Department of Computer and Information Systems Engineering

N.E.D. University of Engg. & Tech.,


Karachi-75270

Biped Walking Humanoid

B.E. (CIS) PROJECT REPORT

Project Group:

SUNDUS ALEEM

CS-28

ZUBAIR AHMED

CS-39

ANAS KHURSHID

CS-52

ANJUM MOZAFFAR CS-63

BATCH: 2010-11

Project Advisor(s):

Mr. GUL MUNIR UJJAN (Internal Advisor)

June 2014

Department of Computer and Information Systems Engineering


N.E.D. University of Engg. & Tech.,
Karachi-75270

ABSTRACT

Our project is to build biped human like robot called Humanoid. In this project we will be
working on walking control algorithm for the stable walking of a biped Humanoid on a flat
surface. Our project includes stable walking control techniques for a biped humanoid to perform
dynamic walking on a smooth surface. In reality, however, a typical room floor that appears to
be flat has local and global inclinations of about 2. It is important to note that even slight
unevenness of a floor can cause serious instability in biped walking robots. In this project, our
goal is to make walk humanoid on a normal floor. For walking motions, a suitable walking
pattern will be designed first. Online controllers were then developed and activated in suitable
periods during a walking cycle. The walking control algorithm was successfully tested and
proved through walking experiments on a flat floor.

ACKNOWLEDGEMENTS

Firstly we would like to thank Allah for giving us the courage and for opening His doors
of blessings upon us when we were stuck in difficult times. His mercy towards us made it
possible for us for completing the project.
We would like to acknowledge and extend our heartfelt gratitude to our internal advisor
Mr. Gul Munir Ujjan for his vital encouragement and support. He was always there for us
despite of his busy schedule. His comments and suggestion provided the valuable information
necessary to complete the project.
Besides our internal, we sincerely acknowledge the unstinting support and help offered
by our co-internal Mr. Aqeel Haider.
Last but not least, we thank our parents for supporting us during the course of
development of this project. Their understanding and love gave us the strength to tackle
problems and unforeseen situations.

CONTENTS

S.No

Page No.

1. 1INTRODUCTION
1.1 Introduction
1.2 Objectives and Motivations
1.3 Assistance and Help
1.4 Chapter Summary

1
1
2
3
3

2.

BACKGROUND
2.1 History of Humanoid
2.2 Scope of Humanoid in the world
2.3 Limitations and Constraints
2.4 Biped walking Humanoids background
2.4.1 Elvis
2.4.2 Elvina
2.4.3 Priscilla
2.4.4 Murphy
2.4.5 Guroo
2.4.6 Senchans
2.4.7 Viki
2.4.8 Humanoid DB
2.4.9 Pino

5
5
5
6
8
8
9
9
10
10
11
12
13
14

3.

THEORY & DESIGN


3.1 Challenges in Bipdel Walking
3.1.1 Dynamically vs. Statically Stable Walking
3.2 Design
3.2.1 Structure
3.2.2 Mechanical Design
3.3 System Overview
3.4 Communication
3.4.1 Wired Communication System
3.4.2 Wireless Communication System

15
15
15
17
17
18
21
22
23
24

4.

HARDWARE

26

4.1 Arduino MEGA2560


4.2 RDS3115 with U-angles
4.3 MPU6050 Gyroscope Sensor
4.4 Wireless Bluetooth Module

27
28
30
32

5.

SOFTWARE
5.1 Designing Software
5.2 Walking Control Algorithm
5.3 Interfacing the Servos Motors to Arduino MEGA2560
5.4 Programming the Microcontroller MEGA2560

33
35
36
38
39

6.

TESTING AND RESULTS


6.1. WIRED
6.1.1. Method of Testing
6.2.1. Results of Testing
6.2. WIRELESS
6.2.1. Methods of Testing
6.2.2. Pairing

40
40
40
43
43
44
47

7.

CONCLUSION

48

Appendix A: Datasheets of Arduino Mega2560

49

Appendix B: Interfacing The Servo Motor To Arduino

52

Appendix C: Arduino To Gyroscope Connection

53

Appendix D: Arduino Code

54

References

63

Bibliography

66

CHAPTER 1

INTRODUCTION

1.1 INTRODUCTION
The term "humanoid" was first used to denote fictional automata in the 1921 play R.U.R.
(Rossum's Universal Humanoids) by the Czech writer,
Many humanoids were constructed before the dawn of computer-controlled servomechanisms, for the public relations purposes of major firms. They were essentially machines
that could perform a few stunts, like the automatons of the 18th century. In 1928, one of the first
humanoid was displayed at the annual exhibition of the Model Engineers Society in London.
Invented by W. H. Richards, the humanoid Eric's frame consisted of an aluminum body of armor
with eleven electromagnets and one motor. The humanoid could move its hands and head and
could be controlled through remote control or voice control.
Recently, the research on humanoids has attracted many researchers. The research spans
from stability and optimal control, gait generation, human-humanoid and humanoid-humanoid
communication. In addition, humanoids have also been used to understand better human jobs.
Humanoids are being developed to perform human tasks like personal assistance, where they
should be able to assist the sick and elderly, and dirty or dangerous jobs. Regular jobs like being a
receptionist or a worker of an automotive manufacturing line are also suitable for humanoids. In essence,
since they can use tools and operate equipment and vehicles designed for the human forms, humanoids
could practically perform any task that human being can do as long as they have the proper software.

Humanoids as anthropomorphic walking machines have been in operation for more than
twenty years. Currently, research on humanoids and biped locomotion is one of the most exciting
topics in the field of robotics.

1.2

OBJECTIVES AND MOTIVATIONS


Now a days, many humanoids were developed for particular industrial, entertainment and

service applications.
The goal of this thesis is the derivation of a control methodology for stable walking of
bipedal humanoid based on concepts found in human motion. This goal is based on the
hypothesis that a control system similar to the human one will enable a humanoid to perform
locomotion. Obviously, neither all aspects of human motion can be controlled nor all capabilities
of human locomotion can be expected included. Balanced standing and the walking of a fully
articulated biped is the target forms of locomotion. This allows analyzing the control
performance during both static and dynamic motions of a complex robotic system. Further
modes of movement like running or jumping should potentially be viable.
The world needs humanoids for a countless number of reasons, including hazardous jobs
and automated manufacturing. Humanoids can work without any rest or eat, allowing
manufactures to streamline processes and improve outputs. Humanoids are employed in roles
ranging from cleaning up dangerous waste and chemical spills to disarming bombs and
protecting soldiers in the field. Modern humanoids were mostly designed for military use, and
are now being developed in the private sector for uses ranging from manual labor to helping
those with handicaps and mobility issues.
While the results of a single prototype surely cannot fully compete with the abilities of
machines developed over decades, it should at least show some of their drawbacks that can be

overcome. As in the natural example, a walking style of less clumsiness, higher speed, or better
eciency should be expected. Here in our project we intend to build a humanoid that can be
controlled through software and can perform stable walking on a flat surface.

1.3 ASSISTANCE AND HELP


Humanoid is a difficult area to start on without any prior experience in the field.
The practical help, guidance and opinions of algorithm and general progress of this project from
people already involved in this field has given a greater understanding of what is appropriate and
what does not work when working with virtual models (See Acknowledgements for details).

1.4 CHAPTER SUMMARY


Chapter 2 Background:
This chapter will discuss some history about the concept of humanoids and remotely
controlling humanoids to the use of humanoid. It also discusses constraints regarding
development of humanoid and what should be considered well before working on them
Chapter 3 Theory and Design
This chapter will provide a system overview of the project, showing how individual parts
will be linked together. This will also give a look up of the group project that how components
are interfaced with each other. Some basic ideas of communication system are also explained in
this part.
Chapter 4 Hardware
In this chapter, a detailed description is provided of the hardware used in this project.
This will include an introduction and details regarding hardware components that have been used
in this project. It will also provide information about the working of hardware components and
their features.

Chapter 5 Software
This chapter will have a detailed description of the software written for this project. This
will include descriptions of the code used for programming the humanoid side of the
communication link and also the software written for the remote computer side for the
communication. It will also provide information about interfacing the hardware components.
Chapter 6 Testing and Results

Wired
In this chapter portion of wired communication provides a description to test the wired,

serial communications link. The results of this testing will be presented and conclusions are
drawn from these results.

Wireless
Wireless communication part provides summarization that is used to test the wireless

communication links.
Chapter 7 Conclusions
This chapter will provide some closing remarks of the report, as well as Giving a
summary of what has been achieved.

CHAPTER 2

BACKGROUND

2.1

HISTORY OF HUMANOIDS
Concepts akin to a humanoid can be found as long ago as the 4th century BC, when the

Greek mathematician Archytas of Tarentum postulated a mechanical bird he called "The Pigeon"
which was propelled by steam. Yet another early automaton was the clepsydra, made in 250 BC
by Ctesibius of Alexandria, a physicist and inventor from Ptolemaic Egypt. Hero of Alexandria
(1070 AD) made numerous innovations in the field of automata. Machine humanoids perhaps
were the first autonomous walking machines in the world. It was the obstacles of their design
that led to the first real advances in walking automation biped humanoids, or often termed as
humanoid humanoids.
Remotely operated vehicles were demonstrated in the late 19th century in the form of several
types of remotely controlled torpedos. The early 1870s saw remotely controlled torpedos by John
Ericsson (pneumatic), John Louis Lay (electric wire guided), and Victor von Scheliha (electric
wire guided).

2.2

SCOPE OF HUMANOID IN THE WORLD


Among humanoid robot prototypes the most well-known is Honda humanoid robot

(Hirai et. al., 1998). This humanoid has the ability to move forward and backward, sideways to
the right or the left, as well as diagonally. In addition, the humanoid can turn in any direction,
walk up and down stairs continuously.

One of the most famous humanoid up till is the Honda ASIMO (21 October 2000).
However, Honda developed three prototype predecessors of the ASIMO humanoid. Further
improvements on these prototypes have helped ASIMO become recognized as the most
advanced humanoid robot in the world considering its artificial intelligence and impressive
movement capabilities. Multiple ASIMO humanoids are working together to serve coffee to
humans in a cafeteria.
Technical University of Munich created Johnnie, an autonomous bipedal walking
humanoid. Their main objective was to realize an anthropomorphic walking machine with a
human-like, dynamically stable gait.
They also released a new 25-degree of freedom (DOF) humanoid walking humanoid, called
Lola. The goal of this project was to realize fast and human-like walking motion.
They are becoming increasingly popular for providing entertainment too. For example,
Ursula, a female humanoid, sings, play music, dances, and speaks to her audiences at Universal
Studios.
Several Disney attractions employ the use of animatrons, humanoids that look, move, and
speak much like human beings, in some of their theme park shows. These animatrons look so
realistic that it can be hard to decipher from a distance whether or not they are actually human.

2.3 LIMITATION AND CONSTRAINTS


In order to organize the project more effectively the following constrains will set as a
framework for the cost, time, power consumption, and accuracy.
Power consumption Since the system requires battery to operate, power consumption
will need to be optimized. Power consumption is always an issue when it comes to humanoids,
motors are an integral part of any humanoid that requires power considerably more than any

other components used in humanoids, so care should be taken towards power consumption while
designing the humanoids and analyzing its requirements
Cost Cost is an important issue when it comes to an account of a research project. As
humanoid is still a research project although it is almost a decade when Honda have designed
first modern humanoid named ASIMO, so this project is still subjected to limited funding,
therefore, the design has to be within determined budget.
Time Time is an important factor when work is to be done on hardware components.
Hardware component usually requires special attention while working. So time management
should be done to have a reliable result.
Accuracy To get an accurate result from humanoid data errors must be eliminated or
minimized as much as possible. Special precaution should be taken to reduce human and
systematic errors.
Additional Consideration
Design factors that need to take into consideration include safety, reliability, and mobility.
Safety Consideration for overall safety must be taken into account in order to reduce
potential injuries. Hazardous material must be minimized.
Reliability - Since communication between the humanoid and the controller is wireless,
humanoid must perform commands effectively.
Mobility The new design must allow the humanoid to be manipulatable.

2.4 BIPED WALKING HUMANOIDS BACKGROUND:


The study of artificial arms and hands began in 1967 incorporating the technological assets
gained from developing the active prostheses started three years before. The studies had at first
aimed only to develop machines to perform manual labor in lieu of persons and emphasized
development of artificial hand mechanisms. Recently the aim has been to develop humanoids
which can perform intelligent work as well as manual labor.

2.4.1 Elvis

Figure 2.1 Elvis

Elvis is the oldest of the humanoids. Prototype 1 was assembled in the summer of 1998
and the initial projects included adaptive balance evolution and extensive hearing and vision
experiments. He took his first autonomous steps in April 2000 and participated in Expo2000 in
Hannover, Germany, the following summer.
Elvis is a low weight humanoid Developed at Chalmers University of Technology,
Department of Physical Resource Theory, Complex Systems Group. He has 23 degrees of
freedom, 6 in each leg, and 4 in each arm, one in the torso and 2 in the neck. Three independent
sensory systems provide visual information as well as a sense of pressure and acceleration.

2. 4.2 Elvina

Figure2.2 Elvina

Elvina is the second generation developed at Chalmers University of Technology,


Department of Physical Resource Theory and Complex Systems Group. It was designed to be a
low weight platform, serve as a full-scale prototype. The mechanical design aims to be as less
energy consuming as possible and to make it easy to keep the stability while the humanoid is
walking or standing. The Elvina humanoid has three independent sensory systems, vision,
pressure sensors and accelerometers.

2.4.3 Priscilla

Figure 2.3 Priscilla

Priscilla is a different class humanoid, it is modify based on a plastic full-scale


replica of a human skeleton reinforced with metal joints and hydraulic pistons. The project was
initiated in the summer of 2000. The Priscilla humanoid consists of a plastic skeleton with
titanium reinforcements and linear electric actuators.

10

2.4.4 Murphy

Figure 2.4 Murphy

The Murphy project at Uppsala University is part of the ongoing RFC-Uppsala effort.
The aim of the project for the spring 2002 is to make the humanoid robot Murphy balance, walk
and ultimately kick a football past a humanoid goalkeeper into the goal.
The Murphy is a humanoid robot based on an aluminum skeleton. He is powered by
hydraulics, which has some advantages and some disadvantages compared to electrical motors or
linear actuators. Murphy has 21 degrees of freedom, and a neural net that in turn is being trained
on a simulator control.

2.4.5 GuRoo

Figure 2.5 GuRoo

11

GuRoo is a humanoid robot platform, developed at the University of Queensland,


Department of Information Technology and Electrical Engineering. It stands 1.2m high with
limb proportions based heavily on anthropomorphic data. It consists of 23 Degrees of Freedom, 6
in each leg, 3 in each arm and an articulated spine and head. Actuation is achieved by a
combination of brushed DC and RC servomotors. A distributed multi-master system controls the
humanoid along a Controller Area Network. Vision processing is provided via a CMOS camera
connected to a dedicated Hitachi SH4 board.
SolidEdge, a solid modeling package, was used to design the mechanical structure of the
GuRoo.

2.4.6 Senchans

Figure 2.6 Senchans

Senchans is a project from Osaka University, Department of Adaptive Machine Systems


Graduate School of Engineering. The humanoid robot platform Fujitsu HOAP-1 (Humanoid for
Open Architecture Platform) that is 48 cm in height and 6kg in weight with totally 20 Degree of
Freedoms, 6 for each leg and 4 for each arm operated by RT-Linux. USB interface is used for
communication with a host machine. The basic control is done in terms of position and its cycle

12

time is 1ms. The acceleration and angular velocity sensors, joint encoders and FSR (force
sensing register) at foot surface are equipped.
2.4.7 Viki

Figure 2.7 Viki

Viki was developed at University of Southern Denmark. The Maersk Mc-Kinney Moller
Institute for Production Technology. The principle behind Viki is minimalistic design; the
minimalistic approach to the construction of Viki combines the bottom-up approach with the
new AI focus on interaction between physical properties and control (i.e. between body and
brain). The design of Viki is to minimal the complexity that is necessary to achieve the
mechanical properties and control for specific behaviors.
The control hardware is a custom-made printed circuit board with a 186-type controller
with 1.7MB flash, an IC bus, and another board with motor controller. They have developed the
possibility to integrate Bluetooth with the humanoid, in order to facilitate wireless
communication. The humanoid has a number of IR sensors, and can, for instance, detect a small
IR emitting ball over the distance of 2m-3m.

13

2.4.8 Humanoid DB

Figure 2.8 Humanoid DB

Humanoid DB (Dynamic Brain) was developed from the Kawato Dynamic Brain Project
of the Japan Science and Technology Corp. The purpose is to build an experimental tool to
explore issues of biological motor control, theories of neuroscience, machine learning, and
general-purpose biomimetic robotics. Humanoid DB is185 cm high, weight 80 kg, has hydraulic
actuators. For the vision system, it got two 2 degree of freedom eyes (pan and tilt), each with two
cameras (foveal and wide angle, corresponding to human foveal and peripheral vision). The
Sensors system consists of four cameras, an artificial vestibular system (three-axis angular
velocity, three- axis translational acceleration), and load sensors in 26 degrees of freedom,
position sensors in all degrees of freedom. The cost is around $1 million US.
Humanoid DB learns from demonstration by imitating the movements of a person. The
following are some things Humanoid DB had trained so far; learned to strike the tennis forehand
and backhand moves, it can also paddle a ball, it can also play air hockey against human, and
emulate a human dance.

14

2.9 PINO

Figure 2.9 PINO

Kitano Symbiotic Systems was the project developed PINO, contributed with ERATO,
JST, Osaka University and Sony CSL. It is design to be the platform research for robotics and
AI.Pino had a configuration of 26 DOFs. They are distributed in such way, each leg has 6 DOFs,
each arm has 5 DOFs, the neck has 2 DOFs and the trunk has 2 DOFs. The actuators it uses are
cheap, compact and high torque servomotors.
Pino has a sensors system consist of force sensor, posture sensor, joint angle sensor, and
vision sensor. Pino uses 8 force sensors on each foot, which can obtain foot forces, a posture
sensor on chest so that it can sense its bodys posture. Pino also has a vision sensor mounted on
head. All information of these sensors are sent to host computer via A/D converters (AD1264(PCI), vender CONTEC) and frame grabber (GV-VCP2/PCI, vendor I/O DATA Japan).

15

CHAPTER 3

THEORY & DESIGN

3.1 CHALLENGES IN BIPEDAL WALKING:


The task of getting a bipedal humanoid to walk can be divided into several separate
problems. For each of these challenges a solution must be found to achieve stable locomotion.
This section will shortly introduce this set of problems to enhance the understanding on the
subject matter of this thesis. However, rst there must be distinguished between two
fundamentally dierent ways of walking.

3.1.1 Dynamically vs. Statically Stable Walking


Walking can be performed in two entirely dierent ways: statically or dynamically stable.
In statically stable walking it is possible to freeze the motion at any time without risking
instability. This can only be achieved by always keeping the projection of the center of mass
within the support area of the feet with ground contact. For bipedal walking this creates the
necessity to rst fully move the weight of the body over the foot of the next stance leg before the
swing foot can leave the ground. As a result statically stable walking, while guaranteeing
stability is comparatively slow and tedious, consumes more energy, and limits the possible step
length.

16
Figure 3.1: Statically stable walking keeps the projection of the center of mass inside the support area,
dynamic walking allows for temporarily instability.

Figure 3.1 Statically Stable Walking

Dynamically stable walking, or dynamic walking in short, does not pose limitations that
hard on the trajectory of the center of mass. Dynamic walking means to constantly fall, but to
bring forward the swing leg in time to prevent tilting over. This far more ecient kind of
walking allows for higher velocity by larger step size, shorter double support phase, and less
time consuming adjustment of weight distribution. Figure 3.1 illustrates the dierence by
showing projection of the center of mass during a statically and dynamically stable step.
Statically stable walking can be observed in very slow or cautious locomotion, or in case highly
deliberate foot placement is necessary. In bipedal humanoids, both ways of walking can and have
been realized with dynamic walking being the considerably more challenging control problem.

17

Figure 3.2 Biped Walking

3.2 DESIGN
3.2.1 STRUCTURE:
The structure of a humanoid is very obvious from the word HUMANOID. Its body is
much like human that it has two legs, two hands and a body, quite similar to human being. Biped
walking Humanoid made to walk like human that makes HUMANOID more interactive than any
other humanoids.
The main task while designing the humanoid structure is to make it light weight and
robust so it can sustain high speed movement of actuators. We have used RDS3115 servo motors
to perform the movement. The body structure is made of stainless steel that ensures structure
should be light and rigid.

18

Figure 3.3 Structure of Humanoid

3.2.2 MECHANICAL DESIGN


The DOFs diagram of the HUMANOID is shown in Fig3.4. It has 22 DOFs and 2 DOFs
on the head, 2 DOF in the waist, 4 DOFs on each arm, and 6 DOFs on each leg. In this section,
the developments of the arms, waist, trunk and legs are presented as follow:

Figure 3.4 16 Servo Motors Humanoid Robot

19

1. Arms :
The mechanical design of arms has 4 DOF in each arm. The mechanism design
and the DOFs diagram of the arms are shown in Fig 3.5. The arms designed based on the concept
of size of the general human arms. HUMANOID combines one of the arms DOF with the body.
Therefore the first DOF of the arms is inside the body. This is contributive for the humanoid
balance when humanoid is walking. This design of arms can also be extended to make a proper
human hand that can hold objects.

Figure 3.5 Humanoid Arms

2. Legs:
The mechanical design of the legs are for imitate the human walking motion. There are 6
DOFs in each leg. The mechanism design and DOF diagram of the legs are shown in Fig 3.6 the
design purpose of the legs mechanism is the humanoid can accomplish the human walking
motion. This design can provide the legs to imitate the human walking motion. The legs
mechanism dimension of HUMANOID is shown in Fig. In order to realize light weight and
proper humanoid motion we have not used any steel bars or any other material to join two
servos. Servos are joined by the aluminum u-angles in order to connect servos with each other.

20

HUMANOID uses alloy to combine 2 DOFs as a cube in the hip and ankle. Therefore the first
DOF of the legs is inside the waist. This is contributive for the humanoid balance when
humanoid is walking. This design can lower the center of gravity of HUMANOID.

Figure 3.6 Humanoid Legs

3. Waist Joint:
The mechanical design of the waist is for the fall down. There are 2 DOF in the waist.
The mechanism design and the DOF diagram of the waist are shown in Fig. The two actuators of
the waists joint are placed on both end of waist joint (hips). The design purpose of the waist
mechanism is to accomplish the proper human motion. Humanoid combines one of the legs DOF
with the waist. The waist mechanism can design as a cube only use two simple mechanisms. The
waist structure is the center of gravity in the HUMANOID. Since this waist mechanism is the
highest stiffness and the center of gravity, the HUMANOID can move as high speed motion.
Battery pack and all the circuitry mechanism is placed on that steel cube body so HUMNOID
can maintain its weight balance.

21

Figure 3.7 Humanoid Waist Joint

Height

70 cm

Weight

4 kg

No of Motors

20

Total DOF

23

Table 1 Properties of HUMANOID

3.3 SYSTEM OVERVIEW:


The main tasks that need to be done for the humanoid are listed below.
Stability control: This is obviously a major task that needs to be taken care of for the
humanoid. If the humanoid is unstable (and falls over in the worst case) then the rest of the
system is effectively useless. Getting the humanoid to be dynamically stable is expected to be
quite a large burden for the microcontroller and the stability control needs to have priority over
all other tasks.
Movement: The movement of the humanoid will be intimately related to the stability control.
Both of these tasks are expected to require the most usage from the microcontrollers resources.

22

Sending data: This task involves sending data from computer to humanoid. The angles for the
servo motors will be sent in character array, each character contain servo motors degree from 0180
Receiving Data: on receiving end, characters will be converted into integers and stored in
integer array then these values will be assigned to servo motors

Figure 3.8 Structure of lower part

3.4 COMMUNICATION
Communication is an essential part of our project as we have to control our HUMANOID
through a PC based application, so we should have a proper communication algorithm for it. We
will be controlling our HUMANOID through both wired and wireless technology. Later in this
document we will be discussing software side in details. Here we will be discussing about
communication algorithm that we have designed and implemented to control our humanoid.

23

Figure 3.9 Communication Flow

3.4.1 WIRED COMMUNICATION SYSTEM


The need for a wired communications system is essential before start working on wireless
communication mechanism. A basic graphical description for this system is shown in figure
3.10.

Figure 3.10 Wired System - Basic Overview

The setup for this system handling all communications for the humanoid through the
serial port on the circuit board. This introduces an obvious problem, which is that the serial cable
will limit the mobility of the humanoid since the humanoid is actually connected to the remote
computer. Another problem it introduces which may not be so obvious, is that the presence of the

24

serial cable connected to the humanoid has quite a negative effect on the stability of the
humanoid. Some of the other main disadvantages of the wired system compared to the wireless
system include:
For a wired testing, we used Arduino MEGA2560. Humanoid has 16 servo motors each
of which is connected to 15 PWM pins of the Arduino. We can use any pin of the Arduino as
PWM pin so the remaining one servo motor is connected to any of the arduino pins. The Arduino
is programmed through Arduino software.

3.4.2 WIRELESS COMMUNICATION SYSTEM


Figure 3.11 shows a basic overview of the wireless communications system. One side of the link
consists of the humanoid with a mounted wireless Bluetooth transceiver. The other side of the
wireless link consists of another wireless bluetooth transceiver, embedded in a mobile or a laptop
bluetooth which is controlled by an application. All transmission of data between the humanoid
and remote computer then takes place wirelessly between the two transceivers.

Figure 3.11 Wireless System Basic Overview

25

When a Bluetooth switch is turns on it will detect the Humanoid through its MAC
address. Each device has unique MAC address. Software starts sending the serial data through
serial port.
The RFCOMM protocol emulates the serial cable line settings and status of an RS-232
serial port and is used for providing serial data transfer.

Figure 3.12 Wireless Communication

26

CHAPTER 4

HARDWARE

The hardware components that are used in our project are shortly listed in the table 4.

Components

Description

Arduino MEGA2560

Arduino MEGA2560 is a board made Arduino that uses


microcontroller Mega2560

RDS3115

S3315D is a servo motor specially designed for humanoids,


we have used 20 x SS35D servos in our HUMANOID

MPU6050 gyroscope sensor

MPU6050 is 3- dimension gyroscope that gives feedback of


the position of humanoid

Wireless Bluetooth Module

Wireless Bluetooth Module is a F2203 chip that used to


communicate with Bluetooth master device

Body

Stainless Steel body specially cut plates that are properly


designed for our HUMANOID

Battery Pack

Two Li-ion Battery 7.4 volts

U angles

U angles have bought with servos. These U angles are


properly fitted with SS315D servos.

Table 2 Components List

27

4.1 ARDUINO Mega2560


The Arduino Mega2560 has a number of facilities for communicating with a computer,
another Arduino, or other microcontrollers. We are using it in our project to communicate
humanoid with computer through serial communication.

Figure 4.1 Arduino Mega2560

The Arduino Mega 2560 is a microcontroller board. It has 54 digital input /output pins (of
which 15 can be used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial ports), a 16
MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button. It
contains everything needed to support the microcontroller; simply connect it to a computer with
a USB cable or power it with an AC-to-DC adapter or battery to get started. The Arduino Mega
can be powered via the USB connection or with an external power supply. The power source is
selected automatically.
External (non-USB) power can come either from an AC-to-DC adapter or battery. The
adapter can be connected by plugging a 2.1mm center-positive plug into the board's power jack.
Leads from a battery can be inserted in the Gnd and Vin pin headers of the POWER connector.
The board can operate on an external supply of 6 to 20 volts.. The recommended range is
7 to 12 volts. The Mega2560 has 256 KB of flash memory for storing code (of which 8 KB is

28

used for the boot loader), 8 KB of SRAM and 4 KB of EEPROM (which can be read and written
with the EEPROM library).

4.2

RDS3115 WITH U-ANGLES


Servo motors (or servos) is self-contained electric devices that rotate or push parts of a

machine with great precision. This high quality metal gear servo is designed to suite robotic
applications. Supplied with metal mounting brackets (pre-fitted) it allows to easily bolt multiple
servo's together to create robotic limbs, pan and tilt heads etc.
Servo motors are controlled by electrical pulses. An electrical pulses is provided with
variable width or pulse width modulation (PWM) through control wire. Three kind of pulses are
there minimum pulse, maximum pulse and a repetition rate. Servo motors can usually only turn
90 in either direction for a total of 180 movement, Servo motors are often centered at 90 to
get the right result. The PWM sent to the motor determines position of the shaft, and based on
the duration of the pulse sent via the control wire; the rotor will turn to the desired position. The
servo motor expects to see a pulse every 20 milliseconds (ms) and the length of the pulse will
determine how far the motor turns. For example, a 1.5ms pulse will make the motor turn to the
90 position. Lesser than 1.5ms moves it to 0 and greater than 1.5ms will turn the servo to 180.
Servo control: The servo motor can be moved to a desired angular position by sending
PWM (pulse width modulated) signals on the control wire. The servo understands the language
of pulse position modulation. A pulse of width varying from 1 millisecond to 2 milliseconds in a
repeated time frame is sent to the servo for around 50 times in a second. The width of the pulse
determines the angular position. For example, a pulse of 1 millisecond moves the servo towards
0, while a 2 milliseconds wide pulse would take it to 180. The pulse width for in between

29

angular positions can be interpolated accordingly. Thus a pulse of width 1.5 milliseconds will
shift the servo to 90.It must be noted that these values are only the approximations. The actual
behavior of the servos depends upon its manufacture. Pulse Widths = The Servos
Heartbeat=position. A sequence of such pulses (50 in one second) is required to be passed to the
servo to sustain a particular angular position. When the servo receives a pulse, it can retain the
corresponding angular position for next 20 milliseconds. So a pulse in every 20 millisecond time
frame must be fed to the servo.

Figure 4.2(a) Controlling Angular Position of Servo Motor using Pulse Width Modulation.

Specifications:

Weight: 60g

Wire length: 320MM

Speed: 0.18sec/60 at(6v),0.16sec/60 at(7.2)

Torque: 14kg.cm.at(6v),15kg.cm.at(7.2)

Voltage: 4.8v-7.2v

Rotation Angle: maximum 180

30

Connections:
>Brown: 0V
>Red: +5V
>Orange: Signal

Figure 4.2(b) RDS3115 WITH U-ANGLES

4.3 MPU6050 GYROSCOPE SENSOR


The MPU-6000/MPU-6050 family of parts are the worlds first and only 6-axis Motion
Tracking devices designed for the low power, low cost, and high performance requirements of
smartphones, tablets and wearable sensors.

Figure 4.3(a) MPU6050 Gyroscope Sensor

Motion interface is rapidly becoming a key function in many consumer electronics


devices including smartphones, tablets, gaming consoles, and smart-TVs as it provides an

31

intuitive way for consumers to interact with electronic devices by tracking motion in free space
and delivering these motions as input commands.
The MPU-6050 device combines a 3-axis gyroscope and a 3-axis accelerometer on the
same silicon die together with an onboard Digital Motion Processor which processes complex 6axis Motion Fusion algorithms. The device can access external magnetometers or other sensors
through an auxiliary master IC bus, allowing the devices to gather a full set of sensor data
without intervention from the system processor. The devices are offered in the same 4x4x0.9 mm
QFN footprint and Pin out as the current MPU-3000 family of integrated 3-axis gyroscopes,
providing a simple upgrade path and making it easy to fit on space constrained boards.

Figure 4.3(b) MPU-6000/6050 System Diagram

Motion sensing
Every robot is more or less unstable and can overbalance if there is no feedback from the
angle of the robot. So the motion processing and detection is the most concerned topic in robot
movements. There are two ways of motion detection:
Detecting the rotation with gyro sensors
Detecting motion with accelerometer
If the information of the gyro sensor is integrated, we will be able to get the position of
servos in the 3 dimension.

32

4.4 WIRELESS BLUETOOTH MODULE


Bluetooth module will be used for wireless communication of Humanoid.

Figure 4.4 Wireless Bluetooth Module

Serial port bluetooth, Drop-in replacement for wired serial connections, transparent
usage. It is simply used for a serial port replacement to establish connection between MCU and
GPS, PC to your embedded project and etc.
HC-06 has be designed Master or Slave when the factory, user couldn't change the role.
Features:
1Bluetooth protocol: Bluetooth Specification v2.0+EDR
2Frequency: 2.4GHz ISM band
3Modulation: GFSK (Gaussian Frequency Shift Keying)
4Emission power: 4dBm, Class 2
5Sensitivity: -84dBm at 0.1% BER
6Speed: Asynchronous: 2.1Mbps (Max) / 160 kbps, Synchronous: 1Mbps/1Mbps
7Security: Authentication and encryption
8Profiles: Bluetooth serial port
9Power supply: +3.3VDC 50mA
10Working temperature: -20 ~ +75 Centigrade
11Dimension: 26.9mm x 13mm x 2.2 mm

33

CHAPTER 5

SOFTWARE
Software is an important module of our project to control the movement of HUMANOID.
We have interfaced our HUMANOID with our software by both wireless and wire technologies.
Following are some tools we have used to build our software.

Operating System

Windows 8.1

Development tool

Microsoft Visual Studio 2013, Arduino IDE

Languages

C#, C(Arduino default)

Wireless Library

32 Feet Library

Office tools

Microsoft word, Microsoft excel


Table 4 Tools List

Microsoft Visual Studio .NET is an IDE for programming languages such as C, C++, and
C#. It is an IDE for the Microsoft Windows operating system and is aimed mainly, at
development for Win32 applications. We have used visual studio 2013 version for the
development. C# applications are broadly used in the office environment and in corporate, it is
the leading development tool in the industry beside java.

34

Figure 5.1(a) Microsoft Visual Studio .NET Interface

The Arduino ATMega can be programmed with the Arduino software. The Mega2560 on
the Arduino ATMega comes pre-burned with a boot loader that allows you to upload new code
to it without the use of an external hardware programmer.

Figure 5.1(b) Arduino IDE

35

5.1 DESIGNING SOFTWARE:


Designing of software besides making of HUMANOID is quite important as we have to
deal lots of things from it, the control movement of HUMANOID is done by this software. As
mentioned above software has been designed on C#. Our software has many functions such as it
consist of two major parts wired and wireless. As we have discussed earlier that we have used
Bluetooth for the wireless communication and for wired communication we will be using a USB
cable that will communicate directly with the Arduino board as Arduino have self-contained
programmer on its board.
The interface of our software is quite simple; it is capable to control each servo of
humanoid. Our software contains three main features.
1. Wired and Wireless (Bluetooth) Connection.
2. Testing of each Servos in humanoid
3. Movement of Humanoid

1. Wired And Wireless (Bluetooth Connection)


Our Software is capable to communicate with humanoid through both Bluetooth
and Serial port. There are two modes in our software, user can select wired if user wants
to communicate with humanoid through serial port. If user wants to connect through
Bluetooth he/she can switch to wireless mode. Both modes have feature to test each
servos of humanoid and to control its movement.

2. Testing of each Servos in Humanoid


Our software have feature where each servo can be tested. There are 16 combo
boxes in our software where user can choose angles for different servos and can test

36

them. There is one more option where user can test the whole position of humanoid by
sending different angles of all servos under one posture name.

3. Movement of Humanoid
Our software has two main movement of humanoid namely walk, stand. There are
two buttons for these three movements in our humanoid. Under these two buttons proper
angles of walking pattern, standing pattern has been designed. Humanoid will show the
respective movements on pressing these buttons.

5.2 WALKING CONTROL ALGORITHM


The proposed walking control method is based on a controller switching strategy, and
thus it is important to divide the walking cycle into several walking stages. In each walking
stage, suitable controllers are activated. Figure 5.2(a) below shows the walking stages and their
descriptions are as follows:

1st stage- lifts the left leg to its maximum flexion and height.

2nd stage- lowers the left leg until it makes complete contact with the
ground.

3rd stage -lifts the right leg to its maximum flexion and height.

4th stage -lowers the right leg until it makes complete contact with the
ground.

5th stage -this stage follows the 1st or 3rd stage, and brings the humanoid to a
standing pose with both legs landed on the ground

37

.
Figure 5.2(a) Walking Pattern

During walking, the walking stages 1-4 are repeated continuously. In particular, in the 2nd
and 4th walking stages, the single and double support phases coexist. A walking control
algorithm is developed that is composed of three control strategies, a real-time balance control
strategy, a walking pattern control strategy, and a predicted motion control strategy. This
walking control algorithm could make the biped humanoid robot walk stably on a normal room
floor.
Control strategy of Humanoid robot is described by the software flow diagram as shown
in Figure 5.2(b)

Start

Initialization the servos

Left Foot leaves the ground


Right Foot touches the ground

Left Foot moves forward


Right Foot grasps the ground

38

Both Feet on the ground

Right Foot leaves the ground


Left Foot touches the ground

Right Foot moves forward


Left Foot grasps the ground

Stop
Figure 5.2(b) A Software flow diagram of the movement of humanoid

5.3 INTERFACING THE SERVO MOTORS TO ARDUINO MEGA2560


The interfacing of servo to the arduino is shown in below, Figure 5.3. Here we are using
16 servos to model the humanoid, therefore, 15 PWM pins and 1 any other pin of arduino is used
to interface servo motors.

Figure 5.3 Interfacing of servo to Arduino MEGA2560

39

5.4 PROGRAMMING THE MICROCONTROLLER MEGA2560


The next step was to build a small program to run on the microcontroller Mega2560 in
order to prepare the communications with the PC.
. In the piece of code of a simple situation is coded were the PWM starts by reading bytes
from the PC side corresponding to the final desired position for servo. Afterwards, this desired
position is sent to the servo. The cycle ends by sending the actual position of the servo back to
the PC.
The code was compiled by using the arduino software and finally the code is uploaded to the
Mega2560.

40

CHAPTER 6

TESTING AND RESULTS

6.1 Wired
In this chapter, the results of testing for the wired communications system will be
presented.
This will include:
Detailed descriptions of how the system was tested.
Results of the testing.
Conclusions that can be drawn from the test results.
The serial data transmission sends the first bit, then the second bit, then the third bit and
so on. The advantage of this is that only one wire is needed for the transmission. Therefore there
are no problems with the propagation delay of the signal. The disadvantage is that the data
throughput is lower with low frequencies in comparison to the parallel transmission.

6.1.1 METHOD OF TESTING


For a wired testing, we used Arduino MEGA2560. Humanoid has 16 servo motors each
of which is connected to 15 PWM pins of the Arduino. We can use any pin of the Arduino as
PWM pin so the remaining one servo motor is connected to any of the arduino pins.
Program is written in arduino software which is then loaded to the arduino device. As
shown in figure 6.1.

41

In void setup () function we define the pin number of Arduino to which each servo motor
is connected through servo.attach () function.
In void loop () function we mentioned a delay i.e. after how much time the humanoid
stop walking and then again start walking.
We have made three functions for the movement of humanoid that are mentioned below:

void stand ()

void right_leg_forward()

void left_leg_forward()

void stand () : In this function the angles of each servo motor is set in such a way that the
humanoid become stable and stand in a straight position like as human. A pulse of width 1.5
milliseconds will shift the servo to 90.It must be noted that these values are only the
approximations. The actual behavior of the servos depends upon its manufacture.
void right_leg_forward() : The angles of the servo motors are set in such a manner that only
right leg of humanoid move forward while the left leg remain in a straight position to help
humanoid in moving forward.
void left_leg_forward() : Firstly the void right_leg_forward() function will execute then this
function will execute so the left leg which was initially in straight position will also move
forward. This is how the humanoid will move one step forward.

42

Figure 6.1 Arduino IDE Interface

The above three functions will execute continuously so the humanoid will walk in a
forward direction until we stop it to walk after some time.

This is how the system is tested through wired communication.

43

6.1.2. RESULTS OF TESTING


Following are the results that are observed from the testing.

Humanoid can able to stand and move in a forward direction.

Angles are not accurately detected because of manufacture issue due to which humanoid
cannot walk properly.

Speed of the servo motor is very fast so when function is executed the motor rotates very
fast that causes the misbalance of humanoid.

Body weight also affects the stable walking of Humanoid.

Servo motors may burn if there is too much deviation in angle.

6.2 Wireless
In this chapter, the results of testing for the wireless communications system will be
presented.
This will include:
Detailed descriptions of how the system was tested.
Results of the testing.
Conclusions that can be drawn from the test results.
The testing of the wireless communications system proved to be long and quite
frustrating, with the system not performing to a satisfactory standard despite the time put into it.
To show all the testing in this report would be tedious and unnecessary, so instead a
selection of tests will be presented which show the typical performance of the system as it stands
today.

44

6.2.1. METHOD OF TESTING


For the wireless testing, we used HC-06 Bluetooth serial module. Bluetooth serial
module is used for converting serial port to Bluetooth. It actually creates the virtual serial port.
These modules have two modes: master and slave device. The device named after even
number is defined to be master or slave when out of factory and cant be changed to the other
mode. But for the device named after odd number, users can set the work mode (master or slave)
of the device by AT commands.
The main function of Bluetooth serial module is replacing the serial port line, such as:
1. There are two MCUs want to communicate with each other. One connects to Bluetooth master
device while the other one connects to slave device. Their connection can be built once the pair
is made. This Bluetooth connection is equivalently liked to a serial port line connection including
RXD, TXD signals. And they can use the Bluetooth serial module to communicate with each
other.
2. When MCU has Bluetooth slave module, it can communicate with Bluetooth adapter of
computers and smart phones. Then there is a virtual communication serial port line between
MCU and computer or smart phone.
3. The Bluetooth devices in the market mostly are slave devices, such as Bluetooth printer,
Bluetooth GPS. So, we can use master module to make pair and communicate with them.
Bluetooth Serial modules operation doesnt need drive, and can communicate with the other
Bluetooth device that has the serial. But communication between two Bluetooth modules
requires at least two conditions:
(1) The communication must be between master and slave.
(2) The password must be correct.

45

However, the two conditions are not sufficient conditions. There are also some other
conditions basing on different device model.
Factory parameters of HC-06:
Some factory parameters of HC-06 are listed below:

Package size is 28mm * 15mm * 2.35mm.

Master and slave mode cant be switched

Bluetooth name: linvor

Password: 1234

Master role: have paired memory to remember last slave device and only make pair with
that device unless KEY (PIN26) is triggered by high level. The default connected PIN26
is low level.

Pairing: Master device search and make pair with the slave device automatically.

Typical method: On some specific conditions, master and slave device can make pair
with each other automatically.

Multi-device communication: There is only point to point communication for modules,


but the adapter can communicate with multi-modules.

AT Mode: Before paired, it is at the AT mode. After paired its at transparent


communication.

During the communication mode, the module cant enter to the AT mode.

KEY: PIN26, for master abandons memory

Consumption: During the pairing, the current is fluctuant in the range of 30-40m.The
mean current is about 25mA. After paring, no matter processing communication or not,

46

the current is 8mA. There is no sleep mode. This parameter is same for all the Bluetooth
modules.
The following Table 6.2 is a picture of HC-06 and its main PINs:
PIN1

UART_TXD , TTL/CMOS level, UART Data output

PIN2

UART_RXD, TTL/COMS level, s UART Data input


RESET, the reset PIN of module, inputting low level can reset the module,

PIN11

when the module is in using, this PIN can connect to air.


VCC, voltage supply for logic, the standard voltage is 3.3V, and can work

PIN12

at 3.0-4.2V

PIN13

GND

PIN22

GND
LED, working mode indicator
Slave device: Before paired, this PIN outputs the period of 102ms square
wave. After paired, this PIN outputs high level.

PIN24

Master device: On the condition of having no memory of pairing with a


slave device, this PIN outputs the period of 110ms square wave. On the
condition of having the memory of pairing with a slave device, this PIN
outputs the period of 750ms square wave.
For master device, this PIN is used for emptying information about
pairing. After emptying, master device will search slaver randomly, and
then remember the address of the new got slave device. In the next power

PIN26

on, master device will only search this address.


Table 6.2 Pin Description

47

6.2.2 PAIRING
HC-06 Pairing:
HC-06 master device has no memory before the first use. If the password is correct, the
mater device will make pair with the slave device automatically in the first use. In the following
use, the master device will remember the Bluetooth address of the last paired device and search
it. The searching wont stop until the device is found. If master devices PIN26 is input high
level, the device will lose the memory. In that occasion, itll search the proper slave device like
the first use. Based on this function, the master device can be set to make pair with the specified
address or any address by user. The connections of Arduino and Bluetooth module are shown in
figure (6.3).

Figure 6.3 Interfacing Arduino with Bluetooth Module

48

CHAPTER 7

CONCLUSION
The main purpose of this project is to make the humanoid stable and generate the stable
walking pattern. A walking control algorithm for biped humanoid robot that considers a smooth
floor is developed and tested. Successful forward, backward walking on the flat surface was
realized, and the effectiveness of the proposed walking algorithm was thereby verified.
Through several experiments, it is validated the performance of the stable biped walking
pattern generation algorithm. The effectiveness of the walking control method proposed and the
walking systems are experimentally tested on a humanoid.
As future research, it is necessary to develop a more human-like sole that is ground shape
adaptive and ground reaction force absorptive. In the case of a human sole, the thick and soft
skin absorbs landing impact and adapts to uneven ground. The present biped humanoid
humanoids, KHR-2, HUBO, and Albert HUBO have hard and flat soles with four rubber
supporters. If the floors curvature is large, one rubber supporter among the four rubber
supporters may not be in contact with the floor, and consequently the foot landing becomes
unstable.

49

Appendix A: Datasheets of Arduino Mega2560


Pin
Number
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.

Pin
Name
PG5 ( OC0B )
PE0 ( RXD0/PCINT8 )
PE1 ( TXD0 )
PE2 ( XCK0/AIN0 )
PE3 ( OC3A/AIN1 )
PE4 ( OC3B/INT4 )
PE5 ( OC3C/INT5 )
PE6 ( T3/INT6 )
PE7 ( CLKO/ICP3/INT7 )
VCC
GND
PH0 ( RXD2 )
PH1 ( TXD2 )
PH2 ( XCK2 )
PH3 ( OC4A )
PH4 ( OC4B )
PH5 ( OC4C )
PH6 ( OC2B )
PB0 ( SS/PCINT0 )
PB1 ( SCK/PCINT1 )
PB2 ( MOSI/PCINT2 )
PB3 ( MISO/PCINT3 )
PB4 ( OC2A/PCINT4 )
PB5 ( OC1A/PCINT5 )
PB6 ( OC1B/PCINT6 )
PB7 ( OC0A/OC1C/PCINT7 )
PH7 ( T4 )
PG3 ( TOSC2 )
PG4 ( TOSC1 )
RESET
VCC
GND
XTAL2
XTAL1
PL0 ( ICP4 )
PL1 ( ICP5 )
PL2 ( T5 )
PL3 ( OC5A )
PL4 ( OC5B )

Mapped Pin
Name
Digital pin 4 (PWM)
Digital pin 0 (RX0)
Digital pin 1 (TX0)
Digital pin 5 (PWM)
Digital pin 2 (PWM)
Digital pin 3 (PWM)

VCC
GND
Digital pin 17 (RX2)
Digital pin 16 (TX2)
Digital pin 6 (PWM)
Digital pin 7 (PWM)
Digital pin 8 (PWM)
Digital pin 9 (PWM)
Digital pin 53 (SS)
Digital pin 52 (SCK)
Digital pin 51 (MOSI)
Digital pin 50 (MISO)
Digital pin 10 (PWM)
Digital pin 11 (PWM)
Digital pin 12 (PWM)
Digital pin 13 (PWM)

RESET
VCC
GND
XTAL2
XTAL1
Digital pin 49
Digital pin 48
Digital pin 47
Digital pin 46 (PWM)
Digital pin 45 (PWM)

50

40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.

PL5 ( OC5C )
PL6
PL7
PD0 ( SCL/INT0 )
PD1 ( SDA/INT1 )
PD2 ( RXDI/INT2 )
PD3 ( TXD1/INT3 )
PD4 (ICP1)
PD5 (XCK1)
PD6 ( T1 )
PD7 ( T0 )
PG0 ( WR )
PG1 ( RD )
PC0 ( A8 )
PC1 ( A9 )
PC2 ( A10 )
PC3 ( A11 )
PC4 ( A12 )
PC5 ( A13 )
PC6 ( A14 )
PC7 ( A15 )
VCC
GND
PJ0 ( RCK3/PCINT19 )
PJ1 ( TCK3/PCINT10 )
PJ2 ( XCK3/PCINT11 )
PJ3 ( PCINT 12 )
PJ4 ( PCINT 13 )
PJ5 ( PCINT 14 )
PJ6 ( PCINT 15 )
PG2 ( ALE )
PA0 ( AD7 )
PA0 ( AD6 )
PA0 ( AD5 )
PA0 ( AD4 )
PA0 ( AD3 )
PA0 ( AD2 )
PA0 ( AD1 )
PA0 ( AD0 )
PJ7
VCC
GND
PK7 ( ADC8/PCINT23 )
PK6 ( ADC8/PCINT22 )
PK5 ( ADC8/PCINT21 )

Digital pin 44 (PWM)


Digital pin 43
Digital pin 42
Digital pin 21 (SCL)
Digital pin 20 (SDA)
Digital pin 19 (RX1)
Digital pin 18 (TX1)

Digital pin 38
Digital pin 41
Digital pin 40
Digital pin 37
Digital pin 36
Digital pin 35
Digital pin 34
Digital pin 33
Digital pin 32
Digital pin 31
Digital pin 30
VCC
GND

Digital pin 39
Digital pin 29
Digital pin 28
Digital pin 27
Digital pin 26
Digital pin 25
Digital pin 24
Digital pin 23
Digital pin 22
VCC
GND
Analog pin 15
Analog pin 14
Analog pin 13

51

85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.

PK4 ( ADC8/PCINT20 )
PK3 ( ADC8/PCINT19 )
PK2 ( ADC8/PCINT18 )
PK1 ( ADC8/PCINT17 )
PK0 ( ADC8/PCINT16 )
PF6 ( ADC7 )
PF6 ( ADC6 )
PF5 ( ADC5/TMS )
PF4 ( ADC4/TMK )
PF0 ( ADC3 )
PF0 ( ADC2 )
PF0 ( ADC1 )
PF0 ( ADC0 )
AREF
GND
AVCC

Analog pin 12
Analog pin 11
Analog pin 10
Analog pin 9
Analog pin 8
Analog pin 7
Analog pin 6
Analog pin 5
Analog pin 4
Analog pin 3
Analog pin 2
Analog pin 1
Analog pin 0
Analog Reference
GND
VCC

52

Appendix B: INTERFACING THE SERVO MOTOR


TO ARDUINO

53

Appendix C: ARDUINO TO GYROSCOPE


CONNECTION

54

Appendix D: ARDUINO CODE


#include <Servo.h>
// centre values for right side servos
#define R_one_center 90
#define R_two_center 90
#define R_three_center 90
#define R_four_center 95
#define R_five_center 90
// centre values for left side servos
#define L_one_center 90
#define L_two_center 90
#define L_three_center 95
#define L_four_center 95
#define L_five_center 100
// lower value of motor move it forward toward sticker
Servo R_one;
Servo R_two;
Servo R_three;
Servo R_four;
Servo R_five;
Servo L_one;
Servo L_two;
Servo L_three;
Servo L_four;
Servo L_five;
Servo R_shoulder;
Servo L_shoulder;
// Accelerometer
int x_acc = 0;
int y_acc = 0;
int z_acc = 0;
int x_old = 0;
int y_old = 0;
int z_old = 0;
int old = 1;
int checkAccelro = 0;
// communication initialization
char inSerialData[24];
int indexOfSerialData;
char commandSerialData[8];
char dataRecieved[25];
char recvChar;

55
int serialServoPositions[16];
void setup() {
Serial.begin(9600);
Serial1.begin(9600);
// legs of robot attached
R_one.attach(13);
R_two.attach(12);
R_three.attach(11);
R_four.attach(10);
R_five.attach(9);
L_one.attach(8);
L_two.attach(7);
L_three.attach(6);
L_four.attach(5);
L_five.attach(4);
/*
// arms of robot attached
R_shoulder.attach(3);
L_shoulder.attach(2);
*/
}
void loop(){
while(Serial.available() > 0) {
if(indexOfSerialData <= 23) {
recvChar = Serial.read();
if(recvChar != '\0') {
inSerialData[indexOfSerialData] = recvChar;
indexOfSerialData++;
}
}
if(indexOfSerialData == 24) {
indexOfSerialData = 0;
commandSerialData[0] = inSerialData[16];
commandSerialData[1] = inSerialData[17];
commandSerialData[2] = inSerialData[18];
commandSerialData[3] = inSerialData[19];
commandSerialData[4] = inSerialData[20];
commandSerialData[5] = inSerialData[21];
commandSerialData[6] = inSerialData[22];
indexOfSerialData = 0;
}
}
if((String)commandSerialData == "Assign.") {
for(int x=0; x<8; x++){
commandSerialData[x] = 0;
}
Serial.println("Assign");
for(int y=0; y<16; y++){
serialServoPositions[y] = inSerialData[y];

56
Serial.println(serialServoPositions[y]);
}
serial_servo_Write(serialServoPositions);
checkAccelro = 0;
}
else if((String)commandSerialData == "Walk...") {
for(int x=0; x<8; x++){
commandSerialData[x] = 0;
}
Serial.println("Walk");
test1();
checkAccelro = 0;
}
else if((String)commandSerialData == "StandA.") {
for(int x=0; x<8; x++){
commandSerialData[x] = 0;
}
Serial.println("StandA");
stand_angled();
checkAccelro = 0;
}
else if((String)commandSerialData == "Stand..") {
for(int x=0; x<8; x++){
commandSerialData[x] = 0;
}
Serial.println("Stand");
stand();
checkAccelro = 0;
}
else if(((String)commandSerialData == "Accelro") || (checkAccelro == 1)) {
for(int x=0; x<8; x++){
commandSerialData[x] = 0;
}
Serial.println("Accelro");
// some looping technique to work continously in iritating mood
x_acc = analogRead(A0);
y_acc = analogRead(A1);
z_acc = analogRead(A2);
if(old == 1) {
x_old = x_acc;
y_old = y_acc;
z_old = z_acc;
old = 0;
}
if(checkAccelro == 1) {
R_three.detach();
L_three.detach();
}
if((x_acc >= x_old+15) || (x_acc <= x_old-15)) {

57
R_three.attach(11);
L_three.attach(6);
delay(100);
stand();
} }
}
void serial_servo_Write(int input[16])
{
R_one.write(input[0]);
delay(20);
R_two.write(input[1]);
delay(20);
R_three.write(input[2]);
delay(20);
R_four.write(input[3]);
delay(20);
R_five.write(input[4]);
delay(20);
L_one.write(input[5]);
delay(20);
L_two.write(input[6]);
delay(20);
L_three.write(input[7]);
delay(20);
L_four.write(input[8]);
delay(20);
L_five.write(input[9]);
delay(20);
}
// finalized stand position
void stand()
{
R_one.write(R_one_center - 3);
delay(20);
R_two.write(R_two_center);
delay(20);
R_three.write(R_three_center);
delay(20);
R_four.write(R_four_center - 2);
delay(20);
R_five.write(R_five_center + 9);
delay(20);
L_one.write(L_one_center - 5);
delay(20);
L_two.write(L_two_center);
delay(20);
L_three.write(L_three_center);
delay(20);
L_four.write(L_four_center - 2);

58
delay(20);
L_five.write(L_five_center - 10);
delay(20);
}
// finalized stand_angled position
void stand_angled() {
R_one.write(R_one_center - 7);
delay(20);
R_two.write(R_two_center);
delay(20);
R_three.write(R_three_center + 20);
delay(20);
R_four.write(R_four_center - 27);
delay(20);
R_five.write(R_five_center + 15);
delay(20);
L_one.write(L_one_center - 5);
delay(20);
L_two.write(L_two_center);
delay(20);
L_three.write(L_three_center + 20);
delay(20);
L_four.write(L_four_center - 27);
delay(20);
L_five.write(L_five_center - 10);
delay(20);
}
// good response angles
void right_leg_forward() {
R_one.write(R_one_center);
delay(20);
R_two.write(R_two_center + 10);
delay(20);
R_three.write(R_three_center + 20);
delay(20);
R_four.write(R_four_center - 24);
delay(20);
R_five.write(R_five_center + 2);
delay(20);
L_one.write(L_one_center);
delay(20);
L_two.write(L_four_center - 10);
delay(20);
L_three.write(L_three_center - 20);
delay(20);
L_four.write(L_four_center + 24);
delay(20);
L_five.write(L_five_center - 2);
delay(20);

59
}
void right_leg_straight() {
R_one.write(R_one_center);
delay(20);
R_two.write(R_two_center);
delay(20);
R_three.write(R_three_center);
delay(20);
R_four.write(R_four_center);
delay(20);
R_five.write(R_five_center);
delay(20);
}
void left_leg_forward() {
L_one.write(L_one_center + 5);
delay(20);
L_two.write(L_two_center + 10);
delay(20);
L_three.write(L_three_center + 15);
delay(20);
L_four.write(L_four_center - 15);
delay(20);
L_five.write(L_five_center - 10);
delay(20);
R_four.write(R_four_center + 20);
delay(20);
R_three.write(R_three_center - 15);
delay(20);
R_five.write(R_five_center - 10);
delay(20);
R_one.write(R_one_center);
delay(20);
}

void test1() {
//right leg straight for left leg to come forward
R_one.write(R_one_center + 6);
delay(20);
R_two.write(R_two_center);
delay(20);
R_three.write(R_three_center);
delay(20);
R_four.write(R_four_center);
delay(20);
R_five.write(R_five_center);
delay(200);
// left leg comes forward
L_three.write(L_three_center + 55);

60
delay(20);
L_two.write(L_two_center + 60);
delay(20);
L_four.write(L_four_center - 30);
// now right leg will m0ve forward
R_four.write(R_four_center + 25);
R_two.write(R_two_center - 25);
R_three.write(R_three_center);
//now left leg will touch the ground
L_four.write(L_four_center - 40);
delay(30);
L_two.write(L_two_center - 20);
delay(200);
//now stand on left leg
L_three.write(L_three_center);
delay(20);
L_four.write(L_four_center);
delay(20);
L_two.write(L_two_center);
// repeating tes1 from top again for opposite leg means right leg
L_one.write(L_one_center + 6);
delay(20);
L_two.write(L_two_center);
delay(20);
L_three.write(L_three_center);
delay(20);
L_four.write(L_four_center);
delay(20);
L_five.write(L_five_center);
delay(200);
// right leg comes forward
R_three.write(R_three_center + 55);
delay(20);
R_two.write(R_two_center + 60);
delay(20);
R_four.write(R_four_center - 30);
delay(200);
// now left leg will m0ve forward
L_four.write(L_four_center + 25);
L_two.write(L_two_center - 25);
L_three.write(L_three_center);
//now right leg will touch the ground
R_four.write(R_four_center - 40);
delay(30);
R_two.write(R_two_center - 20);
delay(200);
//now stand on left leg

61
R_three.write(R_three_center);
delay(20);
R_four.write(R_four_center);
delay(20);
R_two.write(R_two_center);
R_one.write(R_one_center + 8);
R_five.write(R_five_center + 5);
delay(200);
// left leg comes forward
L_three.write(L_three_center + 55);
delay(20);
L_two.write(L_two_center + 60);
delay(20);
L_four.write(L_four_center - 30);
void test2() {
R_three.write(R_three_center - 25);
delay(20);
R_four.write(R_four_center - 2 + 30);
delay(20);
L_one.write(R_one_center + 5);
delay(20);
L_five.write(R_five_center + 5);
delay(20);
L_two.write(R_two_center);
delay(20);
L_three.write(R_three_center);
delay(20);
L_four.write(R_four_center - 2); // centered
delay(20);
}
void centerall()
{
R_one.write(R_one_center);
delay(20);
R_two.write(R_two_center);
delay(20);
R_three.write(R_three_center);
delay(20);
R_four.write(R_four_center);
delay(20);
R_five.write(R_five_center);
delay(20);
L_one.write(L_one_center);
delay(20);
L_two.write(L_two_center);
delay(20);
L_three.write(L_three_center);
delay(20);
L_four.write(L_four_center);

62
delay(20);
L_five.write(L_five_center);
delay(20);
}
void servo_attach() {
R_one.attach(13);
R_two.attach(12);
R_three.attach(11);
R_four.attach(10);
R_five.attach(9);
L_one.attach(8);
L_two.attach(7);
L_three.attach(6);
L_four.attach(5);
L_five.attach(4);
}
void servo_detach() {
R_one.detach();
R_two.detach();
R_three.detach();
R_four.detach();
R_five.detach();
L_one.detach();
L_two.detach();
L_three.detach();
L_four.detach();
L_five.detach();
}

63

REFERENCES

[1] Jung-Yup Kim, Ill-Woo Park and Jun-Ho Oh, WALKING CONTROL ALGORITHM OF
BIPED HUMANOID ROBOT ON UNEVEN AND INCLINED FLOOR, Received: 31 July 2006
/ Accepted: 6 November 2006 /, pp. 460-463, Published online: 24 January 2007.
[2] J. Yamaguchi, A. Takanishi and I. Kato. DEVELOPMENT OF A BIPED WALKING ROBOT
COMPENSATING THREE AXIS MOMENT BY TRUNK, Paper presented at the IEEE/RSJ
international conference on intelligent robots and systems, Yokohama, Japan, 26-30 July 1993.
[3] K. Nagasaka, H. Inoue and M. Inaba. DYNAMIC WALKING PATTERN GENERATION FOR
A ROBOT BASED ON OPTIMAL GRADIENT METHOD, Paper presented at the IEEE
international conference on systems, man, and cybernetics, 12-15 Oct. 1999K. Elissa, Title of
paper If known, unpublished.
[4] K. Kaneko, F. Kanehiro, S. Kajita, H. Hirukawa, T. Kawasaki, M. Hirata, K. Akachi, T.
Isozumi. HUMANOID ROBOT HRP-2, Paper presented at IEEE international conference on
robotics and automation,New Orieans, LA, 26 April - 1 May 2004.
[5] Hamid Benbrahim and Judy A. Franklin, BIPED DYNAMIC WALKING USING
REINFORCEMENT LEARNING, ROBOTICS AND AUTONOMOUS SYSTEMS, Volume 22,
p283-p302, 1997.
[6] Ben Choi, HUMANOIDS, Hard cover, 388 pages , Publisher InTech, Published online 01,
January, 2009, Published in print edition January, 2009.

64

[7] Benbrahim, H., Franklin, J. A., BIPED DYNAMIC WALKING USING REINFORCEMENT
LEARNING, ROBOTICS AND AUTONOMOUS SYSTEMS, 22, 1997, pp.283-30.
[8] Jung-Yup Kim, ON THE STABLE DYNAMIC WALKING OF BIPED HUMANOIDS, Ph. D
Thesis, Korea Advanced Institute of Science and Technology, 2006.
[9] Jun-Ho Oh, David Hanson, Won-Sup Kim, Il Young Han, Jung-Yup Kim, and Ill-Woo Park,
DESIGN OF ANDROID TYPE HUMANOID ROBORT ALBERT HUBO, in Proc. IEEE/RSJ
Int. Conf. on Intelligent Robots and Systems, Beijin, China, 2006.
[10] Dusko Katic and Miomir Vukobratovic, CONTROL ALGORITHM FOR BIPED WALKING
USING REINFORCEMENT, 2nd Serbian-Hungarian Joint Symposium on Intelligent Systems,
2004.
[11] A. Takanishi, M. Tochizawa, H. Karaki and I. Kato, DYNAMIC BIPED WALKING
STABILIZED WITH OPTIMAL TRUNK AND WAIST MOTION, Proc. IEEE/RSJ International
Workshop on Intelligent Robots and Systems, p187-p192, 1989.
[12] N. Kanehira, T. Kawasaki, S. Ohta, T. Isozumi, T. Kawada, F. Kanehiro, S. Kajita and K.
Kaneko, DESIGN AND EXPERIMENTS OF ADVANCED LED MODULE(HRP-2L) FOR
HUMANOID ROBOT(HRP-2) DEVELOPMENT, Proc. IEEE/RSJ International Conference on
Intelligent Robots and Systems, p2455-p2460, 2002.
[13] Nishiwaki Koichi, HIGH FREQUENCY WALKING PATTERN GENERATION BASED ON
PREVIEW CONTROL OF ZMP, Proc.IEEE International Conference on Robotics and
Automation, ICRA, pp. 2667 2672, 2006.

65

[14] A. Konno, R. Sellaouti, F. B. Amar and F. B. Ouezdou, DESIGN AND DEVELOPMENT


OF THE BIPED PROTOTYPE ROBIAN, IEEE International Conference on Robotics &
Automation, pp. 1384-1389, 2002.
[15] K. Kaneko, F. Kanehiro, S. Kajita, K. Yokoyama, K. Akachi, T. Isozumi, DESIGN OF
PROTOTYPE HUMANOID ROBOTICS PLATFORM FOR HRP,

Proc. IEEE/RSJ Int.

Conference on Intelligent Robots and Systems, pp.2431-2436, 2002


[16] C. Angulo, R. Tellez and D. Pardo, EMERGENT WALKING BEHAVIOUR IN AN AIBO
ROBOT, ERCIM News 64, p38-p39, 2006
[17] Wolff, K., and Nordin, P., EVOLUTIONARY LEARNING FROM FIRST PRINCIPLES OF
BIPED WALKING ON A SIMULATED HUMANOID ROOT, The Advanced Simulation
Technologies Conference 2003 ASTC'03, 2003.
[18] Ill-Woo Park, Jung-Yup Kim and Jun-Ho Oh, ONLINE WALKING PATTERN
GENERATION AND ITS APPLICATION TO A BIPED HUMANOID ROBOT-KHR-3(HUBO),
Journal of Advanced Robotics, 2007.
[19] J. Yamaguchi, A. Takanishi, and I. Kato, DEVELOPMENT OF A DYNAMIC WALKING
SYSTEM FOR HUMANOID-DEVELOPMENT OF A BIPED WALKING ROBOT ADAPTING
TO THE HUMAN LINING FLOOR- , Proc. of the 1996 ICRA, pp.232-239, 1996.

66

BIBLOGRAPHY
[Akachi 05] K. Akachi, K. Kaneko, N. Kanehira, S. Ota, G. Miyamori, M. Hirata, S.
Kajita, F. Kanehiro, Development of humanoid robot HRP-3P, in Proceedings of the
IEEERAS International Conference on Humanoids. 2005, pp. 5055.
[Albert 01] A. Albert, W. Gerth, New Path Planning Algorithms for Higher Gait
Stability of a Bipedal Robot, in Proceedings of 4th International Conference on
Climbing and Walking Robots (CLAWAR). Karlsruhe, Germany, 2001, pp. 521 528.
[Albiez 03a] J. Albiez, T. Luksch, K. Berns, R. Dillmann, An Activation-Based
Behavior Control Architecture for Walking Machines, The International Journal on
Robotics Research, Sage Publications, vol. 22, pp. 203211, 2003.
[Albiez 03b] J. Albiez, T. Luksch, K. Berns, R. Dillmann, A Behaviour Network
Concept for Controlling Walking Machines, in 2nd International Symposium on
Adaptive Motion of Animals and Machines (AMAM). Kyoto, Japan, March 48 2003.
[Albiez 03c] J. Albiez, T. Luksch, K. Berns, R. Dillmann, Reactive reflex-based control
for a four-legged walking machine, Robotics and Autonomous Systems, Elsevier, 2003.
[Albiez 07] J. Albiez, Verhaltensnetzwerke zur adaptiven Steuerung biologisch
motivierter Laufmaschinen, GCA Verlag, 2007.
[Alexander 84] R. M. Alexander, The Gaits of Bipedal and Quadrupedal Animals,
International Journal of Robotics Research, vol. 3-2, pp. 4959, 1984.
[Alexander 90] R. Alexander, Three Uses of springs in Legged Locomotion, The
International Journal of Robotics Research, vol. 9, no. 2, pp. 5361, 1990. Special issue
on legged locomotion.

67

[Aoi 05] S. Aoi, K. Tsuchiya, Locomotion Control of a Biped Robot Using Nonlinear
Oscillators, Autonomous Robots, vol. 19, no. 3, pp. 219232, 2005.
[Cappellini 06] G. Cappellini, Y. P. Ivanenko, R. E. Poppele, F. Lacquaniti, Motor
patterns in human walking and running, Journal of Neurophysiology, vol. 95, 2006.

Вам также может понравиться