This blog has become a year old today! Of course, I shifted from Livejournal in May, but it is a continuation of that blog. And it has been a great day, as “The Story of Phoenix” has been featured in the “Science” category of WordPress (what a coincidence!). Anyway, thank you all for reading my blog patiently! Hope you will keep coming back.
June 28, 2008
Looking back as my stay here at IUAC, Delhi comes to an end, it has been an extremely enriching experience for me, working on the Phoenix project under Ajith sir. He has been working at the Inter University Accelerator Centre for well over twenty years, right since the institue was set up in 1984, and had been actively involved in the setting up of the accelerator research facility during its early years. A few days ago I asked Ajith sir how and when he got the idea to start the Phoenix project. Let me present his reply, along with some other information, in the form of an article.
The Story of Phoenix
When you conduct experiments in modern Physics, the equipment involved is often huge and complicated, which is beyond a human being’s ability to control. Also, precise measurement of time and fast and continuous measurement of physical quantities are often required. Consequently, such experiments are automated, and computer interfaced. This means that the scientist carries out the experiment by controlling the equipment using a computer.
Carrying out an experiment consists of different steps. The first step is to activate the equipment, that is, to start the physical phenomenon which is to be studied. For example, in a simple pendulum experiment, this step would be to set the pendulum in motion. Once the physical system is active, we record the observations. This is the second step – data acquisition. And the final step is the analysis of the data obtained. Computers are unique in that they can be used for all these three steps, with the appropriate peripheral equipment.
When a student who has completed her post graduate studies in Physics starts doing research, she inevitably has to carry out computer interfaced experiments. But we do not get such exposure in our education system, even at the post graduate level. As a result, it is likely that the student would find herself in highly unfamiliar territory. Of course, the research facility would provide a friendly interface and adequate help to the student to complete her experiment successfully, but chances are that the student might not have developed a feel for the whole procedure. This affects the quality of research.
So what is the way out? The obvious solution is to introduce computer interfaced experiments right at the undergraduate or even high school level. One of the main obstacles is the cost involved. Though computers have become inexpensive, commercially available data acquisition hardware is too expensive to be affordable for college labs, where teaching/learning and not research, is the main objective. Thus the idea of building a low cost data acquisition hardware, and subsequently “Physics with Home-made Equipment and Innovative Experiments” (Phoenix), evolved. Phoenix is a big step in the right direction. It is easily affordable for colleges and can be interfaced with personal computers through 100% free and open source software.
The Early Days
The first version of Phoenix was completed around September 2004. It communicated with the computer through the parallel port interface, and depended entirely on the computer CPU for control. Time measurements were done using the CPU clock itself, using real time operating system features. The device driver took care of all the control and measurements. It was first implemented using DOS, and later using real time linux.
The first Phoenix workshop was held on 11 November 2004 at the University of Calicut, Kerala. The first workshop hosted by IUAC was conducted from the 3rd to 14th of October 2005. Many such workshops have been held since. Physics teachers from all parts of the country have taken part in these programs. More such workshops will be conducted in the future. You can find a complete list of the Phoenix workshops conducted so far, as well as announcements regarding future workshops at http://iuac.res.in/~elab/phoenix/workshops/index.html.
Thus the parallel port version kicked off the Phoenix activities. As it later became completely based on free and open source software (FOSS), it attracted interest from the FOSS community, most notably from Pramode C E, who continues to be an active developer/promoter of Phoenix. As a result, demonstrations of Phoenix have since been held at some of the prominent FOSS events like FOSS.IN, FOSSMeet@NITC etc.
Need for a Simpler Hardware/Interface
But the parallel port version was never going to be viable in the long run. For one thing, it was bulky. More importantly, for using it on a computer, you had to compile the device driver with the kernel. This would have been too difficult a task for the end user. As a result, it was not very portable, in the sense that you could not just plug Phoenix in and start using it. Some amount of expertise in programing was required for installing the Phoenix driver. It is still a valuable tool for students for learning how to write device drivers, though.
This led to a complete redesign of Phoenix in early 2006. The new design was based on the Atmel ATMega16 microcontroller, which shifted the control tasks from the real time kernel, to the firmware (written in C and compiled using the AVR-GCC cross compiler) running on the microcontroller. This made things a lot simpler. Now once you burnt the firmware onto the microcontroller flash memory, all you needed was a code library to communicate with it from the PC (through the RS232 serial port interface). No more complicated device drivers! Also, this made the hardware schematic simpler and easier to debug. The new version of Phoenix was named the Phoenix-Mini, or Phoenix-M for short. It was also much more compact (13cm x 10.5cm x 2.5 xm) and cheaper (it costs only around Rs.1500) than its predecessor.
Ready for the Market!
Phoenix-M was ready by the end of May 2006, and started being produced commercially by three different vendors in different parts of India. You can find information about these vendors at http://iuac.res.in/~elab/phoenix/vendor.html. Since the cost of research and development is funded by the IUAC and the schematics are made freely available, the vendors are able to provide the hardware at a low price, based on the cost of raw material and the labour involved.
Phoenix Live CD
By this time, workshops were being held in different parts of the country, and the need for a portable suite of the Phoenix software libraries arose. This resulted in the development of the Phoenix Live CD, which is a complete customized GNU/Linux operating system (based on the Slax live CD) which you can boot from the CD without needing to install anything to the hard disk. It contains, apart from all the software needed to use Phoenix, a collection of free and open source scientific/educational software tools. You can download the Phoenix live CD from http://iuac.res.in/~elab/livecd_images/index.html. A new version based on Debian GNU/Linux is also being developed.
Laptop computers have become popular, and many of them do not provide the RS232 interface. So, a new USB version of Phoenix-M was developed in late 2007. It communicates with the computer, using a USB to RS232 converter implemented by firmware running on a dedicated on-board controller. Apart from this, the Phoenix Microcontroller Development Kit (PMDK) has also been developed to provide a low cost, easy to use microcontroller development system, mainly for engineering students and electronics enthusiasts. Several add-on boards have also been designed for use with PMDK. This modular structure is useful for application in the projects of engineering students.
Future Direction and Challenges
The Phoenix project has matured since its beginning in 2004. We now have a reliable, cost-effective product which is ready for mass deployment. Some academic institutions have already started using Phoenix. For example, the West Bengal University of Technology(WBUT) has included it in their refresher course for Physics teachers. The Department of Education, Kerala, has initiated a project to use Phoenix as a tool for IT enabled education at the high school level.
But there are many challenges that lie ahead, before Phoenix can become a regular part of the curriculum. First of all, computer interfacing of scientific experiments is an entirely new concept, to most of the Physics teachers and students in India. This hurdle can be overcome only through a series of Phoenix workshops. But for its effect to be far-reaching, we need to build a community of enthusiasts from different parts of the country, who can help in conducting workshops. Only with a stong community and user base, can we be assured that Phoenix will realize its potential to revolutionize science education in our country.
1. A Report on Phoenix, by B.P. Ajith Kumar.
2. Experimental Physics with Phoenix and Python, by Pramode.C.E
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.
Download the PDF version of this article.
June 25, 2008
The SBI ATM near the IUAC gate has been out of order for a couple of days. And guess what, I ran out of money yesterday! The three nearest ATM’s are mentioned on a sticker on the ATM here, and according to it, the nearest one was at Ber Sarai, two kilometres away. So I thought I’d go for a walk. Ber Sarai is actually a continuation of the Aruna Asaf Ali Marg, from the JNU junction (I don’t know what it’s really called). To reach the JNU main gate, though, you have to turn west and walk for another kilometre.
I started walking from IUAC at around five past seven in the evening. Aruna Asaf Ali Marg, like most other roads in Delhi, is a well maintained four lane road where cars rush along at high speeds. But there is ample space for pedestrians also, though I doubt whether many people walk along that road, because it is really deserted, except for a few institutions on one side. On the other, you have the Sanjay Van, an intriguing little forest. While walking down the road, you can see the Qutab Minar in the distance, rising like a lone watch tower, on the other side of Sanjay Van.
The Aruna Asaf Ali Marg is home to a variety of instituions. Starting with the IUAC, you have the Indian Council for Social Science Research, the National Institute of Plant Genome Research, the Indian Institute of Mass Communication and the National Institute of Immunology, all on the same side of the road, before you reach the JNU East Gate.
The walk took me just over half an hour, so I think the distance is closer to three kilometres than two. The return journey also took me roughly the same time. By the time I reached my room, I was overcome with the pleasant weariness that’s associated with all long walks! And I almost forgot to mention the important thing – I did get money from the Ber Sarai ATM!
June 23, 2008
I’m reading The Discovery of India by Jawaharlal Nehru. I have only read less than half of it so far, but nevertheless I find it fascinating. I remember how I used to hate History at school. Learning all those dates and events by heart had always been tiresome and irritating. The problem with History in the school curriculum is that undue importance is given to dates and other details, which you can never really connect with your life.
But actually, the main reason (the only reason, perhaps, except for historians and academicians) for learning about our past (History) is to understand our present, contradictory though it may seem to be. Our present day world didn’t just come to be. It is the result of thousands of years of events – wars, revolutions, reforms, expeditions – in which our ancestors took part with all their vitality . The problems which our society face today, have their roots in the past, and to solve them, we should relate our past with the modern world.
So I think, for being interested in History, one has to be first interested in the problems and challenges of the day. Only then can one savour the chapters of History to their fullest. I think that’s why I’m more interested in History now than I was, perhaps five years ago.
You can read a related post on Dinil’s blog.
June 22, 2008
This post should have appeared four days ago, but at times there is some trouble with the proxy server in accessing Gmail and WordPress. Anyway!
I’d been roaming around Delhi on Tuesday and Wednesday. Shyamachechi called me around 12.45 on Tuesday afternoon, after Pallavi’s counselling at NIFT was over. They were at JNU, with their friend Aneesh, who is doing research in political science there and has been selected for the Civil Service. I took an auto and went straight to JNU, which is a huge campus. From there all of us went by taxi to Kerala House, where Shyamachechi, Kannettan and Pallavi were staying. Had a nice nadan lunch from there! Then we went to the Connaught Place metro station, but it was so crowded that we decided to abandon the metro trip. We spent around an hour in Palika Bazaar, the underground market. After that we had tea, and Aneesh and I returned by auto. I got off at JNU and caught another auto to IUAC.
The next day, I met them at the National Museum. It was my first bus ride in Delhi! I took the 604, the only bus which comes near here, and got off at Munirka to catch the 615 which stops in front of the National Museum, as Aneesh had told me. Actually if you are interested in History, you should spend a whole day at the National Museum. There’s so much to see there. We made a quick round-up and set off for the Red Fort, in Old Delhi. We stopped at the India Gate in between and took a few photos. From there we went to JNU to pick up Aneesh, had lunch and then visited the Qutab Minar. This was my third visit to the famous monument, only a couple of weeks ago with Rajuettan. Then they dropped Aneesh and me at our places, and returned to Kerala house in their taxi.
Overall, it was a wonderful couple of days of exploring Delhi. Now I’ve travelled in Delhi by bus, by auto, by cycle (on that great little trip through Kishangarh with Ajith sir), by car (that too in princely manner in Rajuettan’s car) and of course by foot (going for walks is one of my favourite pastimes)… Only the metro has proved elusive so far, except of course, the cycle rickshaws which you find in abundance in Old Delhi.
I’ll upload the photos of the trip together, when I reach home.
June 14, 2008
A companion analog box for Phoenix, is being developed here at IAUC, with which you can study AM, FM etc. It’s still in the process of development, but I had observed AM and FM signals generated by it, and studied their frequency spectra using the fft() in SciPy. We felt that it would be convenient to add these functions to the Python library of Phoenix, as given below. You can use these functions by adding this code segment to the file /usr/lib/python2.4/site-packages/phm.py
But since this bit of code has not really been tested, it’s better to avoid mixing these functions with the original phm.py . Instead, you can save this file to your home directory, and import it along with phm. It can be used just like phm, and you can initialize an object by typing “s=phsig.phsig()”.
def fft(self, data): """ Returns the Fourier transform of the signal represented by the samples in 'data' which is obtained by a read_block() call. Usage example: x = p.read_block(200,10,1) y = p.fft(x) """ from scipy import fft np = len(data) delay = data - data v =  for i in range(np): v.append(data[i]) ft = fft(v) #corrections in the frequency axis fmax = 1/(delay*1.0e-6) incf = fmax/np freq =  for i in range(np/2): freq.append(i*incf - fmax/2) for i in range(np/2,np): freq.append((i-np/2)*incf) ft_freq =  for i in range(np/2): x = [freq[i], abs(ft[i+np/2])/np] ft_freq.append(x) for i in range(np/2,np): x = [freq[i], abs(ft[i-np/2])/np] ft_freq.append(x) return ft_freq def plot_fft(self, data): """ Plots the Fourier transform of the signal represented by the samples in 'data'. Calls self.fft() for obtaining the Fourier Transform Usage example: x = p.read_block(200,10,1) p.plot_fft(x) """ ft_freq = self.fft(data) np = len(data) delay = data - data fmax = 1/(delay*1.0e-6) y = 0.0 for i in range(np): if ft_freq[i] > y: y = ft_freq[i] if self.root == None: self.window(400,300,None) self.remove_lines() self.set_scale(-fmax/2, 0, fmax/2, y*1.1) self.line(ft_freq) def freq_comp(self, data): """ Returns and displays the frequency components with the greatest spectral density. Calls self.fft() for obtaining the Fourier transform Usage example: x = p.read_block(200,10,1) p.freq_comp(x) #Only prints the components y = p.freq_comp(x) #Prints and stores the components in a variable #as an array of [strength, component] """ ft_freq = self.fft(data) np = len(data) delay = data - data peaks =  for n in range(1,np-1): a = ft_freq[n-1] b = ft_freq[n] c = ft_freq[n+1] if (b>50) & (b>a) & (b>c): peaks.append([ft_freq[n],ft_freq[n]]) peaks.sort() peaks.reverse() print 'Dominant frequency components are:' for i in range(len(peaks)): print '%6.3f Hz, %5.3f mV'%(peaks[i],peaks[i]) return peaks
June 9, 2008
Crude oil costs $135/barrel globally, but Indian prices of petroleum products have long been linked to barely $60/barrel. This has meant under-recoveries — explicit and implicit subsidies to consumers — of a whopping Rs 2,45,000 crore … Yet, political parties have launched agitations in protest. Politicians cynically pretend that high oil prices are the fault of the government, not Opec or global trends …
… Back in 1974, when Opec first sent oil prices skyrocketing, India had no giant consumer subsidies or agitations against oil prices. The price of petrol doubled overnight, inflicting much pain. India was very poor then. Today, it is much richer, and better able to pay the full world price. Yet, that prosperity has also brought the capacity to subsidise on an unprecedented scale …
… Ideally, India should pass on the full cost to consumers, as it did in 1974. But for politicians who view high subsidies as electoral necessities, here is a proposal. First, abolish all implicit and explicit subsidies on oil. Use the money saved to cut excise duties on other items of common consumption and provide cash to poor families. Overall inflation and government revenue will be unchanged. Yet, the poor will benefit, and high oil prices will encourage energy-efficiency …
Read the full article here.
Recently we had a hartal in Kerala protesting against the increase in the price of petrol, diesel and cooking gas. As is the culture in Kerala, everyone happily accepted the holiday. But how many of us think of the foolishness of such protests? Are we not aware of what’s happening in the world? It’s easy for opposing parties to protest whenever there’s a price hike. It’s the curse of today’s politics.
Like the author says, it’s a big big mistake to subsidise oil. Today we might enjoy lower prices, but how far can the government subsidise? One day everyone will have to suffer, no doubt. And the other side is that high prices would force the people to consume less energy, and breed a healthy habit of being energy efficient. What’s happening today is that the government is subsidising the destruction of our environment.
June 6, 2008
I remember the clarity and rigour with which I used to explore (theoretical) Physics, when I was in the Eleventh and Twelfth standards, thanks to the inspirational teaching of Gopinathan sir. But after that, I have really been struggling to make sense of what I am learning at college. Working here under Ajith sir, has been a breath of fresh air.
Documenting the experiments properly, has proved to be a challenging job, because you have to verify everything once again before making the report. I don’t know how much I’d be able to complete, but it’s been a good experience.
There is an experiment which you usually do at school, in which you measure the time period so as to calculate the value of acceleration due to gravity from it. But the whole equation is valid for only small amplitudes of oscillation, because the sin(theta)=theta approximation is used. For large amplitudes, this equation is to be used. It must have been mentioned back then, but it sure didn’t stick. There’s no way you can actually verify that in a school lab.
But with Phoenix, you can! We experimented with a combination pendulum, which is nothing but a metal ball fixed on a thin metal rod. It’s similar to the simple pendulum, except that it has a rigid rod, which makes it stable, and that you have to consider the moments of inertia of the rod and the ball. A very thin needle (whose effect can be neglected) was attached to the pendulum, to measure the approximate value of amplitude, as shown in the picture.
We got beautiful results from this setup, and could fit the data onto the large amplitude equation almost perfectly. Measuring the amplitude was the tricky part. Time period can be measured with microsecond accuracy using Phoenix. For each value of amplitude, ten readings were noted. On extrapolating the graph, you can get the time period as the amplitude tends to zero. It was a fascinating result, because you never really carry out experiments from such angles, in our schools/colleges. Hopefully Phoenix can change that!
June 2, 2008
Yesterday was an eventful day. I spent the morning and most of the afternoon in the lab. At four o’ clock, I went to play cricket with the PhD. scholars here. Prasad, who comes from Kerala, had been asking me for a couple of days to go and play with them. So I played one match with them. After that I got a bit bored. Besides, playing in the sun here in Delhi is not that easy, and when I was returning to my room, I met Ajith sir and his younger son Sarath with their cycles. They got me Ajith sir’s elder son Jithin’s cycle, and we went for a little trip.
Delhi is a city of extreme contrasts. There would be a very well planned and posh locality right next to a shanty town. Near the IUAC campus, there is one such planned locality by the name of Vasant Kunj. There is also a village, which Ajith sir showed me. We rode our bicycles through the little fly infested crowded streets for a while, passed through Mehrauli and reached an old Mughal monument. I looked for its name, but all there was, was a notice that it was a protected site. We could see the top of the Qutab Minar from there.
The village streets are a buzz of life and activity. They are so congested, that at some places, the buildings on both sides of the street are so close together, that there would be hardly a metre separating its balconies. It was a very good experience to observe the activities of the people. On our way back, we bought some mangoes and bananas. Our trip had taken around an hour. I was pleasantly exhausted and went to bed early.