Académique Documents
Professionnel Documents
Culture Documents
Submitted by
Navdeep Ojha
225/99
ELECTRONICS (INSTRUMENTATION AND CONTROL)
JULY 2002
Bachelor of engineering
in
Electronics & Instrumentation Engg.
Harbans Lal
(Project Incharge)
Joint Director,
Zone III, TBRL,
Chandigarh.
Anu Sachdeva
BE 11706431
E.I.E
I.E.T. BHADDAL
ROPAR
CERTIFICATE
This is to certify that Navdeep Ojha, Roll No. BE 225/99, of Thapar Institute of
Engineering and Technology (TIET), Patiala has undergone six months project semester
industrial training from Jan 9, 2002 to July 9, 2002 at Terminal Ballistics Research Lab
(TBRL), Chandigarh. He was assigned the project titled Design and development of
PC based firing control unit.
The work reported meets the standards necessary for partial fulfillment of requirement of
degree of B.E. Electronics (Instrumentation and Control) awarded by Thapar Institute of
Engineering and Technology (deemed university).
Place: Chandigarh
( Harbans Lal )
Date:
Deputy Director,
Zone-III
DECLARATION
This is to certify that the project report titled Design and development of PC based
firing control unit submitted by Navdeep Ojha, Roll No. BE 225/99, student of B.E
Electronics (Instrumentation and Control), Thapar Institute of Engineering and
Technology, Patiala (deemed university) is a record of the students own work. The work
presented has been done by him under my supervision and guidance.
The reported work is of desired standards and has not been submitted in any other university or institution
for the award of any other degree or credentials.
(Harbans Lal)
Project Incharge
Acknowledgement
I would like to express my sincerest thanks to the director of TBRL,
Padam Shri Sh.V.S.Sethi, for permitting me to undergo 6-months industrial
training in this institute.
It is with deep affection and appreciation that I acknowledge my
indebtedness to Mr. Harbans Lal Joint Director (Zone 3), not only for his
enlightening guidance and enthusiastic interest but also for his ever available
help & cooperation.
I also express my gratitude to Ms. Rajesh Kumari (Scientist D) for
her constructive discussions, healthy criticism and persistent encouragement
that has brought this project to its present stage.
I sincerely thank Mr.Dhan Prakash, Pankaj Sajan, Jatinder Pal, Ms.
Shalini and all the others in the lab for their timely help and cooperation.
In the end I would like to thank my family who provided me help
backstage and whose blessings I always treasure.
HITESH PURI
High speed and ultra high speed framing and streak cameras
Flash radiography
Blast instrumentation
Fragment launching gas gun for hyper velocity impact phenomena studies
During my training, I was associated with Blast and Damage Studies zone,
which is engaged in instrumentation studies carried out for assessment of response and
damage pattern of variety of structures. These structures may be above ground,
underground or underwater and hence are subjected to air blast, ground shock and
underwater shock. Various types of instrumentation techniques are employed to record
the terminal effects of explosives. Blast and damage study is related to effects and kill
mechanisms of blasts. It takes into consideration the various parameters related to blast
like peak over pressure, duration, impulse and shock. Damage due to blast is defined as
kill mechanism of the blast. Various kill mechanisms of air blasts are
Broken windows.
Fallen of buildings.
Heaving effect
The zone also deals with various sensors, signal conditioners and computer-based
data acquiring systems for measurement and analysis of intense shock and structure
response. I was associated with both lab and field activities for studying the effects of
free air explosions.
1.2 Study of blast phenomenon:
The detonation of explosive convert the original material into gases products at a very high temperature
(3000oC) and pressure (150Kbar) .The conversion takes place at very high speed releasing a large amount
of energy into the atmosphere in very short duration. The measurement of these events requires very
accurate and sophisticated instruments, having time resolution of the order of microseconds. I was involved
in use of various types of equipments and sensors to record the transient events occurring at the time of
explosion. During the training period I was associated both lab as well as field activities for studying the
effects of
1.2.1 Sensors
Blast gauge:
The fact that some materials produce an electrical charge on their faces when
subjected to a mechanical strain along certain axis and thereby exhibiting the phenomena
known as piezoelectricity has for a long time been used in the construction of pressure
transducers. The choice of this type of transducer for air blast gauges is fairly obvious as
it is probably the most robust, reproducible and linear. These advantages have to be paid
for in terms of low signal output and need to pay considerable attention to electrical
insulation but this is considered worthwhile in order to make accurate measurements of
air blast parameters.
The choice of piezoelectricity type of transducer for free air blast gauges is fairly
obvious as it is
1. Mechanically robust
2. Offer the highest frequency response
3. Non - pyroelectric
4. Chemically stable
5. Insensitive to humidity
6. No hysterisis effects
7. Reproducible
8. Linear response
Pyroelectric effects (the appearance of the charge on the faces of crystal due to a
change in temp of crystal) are observed with materials such as Barium Titanate and
Tourmaline. Other materials such as lithium Sulphate, Rochelle salt, are very brittle and
sensitive to humidity conditions.
Advantages in selecting the quartz crystal as sensing element:
1. Chemically stable.
2. Free from hysterisis.
3. Mechanically stable.
4. Available as a high quality material.
5. Non-pyroelectric.
Disadvantages of quartz crystal:
1. Low piezoelectric constant.
2. It is not sensitive to hydrostatic pressure.
These disadvantages can be obviated by using multiple crystal piles and by ensuring that
pressure is applied only to certain faces of crystal.
A quartz crystal is oriented with respect to three orthogonal axes designated X, Y
& Z. Z-axis is one of the optical symmetry. Light passed through crystal along this axis
suffers no change in polarization. X and Y-axes are polar axis, mutually perpendicular to
each other and perpendicular to Z- axis. When the crystal is strained in the direction of a
polar axis only, charge separation occurs. Equal and opposite charges are induced in the
conductors placed on surfaces cut perpendicular to a polar axis and the charge is the
linear function of the strain.
Components required for the construction of a pile are
2 Dural pistons
marked accordingly. Essentially this involves placing the crystal on a grounded plate and
applying the pressure on a metal electrode placed on the other surface. The polarity of
charge collected by the electrode is determined by connecting the crystal to DSO and
observing the deflection.
The blast gauge consists of pile of 12- octagonal x-cut quartz crystal of
approximate 0.001-inch thickness, 1.0-inch diameter. The crystal faces are of evaporated
aluminium or gold. The pile is formed to increase the gauge sensitivity. All 12 crystals are
assembled with proper polarity axis marker with copper foil electrodes. Both sides of
copper foil are coated with a solution of pure bitumen dissolved in benzene and allowed
to dry. This assembly is kept in a temperature-controlled oven at 140oC for two hours.
The pile is cooled in vacuum for 24 hours after which it is cleaned with benzene to get
extra bitumen out. The following figure shows a gauge pile assembly.
ELECTRODE
+
secondary
explosive
+
+
aerodynamic shape. The gage has sensitivity of 100pc/psi, and natural frequency of 200
kHz. It can be used for pressure measurement in the range of 1-200psi.
Various other gages used are Lollipop gage, under water gage and PZT gage normally
called as shock arrival gage. Figure above shows the four gages generally used in blast
and damage studies.
1.2.2 Signal conditioners
Charge amplifier:
The charge amplifier, which is the heart of blast instrumentation, converts charge into
voltage and is useful for carrying out field blast measurements. It can be used for
measurement of both free air as well as under water explosive pressures. Charge
amplifier consists of following stages:
Trans
ducer
out
Low Pass
filter
14KHz
Charge to
Voltage
Converter
Sensitivity
control
Amplifier
and gain
control
O/P
Low pass
filter
150 KHz
Charge
simulator
corrupted, which provides calibration signal in five steps from 10pC to 10000pC at
frequency of 1 KHz. The calibration signal can be fed internally to each channel one by
one through a channel select control. The output of charge simulator system is also
available externally in voltage form.
Gauge calibration:
It is necessary to determine the gauge sensitivity before the gauge is used in the field.
There are two types of calibration processes: static and dynamic. Static calibration is
done in the laboratory using a static calibration setup as shown.
Manometer
Blast
Gauge
Release
valve
Cellofin
Sheet
+
_
Compressor
Solenoid
Charge
Amplifier
DSO
The gauge is fitted inside a small chamber which is mounted on a bigger chamber. The
two chambers are separated by a cellophane diaphragm which is pre-heated in an oven to
avoid sagging when pierced. The big chamber is filled with air to a pressure of 10 psi.
The diaphragm is punctured by a solenoid with a pointed pin. The gauge senses the
sudden release of air pressure. The signal from the gauge is fed to a charge amplifier, the
output of which is fed to an oscilloscope.
The sensitivity of the gauge is calibrated from the relation:
G= (total charge in pc x gauge deflection)/ (Cal. Deflection x chamber pressure)
The deflection due to gauge and calibration signal is measured from the records. The
chamber pressure is taken from a mercury manometer, just prior to puncturing the
diaphragm. Total charge in pico-coulomb is obtained from the chart prepared from
measurements of the components of the preamplifier and calibration voltage.
Dynamic calibration
The blast gauges are subjected to dynamic calibration trials to determine errors in
measurements and spurious response of the gauges due to defective assembly. Standard
spherical explosive charge are utilized with blast gauges symmetrically positioned as
shown in figure below:
G2
G3
G1 Charge
G4
One Meters
G3
Three Meters
G2
Two Meters
G4
Four Meters
In practice a minimum of four gauges are mounted around the explosive charge
either at the same distance or at different distances in a line, all depending upon the
experimental requirements.
1.3 Blast Wave
One of the most significant measurements in experimental study of an explosive
is the blast wave, generated in surrounding medium when charge is detonated. Blast wave
originates at the charge and is propagated outwards and away from the charge at a
velocity which depends on nature of the charge i.e. geometry, size, type of explosive.
Initially, the pressure rises abruptly at the leading edge of the wave (shock front),
and then decreases continuously. This decrease may reduce the pressure to below the
ambient pressure; phases of continuous increase may also be observed .The primary
shock moves with a velocity greater than the velocity of sound in the medium ahead of it.
Eventually the pressure at any point must revert to the measurement, dependent on
pressure being recorded.
Involving above mentioned instrumentation systems we have evaluated following
blast parameters. Figure below shows one of the blast results:
Peak-over
Pressure
Impulse
Negative
impulse
Duration
This is the pressure jump of blast wave phase measured by excess pressure above the
atmospheric pressure. It is also defined as the maximum pressure above the atmospheric
pressure level of the positive phase of the blast wave.
DURATION
It is a measure of time period elapsed between the arrivals of shock wave at the
point up till the peak over pressure becomes zero i.e. equal to atmospheric pressure.
IMPULSE
This is the important parameter to determine extend of damage. In pressure time
curve, it may be defined as area under the curve i.e. specific impulse (impulse/unit area).
It depends on peak over pressure, duration and decay constant. The blast parameters
calculated from blast profile contribute to define the damage on different targets.
If the response time of the structure is high compared to blast duration then,
impulse is taken as damage criteria. If the response time is small compared to duration of
load then peak over pressure is the criterion for the damage. In case both are compared
the peak over pressure and impulse are considered for accessing the damage in structures.
Some typical damage effect of blast, based on pressure criteria is obtained by using above
set of instrumentation: 1. 14 Kg/cm2
2. 2.5 Kg/cm2
Lungs injury.
3. 1.6 Kg/cm2
4. 1 Kg/cm2
Eardrum burst.
5. 0.02 Kg/cm2
Damage to windowpanes.
Depending on the proximity of the target from the point of explosion the ground motion
results in the damage of buildings and other structures. In evaluating the structure-ground
motion interaction, the work is divided under as
1. Measurement and prediction of ground motion.
2. Measurement and prediction of damaged structures as a result of ground shocks.
In close vicinity of underground explosion the particle acceleration is of the order of 10
g to 105 g. As this shock travels in the surrounding soil it decays very fast into ground
motion. The dominant frequency in ground motion lies between 1-30Hz.
The instrumentation system used for capturing ground motion in this region is as
under.
1. Geophone
2. Accelerometer
3. Blast mate
4. Etna accelerograph
1. GEOPHONE:
The geophone is velocity transducer consists of a permanent bar magnet, which
moves up, & down within a long coil of two windings. When frequency of vibration is
higher than natural frequency of suspended system, the seismic mass remains in fixed
position and the case with the coil vibrate about it. The sensitivity is constant above the
resonance frequency.
The typical transducers used for measurement of ground particle velocity are triaxial
geophone of sensitivity 29V/m/s are:
Vertical uniaxial geophone of sensitivity 20V/m/s and natural frequency of 10Hz.
Uniaxial horizontal geophone of sensitivity of 19V/m/s, with a natural frequency of
10Hz
2. ACCELOROMETER:
Accelerometer is an instrument used to measure shock and vibration. It can be
initialized by mass element connected to the case by spring and a damping medium. The
transducing elements produces an electrical output proportional to the displacement of
the mass element relative to the case and also proportional to the acceleration applied to
the case.
Accelerometer use a sensing method in which acceleration acts on a seismic mass
(proof mass) that is restrained by and whose motion is usually damped in a spring mass
system.
Damper
Mass
Spring
When acceleration is applied to accelerometer case the mass moves relative to the
case. When acceleration stops, the spring returns the mass to its original position. If
acceleration is applied in opposite direction to the transducer case, the spring would be
compressed rather than extended.
Under steady state conditions displacement of seismic mass is given by equation
We have
F= k X
3. BLASTMATE:
Blast Mate is used to record full field analysis of an event i.e., peak particle velocity, peak
acceleration, peak displacement, peak vector sum, zero crossing frequency and peak air
(sound) pressure.
Using the Blast Mate we can do event monitoring. Event monitoring measures both
ground vibrations and air pressure. Blast mate measures transverse, vertical and
longitudinal ground vibrations. Transverse ground vibrations agitate particles in a side to
side to motion. Vertical ground vibrations agitate particles in an up and down motion.
Longitudinal ground vibrations agitate particles in a forward and backward motion
progression outward from the event site. Events also affect air pressure by creating what
is commonly referred to as air blast. By measuring air pressures, we can determine the
effect of air blast energy on structures measured on the linear L scale or as perceived
by the human ear, measured on the A weight scale.
Theory of operation:
TRANSDUCER:
A transducer used is a geo phone, which measures ground particle vibrations. Geo-phones
can be categorized as uniaxial transducers and triaxial transducers. Uniaxial transducers
measure particle velocity in one direction. Triaxial transducers measure particle velocity
in three directions i.e. x ,y ,z .
GEO-PHONE OPERATION:
Functionally a geo-phone sensor is a coil of wire suspended around a magnet. The
magnet is free to move in a field of magnetic flux lines. By Lenzs law induced voltage is
proportional to the speed at which flux lines are traversed. Induced coil voltage is
therefore proportional to the relative velocity of the coil to the magnet. In practice, it does
not matter whether the coil or the magnet moves only the motion and speed relative to
each other are important.
COIL
INDUCED
VOLTAGE
LINEAR L:
Linear measurement is generally used to measure the effect of low frequency air pressure
on buildings. The linear scale records sound pressure without modification in the 2 to 300
Hz range. Measurement units may be in absolute, Pascal or relative dB scales.
A WEIGHT:
A weight measures noise levels people may consider an annoyance. The signal is then
converted to root mean square (RMS).
Units are measured using the decibel scale dB (A).
SOUND PRESSURE:
The Blast Mate III calculates two sound pressure parameters i.e., peak sound pressure and
zero crossing frequency, recorded by the microphone.
The zero crossing frequency calculates the event waveforms frequency at the
largest peak for sound pressure.
FEATURES:
1)
2)
3)
4)
Full PC compatibility
5)
6)
On-line Help
7)
Upgradeable
8)
Rugged design
SPECIFICATIONS:
Seismic:
Range
254 mm/s
Resolution
0.127mm/s to 0.0159mm/s
2 Pa to 500 Pa
0.1 dB above 120 dB
A Weight (optional)
Range
Sampling rate
Event storage
Full wave
Form events
Frequency response
2 to 300 Hz
4. ETNA ACCELEROGRAPH:
Etna is used for the measurement of the ground particle acceleration at the time of under
ground explosion. The block diagram of the Etna is as shown.
Oscillator
Capacitive
Demodulator
Amplifier
Transducer
Calibration
Coil
Functional
Analog
Test Pulse
Output
Calibration
Control
This displacement results in a signal on the center plate of the capacitor, which become
unbalanced, resulting in an AC signal of the same frequency as the oscillator being
passed to the amplifier. The amplifier amplifies this AC signal. This error signal is then
passed to the demodulator where it is synchronously demodulated and filtered, creating a
DC signal in feed back amplifier. The feed back loop compensates for this error signal by
passing current through coil to create a magnetic restoring force to balance the capacitor
plates back to their original null position.
The current traveling through the coil is thus directly proportional to the applied
acceleration. By passing this current through a complex impedance consisting of a
resistor and capacitor, it can be converted to voltage output proportional to acceleration
with a bandwidth of approximately 200 Hz. Selecting a particular resistor values are
determined by a high accuracy network, so the range can be set at 0.25g, 0.5g, 1g, 2g and
4g without re-calibrating the sensor span. The capacitor and overall loop is selected along
with resistor to ensure an identical transfer function on each range. The voltage output of
the resistor capacitor network is set at 2.5volts for the acceleration value corresponding to
the particular range. This voltage is then applied to the amplifier. The low power
amplifier amplifies this signal by either 1 or 4 to give a single ended output of either 2.5
or 10volts. A second amplifier is also present which inverts the signal form the first and
can be connected to the negative output lead. The system is used to study the ground
acceleration; it has built in triaxial forced balanced accelerometer, which has a range of
4g, with a nature of frequency of 100 Hz. The system has built ion 2Mb flash memory
with an addition of PCMCIA memory card to extend its memory capacity up to 8Mb. The
system has internal battery of 12V and 6.5 Ampere-hour and the sample rate of the
system is 100-250 cycles per second with 18- bit resolution. The system has three channel
frequency response is DC-80Hz Features:
(1) Each coil is equipped with a calibration coil. Applying a current to this simulates the
effect of acceleration applied to the sensor.
(2) The calibration coils are open circuit in normal, to prevent cross talk and noise pick
up. To utilize this, the enable signal must be activated by a DC voltage 5 volts to 12
volts with respect to ground.
SPECIFICATIONS:
: + 4g
Frequency response
: DC to 80 Hz @sps
Resolution
sampling rate
Input range
: + 2.5volts.
The tables below show the damage pattern by ground acceleration and particle velocity.
Table 1: Damage pattern by ground acceleration
No damage:
<0.1g
Minor damage:
0.1-1g
Major damage:
>1g
2.8 inch/sec
4.3 inch/sec
Cracking:
6.3 inch/sec
Serious cracking:
9.1 inch/sec
Clearly perceptible:
Annoying:
3. Breakdown voltage:
2.7KV
4. Nominal capacitance:
69pF/m
5. Nominal attenuation:
6. Inner diameter:
0.193mm, 14 strands
5.59mm
6.48mm
8.0mm
INDUCTOR
INDUCTOR
parallel
series
R
The low value components are measured in series combination and the higher valued
components in parallel.
Frequency selection: There are four frequencies to choose from as the bridge source.
1. 100Hz
2. 1KHz
3. 10KHz
4. 100KHz
There are certain optimum recommended values by the manufacturers for the various
combinations. Polarizing voltage can also be given to electrolytic capacitors for providing
a bias.
Strain meter is used to show corresponding voltage or current for the strain
produced. Method of measuring strain uses a bridge composed of one strain gauge and
other resistances of same resistance value i.e. 120. This has an advantage of higher
output so it is widely applied to strain gauge based system.
In the quarter bridge with two wires, the affection to the lead wires due to change in
ambient temperature is roughly estimated as a strain of 5210-6/oC, when 10m long 2
parallel cables are used with 120 strain gage. This can be avoided by connecting bridge
as a quarter bridge in 3-wire system using three parallel cables. The third line is used for
connection to dummy arm of the bridge formed in bridge box to compensate the affection
of ambient temperature to lead wires.
B
STRAIN GAGE
Output
Voltage
Input
Voltage
Digital sensitivity setting method: First select rated output of instrument from the
range of 1 to 10V. Secondly set the strain value corresponding to the output with digital
switch provided.
Resolution:
0.1dB
Polarising voltage:
Storage rate:
1 value/sec
The microphone used is free field prepolarized condenser microphone. It has a linear
frequency response till 10 KHz and has a sensitivity of 50mV/Pa.
The unit gives a direct display of the dB level of the ambient pressure. Additional values
reported include maximum pressure level, overrange and underrange.
1.8 Data recording elements
The information about the quantity under measurement has to be conveyed to the
personnel handling the instrument or the system for monitoring, control, or analysis
purposes. This function is done by data presentation element called recorders. In blast
instrumentation this job is assigned to high-speed oscilloscopes as below:
Magnetic Recorders.
Digital
Output
10 Bit
A/D
12 Bit
A/D
Amplifiers
Output Control
Input
1
Attenuation
&
Offset
10 Bit
A/D
Attenuation
&
Offset
10 Bit
A/D
Attenuation
&
Offset
10 Bit
A/D
Attenuation
&
Offset
10 Bit
A/D
1024
Word
Memory
1024
Word
Memory
1024
Word
Memory
Record Control
Internal
Trigger
Circuit
External Trigger
Timing
&
Mode
Logic
1024
Word
Memory
The scope operating controls are designed such that all confusing details are placed on
the backside and one appears to be using a conventional scope. Some digital scope
provides the facility of switching selectable to analog operation as one of the operating
modes.
The basic advantage of digital operation is storage capability, the stored waveform can be
repetitively read out, thus making transient appear repetitively and allowing their
convenient display on the scope screen.
The voltage and time scales of display are easily changed after the waveform has been
recorded, which allows expansion (typically to 64 times) of selectable portions, to
observe greater details.
A cross hair cursor can be positioned at any desired point on the waveform and the
voltage/time values displayed digitally on the screen.
Pre-triggering capability is also a significant advantage of DSO. Pre-triggering recording
allows the input signal preceding the trigger points to be recorded
An adjustable trigger delay allows operator control of the stop point, so that the trigger
may occur near the beginning, middle or end of the stored information.
GENERAL FEATURES:
100MHz bandwidth
Memory:
1K/channel
Sampling rate:
400MS/s
High resolution, high contrast LCD display with temperature compensation and
replaceable backlight.
1. Fast Fourier transforms: The FFT computes and displays the frequency contents of a
waveform, which is acquired on a math waveform. FFT is used in the following
applications:
Bandwidth:
500MHz
Memory:
50K/channel
1GS/s
fields. Data recorders with ultra wide band frequency characteristics, portability,
compatibility etc are available. These have 4 channel * 160 KHz * 16 bit ultra-wide band
high-speed data recording capability. They apply new AIT technology, which enables
them to record 4 channel * 160 KHz measured data on the one cartridge in digital format
for 2 hours continuously.
AIT (Advanced intelligent tape) is new standard for high speed, large capacity
streamers (computer data backup). Today high-density magnetic recording technology
has achieved 25GB of storage capacity and 24 Mbps data transfer rate. The newly
developed AME (Advanced metal evaporated) tape assures remarkable output with
reliability and durability. The table of contents (TOC) information and file position
information is written into the in built memory.
The difference in the operation of magnetic recorders and digital storage
oscilloscopes is that a DSO is a trigger-based device. It would not store the signal if it is
not triggered. But the magnetic recorder is always ready and stores all the signals that are
input without any need for triggering.
Major Features:
Easy operation.
High quality recording and playback with low power consumption i.e.
1.6A at AC 100V and 7A at DC 12V.
1. It has different displaying modes such as Combo mode, View mode, Meter mode
etc.
2. It also provides Auto Diode Test Mode.
3. It has one important key namely "Save and Print". GMM can use an optical serial
interface cable to communicate with a PC or printer.
4. Frequency display can be obtained in many ways such as Hz, duty cycle, pulse
width or period.
5. It provides a component test mode: It is used to measure the characteristics of
passive components in or out of circuit with no power applied. On connection
with the component it results in a pattern, which provides information about that
component.
Input Impedance:
10Mohm
Accuracy:
Amplitude resolution:
8 bits
6hrs
Measurement range:
3V 1000V
Introduction
2.1.1
Explosive:
A firing unit is a system used to detonate an explosive. An explosive consists of a
primary explosive and a secondary explosive. The primary explosive is a highly sensitive
substance that requires very little energy to explode and release shock which is used to
detonate secondary explosive. The secondary explosive is the one which actually releases
energy to be delivered to the surroundings for damage.
+
-
Det wire
Primary
explosive
Secondary
explosive
2.1.2
(20 mJ) to the detonator for its explosion. This is a very controlled process and requires
stringent safety measures. The firing is done when a safe signal is given by the trial
officer of the trial signifying that the area has been cleared.
The present firing control unit is a mechanically controlled device and has a lock
and key arrangement. After checking the detonator wire and the unit for any malfunction,
the trial officer locks the firing unit and gives the key to the safety officer. When the area
is cleared the safety officer passes back the key to the trial officer and the trial can then
be conducted.
The design and development of a computer controlled firing control unit to
obviate such a primitive-looking system is my assignment.
During my project semester I have been working on
1. Design, development and testing of prototype of PC controlled firing control unit.
2. Software development to make system computer controlled.
2.2
DC
Power
supply
Charge
storage
(Capacitor)
Discharging
circuit
Continuity
check
circuit
Firing
circuit
Detonator
1.
Computer controlled:
The unit is interfaced to the computer with the parallel port. The application
executes the tasks asked for by the user and no other manual switching by the user
is required.
2.
No unauthorized access:
The unit is controlled by a computer and to enter the firing unit application a
password is required. This removes any glitches of the lock and key arrangement.
The unit hardware has no controls on the outside and is thus immune from
tampering.
3.
User-friendly:
The computer application is menu-based and can be easily operated by anyone
and on any computer. The present firing unit has been simulated on the computer
with a nice look and feel.
4.
Safety:
The firing unit has been designed for utmost safety. The system comprises of
many safety features starting from the password-enabled access. Then the
software initiates a hardware check where the computer port, cables and the
components are checked for any malfunction. When the system is running, the
software checks the hardware before and after any action is taken. If the firing is
aborted, the system itself goes into safe mode and then aborts.
System requirements:
1.
2.
Capacitor 10 microF, 350V: It stores the charge for firing the detonator. The
capacitor should be able to store charge for some time (10 min) after switching off
its supply and not leak through the air.
3.
Solenoid relay 6V, 100 ohm: These are the heart of the firing unit. Each firing
routine is managed by control of the relays that are being used. I am using SPDT
solenoid relays which switch at 6V. An SPDT relay (single pole double throw) has
one pole and two connections NO (normally open) and NC (normally closed).
When no input is given to a relay it is connected to NC and when it is energized
the connection shifts to NO. Thus a switching action can be performed with the
control of a relay.
The computer operates the in a specific sequence and the firing procedure can be
completed successfully.
NC
NO
Six relays have been used in my circuit for the following applications:
Charging of capacitor
Discharging of capacitor
Checking continuity of detonating circuit
Firing pulse
5.
Solid state relay: These are also incorporated in the hardware in modules where
fool-proof operation is required. These relays have lower ranges but higher
accuracy.
4.
Optoisolator: It is a device used for isolation of the computer port from the
external power supplies. It has been explained later in detail.
5.
BJT: These have been used in the circuit for current amplification. A series of
transistors are used for higher beta amplification.
6.
Comparator: It is used in various modules for checking signal levels and errors
in the hardware.
A prototype of the circuit was first designed and tested. The relays were controlled using
separate power supplies.
Considerations while selecting a relay:
The relays used in the circuit are solenoid relays which are also known as non-polarized
DC relays. Their working principle is to open and close a series of contacts attached to a
movable magnetic core in an electrical coil by exciting/de-exciting the coil.
The essential characteristics of these relays are
Safety ensured by the electrical isolation between contacts of relay and driving
circuit.
Stability of the relay when subjected to impulse interference and other variations
in the supply voltage.
These relays are generally used in rugged environments and have poor accuracy in terms
of switching voltages and switching frequency. The important points to check out while
using a relay are
1. Control voltage (generally 6V-24V)
2. Power consumed by coil (this value is necessary to calculate the circuitry which
will control the relay).
3. Maximum current which can pass through the power contacts of the relay.
4. Maximum voltage that can be switched by the power contacts.
5. Switching capacity of power contacts (in AC or DC).
6. Switching time of relay.
2.4
user can select what action he wants to perform from the software menu. The interaction
with the hardware is done through the bidirectional parallel port. The following diagram
helps to understand the system better.
K1
K1
3
1
2
9V DC
1
2
12V
DC
R ELAY SPD T
K1
3
1
2
300V
DC
5
4
K1
K1
R 1
R
R ELAY SPD T
3
1
2
C 1
C
R ELAY SPD T
1
2
R 2
5
4
R ELAY SPD T
0
5
R 3
4
R
Continuity
check
module
R E L A Y S O L ID S TA TE
D E TO N A TO R
the charging resistance should be adjusted so that charging time is low, preferably
less than 10s.
2.
Discharging of capacitor:
An arrangement for discharging of the capacitor to the ground has also been
made. This is required in times of emergency when the firing is to be aborted.
3.
4.
Firing of detonator:
When this command is given the whole energy stored in the capacitor is made
available across the det in a very small time.
Parallel Port: A parallel port sends and receives 'n' data bits at a same time over
(n+1) lines along with common ground line. This allows data to be transferred very
quickly; however the cable required is more bulky. Parallel ports are generally used to
connect PC to printer and are rarely used elsewhere.
Serial port: A serial port sends and receives data one bit at a time over one wire.
While it takes eight times as long to transfer each byte of data this way, only few wires
are required. In fact, two-way (full duplex) communications is possible with only three
separate wires - one to send, one to receive, and a common signal ground wire.
2.5.1 PC parallel port:
The PC parallel port adapter is specifically designed to attach printers with a
parallel port interface, but it can be used as a general input/output port for any device or
application that matches its input/output capabilities. It has 12 TTL-buffer output points,
which are latched and can be written and read under program control using the processor
In or Out instruction. The adapter also has five steady state input points that may be read
using the processors instruction.
Compatibility mode is the original Centronics parallel interface and intended for
use with dot matrix printers and older laser printers. The compatibility mode can
be combined with the nibble mode for bi-directional data transfer.
Nibble mode allows data transfer back to the computer. The nibble mode uses the
status lines to send 2 nibble (4-bit units) of data to the computer in two data
transfer cycles. This mode is best used with printers.
Byte mode uses software drivers to disable the drivers that control the data lines
in order for data to be sent from the printer to the computer. The data is sent at the
same speed as when data is sent from the computer to the printer. One byte of data
is transferred instead of the two data cycles required by the nibble mode.
EPP mode (Enhanced Parallel Port mode) was designed by Intel, Xircom, and
Zenith Data Systems to provide a high-performance parallel interface that could
also be used with the standard interface. EPP mode was adopted as part of the
IEEE 1284 standard. The EPP mode uses data cycles that transfer data between
the computer and the peripheral and address cycles that assign address, channel,
or command information. This allows data transfer speeds of 500 kilobytes to 2
megabytes per second, depending on the speed of the slowest interface. The EPP
mode is bi-directional. It is suited for network adapters, data acquisition, portable
hard drives, and other devices that need speed.
No
SPP Signal
Direction
Type 25)
1
2
3
4
5
6
7
8
9
10
11
(Centronics)
1
2
3
4
5
6
7
8
9
10
11
12
12
Paper-Out / Paper-End In
Status
13
14
15
13
14
32
Select
nAuto-Linefeed
nError / nFault
Status
Control
Status
nStrobe
Data 0
Data 1
Data 2
Data 3
Data 4
Data 5
Data 6
Data 7
nAck
Busy
In/out
In/Out
Out
Out
Out
Out
Out
Out
Out
Out
In
In
Register
In
In/Out
In
Control
Data
Data
Data
Data
Data
Data
Data
Data
Status
Status
Hardware
Inverted
Yes
Yes
Yes
16
31
17
36
18 - 25
19-30
nInitialize
nSelect-Printer
nSelect-In
Ground
In/Out
Control
In/Out
Control
Yes
Gnd
Table 2.1: Pin Assignments of the D-Type 25 pin Parallel Port Connector.
Hardware inverted means that line is active low or in other words the signal is inverted by
the parallel card's hardware. The above table uses "n" in front of the signal name to
denote that the signal is active low e.g. nError. If the printer has encountered an error then
this line is low. This line normally is high, should the printer be functioning correctly. The
"Hardware Inverted" means the signal is inverted by the Parallel card's hardware. Such an
example is the Busy line. If +5v (Logic 1) was applied to this pin and the status register
read, it would return back a 0 in Bit 7 of the Status Register.
The output of the Parallel Port is normally TTL logic levels. The voltage levels are the
easy part. The current you can sink and source varies from port to port. Most Parallel
Ports can sink and source around 12mA. However these are just some of the figures taken
from Data sheets, Sink/Source 6mA, Source 12mA/Sink 20mA, Sink 16mA/Source 4mA,
Sink/Source 12mA. The best bet is to use a buffer, so the least current is drawn from the
Parallel Port.
2.5.3 Port addresses:
The Parallel Port has three commonly used base addresses. These are listed in
table 2, below. The 3BCh base address was originally introduced used for Parallel Ports
on early Video Cards. This address then disappeared for a while, when Parallel Ports
were later removed from Video Cards. They has now reappeared as an option for Parallel
Ports integrated onto motherboards, upon which their configuration can be changed using
BIOS.
When the computer is first turned on, BIOS (Basic Input/Output System) will determine
the number of ports the computer has and assigns device labels LPT1, LPT2 & LPT3 to
them. The BIOS first looks at address 3BCh. If a Parallel Port is found here, it is assigned
as LPT1, and then it searches at location 378h. If a Parallel card is found there, it is
assigned the next free device label. This would be LPT1 if a card wasn't found at 3BCh or
LPT2 if a card was found at 3BCh. The last port of call is 278h and follows the same
procedure than the other two ports. Therefore it is possible to have a LPT2 which is at
378h and not at the expected address 278h.
In the MS-DOS operative system three parallel ports, called LPT1, LPT2 and LPT3, are
supported. So we can find three addresses dedicated to these ports in the memory map of
the PC.
ADDRESS
3BCh-3BFh
NOTES
Used for parallel ports which were incorporated into video
Offset
Base + 0
Name
Read/Write Bit No.
Data Port Write (Note- Bit 7
Bit 6
1)
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Properties
Data 7
Data 6
Data 5
Data 4
Data 3
Data 2
Data 1
Data 0
This register is normally a write only port. If you read from the port, you should get the
last byte sent. However if your port is bi-directional, you can receive data on this address.
Offset Name
Base + 1 Status
Port
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Properties
Busy
Ack
Paper Out
Select In
Error
IRQ (Not)
Reserved
Reserved
4
5
6
7
8
9
0
1
2
0
3
1
4
2
5
3
C O N N EC TO R D B25
330
330
330
330
330
330
330
330
void main()
{
int in;
while(1)
{
in = inportb(STATUS);
if (((in^0x80)&0x80)==0)
/* if BUSY bit is at 0 (switch is closed) */
{
outportb(DATA,0x00); /* turn LED on */
delay(100);
outportb(DATA, 0x01); /* turn it off */
delay(100);
}
else
{
outportb(DATA,0x01);
/* if PB not depressed, turn LED off */
}
}
}
This program helped me understand how to output data and use the hardware inverted
bits. After having successfully operated an LED circuit from the port, I operated the relay.
The relay being used can switch at 5V, which is the TTL output level of the port. Thus the
voltage level is not a problem. I found out that a single relay sinks about 95 mA current
and the parallel port can safely sink only about 20 mA. So there was the need to amplify
the current from the port to avoid its loading. I tried the following amplifier circuit to
control the relay.
VC C
K1
3
1
2
parallel port
data pin
4 .7 K
R ELAY SPD T
1
3
BC 547A
parallel port
ground pin
port pin
6
5
ground pin
4
4N 25
Power supply
Pin o/p
Power supply
Opto-isolator
Amplifier 1
Amplifier 2
Output
U 1
P3
1
14
2
15
3
16
4
17
5
18
6
19
7
20
8
21
9
22
10
23
11
24
12
25
13
C O N N EC TO R D B25
R 16
6
5
R
4N 25
R 12
1
U 2
U 3
U 5
4N 25
R 8
2
2
3
Q 3
12 N 3 9 0 4
R ELAY SPD T
R ELAY SPD T
2N 2905A
K5
R 5
Q 10
R 10
2
2
3
Q 5
12 N 3 9 0 4
5
4
1
2
5
4
K4
3
1
2
R 4
2
3
Q 4
12 N 3 9 0 4
K3
R ELAY SPD T
2N 2905A
Q 9
R 9
2N 2905A
Q 8
R ELAY SPD T
1
2
R 3
2
3
Q 2
12 N 3 9 0 4
R E S IS T O R
4N 25
R 15
R 7
4N 25
U 4
3
2N 2905A
Q 7
K2
2
3
Q 1
12 N 3 9 0 4
5
4
1
2
R 2
4N 25
R 14
R 6
R 13
Q 6
K1
1
2
1
3
2N 2905A
5
4
R ELAY SPD T
Fig 2.12: Interfacing circuit. Shown above are the parallel port connector, optoisolator,
amplifier and corresponding relays.
A HIGH from the port at pin 3 for instance, allows current to flow into the optoisolator
from pin 5 to 4 and into the first transistor. It switches on and a low voltage develops at
its collector. This low voltage switches on the second transistor (NPN) which allows
current to sink into the relay at voltage level of Vcc. This operation takes negligible time
and the total time delay that occurs is just because of the switching time of the relay,
which is about 100ms. This delay is acceptable in the operation of this circuit.
Thus a HIGH at a port pin, which is controlled entirely by the software, can switch ON or
OFF a solenoid relay using the interfacing circuitry as shown. The following pins have
been used for data output.
Pin (port address 0x378)
3,4
5
8
3,6,7
Table 2.6: Pins used for control of hardware.
Action
Charging
Discharging
Firing
Continuity check
2.5V
3.5V
The problem here is that the relay switches on at a HIGH from the port but does not
switch off when a LOW is given. This was because of the fact that about 3V remained
across the relay arm of the circuit even after the transistors had switched off. To obviate
this problem I added a 56ohm resistance in series with the relay which has a resistance of
100ohm. This 56ohm resistance shared some voltage of the arm and left less than 2.5V
for the relay. The relay could then be switched off with a 0 at the corresponding pin.
2.5.6 Data input:
Some data is required to be input into the computer to check the voltage level at various
points and also to monitor the state of the hardware. The first problem was to decide what
was to be input and how. The circuit requirements are such that the following need to be
checked before firing:
1. Charge across capacitor
2. Continuity of firing leads and detonator
3. Status of relays
4. Any malfunction in the circuit
I have used the SPP configuration in which data is input at status port.
Pin (port address 0x379)
Action
10 (nACK) : D6
Discharging
11 (BUSY) : D7
Det 5V
12 (PAPER OUT) : D5
Charging
13 (SELECT) : D4
Det 8V
Table 2.7: Pins used for data input.
1. Capacitor voltage measurement: This is required to see whether the capacitor is
charged to the requisite voltage level of 275V for firing to be conducted. Instead of using
an analog-to-digital converter to measure the capacitor voltage which requires a lot of
additional hardware and makes the circuit very complex, I am using a comparator to
compare the voltage across the capacitor with a reference voltage. When the capacitor
voltage exceeds the reference level, the output of the comparator goes from low to high
and this can be input into the status port.
The comparator I am using is LM339, a low power low offset quad comparator. These
operate from a single power supply over a wide range of voltages. The following module
shows the circuit required for monitoring the capacitor voltage.
V C C _ C IR C L E
V C C _ C IR C L E
6
R
+
-
LM 339_A
1
R
R
7
6
LM 339_B
1
12
12
300V
2. Continuity of firing leads and detonator: This module is the most important check in
the whole procedure and requires fool-proof operation. The vital point to be kept in mind
is that the current through the detonator must be as small as possible. Additionally, this
module must not be run for a long time as enough heat can be produced by even small
currents flowing through the detonator to cause it to explode. The following circuit
diagram shows the continuity check module.
9V
5.5V
3
7
6
C1
U6
1
NOT
12
Busy(11)
DETONATOR
5V
3
7
6
C2
Select(13)
12
8V
Fig 2.15: Continuity check module. One of the outputs of the comparators has to be
inverted to match the level of hardware inverted busy bit.
The 9V battery also powers this module. The two resistances used in series with the
detonator are in Megaohms and limit the current flowing in the circuit to 4 microamperes.
Here again two comparators are used. The basic aim to check continuity is that the loop
comprising of the firing leads and the detonator is closed. This is done to avoid any
misfire. There are two options available to us:
We can measure current in the circuit and display the loop resistance for the user.
If the loop resistance is infinity, the circuit is open.
We can measure the voltage in a modified circuit and ascertain the continuity.
Because measuring voltages is a less complex job than measuring loop resistance, I have
used the latter method.
The 9V source voltage is reduced to 5.5V and is compared with two reference levels
one at 5V and the other at 8V. If there is no discontinuity in the loop, then C1 will give
output 1 and C2 will give output 0. Assuming that the detonator is open and the circuit
is not complete, the input voltage for the comparators will become 9V and both will give
output 1. These combinations are incorporated into the software logic and the status of
the comparators is read. The various combinations are summarized below.
C1 output
1
1
0
C2 output
0
1
0
Status
Continuity OK
R2 / det open / R1 short
R1 open / R2 short
before changing the password. This means that only someone who knows the earlier
password can change it.
2. Menu-based: The software is very easy to operate as it is menu driven. The user just
has to select the module to run by pressing a key and the software does the rest. The
user does not have to input anything from the keyboard but just has to select from the
menu present on the screen.
3. Graphical interface: The code written in C++ uses graphics to display the messages
and animations. This makes the application very attractive program to use.
4. Safety: This is the primary concern in the firing control unit. The system has many
safety layers and can detect an error in itself, if present. While conducting the firing,
many events are continually monitored by the software and emergency actions are
taken if required. The following are some such events.
a. At start of the application, system initializes itself to safe mode and then runs.
b. If capacitor is charged and user presses the EXIT button to exit the program,
then the capacitor is discharged automatically and then the application closes.
c. When firing is aborted, the software monitors the voltage across the capacitor
for 20s. If the capacitor has not discharged fully, an error message is
displayed. The user can then continue or exit.
d. If command for capacitor charging is given but the user immediately wants to
exit, this is possible by just pressing any key. The message Press any key to
discharge capacitor is flashed on the screen while charging. The system goes
into safe mode after this.
e. While checking continuity of the loop, previous status of relays is read and
stored. The system is set to that same status after checking the continuity.
f. If the user goes into the firing menu without charging the capacitor, or if the
capacitor has been discharged slowly to a value less than 275V, a message is
flashed on the screen. The user can continue or exit from that point.
g. While final countdown is being done before firing, pressing any key at that
point will put the firing on a standby. The countdown can then be started
again. This is extremely important as many times firing has to be stopped
moments before the firing pulse is given.
h. While exiting, the system again goes into safe mode and exits.
The software provides a host of features and proved reliable in testing. However if an
error is encountered by the software, for instance a graphics error, the error would be
displayed on the screen before aborting the software. This helps the user to ascertain the
problem.
The full software code is written below. Comments are written at places where
instructions are required.
/* File MAING.CPP
**
** Software for firing control unit. This is the graphical
version of the software. The
** non graphical version is not written here
** Navdeep Ojha
*/
#include<iostream.h>
#include<fstream.h>
#include<conio.h>
#include<dos.h>
#include<math.h>
#include<string.h>
#include<graphics.h>
#include<process.h>
#include<stdio.h>
#include<bios.h>
int errorcode;
void screenwel();
int screen_ct(char *[],int,int);
char screen(char *[],int,int);
void screen_init(char *[],int,int);
char screenarr(char *[],int,int);
void enter();
void stop();
void password()
{
//password using C++//
ifstream in;
in.open("passwd.txt",ios::in);
char *s,ch,passwd[100];
int i=0;
while(!in.eof())
{
in.get(ch);
s[i]=ch-127;
cout<<s[i++];
}
char chinp;
int j=0;
int gd=DETECT,gm,errorcode;
initgraph(&gd,&gm,"\\");
gotoxy(25,10);
cout<<"Enter password";
gotoxy(25,11);
while((chinp=getch())!='\r')
{
passwd[j++]=chinp;
cout<<"*";
}
passwd[j]='\0';
gotoxy(25,13);
int cmp=strcmp(s,passwd);
if (cmp==13)
{
for(int k=0;k<30;k++)
{
gotoxy(25,13);
cout<<"Password matched!";
delay(100);
gotoxy(25,12);
for(int l=0;l<500;l++)
{
int a=255;
char b=(char)a;
cout<<b;
}
}
}
else
{
cout<<"Password incorrect! Exitting........";
//cout<<cmp;
delay(1400);
exit(0);
}
/*password using C
FILE *fp;
fp=fopen("passwd.txt","r");
char *s,ch,passwd[20];
int i=0;
fseek(fp, 0, SEEK_SET);
while((ch=fgetc(fp))!=EOF)
{
s[i]=ch-127;
cout<<s[i++];
}
fclose(fp);
char chinp;
int j=0;
cout<<"Enter password"<<endl;
while((chinp=getch())!='\r')
{
passwd[j++]=chinp;
cout<<"*";
}
passwd[j]='\0';
cout<<passwd<<endl;
int cmp=strcmp(s,passwd);
if (cmp==0)
{cout<<"Passwd matched!";
delay(3000);}
else
cout<<"ki gall hai oye??";
cout<<cmp;
}*/
}
void red(int rad)
{
setcolor(RED);
setfillstyle(1,RED);
pieslice(getmaxx()/2,getmaxy()/2,0,360,rad);
}
void black()
{
setcolor(BLACK);
setfillstyle(1,BLACK);
pieslice(getmaxx()/2,getmaxy()/2,0,360,25);
}
void initialize()
{
char *ch[]={"System resetting", "Please wait..."};
screen_init(ch,2,2);
outp(0x378,04);
int inp = inp(0x378);
if(inp!=04)
{
cout<<"Initialization error\n";
getch();
exit(1);
}
}
int key;
keypress()
{
key = bioskey(1);
return(key);
}
void authfail()
{
char *ch[]={"You are not authorized.","Exitting........"};
screen_init(ch,2,1);
exit(0);
}
void screenwel()
{
int gd=9,gm=1,errorcode;
initgraph(&gd,&gm,"\\");
setfillstyle(3,BLUE);
floodfill(0,0,RED);
rectangle(0,0,getmaxx(),getmaxy());
settextstyle(6,0,4);
int y=140;
outtextxy(100,y,"PC based Firing Control Unit");
delay(4000);
cleardevice();
closegraph();
}
void screen_n()
{
int gd=9,gm=1,errorcode;
initgraph(&gd,&gm,"\\");
setfillstyle(3,BLUE);
floodfill(0,0,RED);
rectangle(0,0,getmaxx(),getmaxy());
settextstyle(5,0,4);
int y=140;
outtextxy(120,y,"Made by NAVDEEP OJHA");
delay(7000);
cleardevice();
closegraph();
}
char screen(char *text[],int len,int size)
{
int gd=9,gm=1,errorcode;
initgraph(&gd,&gm,"\\");
setfillstyle(3,BLUE);
floodfill(0,0,RED);
rectangle(0,0,getmaxx(),getmaxy());
settextstyle(1,0,size);
int y=140;
for(int i=0;i<len;i++)
{
outtextxy(150,y,text[i]);
y+=20;
}
char ch2=getch();
cleardevice();
closegraph();
return ch2;
}
void screen_dis(char *text[],int len,int size)
{
int gd=9,gm=1,errorcode;
initgraph(&gd,&gm,"\\");
setfillstyle(3,BLUE);
floodfill(0,0,RED);
rectangle(0,0,getmaxx(),getmaxy());
settextstyle(1,0,size);
int y=140;
for(int i=0;i<len;i++)
{
outtextxy(150,y,text[i]);
y+=20;
}
delay(3000);
cleardevice();
closegraph();
}
int screen_ct(char *text[],int len,int size)
{
int gd=9,gm=1,errorcode;
initgraph(&gd,&gm,"\\");
setfillstyle(3,BLUE);
floodfill(0,0,RED);
rectangle(0,0,getmaxx(),getmaxy());
settextstyle(1,0,size);
int y=140;
for(int i=0;i<len;i++)
{
outtextxy(150,y,text[i]);
y+=20;
}
int ct;
//cin>>ct;
ct=getch();
cleardevice();
closegraph();
return ct;
}
void screen_init(char *text[],int len,int size)
{
int gd=9,gm=1,errorcode;
initgraph(&gd,&gm,"\\");
setfillstyle(3,BLUE);
floodfill(0,0,RED);
rectangle(0,0,getmaxx(),getmaxy());
settextstyle(1,0,size);
int y=140;
for(int i=0;i<len;i++)
{
outtextxy(150,y,text[i]);
y+=20;
}
delay(5000);
cleardevice();
closegraph();
}
int screen_passwd(char *text[],int len,int size)
{
int gd=DETECT,gm,errorcode;
initgraph(&gd,&gm,"\\");
setfillstyle(3,BLUE);
floodfill(0,0,RED);
rectangle(0,0,getmaxx(),getmaxy());
settextstyle(1,0,size);
int y=140;
for(int i=0;i<len;i++)
{
outtextxy(150,y,text[i]);
y+=20;
}
char first[50]="bds",second[50];
gets(second);
cleardevice();
closegraph();
return( strcmp(first,second));
}
void stop()
{
char input,input1;
char *ch[]={"Do u want to start counter again?"," Press y or
n."};
input=screen(ch,2,2);
if(input=='y'|input=='Y')
{enter();}
else
{
char *ch[]={"Are u sure u want to exit?","Press y or n."};
input1=screen(ch,2,1);
if(input1=='y'|input1=='Y')
{outp(0x378,00);
exit(0);}
else
stop();
}
}
void discharging_routine()
{
outp(0x378,4);
char *ch[]={"Discharging capacitor.......\n"};
screen_dis(ch,1,1);
for(int l=0;l<15;l++)
{
int in_dis=inp(0x379)&64;//this is bit number
10 i.e. nACK
//It
is
active
low.If capacitor is below
//0.28V then 0 is read into
the pin
if (in_dis==0)
{
char *ch[]={"Firing aborted. Status :
Safe","Press any key to continue"};
screen_dis(ch,2,1);
enter();
}
else
{
char *ch[]={"Wait..."};
screen_dis(ch,1,1);
}
if(l==10)
{
char *ch[]={"Problem with connecting
cable or","Capacitor not discharged","Continue ? Press \"y\" or \"n\"
"};
char cap_dis=screen(ch,3,1);
switch(cap_dis)
{
case 'y':
enter();
case 'n':
exit(0);
default:
exit(0);
}
}//if ends//
}
}
void enter()
{
clrscr();
char choice;
char *ch[]={"Press","1 for checking detonator continuity","2 for
arming the charge","3 to abort firing","4 for firing","5 to exit"};
choice=screen(ch,6,1);
switch(choice)
{
case '2':
{
clrscr();
char *ch[]={"Press","\"s\" to start charging","\"b\" to go
back\n"};
char charge_ch=screen(ch,3,1);
switch(charge_ch)
{
case 's':
{
clrscr();
outp(0x378,3);
char *ch[]={"Charging begins.....","Press any key to
stop and discharge"};
screen_dis(ch,2,1);
int input;
//input routine starts//
for(int i=0;i<100;i++)
{
keypress();
if(key!=0)
{
discharging_routine();
}
input=inp(0x0379);
if((input&32)==0)
{
cout<<i<<"\tcapacitor charged\n";
cout<<"Press any key to continue";
getch();
break;
}
else
{
cout<<i<<"\tcapacitor not charged\n";
}
delay(800);
if(i==99)
{
cout<<"Capacitor not charged!! Press any key
to continue";
outp(0x378,04);
getch();
}
//input routine ends//
}
enter();
}
case 'b':
{
clrscr();
enter();
break;
}
default:
{
}
}
break;
//enter();
}
case '1':
{
clrscr();
int det_cont=inp(0x378);
outp(0x0378,32);
char *ch[]={"Checking continuity of detonator......\n"};
screen_dis(ch,1,1);
for(int m=0;m<19;m++)
{
int check_5=inp(0x379)&128;//this is busy bit bit no.
11.
//it is hardware inverted and I am
//inputtin 0 from NAND gate and
the comp
//reads it as 1. Finally, 1 means
that det
//continuity is established//
int
output of the second
check_8=inp(0x379)&16;//This
//comparator
and
is
the
should
direct
be
under normal
//circumstances.It is input into pin
13, Select.
//
outp(0x0378,16);
if((inp(0x379)&8)==0) //This is direct output of last
comparator
//into pin no. 15, nError. A high at
this pin
//shows that det is open. This pin is
active low
//and is thus read accordingly.
{
if((check_5==128)&&(check_8==0))
{
char *ch[]={"Continuity established !!","Press
any key to continue"};
screen(ch,2,1);
outp(0x378,det_cont+16);
enter();
}
if((check_5!=128)&&(check_8!=16))
{
char
*ch[]={"R1
is
open
short !!","Press any key to continue"};
screen(ch,2,1);
outp(0x378,det_cont+16);
or
R2
is
enter();
}
if((check_5==128)&&(check_8==16))
{
char *ch[]={"Either det or R2 is open or R1 is
short","Press any key to continue"};
screen(ch,2,1);
outp(0x378,det_cont+16);
enter();
}
}
/*
else
{
char *ch[]={"Det is open !!","Press any key to
continue"};
screen(ch,2,1);
outp(0x378,det_cont+16);
enter();
}
*/ }
outp(0x378,det_cont+16);
enter();
break;
}
case '3':
{ clrscr();
char *ch[]={"Are you sure you
firing?","Press \"y\" or \"n\"\n "};
char discharge_ch=screen(ch,2,1);
switch(discharge_ch)
{
case 'y':
{
discharging_routine();
}
want
to
abort
case 'n':
{
char *ch[]={"Capacitor not discharged\n","Press any
key to continue."};
screen(ch,2,1);
enter();
break;
}
}
enter();
break;
}
case '4':
{
clrscr();
if((inp(0x0379)&32)!=0)
{
char conti;
char *ch[]={"Arming of charge not done !!","Continue ??
Press 'y' or 'n'"};
conti=screen(ch,2,1);
switch(conti)
{
case 'n':
enter();
case 'N':
enter();
default:
enter();
case 'y'|'Y':
break;
}
}
char *ch[]={"Go ahead ,enter the countdown value \n"};
int n=screen_ct(ch,1,1);
switch(n)
{
default:
{
char *ch[]={"You must enter a number between 3 and
9.","Press any key to continue"};
screen(ch,2,1);
enter();
}
case '10':
{
clrscr();
keypress();
if(key!=0)
{enter();}
int gd=DETECT,gm,errorcode;
initgraph(&gd,&gm,"\\");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
/* return with error code */
}
setfillstyle(3,BLUE);
floodfill(0,0,RED);
rectangle(0,0,getmaxx(),getmaxy());
settextstyle(1,0,4);
outtextxy(250,200,"10");
settextstyle(1,0,3);
outtextxy(170,230,"Press \"enter\" to stop\n");
cout<<"\a";
delay(3000);
cleardevice();
closegraph();
}
case '9':
{
clrscr();
keypress();
if(key!=0)
{enter();}
int gd=DETECT,gm,errorcode;
initgraph(&gd,&gm,"\\");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
setfillstyle(3,BLUE);
floodfill(0,0,RED);
rectangle(0,0,getmaxx(),getmaxy());
settextstyle(1,0,4);
outtextxy(250,200,"9");
settextstyle(1,0,3) ;
outtextxy(170,230,"Press \"enter\" to stop\n");
cout<<"\a";
delay(3000);
cleardevice();
closegraph();
}
case '8':
{
clrscr();
keypress();
if(key!=0)
{enter();}
int gd=DETECT,gm,errorcode;
initgraph(&gd,&gm,"\\");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
/* return with error code */
}
setfillstyle(3,BLUE);
floodfill(0,0,RED);
rectangle(0,0,getmaxx(),getmaxy());
settextstyle(1,0,4);
outtextxy(250,200,"8");
settextstyle(1,0,3) ;
outtextxy(170,230,"Press \"enter\" to stop\n");
cout<<"\a";
delay(3000);
cleardevice();
closegraph();
}
case '7':
{
clrscr();
keypress();
if(key!=0)
{enter();}
int gd=DETECT,gm,errorcode;
initgraph(&gd,&gm,"\\");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
/* return with error code */
}
setfillstyle(3,BLUE);
floodfill(0,0,RED);
rectangle(0,0,getmaxx(),getmaxy());
settextstyle(1,0,4);
outtextxy(250,200,"7");
settextstyle(1,0,3) ;
outtextxy(170,230,"Press \"enter\" to stop\n");
cout<<"\a";
delay(3000);
cleardevice();
closegraph();
}
case '6':
{
clrscr();
keypress();
if(key!=0)
{enter();}
int gd=DETECT,gm,errorcode;
initgraph(&gd,&gm,"\\");
rectangle(0,0,getmaxx(),getmaxy());
settextstyle(1,0,4);
outtextxy(270,180,"5");
settextstyle(1,0,3)
;
outtextxy(170,230,"Press \"enter\" to stop\n");
cout<<"\a";
delay(3000);
cleardevice();
closegraph();
}
case '4':
{
clrscr();
keypress();
if(key!=0)
{enter();}
int gd=DETECT,gm,errorcode;
initgraph(&gd,&gm,"\\");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
/* return with error code */
}
setfillstyle(3,BLUE);
floodfill(0,0,RED);
rectangle(0,0,getmaxx(),getmaxy());
settextstyle(1,0,4);
outtextxy(250,200,"4");
settextstyle(1,0,3)
;
outtextxy(170,230,"Press \"enter\" to stop\n");
cout<<"\a";
delay(3000);
cleardevice();
closegraph();
}
case '3':
{
clrscr();
keypress();
if(key!=0)
{enter();}
int gd=DETECT,gm,errorcode;
initgraph(&gd,&gm,"\\");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics
error:
grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
/* return with error code */
}
setfillstyle(3,BLUE);
floodfill(0,0,RED);
rectangle(0,0,getmaxx(),getmaxy());
settextstyle(1,0,4);
outtextxy(250,200,"3");
settextstyle(1,0,3)
;
outtextxy(170,230,"Press \"enter\" to stop\n");
cout<<"\a";
delay(3000);
cleardevice();
closegraph();
}
{
clrscr();
keypress();
if(key!=0)
{enter();}
int gd=DETECT,gm,errorcode;
initgraph(&gd,&gm,"\\");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
%s\n",
printf("Graphics
error:
%s\n",
grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
/* return with error code */
}
setfillstyle(3,BLUE);
floodfill(0,0,RED);
rectangle(0,0,getmaxx(),getmaxy());
settextstyle(1,0,4);
outtextxy(250,200,"2");
settextstyle(1,0,3)
;
outtextxy(170,230,"Press \"enter\" to stop\n");
cout<<"\a";
delay(3000);
cleardevice();
closegraph();
}
{
clrscr();
keypress();
if(key!=0)
{enter();}
int gd=DETECT,gm,errorcode;
initgraph(&gd,&gm,"\\");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics
error:
grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
/* return with error code */
}
setfillstyle(3,BLUE);
floodfill(0,0,RED);
rectangle(0,0,getmaxx(),getmaxy());
settextstyle(1,0,4);
outtextxy(250,200,"1");
settextstyle(1,0,3)
;
%s\n",
{
clrscr();
keypress();
if(key!=0)
{enter();}
int gd=DETECT,gm,errorcode;
initgraph(&gd,&gm,"\\");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics
error:
grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
/* return with error code */
}
setfillstyle(3,BLUE);
floodfill(0,0,RED);
rectangle(0,0,getmaxx(),getmaxy());
settextstyle(1,0,5);
outp(0x378,8);
outtextxy(250,200,"FIRE");
sound(3000);
delay(3000);
nosound();
delay(1000);
outp(0x378,00);
cleardevice();
closegraph();
}
}
enter();
%s\n",
}
//case ends//
case '5':
{
outp(0x378,04);
delay(500);
exit(0);}
}
}
default:
{
enter();
}
//switch ends//
//enter fx ends//
void main()
{
clrscr();
screenwel(); //This is a welcome screen //
screen_n();
password();
initialize();
enter();
getch();
}
Following code is for the program that changes the password. The user is asked for the
previous password before the password is changed.
/* File PASSWORD.CPP
**
** Program for changing the password of the main software.
**
** Navdeep Ojha
*/
#include<iostream.h>
#include<conio.h>
#include<dos.h>
#include<bios.h>
#include<process.h>
#include<string.h>
#include<stdio.h>
check()
{
clrscr();
FILE *fp;
fp=fopen("passwd.txt","r");
char *s,ch,passwd[20];
int i=0;
fseek(fp, 0, SEEK_SET);
while((ch=fgetc(fp))!=EOF)
{
s[i]=ch-127;
cout<<s[i++];
}
fclose(fp);
char chinp;
int j=0;
cout<<"Enter password"<<endl;
while((chinp=getch())!='\r')
{
passwd[j++]=chinp;
cout<<"*";
}
passwd[j]='\0';
cout<<passwd<<endl;
int cmp=strcmp(s,passwd);
if (cmp==0)
{
cout<<"Passwd matched!";
}
else
{
cout<<"Passwd not matched!";
exit(0);
}
getch();
}
change()
{
clrscr();
FILE *fp;
fp=fopen("passwd.txt","w");
char passwd[100],ch;
int i=0;
cout<<"Enter password to set\n";
while((ch=getch())!='\r')
{
passwd[i++]=ch;
fputc(ch+127,fp);
cout<<"*";
}
passwd[i]='\0';
cout<<passwd;
getch();
}
void main()
{
check();
change();
}
This is a master program and must be stored away on disks. This program can change the
password without asking for the earlier password. It must be used only in cases when the
password is forgotten.
/* File PASS_MAS.CPP
**
** Program for changing the password of the main software.
**
** Navdeep Ojha
*/
#include<iostream.h>
#include<conio.h>
#include<dos.h>
#include<bios.h>
#include<process.h>
#include<string.h>
#include<stdio.h>
main()
{
clrscr();
FILE *fp;
fp=fopen("passwd.txt","w");
char passwd[100],ch;
int i=0;
cout<<"Enter password to set\n";
while((ch=getch())!='\r')
{
passwd[i++]=ch;
fputc(ch+127,fp);
cout<<"*";
}
passwd[i]='\0';
cout<<passwd;
getch();
}
//vacant//
//vacant//
Field trial:
During the training period I was also involved in the fieldwork.
Trial in which I was engaged is:-
The charge was placed under the muddy surface. Four blocks
of 18 Kg each were placed above the gauge holder of 3 Kg. This
means that the total weight on shoe was 75 Kg. Sensor was placed
inside the pipe filled with sand and was hold by the gauge holder.
Gauge holder was fitted into the shoe. The shoe was placed above
the mine and below the mine detonator along with TTL probe was
placed. TTL probe is an aluminium foil, which is pasted upon two
wires. Normally connection is open but on arrival of detonating
pulse it gets shorted, indicating a high pulse. This helps in
calculating the delay between the supplying of high voltage from
firing unit and energizing of detonator.
MS Block 18 Kg each
Gauge housing
Pressure
sensor
TTLProbe
Soil
EXPLOSIVE
Electric detonator
Future improvements:
The system is fully functional but there is lot of scope for improvement. The
system is presently DOS-based and does not run directly under windows. If the software
is written in Visual Basic or Visual C, the graphical interface would be enhanced and the
operation would become much easier. This would also take care of errors that DOS
applications encounter while running in Windows.
Also, this system presently makes use of a 9V, 4A battery as power supply. In the
long run, a rectifier has to be incorporated into the system for the system to be operable
on 230V mains.
Although the system is fully computer controlled, a system reset switch must be
present on the hardware device to be used at times when software fails to respond at a
critical juncture. This would help the user to counter the idiosyncrasies of computers.
Scope and applications of the project:
My project titled Design and development of PC based firing control unit is
based on the fact that a computer be used to control some hardware. Here, this hardware
is a firing unit circuit. The interfacing circuit that has been designed can also be used for
controlling some other hardware.
The basic action of switching of a relay with a command from the computer lends
a lot of versatility into the applications that this project can handle. A small DC motor can
be operated from this circuit which in turn can control some other process. Having used
the bidirectional parallel port means that an interrupt can be generated in the running
software when an event occurs. For example, when the temperature of a room falls below
a certain level, a logical bit can be generated and input into the computer. The computer
can then initiate heating using a relay switch.
The system designed for controlling the firing unit uses heavy duty components
like solenoids which consume a lot of current. Thus it can easily be used for smaller
devices which take up less than 100 mA current.
Conclusion:
The PC based firing control unit is a comprehensive design
and has the capability to conduct firing trials successfully with no
problems whatsoever. The versatile design also permits its use for
various other applications where the requirements may be
different. The flexibility in the system makes it possible to make
future modifications in hardware and software.
This system has been built at a low cost and provides very
efficient workability because of resourceful usage of various
resources. With no inherent sources of noise present in the system,
it can provide trouble-free usage for a long time. I have worked on
my project titled Design and development of PC based firing
control unit for the last six months and have designed a PCB and
model. I look forward to a chance for implementing this design
later.
REFERENCES
(i)
(ii)
Information about the parallel port including visuals from: Website of University
of New York.
(iii)
(iv)
(v)
GLOSSARY
Blast: Blast is the principle mode of transferring explosive energy to the target,
producing damage by giving a crusting blow, displacing and tumbling the target.
Terminal Ballistics: Terminal Ballistics is defined as study of effect of blast or explosion
on a particular target.
Explosion: Explosion is defined as a chemical reaction in a substance, which converts
original material into a large volume of gaseous products developing sudden high
pressure with liberation of large amount of heat in a short time at supersonic speed". The
temperature in the product gases is of the order of 3000 oC and the pressure 100-350
Kbars.
Deflagration: It is defined as the release of a large amount of energy in a long time and
at subsonic speed. E.g. burning of coal.
Detonation: The explosion is initiated through the process of detonation. A reaction can
be initiated if sufficient energy is provided at one point in the explosive. This is done by
means of a heated wire, which acts directly upon a small amount of especially sensitive
material thus generating a small low energy impulse (shock). It is subsequently
accelerated and intensified by slightly less sensitive but more powerful material called a
booster. The sufficiently energetic shock wave in turn initiates the main explosive. This
whole process is called 'detonation'.
Lethality: Lethality is the antipersonnel efficiency of a high explosive, that is, the ability
of an explosive to cause damage to others. It is measured in terms of MAE, that is, mean
area effect. In this the area of damage is calculated and the number of targets is known,
by which lethality is calculated.
Tertiary Injury: Injury related to whole body translation and deacceleration impact is
called tertiary injury. The acceleration and deacceleration of the objects placed near to
explosive causes injury to living being, as these objects get accelerate due to high
pressure produced during explosion.
APPENDIX
1. LM339:
The LM139 series consists of four independent precision voltage comparators with an
offset voltage specification as low as 2 mV max for all four comparators. These were
designed specifically to operate from a single power supply over a wide range of
voltages. Operation from split power supplies is also possible and the low power supply
current drain is independent of the magnitude of the power supply voltage. These
comparators also have a unique characteristic in that the input common-mode voltage
range includes ground, even though operated from a single power supply voltage. The
LM139 series was designed to directly interface with TTL and CMOS.
Specifications:
Very low supply current drain (0.8 mA) independent of supply voltage
Offset voltage: 3 mV
Output voltage compatible with TTL, DTL, ECL, MOS and CMOS logic systems
Advantages:
2. 4N25 (optoisolator)
The general purpose optocouplers consist of a gallium arsenide infrared emitting diode
driving a silicon phototransistor in a 6-pin dual in-line package.
3. 2N2904(PNP)
The 2N2904, 2N2905, 2N2906 and 2N2907 are silicon planar epitaxial PNP transistors in
Jedec TO-39 (for 2N2904, 2N2905) and in Jedec TO-18 (for 2N2906 and 2N2907) metal
cases. They are designed for high-speed saturated switching and general purpose
applications.
4. 2N3053 (NPN)
Features:
VCEO = 40V
IC = 0.7A
Ptot = 5W