Converting an Embedded DOS SONAR System to Linux
A few months ago, I began working at the National Center for Physical Acoustics on the University of Mississippi campus. The project I inherited was an embedded high-resolution SONAR that was applied in the fields of aquaculture and sediment transfer. For aquaculture research, the system is used to determine the biomass within a catfish pond. The system is able to resolve targets a few cm³ in air volume to centimeter range resolution out to a maximum range of about 100m (on a cool day). Our ultimate goal is to be able to target and size individual fish, though this may entail the use of multiple SONAR units coordinating several scans through a target area. Virtually identical hardware is used for sediment transport research. For this work, a pulse is transmitted, and the returned acoustic backscatter is analyzed to approximate the concentration of particulate matter per unit distance from the transmitter. Here, ranges are much shorter, usually no more that five meters. Both applications demand as focused an acoustic pulse as possible, so the system is tuned to operate at a relatively high 460KHz frequency.
The brains of the SONAR hardware, which I disassembled (see Figure 1), is a PC-104 stack consisting of components listed in Table 1. Both the motor and stack are encased within a waterproof (hopefully) canister. At the bottom of the canister is the acoustic transducer that serves to both transmit the acoustic ping and receive the return echo. The transducer must be mechanically rotated with a stepper motor. An umbilical cord carries power and network cables to the system from the shore. The original system used DOS on a CPU board that ran an executable which communicated with a host computer on shore. Users on the host ran a Java-based program on the host that controlled the SONAR using a 10MB Ethernet connection.
The system had passed its proof-of-concept design for both the aquaculture and sediment transfer experiments. As I began my work, modifications were being made to the hardware. In addition to improving custom SONAR receiver and transmit boards, a new in-house data acquisition board would be added. The old acquisition board, an RTD DM6420, would still be retained for use in an experimental system. I knew of DOS's weaknesses, particularly in the area of networking capability. I was interested in trying Linux in this embedded system, if for no other reason than to avoid DOS's kludged networking. It happened that waiting for our custom boards to be readied gave me enough time to experiment with a Linux-based software system.
I had been using Linux for almost three years on my desktop, but had no experience with Linux in an embedded system. I found through a glance of web resources that few hardware manufacturers officially supported it. I was worried that, somewhere down the road, a serious problem would arise between Linux and some sort of hardware. I determined that the safest way to proceed was to use hardware and software that would be compatible with both DOS and Linux and to develop both systems simultaneously.
My first step was to see if I could gather software tools that would work with both DOS and Linux. This way I could easily transport code between the two systems. Naturally the choice was gcc for Linux and the DJGPP compiler for DOS. Since my program would make heavy use of network programming, I needed both systems to be network capable. Linux comes that way, but not so with DOS. DOS needed both a hardware dependent network packet driver and a BSD socket compatible network library. After some work, and swapping of cards on the embedded stack, I managed to find an Ethernet card that DOS liked, and I installed the Watt32 DOS networking library. Familiar UNIX network programs such as ping now worked on either platform.
The first PC-104 stack I used had five boards: a power regulator, a network card, a VGA adapter, an IDE adaptor (this CPU board did not have an IDE header) and a CPU board with a 2MB M-Systems DiskOnChip. I installed DOS 6.22 first. I have to give credit where credit is due--DOS is easy to install and fits easily into the 2MB flash disk. Now, though, I was entering uncharted waters.












This week 5 lucky Members will receive a Root Superhero T-shirt, as modeled by
Hack Editor Kyle Rankin. No entry necessary. Check back here early next week
to find out who the lucky Online Members are.




Comments
Post new comment