Você está na página 1de 29

INTRODUCTION OF ROBOTIC ARM USING PC

The advent of new high-speed technology and the growing computer capacity
provided realistic opportunity for new robot controls and realization of new methods of
control theory. This technical improvement together with the need for high performance
robots created faster, more accurate and more intelligent robots using new robots control
devices, new drives and advanced control algorithms.
This project describes a new economical solution of robot control systems. The
presented robot control system can be used for different sophisticated robot applications.
The control system consists of a PC, a microcontroller that collects data from the PC and
control the robot.

The controlling of the robot is done by sending commands from the PCs Hyper
terminal. Capturing of locations videos can also be done if we connect the wireless
camera, and the same things can be monitored on the PC.

2. INTRODUCTION TO EMBEDDED SYSTEMS


2.1 EMBEDDED SYSTEM
An embedded system is a combination of computer hardware and software, either
fixed in capability or programmable, that is specifically designed for a particular kind of
application device. It is a special-purpose computer system designed to perform one or a
few dedicated functions, sometimes with real-time computing constraints. It is usually
embedded as part of a complete device including hardware and mechanical parts.

Embedded systems have become very important today as they control many of
the common devices we use. Since the embedded system is dedicated to specific tasks,
design engineers can optimize it, reducing the size and cost of the product, or increasing
the reliability and performance.

An embedded system is some combination of computer hardware and software,


either fixed in capability or programmable, that is specifically designed for a particular
kind of application device. Industrial machines, automobiles, medical equipment,
cameras, household appliances, airplanes, vending machines, and toys (as well as the
more obvious cellular phone and PDA) are among the myriad possible hosts of an
embedded system. Embedded systems that are programmable are provided with a
programming interface, and embedded systems programming is a specialized occupation.

2.2 APPLICATIONS OF EMBEDDED SYSTEMS


Any fast applications which make you believe in your basic survival are just because
of these embedded systems. Our daily life depends on the proper functioning of many
gadgets like Television, Radio, CD player, Card readers, Access Controllers etc. If we go
in detail, we can use these embedded systems in,

Military and Aerospace Software applications:


The LynxOS-178 RTOS for software certification, based on the RTCA DO-178B
standard, assists developers in gaining certification for their mission- and safety-critical
systems.

Communications Applications:
Lynux works Jumpstart for Communications package enables OEMs to rapidly
develop mission-critical communications equipment, with pre-integrated, state-of-the-art,
data networking and porting software componentsincluding source code for easy
customization.

Industrial Automation and Process Control:


Designers of industrial and process control systems know from experience that
LynuxWorks operating systems provide the security and reliability that their industrial
applications require.
From ISO 9001 certification to fault-tolerance, POSIX conformance, secure partitioning
and high availability, we've got it all. Take advantage of our 20 years of experience.

3. AT89S52 MICROCONTROLLERS
3.1 INTRODUCTION
The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K
bytes of in-system programmable Flash memory. The device is manufactured using
Atmels high-density nonvolatile memory technology and is compatible with the Industry-standard 80C51 instruction set and pin out. The on-chip Flash allows the program
memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a
monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a
highly-flexible and cost-effective solution to many embedded control applications. The
AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM,
32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector
two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock
circuitry. In addition, the AT89S52 is designed with static logic for operation down to
zero frequency and supports two software selectable power saving modes.

3.2 Features
Compatible with MCS-51 Products
8K Bytes of In-System Programmable (ISP) Flash Memory
Endurance: 10,000 Write/Erase Cycles
4.0V to 5.5V Operating Range
Fully Static Operation: 0 Hz to 33 MHz
Three-level Program Memory Lock
256 x 8-bit Internal RAM
32 Programmable I/O Lines

3.3 BLOCK DIAGRAM

FIGURE 3.1
It has lot of features like Compatible with MCS-51 Products, Interrupt Recovery
from Power-down Mode, Flexible ISP Programming (Byte and Page Mode), Low-power
Idle and Power-down Modes, Fast Programming Time etc.

3.4 PIN DIAGRAM

FIGURE 3.2

3.5 Pin Description


VCC: Supply voltage.
GND: Ground.

PORT 0: Port 0 is an 8-bit open drain bidirectional I/O port. As an output


port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be
used as high-impedance input.

PORT 1: Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The
Port 1 output buffers can sink/source four TTL inputs.

PORT 2: Port 2 uses strong internal pull-ups when emitting 1s. It emits the
high-order address byte during fetches from external program memory and during accesses to
external data memory that use 16-bit addresses.

PORT 3: Port 3 receives some control signals for Flash programming and
verification

RST: Reset input. A high on this pin for two machine cycles while the
oscillator is running resets the device. This pin drives high for 98 oscillator periods after the
Watchdog times out.

ALE/PROG: Address Latch Enable (ALE) is an output pulse for latching the
low byte of the address during accesses to external memory. This pin is also the program
pulse input (PROG) during Flash programming.

PSEN:

Program Store Enable (PSEN) is the read strobe to external program

memory. When the AT89S52 is executing code from external program memory, PSEN is
activated twice each machine cycle, except that two PSEN activations are skipped during
each access to external data memory.

EA/VPP: External Access Enable. EA must be strapped to GND in order to


enable the device to fetch code from external program memory locations starting at
0000H up to FFFFH.

XTAL1:

Input to the inverting oscillator amplifier and input to the internal clock

operating circuit.

XTAL2: Output from the inverting oscillator amplifier.


Watchdog Timer (One-time Enabled with Reset-out)
The WDT is intended as a recovery method in situations where the CPU may be
subjected to software upsets. The WDT consists of a 14-bit counter and the Watchdog
Timer Reset (WDTRST) SFR. The WDT is defaulted to disable from exiting reset. To
enable the WDT, a user must write 01EH and 0E1H in sequence to the WDTRST register
(SFR location 0A6H).

Using the WDT:


To enable the WDT, a user must write 01EH and 0E1H in sequence to the WDTRST
register (SFR location 0A6H). When the WDT is enabled, the user needs to service it by
writing 01EH and 0E1H to WDTRST to avoid a WDT overflow.

WDT during Power-down and Idle:


In Power-down mode the oscillator stops, which means the WDT also stops. While in
Power-down mode, the user does not need to service the WDT. There are two methods of
exiting Power-down mode: by a hardware reset or via a level-activated external interrupt
which is enabled prior to entering Power-down mode.

UART:

The UART in the AT89S52 operates the same way as the UART in the

AT89S52 and AT89C52.

Timer 0 and 1:

Timer 0 and Timer 1 in the AT89S52 operate the same way as

Timer 0 and Timer 1 in the AT89S52 and AT89C52.

Timer 2:

Timer 2 is a 16-bit Timer/Counter that can operate as either a timer or an

event counter. The type of operation is selected by bit C/T2 in the SFR T2CON.

Serial Programming Algorithm: To program and verify the AT89S52 in the


serial programming mode, the following sequence is recommended: 1. Power-up
sequence: a. Apply power between VCC and GND pins. At the end of a programming
session, RST can be set low to commence normal device operation.

Program Verify:

If lock bits LB1 and LB2 have not been programmed, the

programmed code data can be read back via the address and data lines for verification.

Programming the Flash Parallel Mode: The AT89S52 is shipped with


the on-chip Flash memory array ready to be programmed. The programming interface
needs a high-voltage (12-volt) program enable signal and is compatible with conventional
third-party Flash or EPROM programmers. The AT89S52 code memory array is
programmed byte-by-byte.

Chip Erase: In the parallel programming mode, a chip erase operation is initiated by
using the proper combination of control signals and by pulsing ALE/PROG low for
duration of 200 ns - 500 ns. In the serial programming mode, a chip erase operation is
initiated by issuing the Chip Erase instruction. Programming the Flash Serial Mode the
Code memory array can be programmed using the serial ISP interface while RST is
pulled to VCC.

4. RS232PROTOCOL, MAX232, MOTOR


4.1 RS232 (serial port):

RS-232 (Recommended Standard - 232) is a

telecommunications standard for binary serial communications between devices. It


supplies the roadmap for the way devices speak to each other using serial ports. The
devices are commonly referred to as a DTE (data terminal equipment) and DCE (data
communications equipment).

RS232

FIGURE 4.1

4.2 DC MOTOR: In any electric motor, operation is based on simple


electromagnetism. A current-carrying conductor generates a magnetic field; when this is
then placed in an external magnetic field,. As you are well aware of from playing with
magnets as a kid, opposite polarities attract, while like polarities repel.

FIGURE4.2
You'll notice a few things from this -- namely, one pole is fully energized at a time (but
two others are "partially" energized).

10

5. WORKING FLOW OF THE PROJECT


&
SCHEMATIC DIAGRAM
5.1 BLOCK DIAGRAM OF THE ROBOTIC ARM

REGULATED
POWER SUPPLY

VOLTAGE
LEVEL
CONVERTER

MOTOR1

8051
MICROCONTROLLER

MOTOR2

PC

FIGURE 5.1

5.2 WORKING FLOW: The presented robot control system can be used for
different sophisticated robot applications. The control system consists of a PC, a
microcontroller that collects data from the PC and control the robot. When commands are
given through pc it will be taken by the voltage level converter and from voltage level
converter through serial communication by making use of RS232 protocol these are given
to the microcontroller. And hence by this way microcontroller controls both the motors.
Here there are two types of movements of the robot. One is the neck movement 0f the
robot and the other one is the arm movement. Hence by controlling the motors we can
make the robot to move in our desired way. Here regulated power supply is used to drive
the microcontroller.

11

5.3 Schematic Diagram & Hardware:


REGULATED POWER SUPPLY:
A variable regulated power supply, also called a variable bench power
supply, is one where you can continuously adjust the output voltage to your
requirements. Varying the output of the power supply is the recommended way to
test a project after having double checked parts placement against circuit drawings
and the parts placement guide.
This type of regulation is ideal for having a simple variable bench power supply.
Actually this is quite important because one of the first projects a hobbyist should
undertake is the construction of a variable regulated power supply. While a
dedicated supply is quite handy e.g. 5V or 12V, it's much handier to have a
variable supply on hand, especially for testing.
Most digital logic circuits and processors need a 5 volt power supply. To use these
parts we need to build a regulated 5 volt source. Usually you start with an
unregulated power to make a 5 volt power supply; we use a LM7805 voltage
regulator IC (Integrated Circuit). The IC is shown below.

FIGURE 5.2
The LM7805 is simple to use. You simply connect the positive lead of your
unregulated DC power supply to the Input pin, connect the negative lead to the,
you get a 5 volt supply from the Output pin.

12

5.4 CIRCUIT FEATURES


Brief description of operation: Gives out well regulated +5V output, output current
capability of 100 mA
Circuit protection: Built-in overheating protection shuts down output when
regulator IC gets too hot
Circuit complexity: Very simple and easy to build
Circuit performance: Very stable +5V output voltage, reliable operation
Availability of components: Easy to get, uses only very common basic components
Applications: Part of electronics devices, small laboratory power supply
Power supply voltage: Unregulated DC 8-18V power supply
Power supply current: Needed output current + 5 mA
Component costs: Few dollars for the electronics components + the input
transformer cost

5.5 BLOCK DIAGRAM

FIGURE 5.3

13

5.6 SCHEMATIC DIAGRAM

14

FIGURE 5.4

6. SOURCE CODE
# include <8051.h>
void SerialInit(void)
{
TMOD = 0x20;
TH1 = 0xfd;
SCON = 0x50;
TR1 = 1;
}
void serial0() interrupt 4
{
if(RI == 1)
{
Rx_Ch = SBUF;
RI = 0;
15

}
}
void main(void)
{
unsigned int i = 0,
j

= 0,

ucAddrCounter

= 0;

while(1)
{
if(Rx_ch=='1')
{
// NECK MOVEMENT CLOCKWISE
P2 = 0x03;
for(j = 0; j < 1; j++)
for(i = 0; i < 100; i++);
P2 = 0x09;
for(j = 0; j < 1; j++)
for(i = 0; i < 100; i++);
P2 = 0x0c;

16

for(j = 0; j < 1; j++)


for(i = 0; i < 100; i++);
P2 = 0x06;
for(j = 0; j <1; j++)
for(i = 0; i < 1000; i++);
}
if(Rx_ch=='2')
{
// NECK MOVEMENT ANTI CLOCKWISE
P2 = 0x09;
for(j = 0; j <1; j++)
for(i = 0; i < 100; i++);
P2 = 0x03;
for(j = 0; j < 1; j++)
for(i = 0; i < 100; i++);
P2 = 0x06;
for(j = 0; j < 1; j++)
for(i = 0; i < 100; i++);
P2 = 0x0c

17

for(j = 0; j < 1; j++)


for(i = 0; i < 100; i++);
}
if(Rx_ch=='3')
{
//BODY MOVEMENT CLOCKWISE
P2 = 0x30;
for(j = 0; j < 1; j++)
for(i = 0; i < 100; i++);
P2 = 0x90;
for(j = 0; j < 1; j++)
for(i = 0; i < 100; i++);
P2 = 0xc0;
for(j = 0; j < 1; j++)
for(i = 0; i < 100; i++);
P2 = 0x60;
for(j = 0; j <1; j++)
for(i = 0; i < 1000; i++)
}

18

if(Rx_ch=='4')
{
//NECK MOVEMENT CLOCKWISE
P2 = 0x90;
for(j = 0; j <1; j++)
for(i = 0; i < 100; i++);
P2 = 0x30;
for(j = 0; j < 1; j++)
for(i = 0; i < 100; i++);
P2 = 0x60;
for(j = 0; j < 1; j++)
for(i = 0; i < 100; i++);
P2 = 0xC0;
for(j = 0; j < 1; j++)
for(i = 0; i < 100; i++);
}
if(Rx_ch=='5')
P2=0x00; //STOPS the motor
}

19

7. KEIL SOFTWARE
1.

Click on the Keil vision Icon on Desktop.

2.

The following fig will appear

3.

Click on the Project menu from the title bar

4.

Then Click on New Project

20

5.

Save the Project by typing suitable project name with no extension in u r own
folder sited in either C:\ or D:\

6.

Then Click on save button above.

7.

Select the component for u r project. I.e. Philips

8.

Click on the + Symbol beside of Philips.

9.

Select AT89S52 as shown below

21

10.

Then Click on OK

11.

The Following fig will appear

12.

Then Click either YES or NOmostly NO.

13.

Now your project is ready to USE

14.

Now double click on the Target1, you would get another option Source group
1 as shown in next page.

22

15.

Click on the file option from menu bar and select new.

16.

The next screen will be as shown in next page, and just maximize it by double
clicking on its blue boarder.

17.

Now start writing program in either in C or ASM.

18.

For a program written in Assembly, then save it with extension . asm and
for C based program save it with extension .C

19.

Now right click on Source group 1 and click on Add files to Group Source

20.
23

21.

Now you will get another window, on which by default C files will appear.

22.

Now select as per your file extension given while saving the file

23.

Click only one time on option ADD

24.

Now Press function key F7 to compile. Any error will appear if so happen.

25.

If the file contains no error, then press Control+F5 simultaneously.

26.

The new window is opened.

27.

Then Click OK

24

28.

Now Click on the Peripherals from menu bar, and check your required port as
shown in fig below

29.

Drag the port a side and click in the program file.

30.

Now keep Pressing function key F11 slowly and observe.

31.

You are running your program successfully.

25

8. RESULT

INPUT:

Any keyword from PC (personal Computer)

OUTPUT:

The motors will rotate left and then with another keyword it will rotate

right.

26

9. CONCLUSION
The project ROBOT ARM CONTROL USING PC has been successfully
designed and tested.
It has been developed by integrating features of all the hardware components
used. Presence of every module has been reasoned out and placed carefully thus
contributing to the best working of the unit.

Secondly, using highly advanced ICs and with the help of growing technology
the project has been successfully implemented.

27

10. BIBLIOGRAPHY
The 8051 Micro controller and Embedded
Systems
-Muhammad Ali Mazidi
Janice Gillispie Mazidi
The 8051 Micro controller Architecture,
Programming & Applications
-Kenneth J.Ayala
Fundamentals of Micro processors and
Micro computers
-B.Ram
Micro processor Architecture, Programming
& Applications
-Ramesh S.Gaonkar
Electronic Components
-D.V.Prasad
Wireless Communications
- Theodore S. Rappaport
Mobile Tele Communications
- William C.Y. Lee

References on the Web:


www.national.com
www.nxp.com
www.8052.com
28

www.microsoftsearch.com
www.geocities.com

29

Você também pode gostar