SWG Dreams

121
A HUMANOID BIPEDAL ROBOT (SWG DREAMS) WITH ODMTS USING AT89S52 A RESEARCH/PROJECT REPORT Submitted By N.GAUTAMAN 30607205031 T.SRI KUMARAN 30607205100 A.WILLIAM AROKIA RAJ 30607205118 in the partial fulfillment for the award of the degree of BACHELOR OF TECHNOLOGY in INFORMATION TECHNOLOGY JEPPIAAR ENGINEERING COLLEGE, CHENNAI ANNA UNIVERSITY :: CHENNAI - 600 025 APRIL 2011

Transcript of SWG Dreams

Page 1: SWG Dreams

A HUMANOID BIPEDAL ROBOT (SWG DREAMS)

WITH ODMTS USING AT89S52

A RESEARCH/PROJECT REPORT

Submitted By

N.GAUTAMAN 30607205031

T.SRI KUMARAN 30607205100

A.WILLIAM AROKIA RAJ 30607205118

in the partial fulfillment for the award of the degree

of

BACHELOR OF TECHNOLOGY

in

INFORMATION TECHNOLOGY

JEPPIAAR ENGINEERING COLLEGE, CHENNAI

ANNA UNIVERSITY :: CHENNAI - 600 025

APRIL 2011

Page 2: SWG Dreams
Page 3: SWG Dreams

i

A HUMANOID BIPEDAL ROBOT (SWG DREAMS)

WITH ODMTS USING AT89S52

A PROJECT REPORT

Submitted By

N.GAUTAMAN 30607205031

T.SRI KUMARAN 30607205100

A.WILLIAM AROKIA RAJ 30607205118

in the partial fulfillment for the award of the degree

of

BACHELOR OF TECHNOLOGY

in

INFORMATION TECHNOLOGY

JEPPIAAR ENGINEERING COLLEGE, CHENNAI

ANNA UNIVERSITY :: CHENNAI - 600 025

APRIL 2011

Page 4: SWG Dreams

ii

ANNA UNIVERSITY : CHENNAI - 600 025

JEPPIAAR ENGINEERING COLLEGE

DEPARTMENT OF INFORMATION TECHNOLOGY

JEPPIAAR NAGAR, RAJIV GANDHI ROAD, CHENNAI-119

BONAFIDE CERTIFICATE

This is to certify that this Project Report “A HUMANOID BIPEDAL

ROBOT (SWG DREAMS) WITH ODMTS USING AT89S52” is the

bonafide work of “N.GAUTAMAN, T.SRI KUMARAN and

A.WILLIAM AROKIA RAJ” who carried out the project under my

supervision.

SUPERVISOR HEAD OF THE DEPARTMENT

Submitted for the examination held on ……………………

INTERNAL EXAMINER EXTERNAL EXAMINER

Page 5: SWG Dreams

iii

Page 6: SWG Dreams

iv

ACKNOWLEDGEMENT

Project and Research work is the product out of experience that goes a long way on

shaping up a person’s caliber. The experience and success one attains is not by one self

but with a group of kind hearts behind.

We are very much indebted to the chairman Dr. Jeppiaar M.A.,

B.L.,Ph.D, the secretary Dr.P.Chinnadurai M.Phil., B.Ed., Ph.D, the

director Dr. Regeena Jeppiaar B.Tech., M.B.A., Ph.D, the principal Dr.

Sushil Lal das M.Sc(Engineering).,Ph.D.

We wish to thank our HOD Dr.R.Sabitha M.E., Ph.D, and internal

guide Ms.S.Uma Maheshwari M.Tech., for guiding us to take up the

project. I also thank our project co-coordinator Mr.V.Anbarasu M.Tech.,

for his enthusiastic support shown towards our project. Their efforts in

establishing methodical work routine have lead to the successful completion

of this project.

We are elated to place in record our sincere appreciation and gratitude

to (EPR) Electronics Platform Research Labs who gave the consent and

technical support to understand and complete this project.

We wish to convey our sincere thanks to all the teaching and non-

teaching Staff of department of IT, without whose co-operation this venture

would not have been a success.

We wish to thank our parents, our family members, our friends and

other well wishers who helped us to complete this work successfully. And

finally, we thank the Lord Almighty for His bountiful love and blessings.

-SWG VERTICAL VIEW INNOVATORS

Humanoid Research and Design

Page 7: SWG Dreams

v

ABSTRACT

Our motivation towards Humanoid Research and design made us design a

humanoid bipedal robot with the principle of ZMP (Zero Momentum Point)

and passive Dynamics in line with the experimental model of Honda’s

walking assistant device. As an enhancement we have used many sensors

such as Object Detection, Motion, and touch sense. Ultra super dynic radio

frequency transmitter and receiver are used for accessing the robot placed at

a remote area. Wireless CMOS capturing device serves as a tool for easier

access of the robot to the end user, and can also be used for surveillance. The

front end is designed using C#. The most challenging part is, we have used a

basic developer board 8051 family’s ATMEL 89S52 to interface all the

motor drivers and sensors.

Page 8: SWG Dreams

vi

PREFACE

The way how content is delivered and how it can be effectively utilized by

the reader is dependent on the authors view. We have designed this book

with list of figures and abbreviations in such a way that it can be easy to read

with a good understanding of the context. Each chapter contains a clear

explanation of the mechanisms and principles with their relevant pictorial

representations and the detailed concepts are furnished in the appendices.

For reader’s quick reference foot notes are given in each page corresponding

to the text. Any content can be referred in a faster way through the index.

We believe that this contribution will be of exemplary use to the user.

Page 9: SWG Dreams

vii

TABLE OF CONTENTS

CHAPTER TITLE PAGENO

ABSTRACT v

PREFACE vi

LIST OF FIGURES x

LIST OF ABBREVATIONS xi

0 SWG DREAMS 1

SWG Vertical View Innovators 2

EPR Labs 2

Overview of SWG Robot 3

Modules Overview 4

1 MECHANICAL MODULE 5

1.0 Mechanics 6

1.0.1 Role of Mechanics

In Robotics 7

1.1 Design Overview 8

1.1.1 Structural Design

1.2 Mechanisms and Principles 10

1.3 Synchronization 13

Page 10: SWG Dreams

viii

2 ELECTRONICS MODULE 14

2.0 PC to Microcontroller

Communication 15

2.1 Interfacing L293D with AT 89S52 17

2.1.0 Skeleton code for motor access

using drivers 18

2.2 Sensors 20

2.2.0 Interfacing Sensor with

AT89S52 using ADC 0804 21

2.2.1 Interfacing LCD with

AT89S52 22

2.2.2 Ultrasonic Sensor,

Working Principle, Circuit 22

2.2.3 PIR Sensor,

Working Principle, Circuit 24

2.2.4 IR Sensor,

Working Principle, Circuit 25

2.2.5 Touch Plate,

Working Principle, Circuit 27

2.2.6 Temperature Sensor,

Working Principle, Circuit 27

2.3 Power Supply 28

2.3.0 Why is Battery Capacity

Specified in Ampere-Hour? 29

2.3.1Calculating Voltage-Ampere-Hrs 29

Page 11: SWG Dreams

ix

3 RF MODULE 30

3.0 Radio Frequency Remote Controller 31

3.1 Remote Controller Types and Basics 31

3.1.1 RF remote 31

3.1.2 Designing RF remote

Using Encoder and Decoder 32

3.1.3 Designing RF Using UART 35

3.2 Skeleton code for receiver side 41

3.3 Skeleton code for transmitter side 43

4 TEST MODULE 45

4.0 Test cases

5 CONCLUSION AND FURTURE

ENHANCMENTS 47

APPENDICES

APPENDIX A: Mechanical 48

APPENDIX B: Electronics 52

APPENDIX C: RF 67

APPENDIX D: Software

Implementation 73

REFERENCES

INDEX

Page 12: SWG Dreams

x

LIST OF FIGURES

FIGURE NO

0.1

1.0

1.1

1.2

2.0

2.1

2.2

2.3

2.4

2.5

2.6

2.7

2.8

3.0

3.1

3.2

3.3

FIGURE NAME

Overview block of SWG Dreams

Robot

Mechanics Block

Structural Design

Synchronization

Basic circuit diagram for PC to

Microcontroller communication

Interfacing L293D with AT89S52

Interfacing sensor with AT89S52

Using ADC 0804

Interfacing LCD with AT89S52

Circuit diagram for Ultrasonic sensor

Circuit diagram for PIR sensor

Circuit diagram for IR sensor

Circuit diagram for Touch sensor

Circuit diagram for Temperature

Sensor

Interfacing transmitter with HT12E

Interfacing receiver with HT12D

Interfacing Transmitter with AT

Using UART

Interfacing Receiver with AT

Using UART

PAGE NO

3

6

8

13

15

17

21

22

23

25

26

27

28

33

34

36

39

Page 13: SWG Dreams

xi

LIST OF ABBREVATIONS

ABBREVATIONS EXPANSIONS

ADC Analog to Digital Convertor

RF Radio Frequency

UMPS Universal Microcontroller Simulator

CMOS Complementary Metal–Oxide–Semiconductor

LCD Liquid Crystal Display

DC Direct Current

PWM Pulse Wave Modulation

IR Infra Red

PIR Pyroelectric IR

TMOD Timer MODe

TCON Timer Control registers

SCON Serial Control registers

MSB Most Significant Bit

LSB Least Significant Bit

LED Light Emitting Diode

UART Universal Asynchronous Receiver Transmitter

Page 14: SWG Dreams

1

Chapter 0

"Unless mankind redesigns itself by changing our DNA through altering our genetic

makeup, computer-generated robots will take over our world", this is the current

scenario of robotics which is one of the most improving fields of technology. It is the

branch of technology that deals with the design, construction, operation, structural

disposition, manufacture and application of robots. Due to its massive developmental

improvement it tends to replace men in most of the scenarios. The most important rules of

robotics as stated by Isaac Asimov is as follows:

1. A robot may not injure a human being, or, through inaction, allow a human being

to come to harm.

2. A robot must obey the orders given it by human beings except where such orders

would conflict with the First Law.

3. A robot must protect its own existence as long as such protection does not conflict

with the First or Second Laws.

As a part of our degree completion we have tried our best to incorporate all the

knowledge that has been inculcated to us such in the fields of mechanical, electrical,

electronics and computer engineering. Being students of Information Technology it has

been a challenging job to take up this idea as it not only involves the coding knowledge

on which we are trained but also involves concepts from all other branches of

engineering. Trying our hands in the most growing field of technology, Robotics it is not

that easy to invent new things as it is a matter of cost and time. Hence we have taken an

ultimatum effort to use many motors and sensors with a basic developer board in 8051’s

family called as ATMEL 89S52 to perform all the hyper actions. Thus our humanoid

bipedal robot with ODMTS poses an economical method for devising a robot. This is

extremely essential, because as for now robots are created on a massive cost which the

main reason for why these humanoid robots can’t be used on a large scale to help

people. Hence our method overrides this discrepancy as it provides a best and an

economical method for robots to be fabricated.

Page 15: SWG Dreams

2

SWG VERTICAL VIEW INNOVATORS

Obviously everyone wants to be successful, but we wanted to be looked back on as being

very innovative, very trusted, and ethical and ultimately

making a big difference in the world. This led to our SWG group to emerge as vertical

innovators where each and everything has to be observed in a different

way. The number one benefit of information technology is that it empowers people to do

what they want to do. It lets people be creative. It lets people to be

productive. It lets people learn things which they would have not thought they could learn

before, and so in a sense it is all about potential. So we have put in our knowledge

gained from the IT field to all other fields of engineering. We did not want to restrict

ourselves to code programs but to implement a real time system that

works according to our commands. Hence it is just a start to our career and we are also

focusing to build this project on R&D basis. “Never before in history has innovation

offered promise of so much to so many in so short time”, hence we are proud for our

humanoid robot which was designed in a very short period of time.

ELECTRONICS PLATFORM RESEARCH LABS

Electronics Platform Research Labs is a Research and Development organization

incorporated to provide fantastic platforms for students and embedded engineers round

the globe. Our products are enhanced to make users aware of the embedded technology

and instill a confidence that immensely inspires them to innovate and create, all by

themselves, in a short period of time. EPRLABS has created a new trend in designing

high-class micro controller boards for people ranging from an amateur to a professional.

Our products have created a new benchmark in embedded platform development domain.

we have also made new standards in designing the sub-platforms making the users feel

more comfortable in developing their products. We offer a wide range of products for a

wide range of customers. We also provide support for our customers in choosing the right

platforms.

Page 16: SWG Dreams

3

OVERVIEW OF SWG DREAMS ROBOT

Fig 0.1 Overview block of SWG Dreams Robot

Page 17: SWG Dreams

4

MODULES OVERVIEW

All the modules are split up into chapters

Chapter 1 covers the mechanical module which briefs about the structure, design and

mechanisms involved in it.

Chapter 2 deals with electronics which briefs about the circuit design the, controller

boards used several sensors modules and also the interfacing techniques.

Chapter 3 deals with the RF module which tells about the RF circuits used for

transmission and reception their design and techniques for effective signal passing.

Chapter 4 covers the test case modules of our project and the test certification from the

embedded platform research labs

Page 18: SWG Dreams

5

Chapter 1

Mechanics is the branch of physics concerned with the

behavior of physical bodies when subjected to forces or

displacements, and the subsequent effects of the bodies on

their environment. During the early modern period, scientists

such as Galileo, Kepler, and especially Newton, laid the

foundation for what is now known as classical mechanics.

This chapter deals with the detailed description and the

contribution of mechanics in robotics.

Outline:

1.0 Mechanics

1.0.1Role of mechanics in robotics

1.1Design overview

1.1.1Structural design

1.2Mechanisms and Principles

1.3 Synchronization

Appendices A. References

Page 19: SWG Dreams

6

1.0 MECHANICS

.

Fig 1.0 Mechanics block

Page 20: SWG Dreams

7

1.0.1 ROLE OF MECHANICS IN ROBOTICS

Mechanical engineering is a discipline of engineering that applies the principles of

physics and materials science for analysis, design, manufacturing, and maintenance of

mechanical systems. It is the branch of engineering that involves the production and

usage of mechanical power for the design, production, and operation of machines and

tools. This field requires an understanding of core concepts including mechanics,

kinematics1, dynamics2, materials science, and structural analysis. Among these

structural analysis of a system plays a vital role in the functioning of the system.

Initial planning about the structure is a must before starting the actual work. The

structural planning gives the actual degree of accuracy that can be achieved after the

complete design of the system .Thus a well designed proper structure can result in a

successful working system. In spite of the hardware and software working, there can

be discrepancies in the system if the structure is not properly designed.

1 Dynamics is the study of the causes of motion and changes in motion. In other words it is the study of

forces and why objects are in motion. Dynamics includes the study of the effect of torques on motion.

2 Kinematics is the branch of classical mechanics that describes the motion of bodies and systems

without consideration of the forces that cause the motion

Page 21: SWG Dreams

8

1.1 DESIGN OVERVIEW

1.1.1Structural Design

Fig 1.1 Structural design

Page 22: SWG Dreams

9

Page 23: SWG Dreams

10

1.2 MECHANISMS AND PRINCIPLES

The structure is split into parts

Head 3

3 Centripetal force is a force that makes a body follow a curved path.

Page 24: SWG Dreams

11

Arms

Function:

Motion in reference to one axis about any desired direction.

Principle:

The work done against the gravitational force in a vertical distance with some

acceleration along the body’s gravitational potential energy (G.P.E) 4

Legs

Function:

Bipedal flexible walk about the horizontal axis

Principle:

Bipedal walking motion5

4 Gravitational potential energy (G.P.E.) is the energy a body has because of its height above the

ground G.P.E. = mgh where h is the height of the body above the ground.

Page 25: SWG Dreams

12

5 Bipedalism is a form of terrestrial locomotion where an organism moves by means of its two rear

limbs, or legs.

Page 26: SWG Dreams

13

1.3 SYNCRONIZATION

Fig 1.2 Synchronization

Page 27: SWG Dreams

14

Chapter 2

The history of electronics is a story of the twentieth century

and three key components—the vacuum tube, the transistor,

and the integrated circuit. In 1883, Thomas Alva Edison

discovered that electrons will flow from one metal conductor

to another through a vacuum. This discovery of conduction

became known as the Edison effect. In 1904, John Fleming

applied the Edison effect in inventing a two-element electron

tube called a diode, and Lee De Forest followed in 1906 with

the three-element tube, the triode. These vacuum tubes were

the devices that made manipulation of electrical energy

possible so it could be amplified and transmitted.

This chapter deals with the detailed description and the

contribution of electronics in robotics.

Outline: 2.0 PC to Microcontroller Communication

2.1 Interfacing L293D with AT 89S52

2.1.0 Skeleton Code for motor access using Drivers

2.2 Sensors

2.2.0 Interfacing Sensor with AT89S52 using ADC

0804

2.2.1 Interfacing LCD with AT89S52

2.2.2 Ultrasonic Sensor, Working Principle, Circuit

2.2.3 PIR Sensor, Working Principle, Circuit

2.2.4 IR Sensor, Working Principle, Circuit

2.2.5 Touch Plate, Working Principle, Circuit

2.2.6 Temperature Sensor, Working Principle, Circuit

2.3 Power Supply

2.3.0 Why is Battery Capacity Specified in Ampere-Hour?

2.3.1Calculating Voltage-Ampere-Hrs

Appendices B. References

Page 28: SWG Dreams

15

2.0 PC TO MICROCONTROLLER COMMUNICATION

.

Fig 2.0 Basic Circuit Diagram for PC to Microcontroller Communication

Page 29: SWG Dreams

16

Using the Serial Port 18051 provides a transmit channel and a receive channel of serial

communication. The transmit data pin (TXD) is specified at P3.1, and the receive data

pin (RXD) is at P3.0. The serial signals provided on these pins are TTL signal levels

and must be boosted and inverted through a suitable converter (MAX232) to comply

with RS2322 standard. All modes are controlled through SCON3, the Serial control

register. The SCON bits are defined as SM0, SM1, SM2, REN, TB8, RB8, TI and RI

from MSB to LSB. The timers are controlled using TMOD, the Timer MOD e

register, and TCON, the Timer control register.

1 Serial port is a serial communication physical interface through which information transfers in or out

one bit at a time. 2 RS-232 (Recommended Standard 232) is the traditional name for a series o f standards

for serial binary ended data and control signals connecting between a DTE (Data Terminal

Equipment) and a DCE (Data Circuit-terminating Equipment). 3 The serial port is full duplex, meaning it can transmit and receive simultaneously. It is also receive -

buffered, meaning it can commence reception of a second byte before a previously received byte has

been read from the register.

Page 30: SWG Dreams

17

2.1 INTERFACING L293D45

WITH AT89S526

Fig2.1 Interfacing L293D with AT89S52

4 *IC: integrated circuit (also known as IC, microcircuit, microchip, silicon chip, or chip) is a

miniaturized electronic circuit (consisting mainly of semiconductor devices, as well as passive

components) that has been manufactured in the surface of a thin substrate of semiconductor material. 5 L293D is a dual H-Bridge motor driver, So with one IC we can interface two DC motors which can

be controlled in both clockwise and counter clockwise direction and if you have motor with fix

direction of motion the you can make use of all the four I/Os to connect up to four DC motors. 6 ATMEL 89S52 is microcontroller with 40 pins of 8051 family.

For detailed description refer appendix B

Page 31: SWG Dreams

18

2.1.0 Skeleton Code for motor access using Drivers

//header_files AT89S52

#include <REGX51.H>

//delay

void wait(const unsigned int d)

{

for(a=0;a<d;a++)

{

for(a=0;a<d;a++);

}

}

//main_function

void main()

{

//repeat_fivetimes

for (i=0; i<10; i++)

Page 32: SWG Dreams

19

{

stop_head();

stop_hands();

stop_joints();

stop_joint_right();

stop_joint_left();

stop_hips();

stop_knees();

stop_foots();

head_left();

stop_head();

lefthand_backward();

stop_hands();

lefthip_up();

leftknee_up();

leftfoot_forward();

stop_hips();

stop_knees();

stop_foots();

head_right();

stop_head();

righthand_forward();

stop_hands();

righthip_up();

lefthip_down();

rightknee_up();

Page 33: SWG Dreams

20

leftknee_down();

rightfoot_forward();

righthip_down();

rightknee_down();

stop_hips();

stop_knees();

stop_foots();

}

while(1)

{

stop_head();

stop_hands();

stop_joints();

stop_joint_right();

stop_joint_left();

stop_hips();

stop_knees();

stop_foots();

}

}

2.2 SENSORS

A sensor is a device that measures a physical quantity and converts it into a signal

which can be read by an observer or by an instrument. For example, a mercury- in-

glass thermometer converts the measured temperature into expansion and contraction

of a liquid which can be read on a calibrated glass tube. A thermocouple converts

temperature to an output voltage which can be read by a voltmeter.

Page 34: SWG Dreams

21

2.2.0 Interfacing Sensor with AT89S52 using ADC 08047

Fig 2.2 Interfacing Sensor with AT89S52 using ADC 0804

7 The ADC0801, ADC0802, ADC0803, ADC0804 and ADC0805 are CMOS 8 -bit successive

approximation A/D converters that use a differential potentiometer ic ladder-similar to the 256R

products. These converters are designed to allow operation with the NSC800 and INS 8080A derivative

control bus with TRI-STATE output latches directly driving the data bus. These A/Ds appear like

memory locations or I/O ports to the microprocessor and no interfacing logic is needed .

* RESISTOR: A resistor is a two-terminal electrical or electronic component that resists an electric

current by producing a voltage drop between its terminals in accordance with Ohm's law R = V/I

Page 35: SWG Dreams

22

2.2.1 Interfacing LCD8 with AT89S52

Fig 2.3 Interfacing LCD with AT89S52

2.2.2 Ultrasonic Sensor, Working Principle, Circuit

Ultrasonic sensors (also known as transceivers when they both

send and receive) work on a principle similar to radar or sonar

which evaluate attributes of a target by interpreting the echoes

from radio or sound waves respectively.

Ultrasonic sensors generate high

frequency sound waves and

evaluate the echo which is

received back by the sensor.

Sensors calculate the time interval

between sending the signal and

receiving the echo to determine the distance to an object.

8 Liquid crystal display (LCD) is a thin, flat electronic visual display that uses the light modulating

properties of liquid crystals (LCs). LCs do not emit light directly.

For detailed description refer appendix B

* Capacitor: A capacitor is an electrical device that can store energy in the electric field between a

pair of closely spaced conductors (called 'plates'). When current is applied to the capacitor, electric

charges of equal magnitude, but opposite polarity, build up on each plate. C=Q/V

Page 36: SWG Dreams

23

Fig 2.4 Circuit diagram for ultrasonic Sensor

Page 37: SWG Dreams

24

2.2.3 PIR Sensor, Working Principle, Circuit

9A Passive Infrared sensor (PIR sensor) is

an electronic device that measures infrared (IR)

light radiating from objects in its field of view.

PIR sensors are often used in the construction

of PIR-based motion detectors (see below).

Apparent motion is detected when an infrared

source with one temperature, such as a human, passes in front of an infrared source

with another temperature, such as a wall.

All objects above absolute zero emit energy in the form of radiation. It is usually

infrared radiation that is invisible to the human eye but can be detected by electronic

devices designed for such a purpose.

The term passive in this

instance means that the

PIR device does not emit

an infrared beam but

merely passively accepts

incoming infrared

radiation.

“Infra” meaning below

our ability to detect it

visually, and “Red”

because this color

represents the lowest

energy level that our

eyes can sense before it

becomes invisible.

9 *LED: A light-emitting diode (LED) is a semiconductor device that emits incoherent narrow-

spectrum light when electrically biased in the forward direction of the p-n junction. This effect is a

form of electroluminescence.

Page 38: SWG Dreams

25

Thus, infrared means below the energy level of the color red, and applies to many

sources of invisible energy.

Fig 2.5 Circuit diagram for PIR sensor

2.2.4 IR Sensor, Working Principle, Circuit

It is the same principle in ALL Infra-Red proximity

sensors. The basic idea is to send infra red light

through IR-LEDs, which is then reflected by any

object in front of the sensor. Then all you have to

do is to pick-up the reflected IR light. For

detecting the reflected IR light, we are going to

use a very original technique: we are going to use

another IR-LED, to detect the IR light that was

emitted from another led off the exact same type.

This is an electrical property of Light Emitting

Diodes (LEDs) which is the fact that a led produces a voltage difference across its

leads when it is subjected to light. As if it was a photo-cell, but with much lower

Page 39: SWG Dreams

26

output current. In other words, the voltage generated by the led’s can't be - in any way

- used to generate electrical power from light, It can barely be detected. That is why

as you will notice in the schematic, we are going to use an Op-Amp (operational

Amplifier) to accurately detect very small voltage changes.

10

Fig 2.6 Circuit diagram for IR sensor

10

*TRANSISTOR: A transistor is a semiconductor device, commonly used as an amplifier or an

electrically controlled switch. The transistor is the fundamental building block of the circui try that

governs the operation of computers, cellular phones, and all other modern electronics.

* DIODE: diode is a component that restricts the direction of flow of charge carriers. Essentially, it

allows an electric current to flow in one direction, but blocks it in the opposite direction. Thus, the

diode can be thought of as an electronic version of a check valve. Circuits that require current flow in

only one direction typically include one or more diodes in the circuit design.

Page 40: SWG Dreams

27

2.2.5 Touch Plate, Working Principle, Circuit

In the Touch Switch two leads must be shorted together by your finger touching them.

In the Touch Plate only one plate needs to be touched. The Touch Switch only needs

a battery to activate it butte Touch Plate requires a mains power supply.

Fig 2.7 Circuit diagram for touch sensor

2.2.6 Temperature Sensor, Working Principle, Circuit

A temperature sensor is a device that gathers data concerning the temperature from a

source and converts it to a form that can be understood either by an observer or

another device. Temperature sensors come in many different forms and are used for a

wide variety of purposes, from simple home use to extremely accurate and precise

Page 41: SWG Dreams

28

scientific use. They play a very important role almost everywhere that they are

applied; knowing the temperature helps people to pick their clothing before a walk

outside just as it helps chemists to understand the data collected from a

complex chemical reaction.

11

Fig 2.8 Circuit diagram for Temperature sensor

2.3 POWER SUPPLY

A power supply is a device that supplies electrical energy to one or more electric

loads. The term is most commonly applied to devices that convert one form of

electrical energy to another, though it may also refer to devices that convert another

form of energy (e.g., mechanical, chemical, solar) to electrical energy. A regulated

power supply is one that controls the output voltage or current to a specific value; the

controlled value is held nearly constant despite variations in either load current or the

voltage supplied by the power supply's energy source.

11

*RELAY: When a coil of wire is wound on a non magnetic material such as plastic, paper etc. ,it is

called a air-core solenoid or simply a solenoid .if a soft iron core is inserted into the coil, it becomes

an electromagnet. This electromagnet is the basic component for relay a nd many other

electromechanical devices such as electric bell, circuit breaker etc...

Page 42: SWG Dreams

29

Electrical Battery

An electrical battery is one or more electrochemical cells that convert stored

chemical energy into electrical energy. There are two types of batteries: primary

batteries (disposable batteries), which are designed to be used once and discarded,

and secondary batteries (rechargeable batteries), which are designed to be recharged

and used multiple times. Batteries come in many

sizes; from miniature cells used to power hearing

aids and wristwatches to battery banks the size of

rooms that provide standby power for

telephone and computer data centers.

2.3.0 Why is Battery Capacity Specified in Ampere-Hour?

An ampere is a unit for measurement for the amount of electricity current flowing

through a circuit. One ampere is the same as one coulomb of electric charge flowing

past any point per second. It is also the same as current produced by one volt of

electricity applied across a 1-ohm resistance. One ampere-hour is equal to a current of

one ampere flowing for one hour. So, if you have a two ampere-hour battery, then it

has the capacity to flow a two-ampere current for one hour. Or you can use the same

battery to flow a one-ampere current for two hours. Therefore, a larger Ah always

specifies higher capacity.

2.3.1Calculating Voltage-Ampere-Hrs

Watt = amp * volt *(hours)

Page 43: SWG Dreams

30

Chapter 3

.

Radio Frequency remote controller is a device used to

transmit the wireless signal from one point to another. The

remote controllers are classified based on the type of signals

that is used to transmit data (information).

This chapter deals with the detailed description and the

contribution of RF Module in robotics.

Outline:

3.0 Radio Frequency Remote Controller

3.1 Remote Controller Types and Basics

3.1.1 RF remote

3.1.2 Designing RF remote using Encoder and

Decoder

3.1.3 Designing RF Using UART

3.2 Skeleton code for receiver side

3.3 Skeleton code for transmitter side

Appendices C. References

Page 44: SWG Dreams

31

3.0 Radio Frequency Remote Controller

Radio Frequency remote controller is a device used to transmit the wireless signal from

one point to another. The remote controllers are classified based on the type of signals

that is used to transmit data (information).

3.1 Remote Controller Types and Basics

Remote controllers are classified based on the types of signals that are used in

transmission and reception. So the property and application of remote controller depends

on the characteristics or nature of the signal which is used in the remote.

Before going through the various remotes controllers available, let us see back ground of

all signals present in this universe which we call as spectrum.

Radio – Microwave – Infrared – Visible – Ultraviolet – X-ray –Gamma Ray

3.1.1 RF 1remote

Uses RF (Radio Pulses) signal, radio part of the electromagnetic spectrum, Range 100

feet. It can go through walls and around corners.

RF remote uses Radio Frequency signals to transmit data.

RF remote can be considered,

1. If the operating device range is around 100 feet

2. If the signal has to penetrate the walls.

1 Radio frequency (RF) is a rate of oscillation in the range of about 3 kHz to 300 GHz, which corresponds

to the frequency of radio waves, and the alternating currents which carry radio signals.

Page 45: SWG Dreams

32

3.1.2 Designing RF remote using Encoder 2and Decoder

3

RF Transmitter module and RF Receiver module are used for transmitting and receiving

the data respectively. RF modules are used to transmit the RF signal using ASK

modulation technique and also it can be tuned to work at 433 MHz

It can operate from 3 volt to 12 volts. We can generate and receive the different signals

(data) using encoder at the transmitting side and decoder at the receiving side

respectively.

Encoders are used to transmit the parallel data (Various Keys) into serial data which the

RF transmitter can understand and transmit it to the RF receiver. RF receiver receives the

serial data and gives it to decoders, which in turn converts the serial data from RF

receiver to the Device which is getting controlled.

2 An encoder is a device, circuit, transducer, software program, algorithm or person

that converts information from one format or code to another, for the purposes of standardization, speed,

secrecy, security, or saving space by shrinking size. 3 A decoder is a device which does the reverse of an encoder, undoing the encoding so that the original

information can be retrieved. The same method used to encode is usually just reversed in order to decode

Page 46: SWG Dreams

33

Fig 3.0 Interfacing Transmitter with HT12E 4Encoder

4 HT12E

Refer Appendix C for detailed description

Page 47: SWG Dreams

34

Fig 3.1 Interfacing Receiver with HT12D 5Decoder

5 HT12D

Refer Appendix C for detailed description

Page 48: SWG Dreams

35

3.1.3 Designing RF Using UART

Instead of Encoder and Decoder we can also use with UART6 Tx pin for RF transmitter

and UART Rx pin for RF receiver in microcontroller. If we need to control more than

100 devices we need to rely on encoder and decoder with 100 data lines which will be

very costly. To control more than 100 devices we can choose microcontroller function as

encoder in the transmission side and another microcontroller to function as decoder in the

receiver side.

6 A universal asynchronous receiver/transmitter, abbreviated UART), is a type of "asynchronous

receiver/transmitter", a piece of computer hardware that translates data between parallel and serial forms.

UARTs are commonly used in conjunction with communication standards such as EIA RS-232, RS-

422 or RS-485. The universal designation indicates that the data format and transmission speeds are

configurable and that the actual electric signaling levels and methods (such as differential signaling etc)

typically are handled by a special driver circuit external to the UART.

Page 49: SWG Dreams

36

Fig 3.2 Interfacing Transmitter with ATMEL IC using UART

This is basic circuit of remote control transmitter, we can add more number of keys to the

microcontroller in matrix form please see the diagram below; in this circuit we connected

16 keys. We can connect up to 256 keys if we use all the ports.

Page 50: SWG Dreams

37

The basic circuit for remote control receiver is shown below, if we need to control more

of devices either we can use port expander or we can go-ahead and choose the

microcontroller which has more number of ports, provided it should have UART support.

Page 51: SWG Dreams

38

Fig 3.4: Interfacing Receiver with ATMEL IC

We have shown the receiver connected with 16 led’s. For each key press the transmitter

side, we can assign unique LED to glow in the receiver.

Page 52: SWG Dreams

39

Fig 3.3 Interfacing Receiver with ATMEL IC using UART

Page 53: SWG Dreams

40

Page 54: SWG Dreams

41

3.2 Skeleton code for receiver side

#include<reg52.h>

void main()

{

serial_init();

serial_write('O');

serial_write('K');

while(1)

{

a = serial_read();

switch (a)

{

case 48://1

{

break; //walk front()

}

case 49://2

{

break;//move left()

}

case 50://3

{

break;//stop()

}

case 51://4

Page 55: SWG Dreams

42

{

break;//move right()

}

case 52://5

{

break;//move back()

}

case 53://6

{

break;//handshake()

}

case 54://7

{

break;//skate()

}

case 55://8

{

break;//speak()

}

default://0

{

break;//stop()

}

}

}

Page 56: SWG Dreams

43

3.3 Skeleton code for transmitter side

#include<reg52.h>

void main()

{

serial_init();

serial_write('O');

serial_write('K');

while(1)

{

a = serial_read();

switch (a)

{

case '0':

{

serial_write(48); break; //walk front()

}

case ‘1’:

{

serial_write(49); break; move left()

}

Case’2’: {

serial_write(50); break; stop()

}

case ‘3’:

{

Page 57: SWG Dreams

44

serial_write(51); break; move right()

}

case ‘4’:

{

serial_write(52); break; move back()

}

case ‘5’:

{

serial_write(53); break; //handshake()

}

case ‘6’:

{

serial_write(54); break; //skate()

}

case ‘7’:

{

serial_write(55); break; //speak()

}

default://0

{

serial_write(50); break; //stop()

}

}

}

}

Page 58: SWG Dreams

45

Chapter 4

Testing is way of knowing the accurate working of our project, design and completing a

work does not matters but checking it as to what extent it works correctly is important.

Such a testing can be done by the developer of the project or the client.

In our research work we have successfully completed the modules and the quality check

is done by the EPR labs, a trade mark company.

4.0 Test cases

MODULE I : Mech

Test

Id

Test Case

Name

Test

Description

Tool used

For Testing

Expected

result

Actual

result

Result

1

Dynamics and

Kinematics

Flexibility and

rigidity

Manually

Tested

Bipedal

walk

Not

accurate

F

2

Walking

Motion

Synchronization

Manually

Tested

Bipedal

walk

Not

accurate

F

3

Walking Motion

Synchronization

after impl. of Honda’s walking

assistant technique

Manually

Tested

Bipedal

walk

Perfect

P

Overall Result

PASS

MODULE I is Quality Checked (QC) by EPR LABS

Page 59: SWG Dreams

46

MODULE II : Electronic

Test

Id

Test Case

Name

Test

Description

Tool used

For Testing

Expected

result

Actual

result

Result

1

Drivers

Continuity and

flow of voltage

EPR Serial

Debugger

Control motor by

perfect voltage

flow

Perfect

motor rotation

P

2

sensors

Set bit when object is detected

UMPS Simulator

Detection of Object

Object Detected P

Overall Result

PASS

MODULE II is Quality Checked (QC) by EPR LABS

MODULE III : RF

Test

Id

Test Case

Name

Test

Description

Tool used

For Testing

Expected

result

Actual

result

Result

1

Transmission Of Bytes

Transmission of

Bytes using HT12E

(write cycle)

HyperTermi

nal (HDD Serial

Port Monitor)

Transmit Bytes

Bytes Transmitt

ed

P

2

Reception Of

Bytes

Reception of Bytes using

HT12D (read cycle)

HyperTerminal

(HDD Serial Port

Monitor)

Receptio

n Bytes

Bytes

Received

P

Overall Result

PASS

MODULE III is Quality Checked (QC) by EPR LABS

Page 60: SWG Dreams

47

Chapter 5

Trying our hands in the most growing field of technology, Robotics it is not that easy to

invent new things as it is a matter of cost and time. Hence we have taken an ultimatum

effort to use many motors and sensors with a basic developer board in 8051’s fa mily

called as ATMEL 89S52 to perform all the hyper actions. Thus our humanoid bipedal

robot with ODMTS poses an economical method for devising a robot. This is extremely

essential, because as for now robots are created on a massive cost which the main reason

for why these humanoid robots can’t be used on a large scale to help people. Hence our

method overrides this discrepancy as it provides a best and an economical method for

robots to be fabricated.

Thus it’s been a great experience for us working on this project. We are indeed

very proud as we have implemented all the ideas that we had during the initial stage.

Working on this project has also taught us a lot of new concepts and technologies. It has

made us to be open to the amazing changes which are occurring in the field that

interested us. It is also a great privilege to us because our project can be claimed as a

green project as it can be recycled without any harm. Not giving it a pause with this

implementation work we have planned to focus this idea on a research basis.

Let the dreams continue . . .

Page 61: SWG Dreams

48

APPENDIX A

MECHANICAL

Literature Survey

A Unified Control Frame for Stable Bipedal Walking A unified control frame to regulate possible undesired motions,

which may occur throughout a bipedal walking motion. The

proposed frame is based on the combination of orientation control,

ZMP control and upper body motion regulation to be able to cope

with distinct restriction factors and maintain dynamic balance in a

feasible way. It can be plugged into one mass model based

trajectory generation methods with inverse kinematics solutions. In

order to validate our proposed control frame, we used ZMP based

trajectory generation approach and performed several simulations and experiments. In

conclusion, we obtained

reasonable amounts of decreases

in undesired yaw moment,

orientation error and ZMP error.

Bipedal Walking Pattern

Generation

Development of a Bipedal Humanoid Robot

Control Method of Whole Body Cooperative

Dynamic Biped Walking

The bipedal humanoid robot expected to play an active role

in human living space, through studies on an

anthropomorphic biped walking robot. As the first stage of

developing a bipedal humanoid robot, the authors developed

the human-size 35 active DOF bipedal humanoid robot

Page 62: SWG Dreams

49

―WABIAN‖ and the Human-size 41

active DOF bipedal humanoid

robot ―WABIAN-R‖. The authors

also proposed a basic control method

of whole body cooperative dynamic

biped walking that uses trunk or

trunk-waist cooperative motion to

compensate for three-axis (pitch, roll

and yaw-axis) moment generated not

only by the motion of the lower-limbs planned arbitrarily but by the time trajectory of

the hands planned arbitrarily. Using these systems and the control method, normal

biped walking forward and backward), dynamic dance waving arms and hip, dynamic

carrying of a load using its arms, and trunk-waist cooperative dynamic walking are

achieved.

Walking control method: Outline of the walking control method

The authors previously developed the control method of dynamic biped walking for

biped walking robots as follows.

(1) Model based walking control (ZMP and yaw axis moment control)

(2) Robust walking using the compensation mechanism of the model deviation

(3) Model deviation compensative control.

(4) Real-time control of ZMP and yaw axis moment

(External force compensative control)

Real-Time Estimation Algorithm for the Center of Mass of a Bipedal

Robot with Flexible Inverted Pendulum Model A closed- loop observer to extract the center of mass (CoM) of a bipedal robot is

suggested. Comparing with the simple conversion equation of using just joint angle

measurements, it enables to get more reliable estimates by using both joint angle

measurements and F/T sensor outputs at the ankle joint. First, a nonlinear type

observer is constructed in the extended Kalman filter framework to estimate the

flexible rotational motion of biped. It is based on the inverted pendulum model with

flexible beam which is to simply address the flexible behavior of a biped, specifically

in the single support phase. Then, the predicted estimates of CoM by the flexible

Page 63: SWG Dreams

50

motion observer are combined with the outputs of the CoM conversion equation and

the final estimates will be determined according to the weighting value which

penalizes the flexible motion model and the CoM conversion equation. Simulation

results are followed to show the effectiveness of the proposed scheme.

Walking simulations

Page 64: SWG Dreams

51

Honda’s walking assistance device

Honda unveils leg assist machine for elderly

Nov 7, 2008 (Honda website – Official press release)

TOKYO (AFP) — Honda Motor, a pioneer of humanoid robots, on Friday

unveiled a new walking assist machine designed to make it easier for the elderly to

climb stairs and help factory workers. The computerised leg device is the latest

addition to walking technology developed by the Japanese automaker, which

announced the world's first two- legged walking robot, ASIMO, in 2000.

The 6.5 kilogramme (14.3-pound) device -- consisting of a saddle, leg- like frames and

shoes -- can reduce the load on users' legs while walking or climbing and descending

stairs by supporting bodyweight, Honda said. Honda said the motor-powered machine

is still at an experimental stage, but elderly people and people undergoing

rehabilitation who need support for their leg muscles and joints are the main target.

The device is also expected to help assembly workers to keep a crouching position,

Honda said, adding that it plans to test the device at one of its factories north of

Tokyo. Like with a unicycle, users ride on the seat sustained by frames that can bend

and extend like knees with two motors controlled by signals from sensors inside the

shoes. "We used ASIMO's technology for developing the walking assist device,"

Masato Hirose, a senior engineer at Honda Research and Development, told AFP.

"ASIMO is designed to be used as a tool, but the walking assist device is designed to

complement real human bodies," he said. "Both will exist for the sake of people."

ASIMO, which resembles a child in an astronaut suit, has been used as a receptionist

and master of ceremonies at home and overseas, while dancing and singing with

musicians at concerts. Honda has yet to decide on further details such as when the

latest device will go on sale and at what price, but the company sees a market for it in

Japan, which has an ageing population. "First, we hope to have visible results in

rehabilitation and other medical fields," Hirose said. "Then we will look at welfare as

another target." Last year, Honda unveiled its first walking assist device with a stride

management system, which can help users move their thighs back and forth.

Page 65: SWG Dreams

52

APPENDIX B

ELECTRONICS

Microcontroller versus Microprocessor

By microprocessor is meant the general purpose Microprocessors such as Intel's X86

family (8086, 80286, 80386, 80486, and the Pentium) or Motorola's 680X0 family

(68000, 68010, 68020, 68030, 68040, etc). These microprocessors contain no RAM,

no ROM, and no I/O ports on the chip itself. For this reason, they are commonly

referred to as general-purpose Microprocessors.

A system designer using a general-purpose microprocessor such as the Pentium or the

68040 must add RAM, ROM, I/O ports, and timers externally to make them

functional. Although the addition of external RAM, ROM, and I/O ports makes these

Systems bulkier and much more expensive, they have the advantage of versatility

such that the designer can decide on the amount of RAM, ROM and I/O ports needed

to fit the task at hand. This is not the case with Microcontrollers.

A Microcontroller has a CPU (a microprocessor) in addition to a fixed amount of

RAM, ROM, I/O ports, and a timer all on a single chip. In other words, the processor,

the RAM, ROM, I/O ports and the timer are all embedded together on one chip;

therefore, the designer cannot add any external memory, I/O ports, or timer to it. The

fixed amount of on-chip ROM, RAM, and number of I/O ports in Microcontrollers

makes them ideal for many applications in which cost and space are critical.

In many applications, for example a TV remote control, there is no need for the

computing power of a 486 or even an 8086 microprocessor. These applications most

often require some I/O operations to read signals and turn on and off certain bits.

Micro controllers

A microcontroller (also MCU or µC) is a functional computer system-on-a-chip. It

contains a processor core, memory, and programmable input/output peripherals. A

Page 66: SWG Dreams

53

microcontroller is a programmable integrated circuit with built-in RAM, ROM,

timers, input and output ports

Why 8051?

Standard

Compatibility

Ease of use

Cost effective

Features

Basic 8051 microcontrollers have ROM up to 8K, RAM up to 256 bytes, 32

I/O interface pins

1 UART

2 External interrupts

2 timers

Speed 3 to 33 MHz

Page 67: SWG Dreams

54

Compatible with MCS®-51 Products

8K Bytes of In-System Programmable (ISP) Flash Memory – Endurance:

10,000 Write/Erase Cycles

Basic Hardware Blocks

The bringing process is said to be complete when the hardware and software

contributing the system is working properly.

Page 68: SWG Dreams

55

Complete Circuit Details

Connect +5 Volt to Pin Number: 40 and 31

Connect GND to Pin Number: 20

Connect Power on Reset logic to Pin Number: 9

Connect Crystal Oscillator to Pin Number: 18 and 19

Page 69: SWG Dreams

56

Basic Software Blocks

Software block must have following routines

1. Interrupt vector tables

2. Reset Handler

3. Interrupt Handler

4. Infinite routine

5. Start and end directives

Flexible Boards

Compatible with standard AT89XXX interface

Basic interface routed for external peripherals

Parallel port downloading interface

Debugging

Serial port downloading interface

Serial port debugging interface

Page 70: SWG Dreams

57

Pull up/pull down support for Powerful and sensitive devices

Hardware / Software upgrading option

User friendly and flexible

Serial Port Dongle

Compatible to standard AT89XXX interface

Serial port downloader

Serial port debugger

Compact Size

8051 Flash Programmer

Now we have to introduce the most important part of your tool chest. Whether you

use Simulator, Debugger or IDE or not, you definitely need a kind of programming

facility to fuse your microcontroller with the target code. Only then you can watch

how your design works. If you have an expanded design, then you may need to

program the EPROM with the program code. Sometimes, you may keep a part of

application code in the Flash/EPROM version of the 8031 and remaining part in an

EPROM (in an expanded system).

Time has come to introduce another useful tool, 8051 Programmer. This Programmer

supports the devices in the 8031 family of Atmel, AT89SXX, and its AVR

microcontroller AT90SXXXX series Controllers. The programmer supports both

parallel and SPI programming for your convenience. A powerful window's based GUI

facility makes your programming task an easy one.

The circuit diagram of the stand-alone spi programmer, the power to the

interface is provided by the PC USB port which can supply a max of 100mA

current. Get a cheap USB cable, cut the cable other end connector and attach a crimp

shell connector to this end, red wire is 5V and black is 0V.

The 74HCT541 ic isolate and buffer the parallel port signals. It is necessary to use the

HCT type ic in order to make sure the programmer should also work with 3V type

parallel port. For the u-controller a 40 pin ZIF socket can be used.

This programmer circuit can be use to program the 89S series devices and the AVR

series devices which are pin compatible to 8051, like 90S8515. For other AVR series

Page 71: SWG Dreams

58

devices the user can make an adapter board for 20, 28 and 40 pin devices. The pin

numbers shown in brackets correspond to PC parallel port connector.

Circuit Diagram

DC Motors

What is a DC Motor?

A DC motor is an electric motor that runs on direct current

(DC) electricity. The brushed DC electric motor generates

torque directly from DC power supplied to the motor by

using internal commutation, stationary permanent magnets,

and rotating electrical magnets. Like all electric motors or

generators, torque is produced by the principle of Lorentz

force, which states that any current-carrying conductor placed within an external

Page 72: SWG Dreams

59

magnetic field experiences a torque or force known as Lorentz force. Advantages of a

brushed DC motor include low initial cost, high reliability, and simple control of

motor speed. Disadvantages are high maintenance and low life-span for high intensity

uses. Maintenance involves regularly replacing the brushes and springs which carry

the electric current, as well as cleaning or replacing the commutator. These

components are necessary for transferring electrical power from outside the motor to

the spinning wire windings of the rotor inside the motor.

Types of DC Motors based on torque and speed

Gear motor-Helical gear

10RPM T0 1000RPM 12V DC geared motors

Very easy to use and available in standard size.

Nut and threads on shaft to easily connect Wheel

10RPM 12V DC motors with Gearbox

6mm shaft diameter with internal hole

125gm weight

Same size motor available in various rpm

5kgcm torque

No-load current = 60 mA(Max),

Load current = 300 mA(Max)

Toy motor

12V DC TOY motors for Low Torque applications

Very easy to use and available in standard size.

Gear motor-Helical gear

10RPM T0 1000RPM 12V DC geared motors for

robotics applications

Very easy to use and available in standard size.

Nut and threads on shaft to easily connect Wheel

10RPM 12V DC motors with Gearbox

6mm shaft diameter with internal hole

125gm weight

Page 73: SWG Dreams

60

Same size motor available in various rpm

5kgcm torque

No-load current = 60 mA(Max), Load current = 300 mA(Max)

Side shaft gear motor

10RPM T0 500 RPM 12V DC geared motors for

robotics applications

Very easy to use and available in standard size.

Nut and threads on shaft to easily connect Wheel

10RPM 12V DC motors with Gearbox

6mm shaft diameter with internal hole Max 10Kg

torque.

Working Principle of DC Motor

The direct current (DC) motor is one of the first

machines devised to convert electrical power

into mechanical power. Permanent magnet

(PM) direct current convert electrical energy

into mechanical energy through the interaction

of two magnetic fields. One field is produced

by a permanent magnet assembly; the other

field is produced by an electrical current

flowing in the motor windings. These two fields result in a torque which tends to

rotate the rotor. As the rotor turns, the current in the windings is commutated to

produce a continuous torque output. The stationary electromagnetic field of the motor

can also be wire-wound like the armature (called a wound-field motor) or can be

made up of permanent magnets (called a permanent magnet motor).

Page 74: SWG Dreams

61

Torque Speed Relation

Calculating Torque

Torque is the force that produces rotation. It causes an

object to rotate. Torque consist of a force acting on

distance. Torque, like work, is measured is pound-feet

(lb-ft). However, torque, unlike work, may exist even

though no movement occurs.

To calculate torque,

T = F x D

Where T = torque (in lb-ft) F = force (in lb) D =

distance (in ft)

Example: What is the torque produced by a 60 lb force pushing on a 3' lever arm?

T = F x D T = 60 x 3 T = 180 lb ft

Page 75: SWG Dreams

62

Page 76: SWG Dreams

63

Motor Drivers

Push-Pull Four Channel Driver

Features

Output Current 1A Per Channel (600mA

for L293D)

Peak Output Current 2A Per Channel

(1.2A for L293D)

Inhibit Facility

High Noise Immunity

Separate Logic Supply

Over-Temperature Protection

Description

The L293 and L293D are quad push-pull drivers capable of

delivering output currents to 1A or 600mA per channel

respectively. Each channels controlled by a TTL-compatible

logic input and each pair of drivers (full bridge) is equipped

with an inhibit input which turns off all four transistors. A

separate supply input is provided for the logic so that it may be run off a lower

voltage to reduce dissipation. Additionally the L293D includes the output clamping

diodes within the IC for complete interfacing with inductive loads. Both devices are

available in 16-pin Batwing DIP packages. They are also available in Power S0IC and

Hermetic DIL packages.

ADC 0804

General Description

The ADC0801, ADC0802, ADC0803,

ADC0804 andADC0805 are CMOS 8-bit

successive approximation A/D converters

that use a differential potentiometric ladder

similar to the 256R products. These

converters are de-signed to allow operation

Page 77: SWG Dreams

64

with the NSC800 and INS8080Aderivative control bus with TRI-STATEÉ output

latches directly driving the data bus. These A/Ds appear like memory locations or I/O

ports to the microprocessor and no interfacing logic is needed. Differential analog

voltage inputs allow increasing the common-mode rejection and offsetting the analog

zero input voltage value. In addition, the voltage reference input can be adjusted to

allow encoding any smaller analog voltage span to the full 8 bits of resolution.

Page 78: SWG Dreams

65

Liquid Crystal Displays

The RCM2034R is a reflective TN type liquid crystal module with a built-in

controller / driver LSI and a display capacity of 16 characters 1 line.

Features

Wide viewing angle and high contrast, 5_7 dot character matrix with cursor,

Interfaces with 4-bit or 8-bit MPUs, Displays up to 226 characters and special

symbols, Custom character patterns are displayed with the character RAM, Abundant

instruction set including clear display, cursor on /off, and character blinking,

Compact and light weight for easy assembly to the host instrument, Operable on

single 5 V power supply, Low power consumption.

Page 79: SWG Dreams

66

Page 80: SWG Dreams

67

APPENDIX C

RF

HT12E encoder

Features

Operating voltage, 2.4V~5V for the HT12A,

2.4V~12V for the HT12E, Low power and high noise

immunity CMOS technology, Low standby current:

0.1_A (typ.) at VDD=5V, HT12A with a 38kHz

carrier for infrared, transmission medium, Minimum

transmission word, Four words for the HT12E, One word for the HT12A, Built- in

oscillator needs only 5% resistor, Data code has positive polarity, Minimal external

components, HT12A/E: 18-pin DIP/20-pin SOP package.

General Description The 212 encoders are a series of CMOS LSIs for remote control system applications.

They are capable of encoding information which consists of N address bits and 12_N data

bits. Each address/data input can be set to one of the two logic states. The programmed

addresses/data are transmitted together with the header bits via an RF or an infrared

transmission medium upon receipt of a trigger signal. The capability to select a TE

trigger on the HT12E or a DATA trigger on the HT12A further enhances the application

Flexibility of the 212 series of encoders. The HT12A additionally provides a 38kHz

carrier for infrared systems.

Block Diagram

Page 81: SWG Dreams

68

Pin Assignment

Page 82: SWG Dreams

69

The 212 series of encoders begin a 4-word transmission cycle upon receipt of a

Transmission enable (TE for the HT12E or D8~D11 for the HT12A, active low). This

cycle will repeat itself as long as the transmission enable (TE or D8~D11) is held low.

Once the transmission enables returns high the encoder output completes its final cycle

and then stops as shown below.

Page 83: SWG Dreams

70

Information word

If L/MB=1 the device is in the latch mode (for use with the latch type of data decoders).

When the transmission enable is removed during a transmission, the DOUT pin outputs a

complete word and then stops. On the other hand, if L/MB=0 the device is in the

momentary mode (for use with the momentary type of data decoders). When the

transmission enable is removed during a transmission, the DOUT outputs a complete

word and then adds 7 words all with the _1_ data code.

An information word consists of 4 periods as illustrated below.

Address/data waveform

Each programmable address/data pin can be externally set to one of the following two

logic states as shown below.

Address/data programming (preset)

Page 84: SWG Dreams

71

The status of each address/data pin can be individually pre-set to logic _high_ or _low_.

If a transmission-enable signal is applied, the encoder scans and transmits the status of

the 12 bits of address/data serially in the order A0 to AD11 for the HT12E encoder and

A0 to D11 for the HT12Aencoder.During information transmission these bits are

transmitted with a preceding synchronization bit. Ifthe trigger signal is not applied, the

chip enters the standby mode and consumes a reduced current of less than 1_A for a

supply voltage of 5V. Usual applications preset the address pins with individual security

codes using DIP switches or PCB wiring, while the data is selected by push buttons or

electronic switches. The following figure shows an application using the HT12E:

Address/Data sequence

The following provides the address/data sequence table for various models of the 212

series ofencoders. The correct device should be selected according to the individual

address and data requirements.

Page 85: SWG Dreams

72

Transmission enable For the HT12E encoders, transmission is enabled by applying a low signal to the TE pin.

For the HT12A encoders, transmission is enabled by applying a low signal to one of the

data pins D8~D11.

Two erroneous HT12E application circuits

The HT12E must follow closely the application circuits provided by Holtek .

Error: AD8~AD11 pins input voltage > VDD+0.3V Error: The IC_s power source is

activated by pins AD8~AD11

Page 86: SWG Dreams

73

APPENDIX D

IMPLEMENTATION

8051 C-Compiler & Assembler KEIL

Keil develops, manufactures, and distributes embedded

software development tools for 8051, 251, ARM, and XC16x/C16x/ST10

microcontroller families. We provide ANSI C compilers, Macro Assemblers, real-

time executives, debuggers and simulators, integrated environments, and evaluation

boards. This web site provides the latest information about our development tools,

evaluation tools, software updates, application notes, example programs, and links to

other sources of information.

UMPS

Universal Microcontroller Programmable

Simulator

UMPS is a universal microcontroller simulator, it runs under Windows 95, Windows

3.11 or Windows NT in a MDI environment. UMPS simulates a microcontroller with

its external environment (we call this « resources »). You can simulate a whole

system such a clock with:. a LCD panel, a real time I2C clock, 4 push button, a

microcontroller. UMPS are able to simulate external components connected to the

microcontroller. Then, debug step is dramatically reduced. UMPS is not dedicated to

only one microcontroller family, it can simulate all kind of microcontrollers. The

main limitation is to have less than 64K-Bytes of RAM and ROM space and the good

microcontroller library.

UMPS include an integrated universal assembler/disassembler but is able to use

external assembler and compiler and to show source code and variables. UMPS

resources can be simply extended if you do not find the external resource you need.

There is a complete documentation and example to write your own resources in « C »

or « PASCAL » language.There is already two libraries which allows UMPS to use

external compiler/assembler instead of its own integrated

Page 87: SWG Dreams

74

assembler: MICROCHIP Assembler and C Compiler, COSMIC Software Assembler

and C Compiler

EPR Serial Debugger

Serial port communication

The serial debug functions are responsible for initializing and communicating with a

debug message output device. Typically, this is a serial UART device connected over

a NULL modem cable to a terminal emulator on the host computer. The OS or OAL

implements the same code, so a single implementation can be shared between the

OAL and the boot loader. The first step in debugging RS232 connections is to make

sure that you are connected to the correct COM port on your PC and that you have the

right cable for connecting the device to your PC.

This serial debugger is used to perform the following operations:

Erase Write Verify Read

Simply it debugs errors in serial port communications. And to erase or load hex file

in controller.

Visual Studio 2005

Professional editon from microsoft

Microsoft Visual C# 2005, pronounced C sharp, is a

programming language designed for building a wide range of applications that run on

the .NET Framework. C# is simple, powerful, type-safe, and object-oriented. With its

many innovations, C# enables rapid application development while retaining the

expressiveness and elegance of C-style languages.

Visual Studio supports Visual C# with a full- featured Code Editor, project templates,

designers, code wizards, a powerful and easy-to-use debugger, and other tools. The

.NET Framework class library provides access to a wide range of operating system

services and other useful, well-designed classes that speed up the development cycle

significantly.

Page 88: SWG Dreams

75

HyperTerminal

HyperTerminal is an application you can use in order to connect your computer to

other remote systems. These systems include other computers, bulletin board systems,

servers, Telnet sites, and online services. However, you would need a modem,

an Ethernet connection, or a null modem cable before you can use HyperTerminal.

LCD AND SENSORS INTERFACING

/ * Filename: lcd.h

* Hardware: Controller -> AT89S52

* I/O RS -> P3.7

* Enable -> P3.6

* Data -> P2.0, P2.1, P2.2, P2.3, P2.4, P2.5, P2.6, P2.7

* Sensors -> P1.0, P1.1, P1.2, P1.3

* Compiler: keil

*/

#include <AT89X55.H>

#define LCD_DELAY 1535 /* Delay for 1 ms */

#define LCD_clear() LCD_command(0x1) /* Clear display LCD */

#define LCD_origin() LCD_command(0x2) /* Set to origin LCD */

#define LCD_row1 () LCD_command(0x80) /* Begin at Line 1 */

#define LCD_row2 () LCD_command(0xC0) /* Begin at Line 2 */

sbit LCD_en=P3^6;

sbit LCD_rs=P3^7;

sbit SEN_PIR=P1^0;

sbit SEN_TEMP=P1^1;

sbit SEN_IR=P1^2;

sbit SEN_ULTRA=P1^3;

/* Prototype(s)*/

void LCD_delay(unsigned char ms);

void LCD_enable();

Page 89: SWG Dreams

76

void LCD_command(unsigned char command);

void LCD_putc(unsigned char ascii);

void LCD_puts(unsigned char *lcd_string);

void LCD_init();

/* Sources */

void LCD_delay(unsigned char ms)

{

unsigned char n;

unsigned int i;

for (n=0; n<ms; n++)

{

for (i=0; i<LCD_DELAY; i++); /* For 1 ms */

}

}

void LCD_enable()

{

LCD_en = 0; /* Clear bit P3.6 */

LCD_delay(1);

LCD_delay(1);

LCD_delay(1);

LCD_en = 1; /* Set bit P3.6 */

}

void LCD_command(unsigned char command)

{

LCD_rs = 0; /* Clear bit P3.7 */

P2 = (P2 & 0xF0)|((command>>4) & 0x0F);

LCD_enable();

P2 = (P2 & 0xF0)|(command & 0x0F);

LCD_enable();

Page 90: SWG Dreams

77

LCD_delay(1);

}

void LCD_putc(unsigned char ascii)

{

LCD_rs = 1; /* Set bit P3.7 */

P2 = (P2 & 0xF0)|((ascii>>4) & 0x0F);

LCD_enable();

P2 = (P2 & 0xF0)|(ascii & 0x0F);

LCD_enable();

LCD_delay(1);

}

void LCD_puts(unsigned char *lcd_string)

{

while (*lcd_string)

{

LCD_putc(*lcd_string++);

}

}

void LCD_init()

{

LCD_en = 1; /* Set bit P3.6 */

LCD_rs = 0; /* Clear bit P3.7 */

LCD_command(0x38);

LCD_command(0x0E);

LCD_clear();

LCD_command(0x06);

LCD_command(0x82);

LCD_delay(256);

LCD_delay(256);

Page 91: SWG Dreams

78

}

/ * Filename: lcdmain.c*/

#include <AT89X55.H>

#include "lcd.h"

main( )

{

LCD_init();

{

LCD_row1();

LCD_puts("SWG Vertical View Innovators | sri wils gokul | proudly presenting SWG Dreams. A Humanoid Bipedal Robo with ODMTS using

AT89S52");

}

while (1);

if(SEN_PIR==1)

{

LCD_command(0xC0);

LCD_puts("PIR");

LCD_delay(256);

LCD_delay(256);

LCD_delay(256);

LCD_puts(" ");

}

if(SEN_TEMP==1)

{

LCD_command(0xC4);

LCD_puts("TEMP");

LCD_delay(256);

LCD_delay(256);

LCD_delay(256);

Page 92: SWG Dreams

79

LCD_puts(" ");

}

if(SEN_IR==1)

{

LCD_command(0xC9);

LCD_puts("IR");

LCD_delay(256);

LCD_delay(256);

LCD_delay(256);

LCD_puts(" ");

}

if(SEN_ULTRA==1)

{

LCD_command(0xC12);

LCD_puts("ULTRA");

LCD_delay(256);

LCD_delay(256);

LCD_delay(256);

LCD_puts(" ");

}

}

HEX FILE

/ * Filename: lcdmain.hex*/

:0300000002095E94

:0C095E00787FE4F6D8FD75810A02094B91

:1008000053574720566572746963616C2056696559

:100810007720496E6E6F7661746F7273207C2073DF

:1008200072692077696C7320676F6B756C207C2010

:1008300070726F75646C792070726573656E74691F

Page 93: SWG Dreams

80

CHECK FOR ERROR AND HEX FILE CREATED

:100840006E672053574720447265616D732E2020D8

:10085000412048756D616E6F6964204269706564FE

:10086000616C20526F626F2077697468204F444D2D

:100870005453207573696E672041543839533532AB

:1008800000504952002020200054454D50002020A7

:10089000202000495200202000554C545241002095

:0508A0002020202000D3

:10091900E4FEEEC39F5011E4FDFC0DBD00010CBCCB

:0809290005F8BDFFF50E80EAA0

:0109310022A3

:1008A500EBC4540FFFE5A054F04FF5A01208BFEBC1

:0A08B500540FFFE5A054F04FF5A02A

:1008BF00C2B67F01120919120919120919D2B622EB

:0C096A00AB07C2B71208A57F01020919F3

:0C097600AB07D2B71208A57F01020919D7

Page 94: SWG Dreams

81

:1008CF008B088A09890AAB08AA09A90A120932609A

:1008DF0013050AE50A7002050914F9120932FF120D

:0508EF00097680E22201

:1008F400D2B6C2B77F3812096A7F0E12096A7F0125

:1009040012096A7F0612096A7F8212096AE4FF12D9

:05091400091902091998

:10094B001208F47F8012096A7BFF7A08790012087B

:03095B00CF80FE4C

:10093200BB010689828A83E0225002E722BBFE02C3

:09094200E32289828A83E49322F6

:00000001FF

LOADING HEX FILE IN MICROCONTROLLER

SENSOR USING ADC

/ * Filename: adc.asm*/

rd equ P3.7 ;Read signal P3.7

wr equ P3.6 ;Write signal P3.6

cs equ P1.0 ;Chip Select P1.0

Page 95: SWG Dreams

82

intr equ P3.2 ;INTR signal P3.2

adc_port equ P0 ;ADC data pins P0

adc_val equ 30H ;ADC read value stored here

; -------main prog

org 0x00

mov r1,#38H ;select 2 lines 5x7 matrix lcd

call command

mov r1,#0EH ;display on cursor blinking

call command

mov r1,#06H ;auto increment the cursor

call command

mov r1,#01H ;clear display

call command

; --------------------start of the program

start: ;Start of Program

acall conv ;Start ADC conversion

acall read ;Read converted value

acall conversion

call data2

call data1

call data

call delay

call delay

call delay

call delay

call delay

call delay

mov r1,#01H ;clear display

call command

Page 96: SWG Dreams

83

call delay

jmp start

; Do it again

; ---------------analog to digital conv

conv: ;Start of Conversion

clr cs ;Make CS low

clr wr ;Make WR Low

nop

setb wr ;Make WR High

setb cs ;Make CS high

wait: jb intr,wait

ret ;Conversion done

; ----------------read from adc

read: ;Read ADC value

clr cs ;Make CS Low

clr rd ;Make RD Low

mov a,adc_port ;Read the converted value

mov adc_val,a ;Store it in local variable

setb rd ;Make RD High

setb cs ;Make CS High

ret ;Reading done

; --------------delay prog

delay:

mov r1,#255

l2: mov r0,#255

l1: djnz r0,l1

djnz r1,l2

ret

; -------------command for lcd

Page 97: SWG Dreams

84

command:

clr p1.1

mov p2,r1

setb p1.2

call delay

clr p1.2

ret

; ------------data for lcd

data2:

setb p1.1

mov p2,r4

setb p1.2

clr p1.2

call delay

ret

data1:

setb p1.1

mov p2,r3

setb p1.2

clr p1.2

call delay

ret

data:

setb p1.1

mov p2,r2

setb p1.2

clr p1.2

call delay

ret

Page 98: SWG Dreams

85

;-adc to ascii conv

conversion:

mov b,#10

div ab

mov r2,b

mov b,#10

div ab

orl a,#30h

mov r4,a

mov a,b

orl a,#30h

mov r3,a

mov a,r2

orl a,#30h

mov r2,a

ret

end

LOAD CPU REGISTER

Page 99: SWG Dreams

86

HEX FILE

/ * Filename: adc.hex*/

:100000007938120063790E12006379061200637961

:0100100001EE

:100011001200631140114D119312006F12007B12F7

:02002100008756

:1000230012005A12005A12005A12005A12005A129F

:02003300005A71

:10003500790112006312005A020014C290C2B60080

:10004500D2B6D29020B2FD22C290C2B7E580F5307B

:10005500D2B7D2902279FF78FFD8FED9FA22C29181

:1000650089A0D29212005AC29222D2918CA0D29229

:10007500C29212005A22D2918BA0D292C292120041

:010085005A20

:1000860022D2918AA0D292C29212005A2275F00A06

:1000960084AAF075F00A844430FCE5F04430FBEAAB

:0400A6004430FA22C6 :00000001FF

Page 100: SWG Dreams

87

RF TRANSMITTER

/ * Filename: rftx.c*/

#include<stdio.h>

#include<reg52.h>

void serial_init()

{

TMOD = 0x20; //Timer MODe register

SCON = 0x50; //Serial port CONtoller register

TH1 = 0xFD;

TR1 = 1;

}

void serial_write(unsigned char dat)

{

SBUF = dat; //Serial Buffer

while(!TI);

TI = 0; //TX

}

unsigned char serial_read()

{

while(!RI);

RI = 0; //RX

return SBUF;

}

void main()

{

unsigned char a;

serial_init();

serial_write('O');

serial_write('K');

Page 101: SWG Dreams

88

while(1)

{

a = serial_read();

switch(a)

{ case '0':

{ serial_write(48); ///front

break;

}

case '1':

{ serial_write(49); ///left

break;

}

case '2':

{ serial_write(50); ///walk

break;

}

case '3':

{ serial_write(51); ///right

break;

}

case '4':

{ serial_write(52); ///back

break;

}

case '5':

{

serial_write(53); ///handshake

break;

Page 102: SWG Dreams

89

}

case '6':

{ serial_write(54); ///stop

break;

}

case '7':

{ serial_write(55); ///speak

break;

}

default:

{ serial_write(54); ///stop

break;

}

}

}

}

HEX FILE

/ * Filename: rftx.hex*/

:030000000208678C

:0C086700787FE4F6D8FD758107020800D8

:0C087300758920759850758DFDD28E227D

:08087F008F993099FDC2992206

:080887003098FDC298AF9922E0

:100800001208737F4F12087F7F4B804F120887EFCB

:1008100024D0B40800504990082575F003A4C5837E

:1008200025F0C5837302083D02084102084502080D

:100830004902084D0208510208550208597F3080CC

:100840001A7F3180167F3280127F33800E7F348092

:100850000A7F3580067F3680027F3712087F80ACA2

Page 103: SWG Dreams

90

:070860007F3612087F80A51E

:00000001FF

Page 104: SWG Dreams

91

RF RECEIVER

/*file name: rx.c*/

//header_files

#include <REGX51.H>

#include<stdio.h>

//var_declaration

unsigned int a,i,j;

//prototype

void walk(void);

void front(void);

void back(void);

void left(void);

void right(void);

void handshake(void);

void stop(void);

Page 105: SWG Dreams

92

//port3_assigned

sbit s0=P0^7;sbit s1=P0^6;

sbit s2=P0^5;sbit s3=P0^4;

sbit s4=P0^3;sbit s5=P0^2;

sbit s6=P0^1;sbit s7=P0^0;

sbit t0=P2^0;sbit t1=P2^1;

sbit t2=P2^2;sbit t3=P2^3;

sbit t4=P2^4;sbit t5=P2^5;

sbit t6=P2^6;sbit t7=P2^7;

sbit r0=P1^2;sbit r1=P1^3;

//delay

void wait(unsigned int a)

{

for(i=0;i<a;i++)

{ for(j=0;j<a;j++)

{

;

}

}

}

void walk()

{

s0=1;s1=0;s2=1;s3=0;

t4=1;t5=0;t0=1;t1=0;

r0=0;r1=1;

wait(60000);

t4=0;t5=0;t0=0;t1=0;

s0=0;s1=0;s2=0;s3=0;

r0=0;r1=0;

Page 106: SWG Dreams

93

wait(50000);

s4=0;s5=1;s6=0;s7=1;

t4=0;t5=1;t0=0;t1=1;

r0=1;r1=0;

wait(60000);

t4=0;t5=0;t0=0;t1=0;

s4=0;s5=0;s6=0;s7=0;

r0=0;r1=0;

wait(50000);

}

void back()

{ s0=0;s1=1;s2=0;s3=1;s4=1;s5=0;s6=1;s7=0;

wait(60000);

s0=0;s1=0;s2=0;s3=0;s4=0;s5=0;s6=0;s7=0;

wait(50000);

}

void front() { }

void left() { }

void right() { }

void stop() { }

void handshake(){ }

//port assigned for serial port communication _rf

void serial_init()

{

TMOD = 0x20;

SCON = 0x50;

TH1 = 0xFD;

TR1 = 1;

}

Page 107: SWG Dreams

94

void serial_write(unsigned char dat)

{

SBUF = dat;

while(!TI);

TI = 0;

}

unsigned char serial_read()

{

while(!RI);

RI = 0;

return SBUF;

}

//main_function

void main()

{

unsigned char a;

serial_init();

serial_write('O');

serial_write('K');

while(1)

{

a = serial_read();

switch(a)

{

case 48:

{

front(); ///front

break;

Page 108: SWG Dreams

95

}

case 49:

{

left(); ///left

break;

}

case 50:

{

walk(); ///walk

break;

}

case 51:

{

right(); ///right

break;

}

case 52:

{

back(); ///back

break;

}

case 53:

{

handshake(); ///handshake

break;

}

case 54:

{

stop(); ///stop

Page 109: SWG Dreams

96

break;

}

case 55:

{

speak(); ///speak

break;

}

default:

{

stop();

break;

}

}

}

}

HEX FILE

/*file name: rx.hex*/

:0300000002092EC4

:0C092E00787FE4F6D8FD75810D0208000A

:0408CF007F607EEADE

:1008D300E4F50AF50BC3E50B9FE50A9E5022E4F508

:1008E3000CF50DC3E50D9FE50C9E500A050DE50DB6

:1008F30070F1050C80ED050BE50B70D9050A80D569

:0109030022D1

:10086B00D287C286D285C284D2A4C2A5D2A0C2A18D

:10087B00C292D2931208CFC2A4C2A5C2A0C2A1C277

Page 110: SWG Dreams

97

:10088B0087C286C285C284C292C2937F507EC31236

:10089B0008D3C283D282C281D280C2A4D2A5C2A005

:1008AB00D2A1D292C2931208CFC2A4C2A5C2A0C237

:1008BB00A1C283C282C281C280C292C2937F507E88

:0408CB00C30208D389

:10090400C287D286C285D284D283C282D281C28077

:100914001208CFC287C286C285C284C283C282C281

:0A09240081C2807F507EC30208D319

:01095600227E

:01095700227D

:01095800227C

:01095900227B

:01095A00227A

:0C093A00758920759850758DFDD28E22B5

:080946008F993099FDC299223E

:08094E003098FDC298AF992218

:1008000012093A7F4F1209467F4B12094612094ED0

:10081000EF24D0B40800504E90082675F003A4C50C

:100820008325F0C5837302083E020843020848028C

:10083000084D02085202085702085C0208611209BA

:100840005680CA12095780C512086B80C012095819

:1008500080BB12090480B612095A80B1120959806E

:0B086000AC12000080A712095980A212 :00000001FF

Page 111: SWG Dreams

98

USER INTERFACE DESIGN

/*File name:Robotui.cs*/

using System;

using System.Collections.Generic; using System.ComponentModel; using System.Data;

using System.Drawing; using System.Text; using System.Windows.Forms;

using System.IO.Ports; using swgdreams;

namespace UI {

public partial class Form1 : Form {

SerialPort serialport; SelectPort spobject = new SelectPort(); String port;

public Form1() {

InitializeComponent(); }

private void button1_Click(object sender, EventArgs e) {

if (configSerialport()) { if (!serialport.IsOpen)

serialport.Open(); byte[] wbuffer = new byte[1];

wbuffer[0] = 0x55; serialport.Write(wbuffer, 0, wbuffer.Length); serialport.Close();

} }

private void button1_Click_1(object sender, EventArgs e) {

//FRONT if (configSerialport())

{ if (!serialport.IsOpen) serialport.Open();

byte[] wbuffer = new byte[1]; wbuffer[0] =0X01;

serialport.Write(wbuffer, 0, wbuffer.Length);

Page 112: SWG Dreams

99

serialport.Close();

} }

private void button2_Click(object sender, EventArgs e) {

//LEFT if (configSerialport())

{ if (!serialport.IsOpen) serialport.Open();

byte[] wbuffer = new byte[1]; wbuffer[0] = 0x02;

serialport.Write(wbuffer, 0, wbuffer.Length); serialport.Close(); }

}

private void button3_Click(object sender, EventArgs e) {

//STOP if (configSerialport())

{ if (!serialport.IsOpen) serialport.Open();

byte[] wbuffer = new byte[1]; wbuffer[0] = 0X03;

serialport.Write(wbuffer, 0, wbuffer.Length); serialport.Close(); }

}

private void pORTToolStripMenuItem_Click(object sender, EventArgs e) {

spobject.ShowDialog(); //creating object for GetPortDevice

GetPortDevice gvobj = spobject.getvaluesobj(); //checking object is null or not if not null getting port value if (gvobj != null)

{ port = gvobj.getSelectedPort();

//displaying value in label Selected_Port_Label.Text = port; }

} private void button4_Click(object sender, EventArgs e)

{ //RIGHT

Page 113: SWG Dreams

100

if (configSerialport())

{ if (!serialport.IsOpen)

serialport.Open(); byte[] wbuffer = new byte[1]; wbuffer[0] = 0x04;

serialport.Write(wbuffer, 0, wbuffer.Length); serialport.Close();

} } private void button5_Click(object sender, EventArgs e)

{ //BACK

if (configSerialport()) { if (!serialport.IsOpen)

serialport.Open(); byte[] wbuffer = new byte[1];

wbuffer[0] = 0x05; serialport.Write(wbuffer, 0, wbuffer.Length); serialport.Close();

} }

public Boolean configSerialport() { Boolean b = false;

if (Selected_Port_Label.Text.Trim().Length != 0) {

port = Selected_Port_Label.Text; serialport = new SerialPort(port, 57600, Parity.None); b = true;

} else

{ b = false; MessageBox.Show("please select Port");

} return b;

} private void button6_Click(object sender, EventArgs e)

{ //HANDSHAKE

if (configSerialport()) { if (!serialport.IsOpen)

serialport.Open(); byte[] wbuffer = new byte[1];

wbuffer[0] = 0x06; serialport.Write(wbuffer, 0, wbuffer.Length);

Page 114: SWG Dreams

101

serialport.Close();

} }

private void button7_Click(object sender, EventArgs e) {

//WALK if (configSerialport())

{ if (!serialport.IsOpen) serialport.Open();

byte[] wbuffer = new byte[1]; wbuffer[0] = 0x07;

serialport.Write(wbuffer, 0, wbuffer.Length); serialport.Close(); }

}

private void button8_Click(object sender, EventArgs e) {

//SPEAK if (configSerialport())

{ if (!serialport.IsOpen) serialport.Open();

byte[] wbuffer = new byte[1]; wbuffer[0] = 0x08;

serialport.Write(wbuffer, 0, wbuffer.Length); serialport.Close(); }

}

Page 115: SWG Dreams

102

Page 116: SWG Dreams

103

Page 117: SWG Dreams

References

IEEE

1. Barkan Ugurlu, Takahiro Hirabayashi and Atsuo Kawamura, (2009)

‘A Unified Control Frame for Stable Bipedal Walking’, Department of Electrical

and Computer Engineering, Yokohama National University.

2. Jin7ichiY amaguchi, E@ Soga, Sadatoshi Inoue and Atsuo Takanishi, (1999)

‘Development of a Bipedal Humanoid Robot Control Method of Whole Body

Cooperative Dynamic Biped Walking’, Humanoid Research Laboratory,

Advanced Research Institute for Science and Engineering, Graduate School of

Science and Engineering, Department of Mechanical Engineering, School of

Science and Engineering Waseda University.

3. SangJoo Kwon and Yonghwan Oh, (2009) ’Real-Time Estimation Algorithm for

the Center of Mass of a Bipedal Robot with Flexible Inverted Pendulum Model ‘.

Books

4. Muhammad Ali Mazidi, Janice Gillispie, Rolin D. McKinlay, (Pearson Second

Edtion 2008) ‘The 8051 Microcontroller and Embedded Systems Using Assembly

and C’.

WWW

5. www.google.com

6. www.wikipedia.com

7. www.8051projects.info

8. www.eprlabs.com

9. www.asimo.honda.com

10. www.keil.com

Page 118: SWG Dreams

INDEX

8051 53

8051 flash programmer 57

A

ADC 0804 21

ATMEL 89S52 17

B

Bipedal walk 11

Bipedalism 12

C

Capacitor 22

Centripetal force 10

D

DC motor 58

Decoder 32

Diode 26

Dynamics 7

E

Electrical battery 29

Encoder 32

F

Flexible boards 56

G

Gravitational potential

energy 11

H

Hondas walking assistance

51

HT12D 34

HT12E 33

HyperTerminal 75

I

IC 17

Information word 70

IR Sensor 25

K

Kinematics 7

L

L293D 17

LCD 22

LED 24

M

Microcontroller

microprocessor 52

Motor drivers 63

P

PIR sensor 24

Power supply 28

R

Relay 28

Resister 21

RF controller 31

RS232 16

S

Sensor 20

Serial port 16

Serial port communication

74

Serial port dongle 57

T

Temperature sensor 27

Torque speed relation 51

Touch Plate 27

Transistor 26

U

UART 35

Ultrasonic sensor 22

UMPS 73

W

WABIAN 49

Walking simulation 50

Z

ZMP 48

Page 119: SWG Dreams
Page 120: SWG Dreams
Page 121: SWG Dreams