+ All Categories
Home > Documents > project report

project report

Date post: 25-Nov-2014
Category:
Upload: dharmendra-yadav
View: 307 times
Download: 0 times
Share this document with a friend
Popular Tags:
55
A Project Report on “REMOTE CONTROLLED ROBOTIC ARM” Submitted in partial fulfillment of Bachelor of Technology degree of the Rajasthan Technical University, Kota Submitted by: Guided by: Ms. NEHA SINGH 1. DHARMENDRA KUMAR YADAV Lecturer/Asst. Prof. 2. JITESH SHARMA Department of Electronics 3. SANDEEP AGARWAL and Communication Engg.
Transcript
Page 1: project report

A Project Report

on

“REMOTE CONTROLLED ROBOTIC ARM”

Submitted in partial fulfillment ofBachelor of Technology degree

of the Rajasthan Technical University, Kota

Submitted by: Guided by: Ms. NEHA SINGH

1. DHARMENDRA KUMAR YADAV Lecturer/Asst. Prof.2. JITESH SHARMA Department of Electronics 3. SANDEEP AGARWAL and Communication Engg.

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENG.INSTITUTE OF ENGINEERING & TECHNOLOGY

ALWAR (RAJASTHAN) – 301030

Session 20010-11

Page 2: project report

CERETIFICATE

This is to certify that the project report entitled “REMOTE

CONTROLLED ROBOTIC ARM “ submitted by DHARMENDRA

KUMAR , JITESH SHARMA , and SANDEEP AGARWAL under my

supervision is students own work and has not been submitted

elsewhere for the award of any degree, to the best of my knowledge &

belief.

SignatureDate: 24, dec, 2010 (Ms. NEHA SINGH)

Lecturer Deptt.; Electronics and

Communication engg.

Page 3: project report

ACKNOWLEDGEMENT

We wish to express our sincere gratitude to Mr. V.K.Agarwal , Chairman,

I.E.T, Alwar, Mr. S.P. Garg , Director, I.E.T, Alwar, for providing us the

infrastructure.

We wish to express our sincere gratitude to Mr. Rakesh Sharma, HOD of EC

department for providing us the opportunity to work in Department.

We own our debt of gratitude to our project guide Ms. Neha Singh, for her

support, help and valuable guidance during the project tenure. It has been a

distinct honor for us to have worked under his esteemed guidance and has learnt

the art of science from her. It has been proud privilege to have worked under the

stimulatory guidance of an auspicious multifaceted teacher who gave us an

opportunity to do research in this field. Her scientific judgment, constructive

criticism and everlasting concern for betterment, sincerity and devotion have

been the role pillars that have provided us the architectural frame work for

designing this project to its present shape.

We wish to accord my special thanks to my friends for their moral and

emotional support throughout the deputation period for the research work.

Name Signature Date

Dharmendra Kumar Yadav 24, dec, 2010

Jitesh Sharma 24, dec, 2010

Sandeep agarwal 24, dec, 2010

Page 4: project report

ABSTRACT

To reduces the human efforts and in industries to increase efficiency,

proficiency and the most important is to reduce the time. Nowadays a new

technology of Robotics is used which can do a specific task. Robotics which is

used in most of the developed countries like Germany, France, and Japan, USA,

CHINA etc. These Robots are controlled with the remote. The Robot is

programmed for the specific task. Every task of the robot is defined; stoppage

timing of the robot and angle of rotation between the two places is defined by

the servo motors. This is very wonderful project to control the working of the

robotic arm without wire.

The project is to control a robotic arm using the remote control. The remote

control works on the RC5 PROTOCOL. It transmits 14 data at a time. The

command data is a Manchester coded bit stream modulating a 36 kHz carrier.

The IR signal from the transmitter is detected by a specialized IC (IR receiver)

with an integral photo-diode, and is amplified, filtered, and demodulated. The

14 bit contains 2 start bit, 1 toggle bit, 5 address bit and 6 command bit. By

receiving the data the coding is done for the operation of the servo motors. As

for the particular bit pattern the particular number or motors are to be operated

for a particular angle. In this way the robotic arm is controlled using the remote

control.

Page 5: project report

CONTENTS

Chapter no. Page no.

1. INTRODUCTION……………………………………………………..1

1.1 Block diagram……………………………………………………..2

1.2 Importance of the Research ……………………………………….2

1.3 Contributions of the project……………………………………… 2

2. ROBOTIC ARM………………………………………………………3

2.1 Overview of robotic arm…………………………………………3

2.2 Advantages………………………………………………………4

2.3 Disadvantages…………………………………………………....4

3. DESIGNING OF ROBOTIC ARM………………………………….5

3.1 Component used in robotic arm…………………………………..5

3.1.1 Servo motor…………………………………………………5

3.1.2 7805 IC………………………………………………………7

3.1.3 CPLD……………………………………………………….11

3.1.4 CRYSTAL oscillator……………………………………….13

3.1.5 T sop……………………………………………………….15

3.1.6 RC5 protocol………………………………………………..16

3.2 Design description of robotic arm………………………………...20

3.2.1 VLSI implementation of robotic arm……………………….22

4. SIMULATION RESULTS…………………………………………...24

5. CONCLUSION AND FUTURE SCOPE……………………………26

APPENDIX…………………………………………………………… 27

REFERENCES………………………………………………………..35

Page 6: project report

LIST OF FIGURES

NAME OF FIGURE PAGE NO.

1.1. Working of project …………………………………………………..2

2.1. Basic Design Of Robotic Arm ……………………………………….3

2.2. Different Robotic Arms ………………………………………………4

3.1. Servo Motor (Vega Servo VS-1) ……………………………………..5

3.2. 7805 IC……………………………………………………………….. 8

3.3 7805 conections………...………………………………………………9

3.4 Pin description………………………………………………………….9

3.5 Circuit 7805……………………………………………………………10

3.6 CPLD….……………………………………………………………….15

3.7 TSOP…………………………………………………………………..16

3.8 Timing Diagram of RC5 Protocol……………………………………..18

3.9 Remote controlled robotic arm…………………………………………20

3.10 Components of robotic arm…………………………………………....21

3.11 Timing diagram of servomotor………………………………………...22

Page 7: project report

CHAPTER 1

INTRODUCTION

This project is designed so that students can understand the technology used in

now a day’s. Robotics which is used in most of the developed countries like

Germany, France, and Japan, USA, China etc. These Robots are controlled with

the remote. The Robot is programmed for the specific task. Every task of the

robot is defined; stoppage timing of the robot and angle of rotation between the

two places is defined by the servo motors. This is very wonderful project to

control the working of the robotic arm without wire. We are using these

components in our project which are CPLD, ULN 2003, Servo motor, Remote.

In this project we try to give the same protocol for this type of remote. We are

using CPLD to control all the function as CPU. CPLD controls the rotation of

motor. First the motor is controlled and rotation of motor is specified and

accordingly the different delay for each angle is provided. So this project works

for robotic arm with remote. The motion of the arm is controlled by the Servo

Motor.

Page 8: project report

Block diagram:

Importance of the Research

To reduces the human efforts, and in industries to increase efficiency,

proficiency and the most important is to reduce the time. Through this a person

who has no hand can also work by using the robotic arm as a temporary hand.

Contribution of the Project

The project concludes the VLSI implementation of the Remote Controlled

Robotic Arm. In this hardware is designed for servo motor by which the motion

of the robotic arm can be controlled.

REMOTE

IR RECEIVERCPLD

ROBOTIC ARM

Fig1.1 Block Diagram of Project

1

2

Page 9: project report

CHAPTER 2

ROBOTIC ARM

2.1 Overview of Robotic Arm

Although these do not fall under the category of mobile robotics, the field of

robotics essentially started with arms and end-effectors (devices that attach to

the end of an arm such as grippers, electromagnets etc). Arms and grippers are

the best way for a robot to interact with the environment it is exploring. Simple

robot arms can have just one motion, while more complex arms can have a

dozen or more unique degrees of freedom.

Fig.2.1 Basic Design of robotic arm

3

Page 10: project report

Fig.2.2 Different Robotic arm models

2.2 Advantages

Very simple to very complex design possibilities

Easy to make a 3 or 4 degree of freedom robot arm (two joints and

turning base)

2.3 Disadvantages

Stationary unless mounted on a mobile platform

Cost to build is proportional to lifting capability

4

Page 11: project report

CHAPTER 3

DESIGNING OF ROBOTIC ARM

3.1 Components used in Robotic arm

3.1.1 Servo motors

Servo motors are types of actuators that rotate to a specific angular position, and

were classically used in more expensive remote controlled vehicles for steering

or controlling flight surfaces. Now that they are used in a variety of

applications, the price of hobby servos has gone down significantly, and the

variety (different sizes, technologies, and strength) has increased.

Fig. 3.1 Servo Motor (vega servo VS-1)

5

Page 12: project report

The common factor to most servos is that the majority only rotate about 180

degrees. A hobby servo motor actually includes a DC motor, gearing,

electronics and a rotary potentiometer (which, in essence, measures the angle).

The electronics and potentiometer work in unison to activate the motor and stop

the output shaft at a specified angle. These servos are generally have three

wires: ground, voltage in, and a control pulse. The control pulse is usually

generated with a servo motor controller.  A “robot servo“ is a new type of servo

that offers both continuous rotation and position feedback. All servos can rotate

CW and CCW.

Dc servo motors are normally used as prime movers in computers, numerically

controlled machinery, or other applications where starts and stops are made

quickly and accurately. Servo motors have lightweight, low-inertia armatures

that respond quickly to excitation-voltage changes. In addition, very low

armature inductance in these servo motors results in a low electrical time

constant (typically 0.05 to 1.5 msec) that further sharpens servo motor response

to command signals. Servo motors include permanent-magnetic, printed-circuit,

and moving-coil (or shell) dc servo motors. The rotor of a shell dc servo motor

consists of a cylindrical shell of copper or aluminum wire coils which rotate in a

magnetic field in the annular space between magnetic pole pieces and a

stationary iron core. The servo motor features a field, which is provided by cast

AlNiCo magnets whose magnetic axis is radial. Servo motors usually have two,

four, or six poles.

Dc servo motor characteristics include inertia, physical shape, costs, shaft

resonance, shaft configuration, speed, and weight. Although these dc servo

motors have similar torque ratings, their physical and electrical constants vary.

6

Page 13: project report

DC Servo Motor Selection: The first selection approach is to choose a servo

motor large enough for a machine that has already been designed; the second is

to select the best available servo motor with a specific feature and then build the

system around it; and the third is to study servo motor performance and system

requirements and mate the two.

The final servo motor system design is usually the least sophisticated that meets

the performance specifications reliably. Servo motor requirements may include

control of acceleration, velocity, and position to very close tolerances. This says

that the servo designer must define the system carefully, establish the servo

motor's performance specifications, determine critical areas, and set up

tolerances. Only then will the designer be able to propose an adequate

servosystem and choose a servo motor type

3.1.2 7805 IC

Voltage regulator ICs are available with fixed (typically 5, 12 and 15V) or

variable output voltages. The maximum current they can pass also rates them.

Negative voltage regulators are available, mainly for use in dual supplies. Most

regulators include some automatic protection from excessive current (over load

protection) and overheating (thermal protection). Many of fixed voltage

regulator ICs has 3 leads. They include a hole for attaching a heat sink if

necessary.

7

Page 14: project report

Fig 3.2 7805 IC

These voltage regulators are monolithic circuit integrated circuit designed as

fixed voltage regulators for a wide variety of applications including local, on

card regulation. These regulators employ internal current limiting, thermal

shutdown, and safe-area compensation. With adequate heat sinking they can

deliver output current in excess of 1.0 A. Although designed primarily as a

fixed voltage regulator, these devices can be used with external components to

obtain adjustable voltage and current.

This is most common voltage regulator that is still used in embedded

designs. LM7805 voltage regulator is a linear regulator made by several

manufacturers like Fairchild, or ST Microelectronics. They can come in several

types of packages. For output current up to 1A there may be two types of

packages: TO-220 (vertical) and D-PAK (horizontal).

8

Page 15: project report

Fig:3.3 7805 conections

With proper heat sink these LM78xx types can handle even more than 1A

current. They also have Thermal overload protection, Short circuit

protection.

If your design won’t exceed 0.1A current you may chose regulator

LM78L05 with smaller packages and lower maximum current up to 0.1A. They

come in three main types of packages SO-8, SOT-89 and TO-92

Fig: 3.4 Pin Description

9

Page 16: project report

Part Output (V) Input range (V)

LM7805 5 7–25

LM7806 6 8–25

LM7808 8 10.5–25

LM7809 9 11.5–25

LM7810 10 12.5–25

LM7812 12 14.5–30

LM7815 15 17.5–30

LM7818 18 21–33

LM7824 24 27–38

Typical Connection is very simple:

Fig:3.5 Circuit 7805

Page 17: project report

Couple decoupling capacitors (between 10 uF and 47 uF) is required on the

input (V-IN) and output (V-OUT) connected to ground.

There are negative voltage regulators that work the same way. They are marked

as LM79xx.

3.1.3 CPLD

CPLD (Complex Programmable Logic Device) is an arrangement of multiple

SPLD-like blocks on a single chip. Alternative names are enhanced PLD

(EPLD), superPAL, and mega PAL. The CPLD we used is of Spartan2.

Fig 3.3 CPLD

A complex programmable logic device (CPLD) is a programmable logic

device with complexity between that of PALs and FPGAs, and architectural

features of both. The building block of a CPLD is the macrocell, which contains

logic implementing disjunctive normal form expressions and more specialized

logic operations.

Features in common with PALs:

Non-volatile configuration memory. Unlike many FPGAs, an external

configuration ROM isn't required, and the CPLD can function

immediately on system start-up.

For many legacy CPLD devices, routing constrains most logic blocks to

have input and output signals connected to external pins, reducing

10

Page 18: project report

opportunities for internal state storage and deeply layered logic. This is

usually not a factor for larger CPLDs and newer CPLD product families.

Features in common with FPGAs:

Large number of gates available. CPLDs typically have the equivalent of

thousands to tens of thousands of logic gates, allowing implementation of

Moderately complicated data processing devices. PALs typically have a

few hundred gate equivalents at most, while FPGAs typically range from

tens of thousands to several million.

Some provisions for logic more flexible than sum-of-product expressions,

including complicated feedback paths between macro cells, and

specialized logic for implementing various commonly-used functions,

such as integer arithmetic.

The most noticeable difference between a large CPLD and a small FPGA is the

presence of on-chip non-volatile memory in the CPLD. This distinction is

rapidly becoming less relevant, as several of the latest FPGA products also offer

models with embedded configuration memory.

The characteristic of non-volatility makes the CPLD the device of choice in

modern digital designs to perform 'boot loader' functions before handing over

control to other devices not having this capability. A good example is where a

CPLD is used to load configuration data for an FPGA from non-volatile

memory.

CPLDs were an evolutionary step from even smaller devices that preceded

them, PLAs (first shipped by Signetics), and PALs. These in turn were preceded

by standard logic products that offered no programmability and were

"programmed" by wiring several standard logic chips together.

11

Page 19: project report

The main distinction between FPGA and CPLD device architectures is that

FPGAs are internally based on Look-up tables (LUTs) while CPLDs form the

logic functions with sea-of-gates

3.1.4 Crystal Oscillator (8MHz)

A crystal oscillator is an electronic oscillator circuit that uses the mechanical

resonance of a vibrating crystal of piezoelectric material to create an electrical

signal with a very precise frequency. This frequency is commonly used to keep

track of time (as in quartz wristwatches), to provide a stable clock signal for

digital integrated circuits, and to stabilize frequencies for radio transmitters and

receivers. The most common type of piezoelectric resonator used is the quartz

crystal, so oscillator circuits designed around them became known as "crystal

oscillators."

Quartz crystals are manufactured for frequencies from a few tens of kilohertz to

tens of megahertz. More than two billion (2×109) crystals are manufactured

annually. Most are small devices for consumer devices such as wristwatches,

clocks, radios, computers, and cell phones. Quartz crystals are also found inside

test and measurement equipment, such as counters, signal generators, and

oscilloscopes.

3.1.5 TSOP

Short for Thin Small Outline Package, it's a surface-mount memory packaging

from Intel. Features of the TSOP include the following: JEDEC and EIAJ

12

Page 20: project report

standard dimensions, it's the smallest leaded package form factor for flash, 0.5

mm (19.7 mil) lead pitch, reduced total package height, 1.20 mm maximum,

gull wing formed leads, and supports future flash density and feature growth.

Fig 3.4 TSOP

3.1.6 RC 5 Protocol

Various remote control systems are used in electronic equipment today. The

RC5 control protocol is one of the most popular and is widely used to control

numerous home appliances, entertainment systems and some industrial

applications including utility consumption remote meter reading, contact-less

apparatus control, telemetry data transmission, and car security systems. Philips

originally invented this protocol and virtually all Philips’ remotes use this

protocol.

Following is a description of the RC5. When the user pushes a button on the

hand-held remote, the device is activated and sends modulated infrared light to

transmit the command. The remote separates command data into packets. Each

data packet consists of a 14-bit data word, which is repeated if the user

continues to push the remote button. The data packet structure is as follows:

15

Page 21: project report

2 start bits,

1 control bit,

5 address bits,

6 command bits.

The start bits are always logic ‘1’ and intended to calibrate the optical receiver

automatic gain-control loop. Next, is the control bit. This bit is inverted each

time the user releases the remote button and is intended to differentiate

situations when the user continues to hold the same button or presses it again.

The next 5 bits are the address bits and select the destination device. A number

of devices can use RC5 at the same time. To exclude possible interference, each

must use a different address. The 6 command bits describe the actual command.

As a result, a RC5 transmitter can send the 2048 unique commands. The

transmitter shifts the data word, applies Manchester encoding and passes the

created one-bit sequence to a control carrier frequency signal amplitude

modulator. The amplitude-modulated carrier signal is sent to the optical

transmitter, which radiates the infrared light. In RC5 systems the carrier

frequency has been set to 36 kHz. Figure 1 displays the RC5 protocol.

The receiver performs the reverse function. The photo detector converts optical

transmission into electric signals, filters it and executes amplitude

demodulation. The receiver output bit stream can be used to decode the RC5

data word. This operation is done by the microprocessor typically, but complete

hardware implementations are present on the market as well. Single-die optical

receivers are being mass produced by a number of companies such as Siemens,

Temic, Sharp, Xiamen Hualian, Japanese Electric and others. Please note that

the receiver output is inverted (log. 1 corresponds to illumination absence).

16

Page 22: project report

Fig. 3.5 Timing diagrams of RC5 Protocol.

The basics of the protocol are well known. The handset contains a keypad and a

transmitter integrated circuit (IC) driving an IR LED. The command data is a

Manchester coded bit stream modulating a 36 kHz carrier. (Often the carrier

used is 38 kHz or 40 kHz, apparently due to misinformation about the actual

protocol.) The IR signal from the transmitter is detected by a specialized IC

with an integral photo-diode, and is amplified, filtered, and demodulated so that

17

Page 23: project report

the receiving device can act upon the received command. RC-5 only provides a

one-way link, with information traveling from the handset to the receiving unit.

The command comprises 14 bits:

A start bit, which is always logic 1 and allows the receiving IC to set the

proper gain.

A field bit, which denotes whether the command sent is in the lower field

(logic 1 = 0 to 63 decimal) or the upper field (logic 0 = 64 to 127

decimal). The field bit was added later by Philips when it was realized

that 64 commands per device were insufficient. Previously, the field bit

was combined with the start bit. Many devices still use this original

system.

A control bit, which toggles with each button press. This allows the

receiving device to distinguish between two successive button presses

(such as "1", "1" for "11") as opposed to the user simply holding down

the button and the repeating commands being interrupted by a person

walking by, for example.

A five-bit system address that selects one of 32 possible systems.

A six-bit command that (in conjunction with the field bit) represents one

of the 128 possible RC-5 commands.

The 36 kHz carrier frequency was chosen to render the system immune to

interference from TV scan lines. Since the repetition of the 36 kHz carrier is

27.778 μs and the duty factor is 25%, the carrier pulse duration is 6.944 μs.

Since the high half of each symbol (bit) of the RC-5 code word contains 32

carrier pulses, the symbol period is 64 x 27.778 μs = 1.778 ms, and the 14

symbols (bits) of a complete RC-5 code word takes 24.889 ms to transmit. The

code word is repeated every 113.778 ms (4096 / 36 kHz) as long as a key

18

Page 24: project report

remains pressed. (Again, please note that these timings are not strictly followed

by all manufacturers, due to a lack of widespread distribution of accurate

information on the RC-5 protocol.)

3.2 Design description of Robotic Arm

The servo motor used in our project is VS-1. These servo motors are fixed with

the strips for the design of the arm. The servo motors are fixed in the way that

can work as an arm properly. There are 4 servo motors used. The 1 st one is at

the base which is for base movement of 0 to 180 degree. The 2nd and 3rd motor

is used for the arm movement of 0 to180 degree and the 4 th motor is used for

catch the object.

19

Page 25: project report

Fig:3.8 Remote controlled robotic arm20

Page 26: project report

Fig:3.9 Components of robotic arm

3.2.1 VLSI implementation of Robotic Arm

SERVOMOTORS

Tsop

CRYSTAL OSCILLATOR CPLD

21

Page 27: project report

The robotic arm is controlled by the CPLD .Coding of the project is designed in

VHDL in the Xilinx software. The VHDL code is designed in 3 stages. In the

first stage the received data is decoded. Which is received from the remote by

the tsop? Then in the second stage the data is processed and a particular output

is generated. And in the 3 stage the servo motors are controlled in a particular

manner by using the generated output. The whole system is controlled by the

remote.

Fig:3.10 Timing diagram for servomotor

The 8MHz crystal oscillator clock has 0.125uSec in one cycle. We derive the

bode rate of 50Hz which has 0.02 sec time in one cycle. For the operation of

servomotors we have to send the different clocks of different duty cycles

according to the diagram given above.

For the 0 degree of the servomotor we generate 0.8ms time cycles means 6400

number of the cycles of the 8MHz clock for high logic ‘1’ and remaining

22

Page 28: project report

3993600 cycles remain low logic ‘0’, and assign this clock to motor for 0

degree position.

For the 90 degree of the servomotor we generate 1.52ms time cycles means

12000 number of the cycles of the 8MHz clock for high logic ‘1’ and remaining

3988000 cycles remain low logic ‘0’, and assign this clock to motor for 90

degree position.

For the 180 degree of the servomotor we generate 2.5ms time cycles means

20000 number of the cycles of the 8MHz clock for high logic ‘1’ and remaining

3980000 cycles remain low logic ‘0’, and assign this clock to motor for 180

degree position.

These clocks are assigned to the motors by the CPLD. The CPLD works on the

basis of remote transmitted data. This transmitted data is of 563Hz which is

modulated on the 36KHz frequency and this data is Manchester coded. The data

is sent by the IR waves. These IR waves are detected by the Tsop device and the

data is demodulated by the Tsop itself the Manchester coding remains in the

data. We detect the data from the received data by the coding in the VHDL that

data is then control the servomotors according to the code defined in the VHDL.

CHAPTER 4

23

Page 29: project report

SIMULATUION RESULTS

Output of servo motor when s1=’1’

Output of servo motor when s2=’1’

24

Page 30: project report

Output of servomotor when y=’1’

CHAPTER 5

25

Page 31: project report

CONCLUSION AND FUTURE SCOPE

In this project we work on Rc5 protocol and by using it we controlled a robotic

arm. We work on Xilinx software to make the code and for simulation we use

Modelsim software. We worked on CPLD. The code is burned into the CPLD.

The servo motors we have used are vega servo motor (vs-1).Thus we made

finally our project.

This Arm will reduce the human efforts, and in industries it will increase

efficiency, proficiency and the most important is it will reduce the time.

Through this a person who has no hand can also work by using the robotic arm

as a temporary hand.

In Future we can control this robotic Arm by giving a voice signal as a input.

After that we can implement more by adding wheels at the base of this arm.

APPENDIX

26

Page 32: project report

library IEEE;

use IEEE.STD_LOGIC_1164.ALL;

use IEEE.STD_LOGIC_ARITH.ALL;

use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity lcdrec is

Port ( clk : in STD_LOGIC;

m1: out std_logic;

d : out STD_LOGIC_VECTOR (10 downto 0);

y : in STD_LOGIC);

end lcdrec;

architecture Behavioral of lcdrec is

signal clock,clock1,clock2,clock3,clock4,clock5:std_logic:='0';

signal si: std_logic_vector(10 downto 0):="00000000000";

begin

process(clk)

variable c:integer range 0 to 80000000:= 0;

variable t1,t2,t3,t4,t5:integer range 0 to 80000000:= 0;

begin

if clk'event and clk='1' then

c:=c+1;

t1:=t1+1;

t2:=t2+1;

t3:=t3+1;

t4:=t4+1;

t5:=t5+1;

if c=114 then

clock<=not clock;

c:= 0;

27

Page 33: project report

end if;

if t1>=0 and t1<5000 then

clock1<='1';

elsif t1>=500 and t1<1600000 then

clock1<='0';

end if;

if t2>=0 and t2<72000 then

clock2<='1';

elsif t2>=7200 and t2<16000 then

clock2<='0';

end if;

if t3>=0 and t3<1200 then

clock3<='1';

elsif t3>=12000 and t3<1600000 then

clock3<='0';

end if;

if t4>=0 and t4<16800 then

clock4<='1';

elsif t4>=168000 and t4<16000 then

clock4<='0';

end if;

if t5>=0 and t5<190000 then

clock5<='1';

elsif t5>=19000 and t5<16000 then

clock5<='0';

end if;

if t1=160000 then

t1:=0;

end if;

if t2=160000 then

28

Page 34: project report

t2:=0;

end if;

if t3=160000 then

t3:=0;

end if;

if t4=160000 then

t4:=0;

end if;

if t5=160000 then

t5:=0;

end if;

end if;

end process;

process(clock,clock1,clock2,clock3,clock4,clock5)

variable p: std_logic_vector(27 downto 0):="00000000000000000000000000";

variable x:integer range 0 to 28 := 0;

begin

if clock'event and clock='1' then

if x=0 then

x:=x+1;

elsif x=1 then

if y='1' then

p(0):='0';

x:=x+1;

end if;

elsif x=2 then

if y='0' then

p(1):='1';

x:=x+1;

end if;

29

Page 35: project report

elsif x=3 then

p(2):=y;

x:=x+1;

elsif x=4 then

p(3):=y;

x:=x+1;

elsif x=5 then

p(4):= y;

x:=x+1;

elsif x=6 then

p(5):= y;

x:=x+1;

elsif x=7 then

p(6):= y;

x:=x+1;

elsif x=8 then

p(7):= y;

x:=x+1;

elsif x=9 then

p(8):= y;

x:=x+1;

elsif x=10 then

p(9):= y;

x:=x+1;

elsif x=11 then

p(10):= y;

x:=x+1;

elsif x=12 then

p(11):= y;

x:=x+1;

30

Page 36: project report

elsif x=13 then

p(12):= y;

x:=x+1;

elsif x=14 then

p(13):= y;

x:=x+1;

elsif x=15 then

p(14):= y;

x:=x+1;

elsif x=16 then

p(15):= y;

x:=x+1;

elsif x=17 then

p(16):= y;

x:=x+1;

elsif x=18 then

p(17):= y;

x:=x+1;

elsif x=19 then

p(18):= y;

x:=x+1;

elsif x=20 then

p(19):= y;

x:=x+1;

elsif x=21 then

p(20):= y;

x:=x+1;

elsif x=22 then

p(21):= y;

x:=x+1;

31

Page 37: project report

elsif x=23 then

p(22):= y;

x:=x+1;

elsif x=24 then

p(23):= y;

x:=x+1;

elsif x=25 then

p(24):= y;

x:=x+1;

elsif x=26 then

p(25):= y;

x:=x+1;

elsif x=27 then

p(26):= y;

x:=x+1;

elsif x=28 then

p(27):= y;

end if;

if x=28 then

x:=0;

end if;

if p(0)='0' and p(1)='1' then

si(0)<=p(6);

si(1)<=p(8);

si(2)<=p(10);

si(3)<=p(12);

si(4)<=p(14);

si(5)<=p(16);

si(6)<=p(18);

si(7)<=p(20);

32

Page 38: project report

si(8)<=p(22);

si(9)<=p(24);

si(10)<=p(26);

d<=si;

end if;

end if;

if si="11110011101" then

m1<=clock1 ;

elsif si="11111100011" then

m1<=clock2 ;

elsif si="11110010011" then

m1<=clock3;

elsif si="11111110010" then

m1<=clock4;

elsif si="11111101110" then

m1<=clock5;

end if;

end process;

end behavioral;

33

Page 39: project report

#PACE: Start of PACE I/O Pin Assignments

#PACE: Start of Constraints generated by PACE

#PACE: Start of PACE I/O Pin Assignments

NET "clk" LOC = "p80" ;

NET "d<0>" LOC = "p45" ;

NET "d<10>" LOC = "p63" ;

NET "d<1>" LOC = "p46" ;

NET "d<2>" LOC = "p47" ;

NET "d<3>" LOC = "p48" ;

NET "d<4>" LOC = "p49" ;

NET "d<5>" LOC = "p57" ;

NET "d<6>" LOC = "p58" ;

NET "d<7>" LOC = "p59" ;

NET "d<8>" LOC = "p61" ;

NET "d<9>" LOC = "p62" ;

NET "m1" LOC = "p147" ;

NET "y" LOC = "p142" ;

#PACE: Start of PACE Area Constraints

#PACE: Start of PACE Prohibit Constraints

#PACE: End of Constraints generated by PAC

References

34

Page 40: project report

[1] J C G Piementel and Hoang le-Hny, “A VHDL-based methodology to

Develop high performance servo drivers”, IEEE 0-7803-6401-5/00.

[2] Eric Monmasson and Marcian N cirstea “FPGA Design methodology for

industrial control systems- A Review”, IEEE trans on industrial

electronics vol-54,no.-4,AUG-2007.

[3] Heui-Wook Kim, Jong-Woo Choi, Seung-Ki SUI, “Accurate Position

Control for AC Servo Motor using Novel Speed Estimator” 0-7803-

3026-9/95, 1995 IEEE.

[4] Joon Hyuk Kang, Chung Hyuk Yim, and Dong I1 Kim, “Robust Position

Control of AC Servo Motors” 0-7803-3026-9/95 1995 IEEE.

[5] Sven Behnke and Michael Schreiber “Digital Position Control for

Analog Servos” Proceedings,IEEE-RAS,Italy,Dec-06.

[6] E. Monmasson, and Y.A. Chapuis “Contributions of FPGAs to the

Control of Electrical Systems, a Review” IEEE Industrial Electronics

Society Newsletter ISSN 0746-1240 VOL. 49, NO. 4 2002.

[7] Dongmei Yu, Qingding Guo and Qing Hu“ Position Control of Linear

Servo System Using Intelligent Feedback Controller” International

Conference on Intelligent Systems Design and Applications (ISDA'06)

0-7695-2528-8/06 © 2006.

[8] VHDL primer (third edition, J. Bhasker).

[9] VHDL programming by example (fourth edition, Douglas L. Perry).

35


Recommended