Professional Documents
Culture Documents
My Proj Report
My Proj Report
INTRODUCTION
1.1 GENERAL
Tank guns are a specific field of weapon design that meet the particular
needs of the tank. As the tank's primary armament, they are almost always
employed in a direct-fire mode to defeat a variety of ground targets at all ranges,
including dug-in infantry, lightly armored vehicles, and especially other heavily
armored tanks. They must provide accuracy, range, penetration, and rapid fire in a
package that is as compact and lightweight as possible, to allow mounting in the
cramped confines of an armored gun turret. Tank guns generally use self-contained
ammunition, allowing rapid loading (or use of an autoloader). They often show a
bulge in the barrel, which is a bore evacuator, or a device on the muzzle, which is a
muzzle brake. The three traditional factors determining a tank's capability
effectiveness are its firepower, protection, and mobility. Firepower is the ability of
a tank's crew to identify, engage, and destroy the enemy. Protection is the tank
crew's ability to evade detection, preserve themselves from enemy fire, and retain
full vehicle functionality after combat.
1
1.2 SCOPE
2
Fig 1.1 TANK SKELETEL VIEW
3
1.3. LITERATURE REVIEW
Presently the air defense gun is maneuvered manually both in azimuth and
vertical planes. This entails operation of the air defense gun by the loader in the
hatch opened condition, exposing the loader to the attack by the enemy. Also this
manual operation will be a tiring activity.
4
CHAPTER-2
HARDWARE DESCRIPTION
2.1 INTRODUCTION
The ADG setup consist of three IR sensors to track the low flying aircraft,
motors to control the movement of ADG.The consists of LASER arrangement, its
our substitute of ADG. The whole ADG setup is supported by a wooden mount.
5
2.1.1BASIC BLOCK DIAGRAM
6
2.2 COMPONENT DESCRIPTION
Transformer
The potential transformer will step down the power supply voltage (0-
230V) to (0-6V) level. Then the secondary of the potential transformer will be
connected to the precision rectifier, which is constructed with the help of op–amp.
The advantages of using precision rectifier are it will give peak voltage output as
DC, rest of the circuits will give only RMS output.
7
Bridge rectifier
Let us assume that the transformer is working properly and there is a positive
potential, at point A and a negative potential at point B. the positive potential at
point A will forward bias D3 and reverse bias D4.
The negative potential at point B will forward bias D1 and reverse D2. At this
time D3 and D1 are forward biased and will allow current flow to pass through
them; D4 and D2 are reverse biased and will block current flow.
The path for current flow is from point B through D1, up through RL,
through D3, through the secondary of the transformer back to point B. this path is
indicated by the solid arrows. Waveforms (1) and (2) can be observed across D1
and D3.
8
current flows through the load (RL) during both half cycles of the applied voltage,
this bridge rectifier is a full-wave rectifier.
Secondary batteries must be charged before use; they are usually assembled
with active materials in the discharged state. Rechargeable batteries or secondary
cells can be recharged by applying electric current, which reverses the chemical
reactions that occur during its use. Devices to supply the appropriate current are
called chargers or rechargers.
9
The oldest form of rechargeable battery is the lead-acid battery.[37] This
battery is notable in that it contains a liquid in an unsealed container, requiring that
the battery be kept upright and the area be well ventilated to ensure safe dispersal
of the hydrogen gas produced by these batteries during overcharging. The lead-
acid battery is also very heavy for the amount of electrical energy it can supply.
Despite this, its low manufacturing cost and its high surge current levels make its
use common where a large capacity (over approximately 10Ah) is required or
where the weight and ease of handling are not concerns.
10
Fig 2.2.2.1 IC VOLTAGE REGULATORS
11
2.2.3MICROCONTROLLER
2.2.3.1PIN DIAGRAM
12
Up to 368 x 8 bytes of Data Memory (RAM),
Up to 256 x 8 bytes of EEPROM Data Memory
• Pinout compatible to other 28-pin or 40/44-pin
PIC16CXXX and PIC16FXXX microcontrollers
Peripheral Features:
• Timer0: 8-bit timer/counter with 8-bit prescaler
• Timer1: 16-bit timer/counter with prescaler,
can be incremented during Sleep via external
crystal/clock
• Timer2: 8-bit timer/counter with 8-bit period
register, prescaler and postscaler
• Two Capture, Compare, PWM modules
- Capture is 16-bit, max. resolution is 12.5 ns
- Compare is 16-bit, max. resolution is 200 ns
- PWM max. resolution is 10-bit
• Synchronous Serial Port (SSP) with SPI™
(Master mode) and I2C™ (Master/Slave)
• Universal Synchronous Asynchronous Receiver
Transmitter (USART/SCI) with 9-bit address
detection
• Parallel Slave Port (PSP) – 8 bits wide with
external RD, WR and CS controls (40/44-pin only)
• Brown-out detection circuitry for
Brown-out Reset (BOR)
Analog Features:
• 10-bit, up to 8-channel Analog-to-Digital
13
Converter (A/D)
• Brown-out Reset (BOR)
• Analog Comparator module with:
- Two analog comparators
- Programmable on-chip voltage reference
(VREF) module
- Programmable input multiplexing from device
inputs and internal voltage reference
- Comparator outputs are externally accessible
Special Microcontroller Features:
• 100,000 erase/write cycle Enhanced Flash
program memory typical
• 1,000,000 erase/write cycle Data EEPROM
memory typical
• Data EEPROM Retention > 40 years
• Self-reprogrammable under software control
• In-Circuit Serial Programming™ (ICSP™)
via two pins
• Single-supply 5V In-Circuit Serial Programming
• Watchdog Timer (WDT) with its own on-chip RC
oscillator for reliable operation
• Programmable code protection
• Power saving Sleep mode
• Selectable oscillator options
• In-Circuit Debug (ICD) via two pins
CMOS Technology:
• Low-power, high-speed Flash/EEPROM
14
technology
• Fully static design
• Wide operating voltage range (2.0V to 5.5V)
• Commercial and Industrial temperature ranges
• Low-power consumption
2.2.3.2 DESCRIPTION:
Memory:
Flash Program 8Kx14 Words,
15
In built Multiplexer availability for signal Selection
It has serial as well as Parallel Communication facilities
16
FIG 2.2.3.2 MICROCONTROLLER
2.2.4.1FEATURES 0F L293D
2.2.4.2 DESCRIPTION:
The L293 and L293D are quadruple high-current half-H drivers. The
L293 is designed to provide bidirectional drive currents of up to 1 A at voltages
from 4.5 V to 36 V. The L293D is designed to provide bidirectional drive currents
of up to 600-mA at voltages from 4.5 V to 36 V.
The pin numbers 3 and 6 are connected to one motor wile the pins
11 and 14 are connected to the other motor. The power supply to the motors is also
given through the motor driver IC.
18
bipolar transistors (either integrated or separated devices) connected in such a way
that the current amplified by the first transistor is amplified further by the second
one. This configuration gives a much higher current gain than each transistor
taken separately and, in the case of integrated devices, can take less space than two
individual transistors because they can use a shared collector.
2.2.5 LCD:
19
This section describes the operation modes of LCDs, then describes how to
program and interface an LCD to PIC Microcontroller.
In recent years the LCD is finding widespread use replacing LEDs (seven-
segment LEDs or other multisegment LEDs). This is due to the following reasons:
The LCD discussed in this section has 14 pins. The function of each pin is
given in below.
While VCC and VSS provide +5V and ground, respectively, VEE is used for
controlling LCD contrast.
There are two very important registers inside the LCD. The RS pin is used
for their selection as follows. If RS=0, the instruction command code register is
20
selected, allowing the user to send a command such as clear display, cursor at
home, etc. If RS=1 the data register is selected, allowing the user to send data to be
displayed on the LCD.
R/W, Read/Write :
R/W input allows the user to write information to the LCD or read
information from it. R/W=1 when reading; R/W=0 when writing.
E,Enable :
The enable pin is used by the LCD to latch information presented to its data
pins. When data is supplied to data pins, a high-to-low pulse must be applied to
this pin in order for the LCD to latch in the data present at the data pins. This pulse
must be a minimum of 450ns wide.
D0-D7 :
The 8-bit data pins, D0-D7, are used to send information to the LCD or read
the contents of the LCD’s internal registers.
To display letters and numbers, we send ASCII codes for the letters A-Z, a-
z, and numbers 0-9 to these pins while making RS=1.
There are also instruction command codes that can be sent to the LCD to
clear the display or force the cursor to the home position or blink the cursor. Table
lists the instruction command codes.We also use RS=0 to check the busy flag bit to
see if the LCD is ready to receive information. The busy flag is D7 and can be read
when R/W=1 and RS=0, as follows: if R/W=1, RS=0. When D7=1 ( busy flag=1 ),
21
the LCD is busy taking care of internal operations and will not accept any new
information.
( Hex )
1 Clear display screen
2 Return home
22
C0 Force cursor to beginning of 2nd line
23
signal
7 D0 Data Bit 0
8 D1 Data Bit 1
9 D2 Data Bit 2
10 D3 Data Bit 3
11 D4 Data Bit 4
12 D5 Data Bit 5
13 D6 Data Bit 6
14 D7 Data Bit 7
15 A +4.2 for Back Positive supply for back light if
light available
16 K Power supply
Back light ( 0V)
STEP 1 : Identify :
LCD are available in as follows: 16x1 , 16x2 , 20x2 in the format AxB where
A is the number of columns and B is the number of Rows An LCD might also be
Back lit .
STEP 2 : Connect :
24
FIG 2.2.5.4.1: LCD INTERFACED WITH MICROCONTROLLER
STEP 3 : Interface :
2.2.6.1 DESCRIPTION
25
Darlington transistor arrays. Each consists of seven npn Darlington pairs that
feature high-voltage outputs withcommon-cathode clamp diodes for
switching inductive loads. The collector-current rating of a single
Darlingtonpair is 500 mA. The Darlington pairs can be paralleled for higher
current capability. Applications include relaydrivers, hammer drivers, lamp
drivers, display drivers (LED and gas discharge), line drivers, and logic
buffers.
The ULN2001A is a general-purpose array and can be used with TTL and
CMOS technologies. The ULN2002Ais designed specifically for use with
14-V to 25-V PMOS devices. Each input of this device has a Zener diodeand
resistor in series to control the input current to a safe limit. The ULN2003A
and ULQ2003A have a 2.7-kΩseries base resistor for each Darlington pair
for operation directly with TTL or 5-V CMOS devices. The
ULN2004A and ULQ2004A have a 10.5-kΩ series base resistor to allow
operation directly from CMOS devices
that use supply voltages of 6 V to 15 V. The required input current of the
ULN/ULQ2004A is below that of the
ULN/ULQ2003A, and the required voltage is less than that required by the
ULN2002A.
2.2.6.2FEATURES
26
2.2.6.3 APPLICATIONS
Logic
• High-Voltage Outputs: 50 V
• Relay-Driver Applications
27
FIG2.2.6.1.1PIN DIAGRAM
28
FIG 2.2.6.5.1 LOGIC DIAGRAM OF ULN2003
29
The current flowing in one circuit causes the opening or closing of another circuit.
Relays are like remote control switches and are used in many applications because
of their relative simplicity, long
life, and proven high reliability.
Relays are used in a wide variety
of applications throughout
There are three basic functions of a relay: On/Off Control, Limit Control and Logic
Operation.
30
On/Off Control: Example: Air conditioning control, used to limit and control a
“high power”
load, such as a compressor
Limit Control: Example: Motor Speed Control, used to disconnect a motor if it
runs slower or
faster than the desired speed
Logic Operation: Example: Test Equipment, used to connect the instrument to a
number of
testing points on the device under test
protected
31
FIG 2.2.6.1.1solid state relay
from the introduction of electrical noises. Advantages of Solid State Relays include
low EMI/RFI, long life, no moving parts, no contact bounce, and fast response.
The drawback to using a solid state relay is that it can only accomplish single pole
switching.
Contact Information
The contacts are the most important constituent of a relay. Their characteristics
are significantly affected by factors such as the material of the contacts, voltage
and current values applied to them (especially, the voltage and current waveforms
when energizing and de-energizing the contacts), the type of load, operating
frequency, and bounce. If any of these factors fail to satisfy a predetermined value,
problems such as metal degradation between contacts, contact welding, wear, or a
rapid increase in the contact resistance may occur. The quantity of electrical
current that flows through the contacts directly influences the contacts’
characteristics. For example, when the relay is used to control an inductive load,
such as a motor or a lamp. The contacts will wear faster and metal decomposition
between the mating contacts will occur more often as the inrush current to the
contacts increases.
To prolong the life expectancy of a relay, a contact protection circuit is
recommended. This protection will suppress noise and prevent the generation of
carbon at the contact surface when the relay is opened. Examples of these
synergistic components that provide contact circuit protection include resistor
capacitors, diodes, Zener diodes and varistors.
Contact Arrangement/Poles
The arrangement of contacts on a relay includes a form factor and a number of
poles. Each form factor is explained below.
Form A is a contact that is Normally Open (NO), or “make” contact. It is open
32
when the coil is de-energized and closes when the coil is energized. Form A
contacts are useful in applications that must switch a single power source of high
current from a remote location. An example of this is a car horn, which cannot
have a high current applied directly to the steering wheel. A Form A relay can be
used to switch the high current to the horn. Form B is a contact that is Normally
Closed (NC), or “break” contact. It is closed in the de-energized position and opens
when the coil is energized.
Form B contacts are useful in applications that require the circuit to remain
closed, and when the relay is activated, the circuit is shut off. An example of this is
a machine’s motor that needs to run at all times, but when the motor must be
stopped, the operator can do so by activating a Form B relay and breaking the
circuit.
Form C is a combination of Form A and B arrangement, sharing the same
movable contact in the switching circuit. Form C contact are useful in applications
that require one circuit to remain open; when the relay is activated, the first circuit
is shut off, and another circuit is turned on. An example of this is on a piece of
equipment that runs continually: when the relay is activated, it stops that piece of
equipment and opens a second circuit to another piece of equipment.
Make-before-break Contact: a contact arrangement in which part of the
switching section is shared between both a Form A and a Form B contact. When
the relay operates or releases, the contact that closes the circuit operates before the
contact that opens the circuit releases. Thus both contact are closed momentarily at
the same time. The inverse of a Make-before break contact is a Break-before-make
contact. Poles are the number of separate switching circuits within the relay. The
most common versions are Single Pole, Double Pole and Four Pole.
and a maintained action switch.
33
2.2.7 ENCODER: RF TRANSMITTER
2.2.7.1 FEATURES
34
N address bits and 18_N data bits. Each address/data input is externally trinary
programmable if bonded out. It is otherwise set floating internally. Various
packages of the 3^18 encoders offer flexible combinations of programmable
address/data to meet various application needs. The programmable address/ data is
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 type
or a DATA trigger type further enhances the application flexibility of the 3^18
series of encoders.
2.2.7.4.2PIN DESCRIPTION
35
36
2.2.8 HT648L DECODER: RF RECEIVER
2.2.8.1 FEATURES
2.2.8.2 APPLICATIONS
Burglar alarm system
Smoke and fire alarm system
Garage door controllers
Car door controllers
Car alarm system
Security system
Cordless telephones
37
Other remote control systems
The 318 decoders are a series of CMOS LSIs for remote control system
applications. They are paired with the 318 series of encoders. For proper
operation a pair of encoder/decoder pair with the same number of address and
data format should be selected (refer to the encoder/decoder cross reference
38
tables). The 318 series of decoders receives serial addressand data from that
series of encoders that are transmitted by a carrier using an RF or an IR
transmission medium. It then compares the serial input data twice continuously
with its local address. If no errors or unmatched codes are encountered, the
input data codes are decodedand then transferred to the output pins. The VT pin
also goes high to indicate a valid transmission. The 318 decoders are capable of
decoding 18 bits of information that consists of N bits of address and 18–N bits
of data. To meet various applications they are arranged to provide a number of
data pins whose range is from 0 to 8 and an address pin whose range is from 8
to 18. In addition, the 318 decoders provide various combinations of
address/data number in different packages.
2.2.9 JOYSTICK
Joysticks pull off a really neat trick. They take something entirely physical --
the movement of your hand -- and translate it into something entirely mathematical
-- a string of ones and zeros (the language of computers). With a good joystick, the
translation is so flawless that you completely forget about it. When you're really
engaged in a game, you feel like you're interacting with the virtual world directly.
39
generally configured so that moving the stick left or right signals movement along
the X axis, and moving it forward (up) or back (down) signals movement along the
Y axis. In joysticks that are configured for three-dimensional movement, twisting
the stick left (counter-clockwise) or right (clockwise) signals movement along the
Z axis. These three axes - X Y and Z - are, in relation to an aircraft, roll, pitch, and
yaw.
Additionally joysticks often have one or more fire buttons, used to trigger some
kind of action. These are simple on/off switches.
Some joysticks have haptic feedback capability. These are thus active devices, not
just input devices. The computer can return a signal to the joystick that causes it to
resist the movement with a returning force or make the joystick vibrate.
40
2.2.10 DC MOTORS
S
S
Flux by
Conductor conductor
Main Flux
N
Magnet
Current carrying N
conductor
41
Fig 2.2.11.1.1 conductor in mag. Fig .2.11.1.2 flux produced
flied by current carrying conductor
These are shown in the fig.3. From this, it is clear that on one side of the
conductor, both the fluxes are in the same direction. In this case, on the left of the
conductor there is gathering of the flux lines as two fluxes help each other. As
against this, on the right of the conductor, two fluxes are in opposite direction and
hence try to cancel each other. Due to this, the density of the flux lines in this area
gets weakened. So on the left, there exists high flux density area while on the right
of the conductor there exists low flux density area as shown in fig.
This flux distribution around the conductor acts like a stretched rubber band under
tension. This exerts a mechanical force on the conductor which acts from high flux
density area towards low flux density area, i.e. from left to right for the case
considered as shown in fig.
42
S Fig.4 S
Direction
of Force
Cancellation
Gathering of flux
Addition Weakening
of flux
N N
DC motors consist of one set of coils, called an armature, inside another set
of coils or a set of permanent magnets, called the stator. Applying a voltage to the
coils produces a torque in the armature, resulting in motion.
Small permanent magnet motors are cheap, but as size increases, the price
advantage shifts to wound motors.
43
2. Series Wound: the field coils are connected in series with the armature coil.
Powerful and efficient at high speed, series wound motors generate the most
torque for a given current. Speed varies wildly with load, and can run away
under no-load conditions.
3. Shunt Wound: the field coils are connected in parallel with the armature coil.
Shunt wound motors generate the least torque for a given current, but speed
varies very little with load. Will not run away under no-load, but may if the
field windings fail.
T = K × f × Ia
where T is torque, K is some constant, f is the flux density, and Ia is the armature
current.
In series wound motors, flux density approximates the square root of current, so
torque becomes approximately proportional to the 1.5 power of torque.
T = K × Ia1.5±
44
Speed, Voltage, and Induced Voltage
Eb = K × N × f
This can be solved for speed to get the "Speed Equation" for a motor:
N = K × Eb ÷ f
45
where N is rpm, K is some constant (the inverse of the K above), Eb is the induced
voltage of the motor, and f is the flux density.
Note that speed is inversely proportional to field strength. That is to say, as field
strength decreases, speed increases.
Starting
Speed Control
Braking
D.C. shunt motor- lathes,fans,pumps disc and band saw drive requiring moderate
torques.
D.C., compound motor- Rolling mills and other loads requiring large momentary
toques.
2.2.11 IR SENSOR
46
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 of the
exact same type!
This is an electrical property of Light Emitting Diodes (LEDs) which is the fact
that a led Produce a voltage difference across its leads when it is subjected to light.
As if it was a photo-cell, but with much lower output current. In other words, the
voltage generated by the leds can't be - in any way - used to generate electrical
power from light, It can barely be detected. that's why Opams are mostly used for
accurately detection of low voltages.
2.2.11.1 FEATURES
IR LED at 900nm
GaAlAs Infrared Light Emitting Diode
Shines invisible IR light on the user’s eye
IR 900nm sensor
Light Detector
Detects reflected IR light
47
Solid-state relays control power circuits with no moving parts, instead using
a semiconductor device to perform switching—often a silicon-controlled
rectifier or triac.
A pair of on-off switches which operate together (shown by the dotted line
in the circuit symbol).
A DPST switch is often used to switch mains electricity because it can
isolate both the live and neutral connections.
Here DPST switches are used to switch between manual and automated
modes for controlling ADG.
CHAPTER -3
TESTING AND RESULTS
The main objective of our project is to control the AIR DEFENSE GUN in
manual and automated mode.
48
Fig 3.1:BASIC BLOCK CONNECTION
The automated mode deals with controlling the set up by means of
PIC16F877A microcontroller and manually by means of JOYSTICK.
Both operations can used separately by means of a switch(DUAL POLE
SINGLE THROW)
The mechanism for both operations are explained here.
49
3.1.1 AUTOMATIC CONTROL OF AIR DEFENSE GUN
50
The manual mode operation is activated when the switch is in released
position.
All the activities of the ADG is controlled by JOYSTICK, which is
manually handled by the gunner.
JOYSTICK is connected to the two motors which controls the movement of
ADG( vertical and horizontal) through relay circuits broads.
The JOYSTICK is divided into two axis as shown below:
0 X
51
direction). When the ADG needs to be moved in other direction
(anticlockwise direction),then the –y axis of JOYSTICK is manhandled to
get the desired positioning of ADG.
52
CHAPTER -4
CONCLUSION
4.1 CONCLUSION
Thus the bench model of Reflexive Adaptation of Air Defense Gun is
successfully completed and is tested to perfection. Our project protects the gunner
from the possible dangers faced when he is exposed to vulnerable situations in the
battle flied, while handling the Air Defense Gun all by himself. So now with our
project, the gunner could control the Gun in two modes, namely automatic and
manual by just resting inside the turret cabin, there by shielding him as well as
providing accurate tracking and firing of the enemy flying aircraft. Thus making
our project a superlative improvement for present MBT ARJUN TANKS.
53
Camera can be interfaced with the computer or a separate monitor for
display purpose.
Instead of camera a periscope can be fixed within the hull for the gunner to
sight the target in manual mode of operation.
Instead of IR sensor we can use RADAR in real time application.
54
APPENDICES
A.1 16F877A MICROCONTROLLER CODING
#include<16f877a.h>
#use delay(CLOCK=20000000)
#byte portc=0x07
#byte trisc=0x87
#byte portb=0X06
#byte trisb=0X86
#byte portd=0x08
#byte trisd=0x88
#byte ADCON1=0x9F
int x;
int y;
int v;
55
void main()
ADCON1=0x07;
trisb=0x00;
trise = 0x00;
porte = 0x00;
trisa = 0xff;
trisc = 0x00;
portc=0x80;
trisd = 0xff;
//portd= 0x10;
ADCON1=0x07;
trisc=0x00;
portc=0x00;
delay_ms(150);
delay_ms(150);
delay_ms(15);
56
delay_ms(15);
//lcdcmd(0x01);
//delay_ms(15);
delay_ms(15);
delay_ms(15);
lcddata ('R');
delay_ms(15);
lcddata('A');
delay_ms(15);
lcddata ('A');
delay_ms(15);
lcddata ('G');
delay_ms(15);
trisc=0x00;
x=porta;
y=portd;
while(1)
trisc = 0x00;
57
portc=0xF0;
x=porta;
y=portd;
if (x==0x01)
portc = 0xF0;
delay_ms(150);
delay_ms(150);
delay_ms(15);
delay_ms(15);
//lcdcmd(0x01);
//delay_ms(15);
delay_ms(15);
delay_ms(15);
lcddata ('F');
58
delay_ms(15);
lcddata('R');
delay_ms(15);
lcddata ('I');
delay_ms(15);
lcddata ('E');
delay_ms(15);
lcddata ('N');
delay_ms(15);
lcddata ('D');
delay_ms(15);
else if (y==0x04)
delay_ms(150);
delay_ms(150);
delay_ms(15);
59
delay_ms(15);
//lcdcmd(0x01);
//delay_ms(15);
delay_ms(15);
delay_ms(15);
lcddata ('E');
delay_ms(15);
lcddata('N');
delay_ms(15);
lcddata ('E');
delay_ms(15);
lcddata ('M');
delay_ms(15);
lcddata ('Y');
delay_ms(15);
lcddata ('-');
delay_ms(15);
lcddata ('F');
delay_ms(15);
60
lcddata ('I');
delay_ms(15);
lcddata ('R');
delay_ms(15);
lcddata ('E');
delay_ms(15);
portc=0x01;
delay_ms(40);
portc = 0x00;
delay_ms(60);
else if (y==0x02)
delay_ms(150);
delay_ms(150);
delay_ms(15);
delay_ms(15);
61
//lcdcmd(0x01);
//delay_ms(15);
delay_ms(15);
delay_ms(15);
lcddata ('E');
delay_ms(15);
lcddata('N');
delay_ms(15);
lcddata ('E');
delay_ms(15);
lcddata ('M');
delay_ms(15);
lcddata ('Y');
delay_ms(15);
lcddata ('-');
delay_ms(15);
lcddata ('F');
delay_ms(15);
lcddata ('I');
62
delay_ms(15);
lcddata ('R');
delay_ms(15);
lcddata ('E');
delay_ms(15);
portc=01;
delay_ms(40);
portc =0x00;
delay_ms(60);
else if (y==0x03)
delay_ms(150);
delay_ms(150);
delay_ms(15);
delay_ms(15);
//lcdcmd(0x01);
63
//delay_ms(15);
delay_ms(15);
delay_ms(15);
lcddata ('E');
delay_ms(15);
lcddata('N');
delay_ms(15);
lcddata ('E');
delay_ms(15);
lcddata ('M');
delay_ms(15);
lcddata ('Y');
delay_ms(15);
lcddata ('-');
delay_ms(15);
lcddata ('F');
delay_ms(15);
lcddata ('I');
delay_ms(15);
64
lcddata ('R');
delay_ms(15);
lcddata ('E');
delay_ms(15);
portc=01;
delay_ms(40);
portc = 0x00;
delay_ms(60);
else if (y==0x01)
delay_ms(150);
delay_ms(150);
delay_ms(15);
delay_ms(15);
//lcdcmd(0x01);
//delay_ms(15);
65
lcdcmd(0x06); // increment cursor
delay_ms(15);
delay_ms(15);
lcddata ('E');
delay_ms(15);
lcddata('N');
delay_ms(15);
lcddata ('E');
delay_ms(15);
lcddata ('M');
delay_ms(15);
lcddata ('Y');
delay_ms(15);
lcddata ('-');
delay_ms(15);
lcddata ('F');
delay_ms(15);
lcddata ('I');
delay_ms(15);
lcddata ('R');
66
delay_ms(15);
lcddata ('E');
delay_ms(15);
portc=01;
delay_ms(40);
portc=0x00;
delay_ms(60);
portc=0x00;
portb = valu;
bit_clear(porte,0);
//bit_clear(porte,1);
bit_set(porte,2);
delay_ms(2);
bit_clear(porte,2);
return;
67
void lcddata(unsigned char value)
portb = value;
bit_set(porte,0);
//bit_clear(porte,1);
delay_ms(2);
bit_clear(porte,2);
return;
#use delay(CLOCK=20000000)
#byte trisc=0*87
68
#byte tris a=0*85
#byte ADCONI=0*09
int y;
int v;
void main()
ADCONI=0*07;
tris b=0*00;
tris e=0*00;
port e=0*00;
tris a=0*ff;
tris c=0*00;
port c=0*80;
tris d=0*ff;
ADCONI=0*07;
tris c=0*00;
69
bit_clear(port e,2);
delay_ms(150);
delay_ms(15);
delay_ms(15);
lcdcmd(0*81);//display
delay_ms(15);//frist line
lcd data('R');
delay_ms(15);
lcd data('A');
delay_ms(15);
lcd data('A');
delay_ms(15);
lcad data('G');
delay_ms(15);
port b=value;
bit_clear(port e,0);
70
bit.set(port e,2);
delay_ms(2);
bit_clear(port e,2);
return;
port b=value;
bit_set(port e,0);
delay_ms(2);
bit_clear(port e,2);
return;
71
REFERENCES
Bradley, B.A., et al, Mechatronics: Electronics in products and process,
Champman & hall, London, 1991
Hute,G.M. and R.D.Chute,Electronics in industry,5th ed.,McGraw-Hill,New
York,1979.
Dubey, G.K., Fundamentals of electrical drives,Narosa Publishing House,
India,1995.
Gross,H.,Ed.,Electrical feed drives for machene tools,John wiley
&sons,USA,1993.
Hunt, V.D., Mechatronics:Japan’s newest threat,chapman & hall,
London,1998.
Electronics fundamentals and applications., J.D.Ryder,Prentise Hall of
India,1969.
Communication systems, simon Haykin, Wiley Eastern,1985.
Transistor Physics and Circuit Design,D.C.Sarkar, S.Chand and co,1985
Theraja.B.L., A text book of electrical technology, Niraj Construction and
development Co, (P) Ltd., India, 1987
72