Over the Thanksgiving break I decided to tackle a small engineering project that has been on my mind for the past month or so. The basic idea was inspired by learning about Bill Stone's underwater cave mapping system (Stone Aerospace). It is a relatively complex system constructed by more funding that a college student has at his/her disposal. Being a caver myself I decided to build a much simpler and cheaper version for both above and below ground mapping.
Since this project is not too large it should be easily constructed over a few weekend hacking sessions, and over the last day the first steps have taken place. The machine uses and Arduino Uno
as an interface between a computer and the real world. While it is true that it would be possible to make a self-contained unit that would store data on a flash drive and maybe even display initial results on some simple display, I opted out of that option for cost and control concerns. It should be simple to make a simple GUI that allows a netbook to control the setup very nicely and process the data real time.
Above the basic layout from my notebook is shown. The ultrasonic ranger (an SRF05
) is attached to a rotating mount to sweep through the space around it. In the initial prototype stages I'm using a simple RC servo since I have it on hand. Servos only sweep close to 180 degrees to avoid bending control links on models. While continuous rotation servos are made, they have no position feedback which does not allow accurate positioning of the servo. It would be possible to use multiple rangers so 180 degrees is enough rotation, but it will be more economical to switch to a slow geared motor with an encoder (maybe a quadrature rotary encoder?) to detect the position as the unit slowly sweeps the space around it.
Also pictured is the Arduino board and the range finder mounted in a custom case built this afternoon (the window added allows the ping LED to be seen inside the case to confirm the link). Modification of the PCB and mounting hardware was required. CAT5e cable along with 4-pin radio mic connectors are used for the power, ground, echo, and trigger pins. The ranger has a built in PIC controller to pulse the output with a length of the echo time. The unit seems to range effectively up to about 17 feet.
While I don't know the accuracy at large distances, or the spread of the 'beam' with the increasing path length, some simple tests should help sort that out. Currently I've written the interface on the Arduino in C, which will listen for commands over the USB connection. It this executes those commands (such as move servo, get distance, etc) and returns the appropriate values if necessary. The communication is asynchronous and not really 'handshaking', but using startbits there is some error checking involved.
The control from the computer is in the form of a python script that takes easy user input and converts it to the short serial commands in the home-made quick transfer format in the Arduino C code. Currently it moves the servo and returns distances in cm. At distances less than 30 cm results seem to be accurate to about 2-5mm.
The next steps include mounting everything up to get 180 degree scans produced, assessing the accuracy and noise limits of the unit. I also plan to implement a scanning algorithm that scans more quickly over plan surfaces and slows down over more interesting surfaces. It will also throw out false returns, which could be due to a range folding issue in large spaces (I have not done anything past back of the envelope on if the signal is strong enough to cause a range folding issue). A leveling mechanism (manual or automatic) would be nice for field applications. If this were to be used in mapping a tunnel some kind of simple inertial navigation system with a combination of gyros and accelerometers could be used. These are all for future development and future posts.
Have a happy and safe Thanksgiving!