Escolar Documentos
Profissional Documentos
Cultura Documentos
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.
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.
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.
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
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.
FIGURE 3.2
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:
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.
XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
UART:
The UART in the AT89S52 operates the same way as the UART in the
Timer 0 and 1:
Timer 2:
event counter. The type of operation is selected by bit C/T2 in the SFR T2CON.
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.
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.
RS232
FIGURE 4.1
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
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
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
FIGURE 5.3
13
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
17
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.
2.
3.
4.
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.
7.
8.
9.
21
10.
Then Click on OK
11.
12.
13.
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.
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.
24.
Now Press function key F7 to compile. Any error will appear if so happen.
25.
26.
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.
30.
31.
25
8. RESULT
INPUT:
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
www.microsoftsearch.com
www.geocities.com
29