Student Projects

cancel
Showing results for 
Search instead for 
Did you mean: 

Ultrasound Positioning System

Ultrasound Positioning System

EE/CE Senior Design II

Chris Baronne – cab094020@utdallas.edu

Ben Delay – bld090020@utdallas.edu

Peter Dimberio – phd100020@utdallas.edu

Matthew Krenik - mxk08700@utdallas.edu

Dr. Marco Tacca - mtacca@utdallas.edu

  

Introduction

            Real-time position tracking has classically required compromises between cost and accuracy.  The flagship positioning technology, the Global Positioning System (GPS), uses electromagnetic signals to calculate a receiver’s position. However, GPS becomes prohibitively expensive at high levels of accuracy.  Radio frequency signals travel so quickly that accuracies of one millimeter require clock time resolutions in the picosecond range.  The expense of these clocks has prevented the adoption of RF positioning systems in many localized applications. Fortunately, ultrasound positioning offers a compelling alternative.  As sound propagates similarly, but more slowly than electromagnetic waves, these systems have lower polling frequencies than the equivalent RF system, while still allowing for the use of familiar established GPS signal processing techniques.  Our senior design project sought to integrate low frequency ultrasound transducers into a GPS inspired positioning system to achieve high spatial resolution, real-time position tracking at a relatively low cost. 

            Our ultimate project goal is to design and construct a positioning device that achieves a distance resolution of 1 mm for a transducer unit that can move up to 1 m/s in a 1m2 area.  This first semester, we narrowed our focus to constructing a prototype circuit in one dimension.  We figured this to be a reasonable goal, as the project hinges upon establishing a certain baseline accuracy between receiver and transmitter. We also assumed that expanding a working circuit to multiple dimensions would cause few issues, as long as we were able to encode the signals properly.  But, perhaps most importantly, we wanted a working product at our first senior design presentation and implementing the entire system at once seemed unfeasible.  Fortunately, this approach of building the one-dimensional prototype first proved fairly successful and seems to show promise going forward.

            While the prototype's results weren't quite up to the standards we defined for the end of the project, it got remarkably close to those goals.  In terms of accuracy, the prototype achieved an average error of around .5% over all the distances we measured.  Higher distances produced higher errors, though the maximum error observed was only around 1% at 1m (10mm).  The update rate of the system was quick enough (~250 times per second at ~.5m) that it should allow for practical real-time tracking of the transmitter in free space (even assuming we use time-division multiplexing to encode our signals).  All of these successes point to the potential of the project to achieve its final goals.

Concept Review and Preliminary Analysis

Problem Analysis

Positioning technologies are a key component in the growing field of robotics and automation. In order for a smart device to perform a function, it needs to know its own location and orientation in reference to the location and orientation of the tasks it is to perform. Our device is currently a generic positioning system that is open to be applied to a multitude of different applications. One possibility is to design the system to track a stylus or pen to allow CAD designers and architects to draw quickly and easily in three dimensions.

From a design perspective, we first analyzed the key features that would be ideal for most positioning systems. For almost every application, precision/accuracy are paramount. Also, the system must respond quickly, be low cost, low power, and track over a fairly large range. Finally, the system needs a user interface that can demonstrate how well the system is tracking the transducer.

This gives us several key specifications for the system:

  • Track the location of a transducer in a 1 cubic meter range
  • Determine the precise location of a transducer for an accuracy of 1 millimeter
  • Be able to track the movement of the transducer at speeds of up to 1 meter per second
  • Have an immunity to obstructions that may block the signals coming from or going to the transducer
  • Develop an algorithm that displays the movement of the transducer on an interface

There are three main features to this design problem. First is the positioning device. Similar to the multitude of satellites around the earth that provide the transmitters for the global positioning system, this positioning device must be low cost, low power, and also must be significantly redundant. The positioning device will house several transducers at fixed, known locations that will be used to either transmit or receive signals and determine the effective location of the stylus. The next component to the design problem is the device to be tracked. This device must be comfortable to hold, low weight, very low power, and able to track, no matter how it is held. This component will also house several transducers that will transmit or receiver signals to determine its location. This tracked device will also have a trigger button that can possibly perform a function as it is moving through free space. Finally, this design project includes a user and computer interface. The motion of the device must be registered into a computer and tracked.

From a technical standpoint, this project has many different components that cover a broad range of engineering knowledge and background. At its core, this project deals with signal processing. A transmitter sends an ultrasound pulse that will be received. Then, the receiver unit will process this signal, determine which transmitter it came from, perform a correlation to find the time stamp, and then calculate the distance between the transmitter and the receiver.

The basic design will focus on a network of transmitters that are set up at fixed locations. Then, at given time intervals, this network will transmit signals that will be received by the object to be tracked. This object will perform the sufficient calculations to establish the various pseudoranges and will return this information to a computer which will perform the rest of the calculations. Ultrasound is chosen as the signal of choice because of the low cost and low power of the transducers and the slow propagation of the speed of sound, which allows an accurate position to be established. 

Other solutions to this problem exist. In one slight change, instead of having a network of transmitters tracking a receiver, a network of receivers could track the location of one transmitter. With this change, the direction of signal propagation is reversed, but the same effect is achieved. Other solutions may incorporate structured light, image processing, or other types of signaling past ultrasound. 

Decision Analysis

Having a system of receivers that determine the location of a transmitter is very appealing in some instances. First of all, if Time Division Multiple Access (TDMA) is used as the encoding process, each transmitter transmits in turn, adding to the total amount of time used to calculate a position. If this solution is used, there will be less transmitters, reducing this time. However, because the object to be tracked may perform a function, it could be easier to calculate the position in the object itself, as the computer will not have to interface with both the positioning device and the object to be tracked. Especially if a wireless system is adopted in the future, this constraint of “calculation locality” will be paramount. Additionally, if Code Division Multiple Access is used, this is no longer a concern.

Other solutions such as image processing or structured light, although interesting, are higher power, more expensive. Additionally, our team does not have the skill sets to work with these problems in depth.

The effectiveness of our system is determined by two metrics: how accurate is the positioning, and how fast is the position update? Other metrics for the overall worth of our system deals with size, weight, cost, and user ability.

We decided to use ultrasound positioning based upon its multitude of benefits. First of all, ultrasound is very accurate due to the slow movement of its propagation. This adds other complications such as Doppler, inconstant speed of sound in air, and resonance. However, there are calculations and designs that can be implemented to overcome these complications. The processing of time for this positioning should also be relatively low compared to an image processing system. Finally, ultrasound components are small, low weight, and inexpensive.

Basic Solution Description / Project Operation and Optimization

Major Components Used

  • National Instruments sB-RIO Board
  • 40kHz Piezoelectric Transmitter
  • 40 kHz Piezoelectric Receiver
  • 2x Texas Instruments TLV2770 Operational Amplifier

Hardware Design Approach and Implementation

For the design of the Senior Design II project, we built directly on our achievements of the first semester.  Our overall goal was to move from 1 dimension to 3, and we decided to use our existing distance approach and algorithm.

            Our original design consisted of a transmitter coupled with a receiver-amplifier pair, both of which were connected to the sB-RIO Board.  By using an onboard timer to create a 40kHz square wave and using that to drive the transmitter transducer, we are able to see a very small sine wave out of the receiver at distances up to a meter. Using the amplifier to raise this to a level that the microcontroller can sense, we can then determine the amount of time it between sending a signal and receiving it.  This can directly be translated into an approximate distance between the transmitter and receiver.

            This semester presented a host of new design challenges.  While last semester dealt with only sensing the distance between two points, this semester focused on determining a position in three dimensional space.  Our first idea on how to tackle this problem called for a cube or sphere to outline the area we would be tracking within.  On the perimeter of this structure, we would place either an array of transmitters or receivers, with the opposite transducer attached to the device we would track within.

            We decided on creating a cube, since it would be the easiest to eventually determine a position in terms of x, y, and z distances from a known point.  We also chose to mount the transmitters around the outside of the cube, since these were simple connections and had no complex circuits attached to them.  The receiver would be function as the “marker” we would track inside the cube. For simplicity of measurements, we placed a transmitter in every corner of the cube.  By attaching our previous receiver circuit (See the circuit diagram below), we then verified that each individual transmitter worked as is with our code from the first semester – measuring a simple distance from each corner to verify everything was wired correctly.

            After we created this simple array, it was simple to connect everything to the prototyping board.  There were more than enough GPIO pins available to wire in each of the 8 transmitters, while keeping the same inputs for the receiver circuit.

            The final hardware issue we ran into was how to actually create the receiver head to use inside the cube.  Each transducer has a cone of use that seems to be about 130o from the datasheet. Because of this, we wanted to incorporate more than one transducer into the head to try and maximize the number of transmitter signals visible at any one point in time.  Our first attempt used 5 transducers, each aligned 90 degrees from the other.  In testing, this array was able to pick up signals from our transmitters, but dampened the signal a little too much.  The end result was that the amplifier was not able to adequately amplify the weak signal enough for the microcontroller.  Because of this, we decided to reduce the number of receiver transducers to 3, and arranged them equidistant from each other in a circle.  This provided a better range of sight than just one, while still keeping the signal strong enough to be amplified correctly.

Software Design Approach and Implementation

            Development of the software system to control the pulses and calculate distance was largely accomplished in tandem with that hardware development.  In the first semester, the first challenges we faced dealt with setting up the initial clock and setting up a timer to send a controlled  pulse out of an external pin.  Previous knowledge from our classes helped to setup a basic timer to output the signal.

            Heading into the second semester, we developed upon our existing software platform in order to support the necessary 8 transmitters and 1 receiver.  The thinking behind this was that it would be relatively simple to scale up the design to incorporate these added features. The first problem we faced, however, was how to drive the individual transmitters themselves.  In the fisrt semester, our transmitter was connected directly to the timer output pin, allowing us to create a 40kHz signal without the use of interrupts on that timer.  This semester, we not only needed a 40kHz signal, but also a way to separate it into 8 separate channels.

            In order to accomplish this task, we needed to reincorporate the idea of interrupts. Our general design consisted of two timers again, one used as it was last semester to establish a TX pulse length and to record the amount of time between transmit and capture, and the other used strictly to create the 40kHz signal.  Instead of the transmit pin being the timer PWM output, we moved all 8 transmit outputs to GPIO pins (4.0-3, 7.0-3).  We then controlled which transmitter was selected and when a transmitter was active.  Each time the 40kHz interrupt fired, these variables were checked to see if (a) the transmitter was active and could therefore have its output toggled and (b) which GPIO pin to toggle based on which transmitter was selected.  Through this method, we could cycle through all eight of the transmitters one by one and record and store measurements from each.

            We borrowed the ring-buffer idea from the first semester since it proved to smooth out a lot of our measurements and made them considerably more accurate. For the sake of speed though, we reduced the buffer size to 10 per transmitter instead of 20.  This meant at an average transmit time of 2ms, recording 8 transmitters * 10 measurements * 2ms + 40ms processing resulted in ideal update rates of about 5 times per second.

            This methodology proved flawed for two reasons.  First, the update rate was much, much slower than we anticipated. Secondly, it was impossible to achieve the ideal rate because the polling took longer (timing out on transmitters the receiver couldn’t see).  Because the receiver is always potentially moving, it was possible that a transmitter could have some bad data in its ring buffer.  Although there were some software checks to try and mitigate these errors, they were impossible to completely eliminate.  Because of these flaws, we decided to remove the ring buffer. It meant that our overall system would have some jitter introduced into measurements, but that system stability would rise considerably due to the reliability of measurements.

            At this point, we had reliable measurements being fed into the microcontroller and code in place to recognize and mark “timeouts” or faulty measurements. The next logical step was to attempt to translate this into x, y, and z coordinates.  Since we decided to create a graphical display on a computer to show the receiver’s location in the first place, we decided to move the computations off the microcontroller and onto the host computer itself to more efficiently calculate our position.

            To accomplish this, we first needed to establish a means by which we could communicate data to the host PC.  We used a very simple module to establish a serial-over-USB link to a Windows PC, which then read the information from the microcontroller through a simple C program.  We encoded the positioning information from the microcontroller as a string of bytes as follows:

            With this in mind, we were able to continually read data until we saw the start flag, from which we were able to read data until we saw the Stop flag. In this way, we ensured that the data was always correctly aligned, and that the right measurements were recorded for the right transmitters

            The last hurdle we faced dealt with actually calculating a position in three dimensions.  We approached this with two basic calculations.  The first, simpler version, calculated the distance along any beam of the cube, where there were two valid measurements from each end. Because we know the length of the beam as well as the length from each end out to the receiver, we can use the law of cosines to determine interior angles and eventually determine a distance.

           By normalizing the origin at a point and making all calculations with respect to that, we can determine an x, y, and z coordinate with a minimum of 4 transmitters responding.  This, however, was not good enough for our purposes.

            We needed to decrease the number of transmitters sending a valid signal down to the absolute minimum to maximize our chances of having a successful position update.  Through some more complicated trigonometry, we were able to narrow it down to a minimum of 3 transmitters being valid that were also all connected by a maximum of 1 beam apart from another.  This seemed reasonable and still allowed us to keep our update rates fairly high. These values were then fed into a software program that tried to position the ball in three dimensional space using OpenGL graphics.

            The OpenGL program consisted of a few different main components.  The basic entry point was an initialization loop that set up the OpenGL window and environment, initialized all the lighting and objects in the program, drew our static checkerboard, and then loaded the range array with an established set of default values representing a range of clock cycles.  The program then entered its main display loop, in which it would: open whatever COM port we were feeding the readings into, place the values in a data array, close our handle to the COM port, convert the raw data to values that make sense as coordinates and update the ball’s position.  The program then did the necessary maintenance of flushing and swapping the draw buffers.  This setup worked quite well, though we did have some issues with the units of our renderer (i.e. what 1 division was in terms of movement in the program) and the values we were getting as coordinates (we were representing them as centimeters). We tried normalizing the values against a sensible number of units (dividing them by 100 put the movement completely in the view), but lost precision in doing so.  If we had to try again, we would instead probably scale up the other objects in the program to minimize some of the ball jitter we were getting.  This would allow for the floating point values we were getting to correspond to a more accurate change in coordinates (i.e. 100 centimeters of motion would be 100 units of movement instead of one, the camera view, checkerboard and ball would be scaled accordingly).  This view would improve the jitter, as less rounding in the rendering location would take place.

Final Scope of Work

In this project, we have completed preliminary op-amp circuit design to ensure the visibility of a transmitted signal on the receiver.  This design includes a cascaded max gain amplifier circuit.  With the circuits and coding for the National Instruments sB-RIOhas allowed for the completion of a one dimensional measurement apparatus with accuracy of between one and five millimeters at a range of up to one meter. We have successfully created a three dimensional positioning system using this technology and have begun perfecting the code to drive, record, and display this data.  Another aspect we are working on is fine-tuning the op amp circuit characteristics to produce a more desirable signal transfer between the transducers.  We are also hoping to expand the distance capabilities to get closer to our theoretical max distance for the board and the transducers.  Our lessons learned revolve mostly around paying more attention to data sheet details.  We found that the skew speed for our op amp circuits was critical for our application and thus tried four different op-amps before finding the proper one for our application.  This was most evident when we initially used the u741 op amp and we measured data that was not quite what we were expecting.  This was remedied by further inspection and comparison of other op amps before finally landing on the Texas Instruments TLV2770.  Our future activities will include expansion of the size of the system along with increased precision and accuracy for all measurement ranges.  Also we will be working on finding a more specific application and modifying our system to more stringent goals.  The life-cycle of our system is mainly dependent upon a small battery source and on the receiver and the power needed to operate the board itself.  Other issues involve our current set-up based on misalignment of the transducer pair.  This can cause skewed measurement readings and calibration errors

Conclusion

            This report describes the design processes and procedures that were taken this semester and discusses how we will move forward going into next semester. Our objectives were to design a 3-dimensional position tracking device that met specifications for various automated or robotics applications. We analyzed several different options including structured light, image processing, RF signals, and ultrasound and found that ultrasound positioning is the best choice for the constraints of our senior design project.

            This semester we expanded our design into three dimensions. We demonstrated that we could send and receive a signal, measure the clock cycles as a time stamp, and then determine the distance between the transducers, translating all of this data into a three dimensional position. The research and basic concepts that we have established this semester have provided a strong foundation under which we can continue work on the project. We are excited to face the problems that the future will bring.

Contributors