Algorithm 1: Single Threshold
Using thresholds is a straight forward way
of extracting an object’s location from the
echo signal. To use a basic threshold, the
amplitude of the echo signal is compared
against a pre-set threshold. This threshold
can be fixed or vary with distance since the
strength of the reflected signal decreases
with distance (Figure 3). The algorithm
identifies the first time that the echo signal
crosses over the threshold and reports the
distance that corresponds to it.
Using a single threshold doesn't take
advantage of the echo signal shape, it simply flags the first instance of when the echo
signal crosses the threshold. This works well
when the signal-to-noise ratio (SNR) is high,
but as the distance increases and the signal
strength decreases, setting the threshold
becomes challenging.
Algorithm 2: Integration
Over a Threshold
Using a two-stage threshold approach
allows the entire echo signal to be incorporated into the decision making algorithm.
The first threshold is set low enough so that
it sits just above the noise floor. Since there
is a second stage, it is not crucial to ensure
that the noise never crosses the threshold.
The second stage integrates everything
above the first threshold, creating an inter-
mediate signal that is compared against
a second threshold. By integrating, the
width of the echo signal is accounted for,
greatly improving the SNR when the signal
strength is low.
The strategy for choosing thresholds
occurs over several steps. First, base
measurements must be taken when no
objects are in the way, and can include
permanent objects that need to be masked,
and should be taken with the sensor
in its position in the final system. Base
measurements should be taken across
various weather conditions for outdoor
applications, as
temperature and
humidity affect
ultrasonic signals.
Additionally, mea-
surements should
also be collected
across several
transducers to
account for trans-
ducer variation.
After compiling
all of the base
measurements,
set the first
threshold so that
it is on the edge
of the maximum
base signal. Then
collect data when objects are in the way.
The second threshold should be chosen by
looking at the intermediate signal. It should
be placed part way between the noise and
the actual signal. Depending on the appli-
cation, adjust the thresholds up or down
to either reduce false positives or false
negatives.
Test Data
The SNR of each system can be mea-
sured by looking at the maximum value
of the signal versus the maximum value
of noise in the region of interest (equa-
tion 1). Table 1 shows a comparison of
SNR figures of the data before processing
and of the intermediate signal. This data
uses the worst case SNR improvement at
each distance after five runs. Since this
dual-threshold algorithm is most helpful
for further distances, these comparison
measurements are from six to seven
meters.
This dual-threshold algorithm is programmed into TI's PGA450-Q1 evaluation
module (EVM) to prove the concept, Table 2
shows the results. Each distance was tested 100 times. At the further distances of 6,
6. 5, and 7 m, false detects occurred in the
region between 6 and 7 m. This is because
the cut off limit was lowered even further
in order to salvage the echo signal. By
comparing data from multiple sensors or
doing multiple runs, these false detects can
be filtered out.
Further Improvements
The dual-threshold strategy can be
used to improve short range detection as
well. Ultrasonic systems have a limit on
detecting close objects. After the transducer is driven, ringing occurs and it takes
some time for the energy to decay. When
attempting to measure distances that are
too close, the echo signal can be masked
by this decaying signal.
Once the echo signal starts to emerge, a
modified dual-threshold algorithm increase
the minimum range detected. The modification involves adding an additional step to
the algorithm that only looks at the sections
of the signal with a positive slope. This
extends the minimum detection distance.
It is also possible to program the thresholds adaptively to account for transducer
variation. In this scheme, a short test is
performed during production to scale the
thresholds for that particular module. This
saves time during the calibration portion
of production and ensures that each module behaves the same way.
The dual-threshold algorithm slightly
increases the complexity for the code
that processes the echo data in an ultrasonic system. However, improved SNR
extends the maximum range of these
systems, which is helpful when detecting
test objects that are less reflective, such
as humans or animals, since the signal
strength of the reflected echo signal will
be lower.
The improvements to SNR also can be
used to save on transducer cost by using
a less sensitive transducer to achieve the
same system performance. Additionally, it
makes ultrasonic sensors more effective
for alternative applications such as blind
spot detection and automatic parking.
Overall, the dual-threshold algorithm is an
effective way to improve system performance in ultrasonic distance measurement
applications. PDD
Table 1.
Table 2.
SNR = 20 log ( ) peaksignal peaknoise