Académique Documents
Professionnel Documents
Culture Documents
INTRODUCTION
In recent years , with the high speed of trains it’s more difficult
for the railway departments to control the train. So a system for the safety of
train become more essential as hijacking and terrorist attack on the train
became a common issue that needed a final solution. It created a strong
pressure in every part of the world where railway is an important and cheaper
mode of transport. A wireless protocol with automatic control is developed
using our system. This system automatically stops the train when the train is
violating the signal rule indicated in the signal post. Thus hijacking or
unnecessary accidents can be avoided by the system. PIC microcontroller is
the brain of the system. It supports all the functioning of the system. It is quite
common that train met with accidents due to obstacles placed in the track. With
the help of ultrasonic sensors, obstacles are sensed over a large distance, then
train will take a separate track to avoid train to train collisions. Temperature
sensors are used to sense the temperature inside the engine cabin where heat is
generated at a large rate. Once the temperature rate exceeds the certain limit
,automatically the fan is switched ON. IR sensors are used for transmitting the
signal to control the speed of the train. Once train is stopped through Remote
Infrastucture Management (RIM),information is passed to control room, and
other stations. This proposed system is based on Automatic Train
Protection(ATP) protocol. Train Protection System is installed in some trains
inorder to help prevent collisions through a driver’s failure to observe a signal
or speed restriction. It mainly concerns with target speed indication and audible
warnings. This system takes in to account the speed and position of the train.
1
This system was introduced in Britain due to clapham junction rail crash and
fatal accidents caused by SPADs.
2. LITERATURE SURVEY
2
monitor units: one is static and each is disturbed along the railway to
determine locations .the other is dynamic and the unit is installed on the train
locomotive. It changes their locations continuously.
3
satellite path, video recording of the antenna environment and reconstruction
of the masking obstacles by simple image analysis using two cameras.
3.1 Overview
This system uses a target speed indication and audible warnings to warn the train
driver if they are likely to exceed a speed profile that will cause the train to pass
a red (danger) signal or exceed a speed restriction. The system will apply the
brakes if the driver fails to respond to these warnings. The system takes into
4
account the speed and position of the train relative to the end of its 'movement
authority' in issuing the warnings and applying the brakes.
By the 1980s, microprocessors had developed sufficiently for British Rail to carry
out pilot trials on existing European 'off the shelf' ATP – fitting part of the Great
Western Main Line with the TBL1 system from ACEC and the Chiltern Main
Line route with SELCAB a derivative of the German LZB system from Alcatel
and GEC.
In the early 1990s, following the Clapham Junction rail crash in December 1988,
and two other fatal accidents in early 1989 caused by SPADs, British Rail was
keen to implement the ATP system across the entire British railway system.
However, the cost (estimated at over £1bn) was balked at by the Conservative
government, whose priority was the privatization of the railways.
All of First Great Western's High Speed Trains (HSTs) are now fitted with ATP
and are not allowed to carry passengers unless the system is functioning. This
requirement is in response to the Ladbroke Grove rail crash. All Chiltern
Railways Class 165 and Class 168 trains are also fitted with ATP. Also, all of
Heathrow Express Class 332 trains and Heathrow Connect's Class 360/2 trains
are fitted with this system.
ATP is given permitted speed and location information from the track via
encoded balise(s), encoded track circuit or more recently via radio.
In TfL's plans to modernise the London Underground network, all lines would be
equipped with ATP, replacing the current train stop system, a mechanical system
which currently prevents SPADs and collisions. The Central Line is already
equipped with ATP, installed with the modernisation of the line in 1996.
5
3.2Continuous and intermittent ATP
ERTMS is an attempt to set a standard for Mainline ATP across Europe where
balises, GSM-R Radio and on train equipment made by any manufacturer (who
are part of the working group) work together with each other. This is achieved by
carefully agreeing the functional specification of the system and the format and
transmission methods of data across the air gap, both transponder and radio
(GSM-R is the most common system in use).
Hines Hill train collision - 1996 - driver misjudges end of crossing loop
during simultaneous cross with opposing train. Two killed.
Watford rail crash - 1996 - Signal passed at danger resulting in collision
with coaching stock. One killed.
Southall rail crash - 1997 - Signal passed at danger, resulting in a
collision between a passenger train and a freight train crossing the track in
front of it.
Ladbroke Grove rail crash - 1999 - inexperienced driver misread
complicated signals, passes red signal and causes head-on collision.
6
Glenbrook train disaster - 1999 - too fast after Stop and Proceed.
Waterfall train disaster - 2003 - too fast around very sharp curve.
Seven Hills, Black town and Concord West - drivers take turnout at too
high a speed, causing minor injuries to passengers.
17 September 2005 Too fast through turnouts between Joliet and
Chicago.
Amagasaki rail crash - 2005 – Over speed through sharp curve. 107
killed, 555 injured.
Chatsworth train collision - 2008 - driver of commuter train passes red
signal and collides head-on with freight train - 25 killed
In the Gare de Lyon train accident in Paris in 1988, a brake failure was
the prime cause of the accident. However a more modern ATP system, if
fitted, might have reduced the intensity of the collision in two ways:
7
o Firstly, the on board ATP equipment may have detected the
excessive speed of the train sooner than the driver did.
o Secondly, the ATP system presumably would have applied a
secondary backup brake system, even though this might have
"risked" flat wheels. Apparently, the driver failed to apply or forgot
the existence of this secondary brake.
3.4.1Train stops
The earliest systems were train stops, as still used by the New York Subway, the
Toronto Subway, the London Underground, the Moscow Subway (oldest lines
only) and the Berlin S-Bahn. Beside every signal is a moveable clamp, which
touches a valve on a passing train if the signal is red and opens the brake line,
applying the emergency brake. If the signal shows green, the clamp is turned
away.
Trackside magnets for very simple data communication. Outside and middle of
track: Integra-Signum, other two (yellow) magnets: ZUB
8
3.4.2Inductive systems
In this system data is transmitted magnetically between the track and locomotive
by magnets mounted beside the rails and on the locomotive.
In the Integra-Signum system the trains are influenced only at given locations,
for instance whenever a train ignores a red signal, the emergency brakes are
applied and the locomotive's motors are shut down. Additionally, they often
require the driver to confirm distant signals (e.g. CAWS) that show stop or
caution – failure to do so results in the train stopping. This gives sufficient braking
distance for trains following each other; however it cannot always prevent
accidents in stations where trains cross paths, because the distance from the red
signal to the next obstacle may be too short for the train to brake to a halt.
More advanced systems (e.g. PZB, and ZUB) calculate a braking curve that
determines if the train can stop before the next red signal, and if not they brake
the train. They require that the train driver enter the weight and the type of brakes
into the onboard computer. One disadvantage of this kind of system is that the
train cannot speed up before the signal if the signal has switched to green, because
the onboard computer's information can only be updated at the next magnet. To
overcome that problem, some systems allow additional magnets to be placed
between distant and home signals, or data transfer from the signalling system to
the onboard computer is continuous (e.g. LZB).
3.4.3Cab signalling
The newest systems use cab signalling, where the trains constantly receive
information regarding their relative positions to other trains. The computer shows
the driver how fast he may drive, instead of him relying on exterior signals.
Systems of this kind are in common use in France, Germany and Japan, where
the high speeds of the trains made it impossible for the train driver to read exterior
9
signals, and distances between distant and home signals are too short for the train
to brake.
These systems are usually far more than automatic train protection systems, not
only do they prevent accidents, but also actively support the train driver. This
goes as far as some systems being nearly able to drive the train automatically.
Siemens has reached a major milestone in the trial of European Train Control
System (ETCS) Automatic Train Protection (ATP) technology, part of a wider
trial being undertaken by RailCorp in the Blue Mountains.
Martin Green, Siemens ATP Project Manager, said: “An ATP system offers
many innovative benefits. By use of an ATP system an onboard computer will
10
analyse the speed and braking pattern of a train and intervene if it anticipates a
train is in danger. For example, if a driver fails to slow down sufficiently when
approaching a red signal, a lower speed limit zone or a worksite, the train’s brakes
will automatically be applied. ETCS further enhances the benefits of ATP by
providing standardisation that ensures all suppliers of ETCS track and train
systems are interoperable with each other”. Siemens has worked with Railcorp to
trial this new technology over a section of rail infrastructure in the Blue
Mountains, New South Wales. The remaining trial runs are now taking place on
three separate sections of the Blue Mountains Line between Penrith and Mt
Victoria.
12
3.5 SAFETY SYSTEMS
There are two primary levels of safety systems to consider in the movement of
trains, i.e., traffic control and enforcement. TRR’s traffic control is a mixture of
traditional signalling (i.e., a railroad’s traffic lights) and an antiquated token block
operation. While the condition of the signalled operation across TRR is
understood to be below par, it is TRR’s token block operation that requires the
greatest attention.
Token block originates back in the middle of the 19th Century in Britain, and its
deployment across the globe was in step with the expansion of the British Empire.
Simply explained, token block’s safety, as used across TRR, is based upon an
operator for each section of track (block) handing a token, e.g., metal rod, to the
train crew as an authority to proceed into the block. Upon exiting the block, the
train crew hands back the token to the next operator and at some point receives a
new token unique to the next block. In concept, token block is a safe system. But,
in practice the manual processes involving the block operator and the crew can
be, and have been, violated resulting in fatal accidents. For this and perhaps other
reasons, various types of Radio Electronic Token Block (RETB) have replaced
manual token block in Britain and elsewhere, including a relatively short corridor
13
in TRR. But for the majority of TRR’s operation that is still manual token block,
the integrity of that operation is subject to being compromised by human error.
Fortunately, as to be addressed in a forthcoming posting, there are non-signalling
traffic control systems that can replace token block. These are solutions that don’t
require the extensive capital investment of traditional CTC operations or the
overwhelming capital investment of ETCS as used for Europe’s high speed rail
networks.
Traffic control safety is not the only issue associated with safe train movements.
There is also the issue of train crew errors regardless of whether the operation is
in signalled territory or token block, and it is the purpose of enforcement systems
to prevent such errors. In TRR’s case, an antiquated enforcement approach,
Automatic Train Protection (ATP), is deployed across much of the railroad.
However, based upon my visits to date, it appears that the maintenance and theft
of ATP components embedded in the track as well as the train drivers turning off
the on-board controller so as to not be enforced for over-speeding, has rendered
the system highly ineffective. To be addressed in a latter posting, ATP is quite
similar in functionality to another enforcement system referred to as Positive
Train Control (PTC) that is now mandated for implementation before 2016 across
most of the track age in the U.S. PTC doesn’t have the theft, maintenance, and
driver abandonment problems of TRR’s ATP system.
Various other benefits are sometimes associated with PTC such as increased fuel
efficiency or locomotive diagnostics; however these are benefits that can be
achieved by having a wireless data system to transmit the information, whether it
be for PTC or other applications.
In the 1990s, Union Pacific had a partnership project with General Electric to
implement a similar system known as Precision Train Control. This system
would have involved moving block operation, which adjusts a 'safe zone' around
a train based on its speed and location.
4. BLOCK DIAGRAM
15
Fig (4.1) Block diagram of designed System
4.1.1 Transmitter:
16
When the signal post is indicating red signal, the driver need to stop the
train, if he is not responding, the IR sensors will detect the passage of train. At
the signal post, we are using HT12E encoder to encode the signal that is to be
transmitted to the receiver located on the train.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 38 kHz carrier for infrared systems.
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
17
HT12A/E: 18-pin DIP/20-pin SOP package
Applications
Burglar alarm system
Smoke and fire alarm system
Garage door controllers
Car door controllers
Car alarm system
Security system
Cordless telephones
Other remote control systems
4.1.2 IR SENSORS
18
All objects emit some form of thermal radiation, usually in the infrared
spectrum. This radiation is invisible to our eyes, but can be detected by an infrared
sensor that accepts and interprets it. In a typical infrared sensor like a motion
detector, radiation enters the front and reaches the sensor itself at the center of the
device. This part may be composed of more than one individual sensor, each of
them being made from pyroelectric materials, whether natural or artificial. These
are materials that generate an electrical voltage when heated or cooled. An
infrared sensor can be thought of as a camera that briefly remembers how an
area's infrared radiation appears. A sudden change in one area of the field of view,
especially one that moves, will change the way electricity goes from the
pyroelectric materials through the rest of the circuit. This will trigger the motion
detector to activate an alarm. If the whole field of view changes temperature, this
will not trigger the device. This makes it so that sudden flashes of light and natural
changes in temperature do not activate the sensor and cause false alarm
Working of IR sensor
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 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 Op-amps are
19
mostly used for accurately detection flow voltages.
Fig (4.2) how the receiver of the sensor measures the distance of the intruding
Object
20
Fig (4.3)Diagram of IR sensors
Upon careful observation, you will notice that amongst the two ‘legs’, one has
a much wider base within the diode. That is normally the cathode (negative)
whereas the leg having a smaller base would be the anode (positive terminal).
Operation:
When the Tx is forward biased, it begins emitting infra red. Since it’s not in
visible spectrum, you will not be able to see it through naked eyes but you will
be able to view it through an ordinary cell phone camera.
21
Fig (4.4) A typical transmitter circuit.
The resistance R1 in the above circuit can vary. It should not be a very high
value (~ 1Kohm) as then the current flowing through the diode would be very
less and hence the intensity of emitted IR would be lesser. By increasing the
current flowing in the circuit, you can increase the effective distance of your IR
sensor. However, there are drawbacks of reducing the resistance. Firstly, it would
increase the current consumption of your circuit and hence drain the battery (one
of the few ‘precious’ resources for any embedded system) faster.
Secondly, increasing the current might destroy the Tx. So, the final choice should
be a calculated trade off between these various factors. You can also modulate
the IR to achieve better distance and immunity. The receiver diode has a very
high resistance, typically of the order of mega Ohms when IR is not incident upon
it. However, when IR is incident upon it, the resistance decreases sharply to the
order of a few kilo Ohms or even lesser. This feature forms the basis of using IR
as a sensor. You will need to connect a resistance of the order of a few mega Ohm
in series with the Rx. Then tap the output voltage at the point of connectivity of
these two resistors. A complete
22
Fig (4.5) A Tx-Rx pair circuitry.
Rx would be of the order of mega ohms and hence the output voltage would be
around 2.6v – 3v depending upon your choice of R2 and the Rx.
The resistance of Rx will sharply fall and hence the output voltage would be
around 1.8v - 1.5v depending upon your choice of Rx and R2
4.1.3Receiver:
The 212 decoders are a series of CMOS LSIs for remote control system
applications. They are paired with Holtek_s 212 series of encoders (refer to the
encoder/decoder cross reference table). For proper operation, a pair of
encoder/decoder with the same number of addresses and data format should be
chosen. The decoders receive serial addresses and data from a programmed 212
series of encoders that are transmitted by a carrier using an RF or an IR
transmission medium. They compare the serial input data three times
continuously with their local addresses. If no error or
23
Unmatched codes are found; the input data codes are decoded and then
transferred to the output pins. The VT pin also goes high to indicate a valid
transmission. The 212 series of decoders are capable of decoding information’s
that consist of N bits of address and 12_N bits of data. Of this series, the HT12D
is arranged to provide 8 address bits and 4 data bits, and HT12F is used to decode
12 bits of address information.
Features
Operating voltage: 2.4V~12V
Low power and high noise immunity CMOS
Technology
Low standby current
Capable of decoding 12 bits of information
Binary address setting
Received codes are checked 3 times
Address/Data number combination
HT12D: 8 address bits and 4 data bits
HT12F: 12 address bits only
Built-in oscillator needs only 5% resistor
Valid transmission indicator
Easy interface with an RF or an infrared transmission
Medium
Minimal external components
Pair with Holtek_s 212 series of encoders
18-pin DIP, 20-pin SOP package
24
Applications
Burglar alarm system
Smoke and fire alarm system
Garage door controllers
Car door controllers
Car alarm system
Security system
Cordless telephones
Other remote control systems
Thus the train will be stopped on violation of the signal on connecting it to PIC
25
Fig (4.6) Schematic diagram of the PIC micro controllers
Separate code and data spaces (Harvard architecture) for devices other than
PIC32, which has a Von Neumann architecture.A small number of fixed length
instruction. Most instructions are single cycle execution (2 clock cycles), with
one delay cycle on branches and skips. One accumulator (W0), the use of which
(as source operand) is implied (i.e. is not encoded in the opcode).All RAM
locations function as registers as both source and/or destination of math and other
functions. A hardware stack for storing return addresses. A fairly small amount
of addressable data space (typically 256 bytes), extended through banking. Data
space mapped CPU, port, and peripheral registers The program counter is also
mapped into the data space and writable (this is used to implement indirect
jumps).There is no distinction between memory space and register space because
the RAM serves the job of both memory and registers, and the RAM is usually
just referred to as the register file or simply as the registers.
26
4.1.4.2 Data space (RAM):
In earlier devices, any register move had to be achieved via the accumulator. To
implement indirect addressing, a "file select register" (FSR) and "indirect
register" (INDF) are used. A register number is written to the FSR, after which
reads from or writes to INDF will actually be to or from the register pointed to by
FSR. Later devices extended this concept with post- and pre-
increment/decrement for greater efficiency in accessing sequentially stored data.
This also allows FSR to be treated almost like a stack pointer (SP).
External data memory is not directly addressable except in some high pin count
PIC18 devices.
All PICs handle (and address) data in 8-bit chunks. However, the unit
of addressability of the code space is not generally the same as the data space.
27
For example, PICs in the baseline and mid-range families have program memory
addressable in the same word size as the instruction width, i.e. 12 or 14 bits
respectively. In contrast, in the PIC18 series, the program memory is addressed
in 8-bit increments (bytes), which differ from the instruction width of 16 bits.
4.1.4.5 Stacks:
PICs have a hardware call stack, which is used to save return addresses. The
hardware stack is not software accessible on earlier devices, but this changed with
the 18 series devices.
Hardware support for a general purpose parameter stack was lacking in early
series, but this greatly improved in the 18 series, making the 18 series architecture
more friendly to high level language compilers.
4.1.4.6Instruction set:
A PIC's instructions vary from about 35 instructions for the low-end PICs to
over 80 instructions for the high-end PICs. The instruction set includes
instructions to perform a variety of operations on registers directly, the
accumulator and a literal constant or the accumulator and a register, as well as for
conditional execution, and program branching.
Some operations, such as bit setting and testing, can be performed on any
numbered register, but bi-operand arithmetic operations always involve W (the
accumulator), writing the result back to either W or the other operand register.
To load a constant, it is necessary to load it into W before it can be moved into
28
another register. On the older cores, all register moves needed to pass through
W, but this changed on the "high end" cores.
PIC cores have skip instructions which are used for conditional execution
and branching. The skip instructions are 'skip if bit set' and 'skip if bit not set'.
Because cores before PIC18 had only unconditional branch instructions,
conditional jumps are implemented by a conditional skip (with the opposite
condition) followed by an unconditional branch. Skips are also of utility for
conditional execution of any immediate single following instruction. The 18
series implemented shadow registers which save several important registers
during an interrupt, providing hardware support for automatically saving
processor state when servicing interrupts.
29
Control transfers. Other than the skip instructions previously mentioned,
there are only two: goto and call.
4.1.4.7 Performance:
The PIC instruction set is suited to implementation of fast lookup tables in the
program space. Such lookups take one instruction and two instruction cycles.
Many functions can be modelled in this way. Optimization is facilitated by the
relatively large program space of the PIC (e.g. 4096 x 14-bit words on the
16F690) and by the design of the instruction set, which allows for embedded
constants. For example, a branch instruction's target may be indexed by W, and
execute a "RETLW" which does as it is named - return with literal in
W.Execution time can be accurately estimated by multiplying the number of
instructions by two cycles; this simplifies design of real-time code. Similarly,
interrupt latency is constant at three instruction cycles. External interrupts have
to be synchronized with the four clock instruction cycle; otherwise there can be a
one instruction cycle jitter. Internal interrupts are already synchronized.
The constant interrupt latency allows PICs to achieve interrupt driven low jitter
timing sequences. An example of this is a video sync pulse generator. This is no
30
longer true in the newest PIC models, because they have a synchronous
interrupt latency of three or four cycles.
4.1.4.8 Advantages
4.1.4.9Limitations
One accumulator
Register-bank switching is required to access the entire RAM of many devices
Operations and registers are not orthogonal; some instructions can address
RAM and/or immediate constants, while others can only use the accumulator
The following limitations have been addressed in the PIC18 series, but still
apply to earlier cores:
Stack:
31
2. Software-implemented stacks are not efficient, so it is difficult to generate
reentrant code and support local variables
Blue pins are ports (inputs/outputs) since there is many extra functions in
this microcontroller. Some pins can be used as inputs to an internal AD and some
pins can be connected to an internal counter etc. The two green pins should be
connected to an external clock signal. The yellow ones are power supply. The red
one is the reset input which will reset the circuit.
33
In-circuit Serial Programming (ISC)
Wide operating voltage range: 2.5V to 5.5V
High Sink / Source current 25/25 mA
Commercial and Industrial temperature ranges
Low power consumption
<2 mA at 5V, 4 MHz
22.5 mA typical at 3V, 32 KHz
<1 mA typical standby current
34
EPROM mask ROM RAM I/O Speed
Part Number
(words) (words) (bytes) pins (MHz)
PIC16C52 384 25 12 4, 20
PIC16C54
512 25 12 4, 20
PIC16C54A
PIC16CR54 512 25 12 4, 20
PIC16C55 512 24 20 4, 20
PIC16C56 1024 25 12 4, 20
PIC16C57 2048 72 20 4, 20
PIC16CR57A 2048 72 20 4, 20
PIC16C58A 2048 73 12 4, 20
PIC16CR58A 2048 73 12 4, 20
35
PIC17C44 8192 454 33 16, 25 2.5 to 6.0 *
36
The compiler includes built-in functions to access the PIC microcontroller
hardware such as READ_ADC to read a value from the A/D converter.
Discrete I/O is handled by describing the port characteristics in a PRAGMA.
Functions such as INPUT and OUTPUT_HIGH will properly maintain the
tri-state registers. Variables including structures may be directly mapped to
memory such as I/O ports to best represent the hardware structure in C. The
microcontroller clock speed may be specified in a PRAGMA to permit built
in functions to delay for a given number of microseconds or milliseconds.
Serial I/O functions allow standard functions such as GETC and PRINTF to
be used for RS-232 like I/O. The hardware serial transceiver is used for
applicable parts when possible. For all other cases a software serial
transceiver is generated by the compiler. The standard C operators and the
special built in functions are optimized to produce very efficient code for the
bit and I/O functions.
During the linking process the program structure, including the call tree, is
analyzed. Functions that call one another frequently are grouped together in
the same page segment. Calls across pages are handled automatically by the
tool transparent to the user. Functions may be implemented inline or separate.
RAM is allocated efficiently by using the call tree to determine how locations
can be re-used. Constant strings and tables are saved in the device ROM. The
output hex and debug files are select-able and compatible with popular
emulators and programmers including MPLAB IDE for source level
37
debugging. PCW includes a powerful Windows IDE. The compiler requires
Microsoft Windows 95, 98, ME, NT4, 2000 or XP.
Built in libraries that work with all chips for RS232 serial I/O, I2C, discrete
I/O and precision delays.
Integrates with MPLAB IDE and other simulators and editors for source
level debugging. Standard HEX file and debug files ensure compatibility with
all programmers.
Formatted print f allows easy formatting and display in HEX or decimal.
Efficient function implementation allows call trees deeper than the
hardware stack.
Source code drivers included for LCD modules, keypads, 24xx and 94xx
serial EEPROM's, X10, DS1302 and NJU6355 real time clocks, Dallas touch
memory devices, DS2223 and PCF8570 serial SRAM, LTC1298 and PCF8591
A/D converters, temperature sensors, digital pots, I/O expander and much
more.
38
Constants (including strings and arrays) are saved in program memory.
Standard one bit type (Short Int) permits the compiler to generate very
efficient Bit orientated code.
#BIT and #BYTE will allow C variables to be placed at absolute addresses to
map registers to C variables.
Reference parameters may be used to improve code readability and inline
function efficiency.
These sensors are used to find any obstacles in the track. 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. This
technology can be used for measuring: wind speed and direction (anemometer),
fullness of a tank and speed through air or water. For measuring speed or direction
a device uses multiple detectors and calculates the speed from the relative
distances to particulates in the air or water. To measure the amount of liquid in a
tank, the sensor measures the distance to the surface of the fluid. Further
39
applications include: humidifiers, sonar, medical ultrasonography, burglar alarms
and non-destructive testing. Systems typically use a transducer which generates
sound waves in the ultrasonic range, above 18,000 hertz, by turning electrical
energy into sound, then upon receiving the echo turn the sound waves into
electrical energy which can be measured and displayed.
40
Fig (4.9) Schematic diagram of ultrasonic sensor
Ultrasonic sensors transmit ultrasonic waves from its sensor head and
receives the ultrasonic waves reflected from an object By measuring the
length of time from the transmission to reception of the sonic wave, it
detects the position of the object. Ultrasonic sensor is a sensor that works
on the principle of reflection of sound waves and is used to detect the
presence of a particular object in front of it, it works on the area above the
frequency of sound waves from 40 KHz to 400 KHz.
41
Ultrasonic sensor consists of two units, namely the transmitter unit and
receiver unit. Transmitter and receiver unit structure is simple; a piezoelectric
crystal is connected with mechanical anchors and only connected with the
diaphragm vibrator. Alternating voltage with a frequency of 40 kHz – 400 kHz
are given on the metal plate. The atomic structure of the piezoelectric crystal will
contract (binding), expanded or shrunk to the polarity of applied voltage, and is
called the piezoelectric effect. Contractions that occur forwarded to the diaphragm
resulting in an ultrasonic vibrator emitted into the air (the surroundings), and the
reflection of ultrasonic waves will occur when there is a particular object, and the
reflection of ultrasonic waves to be received back by the receiver sensor units.
Furthermore, the sensor unit will cause the diaphragm vibrator receiver will
vibrate and the piezoelectric effect produces an alternating voltage with the same
frequency. Large amplitude signals generated electric receiver sensor units
depends on the distant object detected nearby and the quality of the sensor
transmitter and receiver sensors. Yuang sensing process performed on this sensor
using the reflection method to calculate the distance between the sensor with the
target object. The distance between the sensors is calculated by multiplying half
the time used by the ultrasonic signal in the way of a series of Tx to Rx is received
by the circuit, with the speed of propagation of ultrasonic signal propagation on
the use of media, namely air. Time in the count when pemencar active and until
there is input from the receiver circuit and when at a certain time limit circuit
receiving no input signal is considered to be no obstacle in front. An ultrasonic
through-beam sensor consists of a transmitter and a receiver that are installed so
they are facing each other. The working principle of ultrasonic through-beam
sensors is based on the transmission of a sound wave from the transmitter to the
receiver being interrupted by the object that is being detected. The transmitter
generates an ultrasonic signal that is evaluated by the receiver. When the
42
ultrasonic beam is damped or interrupted by the object being detected, the
receiver output switches states.
No electrical connections are required between transmitter and receiver and the
functionality of the ultrasonic through-beam sensors is also independent of the
installation location. To prevent dirt particles from accumulating, however, we
recommend placing the transmitter facing up when components are mounted
vertically.Long detection ranges since the ultrasonic beam only travels in one
direction ,Short response times ,Less subject to faults and thus very suitable for
applications in difficult conditions ,Additional installation expense since both
units have to be wired.
43
Fig (4.10) Schematic diagram of LM335 temperature sensor
FEATURES
All the electronic components starting from diode to Intel IC’s only
work with a DC supply ranging from +5V to +12V. We are utilizing for the same,
the cheapest and commonly available energy source of 230V-50Hz and stepping
down, rectifying, filtering and regulating the voltage.
45
In our circuit the transformer of 230V/15-0-15V is used to perform the step down
operation where a 230V AC appears as 15V AC across the secondary winding.
Apart from stepping down voltages, it gives isolation between the power source
and power supply circuitries.
In this circuit due to positive half cycle D1 & D2 will conduct to give 0.8V
pulsating DC. The DC output has a ripple frequency of 100Hz. Since each
alteration produces a resulting output pulse, frequency = 2 x 50 Hz. The output
obtained is not a pure DC and therefore filtration has to be done.
The DC voltage appearing across the output terminals of the bridge rectifier
will be somewhat less than 90% of the applied rms value. Normally one alteration
of the input voltage will reverse the polarities. Opposite ends of the transformer
will therefore always be 180 degree out of phase with each other. For a positive
cycle, two diodes are connected to the positive voltage at the top winding.
4.1.11.1 FILTERING CIRCUIT:
46
Filter circuits which usually capacitor is acting as a surge arrester always
follow the rectifier unit. This capacitor is also called as a decoupling capacitor
or a bypassing capacitor, is used not only to ‘short’ the ripple with frequency of
120Hz to ground but also to leave the frequency of the DC to appear at the output.
A load resistor R1 is connected so that a reference to the ground is maintained.
C1, R1 is for bypassing ripples. C2, R2 is used as a low pass filter, i.e. it passes
only low frequency signals and bypasses high frequency signals.
The load resistor should be 1% to 2.5% of the load.
1000f/25V: for the reduction of ripples from the pulsating
10f/25V : for maintaining the stability of the voltage at the load side.
0.1f : for bypassing the high frequency disturbances
The voltage regulators play an important role in any power supply unit. The
primary purpose of a regulator is to aid the rectifier and filter circuit in providing
a constant DC voltage to the device. Power supplies without regulators have an
inherent problem of changing DC voltage values due to variations in the load or
due to fluctuations in the AC linear voltage. With a regulator connected to the
DC output, the voltage can be maintained within a close tolerant region of the
desired output. IC7812 and 7912 is used in this project for providing +12V and
12V DC supply.
SPECIFICATION:
Resistors R1 and R2 maintain line load regulation.
At the secondary side of the transformer, applied voltage = 15V
Conducting drop across the diodes = 2 * 0.6 = 1.2V
47
Without capacitor:
Vavg = (15-1.2)V = 13.8c pulsating DC
Frequency = 100Hz
With capacitor:
V = Vavg * 1.414 (form factor) = 19.51V
Frequency = 0 Hz
With 7812 voltage regulator:
V0 = +12V
with 7912 voltage regulator: V0 = -12V
48
5V TO 12V INTERFACE
CIRCUIT
4.1.12 L293D:
49
The L293D is assembled in a16 lead plastic package which has 4 center pins
connected together rand used for heat sinking. The L293DD is assembled in a 20
lead surface mount which has 8 center pins connected together and used for heat
sinking.
50
4.1.12.1 433 MHz RF Transmitter STT-433
Overview
The STT-433 is ideal for remote control applications where low cost and
longer range is required. The transmitter operates from a 1.5-12V supply, making
it ideal for battery-powered applications. The transmitter employs a SAW-
stabilized oscillator, ensuring accurate frequency control for best range
performance. Output power and harmonic emissions are easy to control, making
FCC and ETSI compliance easy. The manufacturing-friendly SIP style package
and low-cost make the STT-433 suitable for high volume applications.
Features
433.92 MHz Frequency
Low Cost
1.5-12V operation
11mA current consumption at 3V
Small size
4 dBm output power at 3V
Applications
Remote Keyless Entry (RKE)
Remote Lighting Controls
On-Site Paging
Asset Tracking
Wireless Alarm and Security Systems
Long Range RFID
Automated Resource Management
4.1.13 BRAKE SYSTEM IN TRAIN:
Brakes are used on the cars of railway trains to enable deceleration, control
acceleration (downhill) or to keep them standing when parked. While the basic
principle is familiar from road vehicle usage, operational features are more
complex because of the need to control multiple linked carriages and to be
51
effective on vehicles left without a prime mover. Clasp brakes are one type of
brakes historically used on trains.
Fig (4.13) A traditional clasp brake: the brake shoe (brown) bears on the
surface (tyre) of the wheel (red), and is operated by the levers (grey) on the left
4.1.13.1Dynamic Braking
A train brake system where the traction motors are used to provide a braking force
by reconnecting them in such a way that they become generators. Al Krug,
referring to diesel-electric locomotive braking .Dynamic brakes are
fundamentally no different from locomotive air brakes. Both systems convert the
energy of the rolling train into heat and then throw away that heat. If you apply
the loco air brakes, the brake shoes are pushed against the wheel treads and the
resulting friction produces heat. The energy required to produce this heat power
makes the loco hard to keep moving. The heat power is thrown away into the air
52
by radiating from the hot brake shoes and hot wheel treads into the surrounding
atmosphere.
A loco with air brakes applied is hard to keep moving but it will keep going,
particularly if it has energy to move it in the form of a train pushing it from
behind. The energy (kinetic energy, it's called) comes from the rolling train that
is pushing it. The trouble with using engine brakes alone is that eventually (rather
quickly actually) the shoes and wheels get very hot. Hot enough to destroy
them. This is because heat is produced faster than it can be dissipated by
radiating it into the air. So dynamic brakes are used to move the heat dissipation
away from the brake shoes and wheel treads to the dynamic brake grids
instead. Like an electric bathroom heater, the dynamic brake grids are designed
to handle this amount of heat power (as long as the grid cooling blowers are
operating).
Train air brakes work in the same manner as loco air brakes. They convert the
rolling energy of the train into heat and throw it away. But when using train
brakes, the heat generated is dispersed throughout the entire train. It is spread
over 800 wheels instead of just the few wheels of the loco. Because of this, the
train's wheels do not normally get overheated.
They will get warm or even hot but not normally so hot as to cause
damage. On prolonged downgrades, however, the braking energy required is
sufficient to overwhelm the heat dissipating ability of even all the train's wheels
and overheating occurs. This is the main reason for using dynamic brakes, to
move the heat dissipation away from the wheels to the dynamic brake grids. In
locomotive dynamic brakes, the traction motors are acting as generators. That
means the traction motors are hard to turn. The loco's wheels are what are turning
the traction motors. They are geared to the traction motors. This means the loco's
wheels are hard to turn. They resist turning because they are geared to the traction
53
motors which are hard to turn when generating power, as they are doing when in
dynamic braking. Because the loco's wheels are hard to turn when in dynamic
braking the loco is hard to move or in other words it resists movement just as if
the airbrakes were applied making the wheels hard to turn. The energy required
to push this "hard to move" loco comes from the rolling train. This removes
energy from the rolling train slowing it.
Note that dynamic brakes are used by electric multiple unit trains as well. In these
designs, careful blending with air braking is required to maintain a smooth
braking profile. Electronic control is used to determine that the brake effort
demanded by the brake controller is matched by the brake effort achieved by the
train. Preference is given to the dynamic brake to save wear on brake blocks
(shoes) or pads and air braking is added if necessary to achieve the braking rate
required. Dynamic braking can be used on electric railways to convert the energy
of the train back into usable power by diverting the braking current into the
current rail or overhead line. This is known as regenerative braking. It is used in
the same way as rheostatic braking but the energy can be used by other trains
requiring power. The power developed by a braking train may not be accepted
by the line if no other trains are drawing power so trains equipped with
regenerative braking will usually have resistor grids as well to absorb the excess
energy. The balance between regenerated current and rheostatic current is also
controlled electronically.
Originally, the only way to stop a train was by applying a brake to the wheels of
the locomotive. A wooden block was applied to the wheel tread. A lever
operated by the driver actuated the brake. If more brake power was required, the
driver reversed the engine as well. Soon however, it became apparent the was
54
not enough to bring the train to a stand in a reasonable distance and anyway, the
reversing of the wheels damaged the wheel treads, so various vehicles in the train
had brakes added. The brake was hand operated by a lever or screw arrangement,
so a man was appointed to ride on each of these "brake vans" as they were
called. As trains became heavier and faster, more brake power was required and
more brake vans were added. The principal disadvantages of the manual braking
system were that it required additional staff along the train and there was little co-
ordination during braking. The driver used the engine to whistle for brakes and
to signal for release.
The traditional air brake works well enough in the hands of a skilled driver but it
has a number of shortcomings. Its control system relies on the changes in brake
pipe pressure to control the application and release of the brakes. This means that
a command by the driver to alter the pressure is felt by the front of the train first
and then gradually by the rest of the train until it reaches the end. This can cause
trouble on a long train if it is not handled carefully, particularly during release
when leading vehicles in release mode can pull on rearmost vehicles which still
have brakes applied.
The brake pipe is also used to replenish the air reservoirs on each vehicle, a slow
process on a long train. Time has to be allowed between successive applications
for reservoirs to recharge. Finally, the automatic air brake has no partial release
capability. Once the driver has demanded a release, it will happen and brakes can
only be reapplied when the reservoir pressure has recharged to a value higher than
the brake cylinder pressure. What was recognised many years ago was that
electrical control could overcome these problems. Since the early 1900s, when
55
electrical control of brakes was tried on the New York Subway, various systems
and solutions have been tried.
Most electro-pneumatic brake systems have been designed so that they can be
added to the traditional air brake system to allow more rapid responses to the
driver's braking commands. For example, in the simple version used on the UK
High Speed trains, each end of the train has an electrically operated valve. When
an application is called for at one end, the valve opens the brake pipe at the other
end so that both ends are exhausting air at the same time. A simple version of
this, called an EOT (End of Train device) is used on US freight trains for
emergency application.
An earlier development first tried on multiple unit trains in the UK in the 1920s,
consisted of a system whereby the application and release of the brake was
achieved by electrically controlled valves on each vehicle. It was originally
designed early this century for rapid transit trains in the US to overcome the
natural delay which occurs due to the propagation of the pure air brake and
quickly adopted in Europe. Normally the electrical control is additional to and
superimposed upon the automatic air brake, although more recent systems
incorporate a failsafe electrical control which eliminates the need for a separate
brake pipe. A basic e-p brake system as applied to a multiple unit train comprises
an electrically operated "holding valve" and "application valve" on each car
together with control wires running the length of the train. The main reservoir is
also connected to each car on the train by a main reservoir pipe. Often more than
one main reservoir is provided. Usually, each car also has an "e-p brake
reservoir”. The e-p brake operates independently of the air brake. It uses main
reservoir air instead of brake pipe air and the air brake and triple valves are kept
in the release position. The e-p brake is controlled from the same driver's brake
valve as the air brake but using new positions to apply and release the e-p brake.
56
Electrical connections attached to the driver's brake valve send commands along
the train to the holding and application valves on each car.
To apply the brake the driver selects "Application", which causes all holding and
application valves to energise. The holding valve closes off the brake cylinder
exhaust and the application valve opens to admit main reservoir air into the brake
cylinder. The brakes apply. Selecting "Release" de-energises the valves, closing
the application valve and cutting off the main reservoir pipe connection and
opening the holding valve to allow brake cylinder air to exhaust. The advantage
of the e-p system is that it allows instantaneous reaction on all cars at the same
time and it allows small and graduated applications and releases. This gives
accurate and rapid stopping, which is particularly important in suburban and rapid
transit operations’-P brakes are not normally used on freight trains because of the
diversity of wagons and the cost of conversion. Also, getting an electric signal to
transmit at a low voltage down a very long train is difficult. Radio control has
been suggested, as has fitting each car with a battery. Some experimental e-p
systems are being tried in the US in an attempt to `railway companies to spend
time and money doing the conversions.
The permissible maximum speed of a passenger train through curves is the level
beyond which a railroad considers passengers will suffer unacceptable centrifugal
force; the limit beyond which derailment becomes a risk is considerably higher.
On a line built for exclusive use of high-speed trains, curved track can be canted
or super elevated, to a degree specifically suited to those trains. The cant can be
steeper than on a mixed-traffic route, where it must be a compromise between the
ideal for fast passenger and slow, heavy freight trains, to avoid the latter bearing
too severely on the curve’s inner rail. Consequently, on a dedicated high-speed
passenger line, the extra degree of super elevation can raise quite significantly the
57
curving speed possible without discomforting passengers from the effects of
force. On existing mixed-traffic lines, however, passenger train speed through
curves can be increased by equipping cars with devices that automatically tilt car
bodies up to 9° toward the inward side of the curve, thereby adding to the degree
of cant imparted by the track’s super elevation. There are two types of automatic
body-tilting system. A passive system is more complex. It reacts to track
curvature: that is, the body-tilting mechanism responds retroactively, if only by a
fraction of a second, to its gauging of deficiency in the track’s super elevation
relative to the speed at which the vehicle is travelling. An active system employs
sensors to detect the transition to curved track and controls to measure the
progressive degree of tilt applied by the tilt-operating mechanism in response to
the sensor’s electronic signals as the curve itself is threaded. The sensors are
usually fitted to the front vehicle of a tilt-body train-set, so that the tilt-body
equipment on following vehicles operates in smooth, split-second anticipation of
a track curve’s development. An active system can apply a higher degree of body-
tilt than a passive system, but active systems impose constraints on some aspects
of car design and add to the car’s capital and maintenance costs
SOFTWARE DETAILS
(INSTRUCTION SET)
INTRODUCTION:
58
register designator and ‘d’ represents a destination designator. The file register
designator specifies which file register is to be used by the instruction. The
destination designator specifies where the result of the operation is to be placed.
If‘d’ is zero, the result is placed in the W register. If‘d’ is one, the result is placed
in the file register specified in the instruction. For bit-oriented instructions. ‘b’
represents a bit field designator which selects the number of the bit affected by
the operation, while ‘f’ represents the number of the file in which the bit is
located. For literal and control operations, ‘k’ represents an eight or eleven bit
constant or literal value.
The instruction set is highly orthogonal and is grouped into three basic
categories,
Byte oriented operations
Bit-oriented operations
Literal and control operations
All instructions are executed within one single instruction cycle, unless a
test is true or the program counter is changed as a result of an instruction. In this
case, the execution takes two instruction cycles with the second cycle executed
as a NOP. One instruction cycle consists of four oscillator periods. Thus, for an
oscillator frequency of 4 MHz, the normal instruction execution time is 1 micro
second. If a conditional test is true or the program counter is changed as a result
of an instruction, the instruction execution time is 2 s. All examples use the
following format to represent a Hexadecimal number: 0xhh, where h signifies a
hexadecimal digit.
INSTRUCTION SET
16CXX has 35 instructions. All instructions are single cycle, except for
any program that branches. This take two cycles since the fetch instruction is
flushed from the pipe line by changing the content of PC, while the new
instruction is being fetched and then executed. The instruction set is grouped into
three basic categories.
# Byte Oriented operations
# Bit oriented operations
# Literal and control operations
For byte-oriented instructions, ‘f’ represents a file register designator
and‘d’ represents destination designator. The file register designator specifies
which file register is to be used by the instruction. For bit oriented instructions
‘b’ represents a bit field designator which selects the number of the bit affected
by the operation, while ‘f’ represents the number of the file in which the bit is
located. For literal and control operation ‘k’ represents an eight or eleven bit
constant or literal value.
ADDWF f, d
ANDWF f, d
CLRF f
CLRW
60
COMPF f, d
DECF f, d
DECFSZ f, d
INCF f, d
INCFSZ f, d
IORWF f, d
MOVF f, d
NOP
RLF f, d
RRF f, d
SUBWF f, d
SWAPF f, d
XORWFf, d
BCF f, b
BSF f,b
BTFSC f, b
BTFSS f, b
ADDLW k
ANDLW k
CALL k
CLRWDTR
GOTO k
IORLW k
61
MOVLW k
RETFIE
RETLW k
RETURN
SLEEP
SUBLW k
XORLW k
6. CONCLUSION
62
High noise immunity cmos technology decoders and encoders are used
which increased the accuracy of operation.
Even a small reason that creates accidents can be avoided by the system.
GPS.
63
64