Wednesday, March 17, 2010

Noiseless measurement of Optical Signal and Laser Pulse generation

After one week of thinking my project is finally decided its "Noiseless measurement of Optical Signal and Laser Pulse generation". Deciding the project was tough job, not only I had to consider that the project should be complited in three weeks it should also not very complicated as well as not very simple. I had many thoughts in mind like making "MP3 player", "USB pen drive", "Touch screen " or "Laser guided robot" but I did'nt like any of them very much since they are mostly electronics gadgets, available in market ( and if you respect chines they can be really very cheap) also I am Physicist not an electronics engineer. Electrnics is just happend to be my hobby but Physics is my passion. So I wanted to decide some project which will reflect my Physics background and finally came up with this Idea.


Motivation-
Often during optical measurment background light is a big problem (still remember the complite blackout of optics lab ). I decided to come up with the idea to remove this background light noise. The idea is as follows-
  1. Light from the light source ( usually laser , monochromator ) is allowed to pass through sample and chopper on to the detector. The job of the chopper is to periodically allow and block the light from the light source. In this way the detector will receive two kinds of signals one with (laser + background ) and other with only background light. Now I just need to subtract these two signals to remove the noise.
  2. Second part of the project is generate laser pulse of desired pulse width of order of millisecond. The idea is to control the speed of chopper motor using PWM method. A feedback mechanism is used to continuously monitor the speed of the chopper motor and then use this data and the set value of pulse width to control the speed of motor.
Part List-
  1. Any 80C51 core micro-controller (I am using P89V51RD2).
  2. LDR ( Light dependent resistor ) as detector.
  3. Chopper and opto-coupler (soon going to post the picture of my opto-coupler ).
  4. LCD.
  5. Keyboard.
I will keep posting the development in the project. I have got three weeks to complete this project lest see how I do .


Update 16 April :
Finally got some time to write.
I started with interfacing LDC to microcontroller. I have written a nice code library for interfacing it. Then I switched to interfacing ADC. I used 8080ADC. Instead of  using external clock using say 555 I used the clock generated by the uC itself. The ADC worked perfectly fine. I landed up in making a simple voltmeter by interfacing the LCD and ADC together. Till now everything was fine but later I observed that ADC is too slow for my use (data sheets says 100us for each conversion ) so I had to ditch the entire Idea of using ADC and I switch to atmega16 which has internal ADC with 15ksps. It was frustrating as my design was completly ready and now I have to start from scrach. Any was I switched to atmega16 all the software development is completed and its working fine atleast in simulation. I will implement it in hardware later.

Sunday, March 7, 2010

What really happened on Mars?

I remember when I was a kid probably in 6th or 7th grade our principle ma'am gave as a example in our daily morning assembly program. Since I was very tall among other class mates I was standing at the end of the line and was really strugling hard to listen her. She was talking about some billion dollar project which was failed just because of some error of 1 and 0. She further told as that Nasa has sent a spacecraft to mars and the robot is male functioning just because of some mistake in 1 and 0. Well at that time I was thinking how come a signle sweep in the digit of 1 and 0 can cause the whole project to crash. Although I didn't understood anything at that time but I was very much fascinated by the whole Idea of sending a bot to Mars. I read each and every article I found in paper regarding the Mars Project but most of them didn't satisfied my needs.
After very long time when I was in 12th standard and my physics teacher taught me digital electronics I understood something what my principle ma'am was taking about. Now I understood what she was talking about I knew that it has something to do with the Boolean condition. Now I am in fourth year of my graduation in IIT Bombay and It took me almost 12 years to understand what really happened in Mars.

So here we go-

The Mars Pathfinder mission was widely proclaimed as “flawless” in the early
days after its July 4th, 1997 landing on the Martian surface. The spacecraft has to gather the meteriological data and send them back to earth. The spacecraft has one processor and has to do many process at time. The engineers decided to in manner called "preemptive priority scheduling of tasks". By tasks I mean process like gathering data or communication with earth.
The operating system is designed such that It after every fixed amount of time (time slice ) the OS will look for all process and assign priority to every process in every cycle and execute process with highest priority.

Pathfinder has mainly three tasks low priority "meteorological data gathering" which run infrequently , medium priority "communication task" and high priority "information bus management task" which run very frequently. The information bus can be assumed as the common memory used by every tasks to exchange information and hence bus management task should run very frequently. Access to the bus was synchronized with mutual exclusion locks called mutexe which will insure that bus is locked to a particular task and other tasks can't access the bus.

How it works-

The meteorologica task will run , it will collect data and while communicating with earth It will access the information bus through mutexes which will lock the bus. Now if an interrrept occur and Information bus is needed to be accessed the Bus management task will wait till the bus is unlocked by mutexe. Once bus is released the Bus management task will use it.

The bug-

Suppose the Bus is locked by the meteorological data task and bus management task is waiting for the bus to be released. At this point of time if interrupt occur that causes the "communication task" to be scheduled with high priority. The OS will keep the "meteorological task" at hold (waiting ) and will start running slow "communication task". Now the communication task is running and "meteorological task" is waiting which has unfortunately locked the Information bus and the highest priority "Information bus management task " is still waiting to access bus. After some point of time if Information bus management task didn't get to access bus "watch dog timer" thinks that something is terribly wrong with system bus and call for Total System Reset.

So where is 1 and 0's-

Now the mutex object accepts a boolean parameter that indicates whether priority inheritance should be performed by the mutex. The basic idea of the priority inheritance protocol is that when a job blocks one or more high priority jobs, it ignores its original priority assignment and executes its critical section at the highest priority level of all the jobs it blocks. After executing its critical section, the job returns to its original priority level. Before launching the pathfinder mutex was initialized with this parameter OFF. So here comes the 1 and o mistake if had it been initialized with this parameter ON the mutex could have released the information bus locked my meteorological task for bus management task which in turn could have prevented watchdog timer from invoking total system reset.

So was it debugged ?

During the development stage of Pathfinder the OS has a C language interpreter intended to allow developers to type C expressions and functions to be executed on the fly during the system debugging. Fortunately Pathfinder was launched with this feature still enabled. A C program was uploaded to the spacecraft, which when interpreted, changed the values of the initialization variable of mutex form FALSE to TRUE. There was no system reset after that.

Saturday, March 6, 2010

Mountain First Aid

Note-For educational purpose only, professional advice should be taken before going to life threatening situation
First Aid person should be experienced

Seven steps to follow after accident -

Step-1:Take the charge of the situation.
  1. If more then one person is injured the order of priority,
    1. More injured but good change of survival should be given first priority.
    2. More inured but can wait.
    3. Who can do safety treatments.
    4. Less chance of survival.
  2. Climb leader should survey the seen immediately.

Step-2:Approach the patient safely-
look for rockfall, avalanche, fast water flow and physical limits.

Emergency rescue and fist aid-
Shift the person if he is in danger or the rescuer is in danger otherwise first inspect the injury. Watch for -
  • Alertness
  • Response of your call.
  • Responsive of pinching (semiconscious )
  • Unconscious.
If semiconscious or Unconscious check for ABCD-
A- Airways ( see nose and mouth ). If there is clothing of blood in nose or swelling in mouse. First clear the airways.
B-Breathing - put hand in front of nose or put small peace of cotton in front of nose.
C- Circulation - normal is 60-90 pulse rate. Pulse rate increases during unconsciousness and can go up to 180 . Observe the pulses from neck since hands will be covered with gloves etc.
D- Deadly bleeding -
External bleeding or internal bleeding.
If internal bleeding check for important sites
  1. Abdomen -
    tightness and swelling at abdomen.
  2. Thai -
    -swelling , blueish color and stiffness at thai.
    -Pulse rate will be very high but less powerful pulse or low pulse pressure.
    - Due to internal bleeding patent can go to comma . Immediately shit patient to hospital.
Step-4:Protect patient-
CPR http://depts.washington.edu/learncpr/quickcpr.html and Cardio.

Step-5
Provide dry clothes, pain killers, shelter and psychological support.

Step -6:Check for other minor injuries-
From head to legs- ears , eyes , teeths , redness at eye or readness at the bottom of eyes, check head, spinal injury (important - if injured stifness ), discolour of skin any defromity (visible fractures ) , swealing ( don't take chance it can be fracture )

Important thing to note-
fracture , spinal and head injury.

Fracture-
-don't move patent too much.
-tie with stick, thick clothes, newspapers since it give painless moment to patient.

Step-7:Carry out plan-
First aid leader will plan for further treatment and climb leader will plan for rest of party.If needed shift the person to base camp with a note detailing his injury . Strong person should shift the patent. Climb leader will decide whether to go further , wait for rescue or come back.

Mountain Manners

Set of rules and regulations that a tracker should follow.

1) Greetings-
Respect other trackers and local peoples, wish them in there local languages say hi, hello.

2) Walking Manners-
-single line don't overtake.
-rythmatical walk- All team should reach at time
-Week person must be in middle of line

3) Judging distance-
1 hour or 2 hour walk according to our capacity.

4) Passing Information-
through arrows or cairns ( heap of stones ) for people coming behind you so that they will not miss the track.

5) Noise Behavior-
-snow bridge can collapse.
-wild animal can attack because of fear.
-Avalanche.
-Rock fall may happen.

6) Hut manners-
When using forest guest houses or huts maintain cleanliness and don't leave any sigh after you leave.

7) Conservation of flora and fauna
-Respect wild animals.
- vegetation ( don't plug flowers etc because they can be dangerous.)

8) Camping manners-
-Camps and tent's must be near drinking water.
-Tents shouldn't be very near to river. ( because in some area river level changes in 5 min also (flash flood )).
-Should not be very near to rock fall area.
-Should not be very near to avalanche prone area.

9) Rescue and search-
Rescue for living person and search for dead person.

Do's and Don't-

1)Do's-
  • Planning (transport, food , climate, rescue ) and preparation.
  • Layout all the equipments (List of equipments ).
  • Select experienced leader accepted by all.
  • Management of rescue
    - chopper ( helicopter arrangement )
    -Bone break arrangement.
  • Greeting.
  • Walk in single line and rythmatical walk.
  • weak or injured person in middle of line.
  • Respect culture and religion of the place and local peoples.
  • Keep survival kit (dry foods etc used if lost ) and first aid kit with you.
  • Follow hut manners.
  • Conservation of flora and fauna.
  • Respect wild life.
  • Passing massage (use bushes to show direction or cairn ).
  • Pass bridge one by one.
  • Construction of bridge if needed.
  • Obey the order of leader and respect the leader.
  • Proof of ascent like photographs or videos.
2) Don'ts-
  • Don't go alone.
  • Don't make noise
  • Don't put too heavy load.
  • Don't disturb wild life, flora and fauna.
  • Don't through stones.
  • Don't thorough waste materials.
  • Don't smoke and use alcohol.
  • Don't pollute water resources (as you will drink that water in future).
  • Don't neglect minor injuries.
  • Don't make loose talk ( in mountain sickness you loose your temper, abnormal behavior ).
  • Don't touch unknown flowers.
  • Don't be over confident.
  • Don't disturb public or private properties.
  • Don't rest (during walking ) from where you can't see your partners.
  • Do not avoid week persons.

Mountaining Hazards

Types of mountaineering hazards.-
  1. Objective Hazards - Hazards created by power of nature.
  2. Subjective Hazards and Psychological Hazards - Hazards by mistake of climbers ( Human Hazards )
Objective Hazards-

1) Weather-
  • Whiteout-
    If unknown place wait for clear. If distributed use torch for signaling (distance signaling).
  • Lightning-
    -keep away from metals.
    -conical rock (at the top of the mountain) has no snow. During lightining come to the place covered with ice and away from rock.
    -Don't take shelter at conical rock and below single tree.
  • Snow Blizzards-
    snow comes with wind.
    -wait till it get clear.
    -blizzards can enter your nose or ears or shirt.
    -stand opposite to it.
  • Snow fall or rain fall-
    -pack all items in plastic bags.
2) Avalanche-
Mass of snow slide down from mountain to valley side.

3) Land Slide-
- start form beginning.
-pass one by one (other should watch and told passing person)
-select best way.
-don't pass without helmet or use rucksack to protect head.

4) River and streams-
streams are dangerous, they are small but flow can be from
8km/h to
km/h

5) Glacier-
moving river of ice.

6) Cornice (very dangerous )-
over hang lap of snow stuck on the mountain ridge.
- crup with X- stick to check hollowness
- choose central or middle area.

7) High altitude sickness-
irritation, noise beading , breathing problems.
-Acclimatise body then climb.

Subjective Hazards-

1) Sun burn -
Use caps, cover , suns scream, hats, umbrella.

2) Snow blindness-
-At mountain UV rays reflect from snow and enter to eye.
-Use black goggles.
-If suffering from snow blindness then use water or urine.
symptoms of snow blindness-
-feel irritation in eyes.
-eye turn to reddish.
-tears comes.

3)Frost Bite-
Blood tissue die because of cold
-don't use wet gloves, socks and always cover face (nose and ears).
Symptoms-
-chill burn
-skin color change to red then yellow then blue.

4) Benightment-
spending night without food, shelter and equipments. Without proper plan or co-ordination in team.

5) Fall and slip and over confidence-
-Use proper sole shoes.
-Concentrate on work.

6) Team Management-
Choose the root such that week person can also climb.