Chapter 6: Analysis and Design of the Adaptive System
6.4 Limitations of the Geometric Approach
The analysis of the WMR's motion presented in the previous section is the ideal geometric model. It is certainly a more faithful mathematical representation of a vehicle's motion than the linear approximation approach of Euler as discussed in Chapter 3. However, the ideal method is not without its limitations - especially when applied computationally. As pointed out in the previous section, there are inevitable truncation and rounding errors as well as constraints on variable size and processing capabilities.
In the later chapter describing the prototype, the documentation will show that the main program uses double-precision (64-bit) floating point numbers for storage and calculations. This is necessary because the high precision of the sensor leads to very small values during calculations, and the turning radius' tendency to approach infinity means that numbers can also get very large. Indeed, simulations confirm that the use of single-precision computation was inadequate for the program to execute without a significant loss of precision in handling either very small or very large numbers.
A major shortcoming of the main microcontroller used by the WMR is that it has no floating point unit. This is quite typical of microcontrollers used in embedded systems. As such, every non-integer number has to be handled via emulation. This inevitably leads to a significant loss of processor performance. Depending on the operation, it could be slower than similar integer calculations by several orders of magnitude.
Aside from the processor limitations, there is another notable concern. The direct consequence of very small numbers being calculated is the large magnitude of the turning radius. Small fluctuations in the raw sensor data, whether caused by detection error or sensor
noise, may cause a similarly small error percentage in the calculated value of the turning radius. However, the large magnitudes involved mean that even a tiny percentage shift can lead to a significant deviation in the final calculated values in absolute terms. In essence, errors are magnified. This was clearly noticed during prototype testing.
During the prototype testing phase, the calibration of sensors revealed that there was a slight difference between them. On a typical test surface, the sensor with the lower sensitivity managed 3.045 x 10-5 m/count. The minimum detectable vehicle turning angle is when either (but not both) of the sensors registers a single count in the lateral (Δy') direction. Using either Eq (3.18) or Eq (6.79), the minimum turning resolution of the vehicle can be determined.
rad
4 min3.383
10
(6.93)So, it is theoretically impossible for the program to return a value smaller than the above. However, this is not always the case according to experimental data. Regardless, as Δψ approaches zero and the program needs to round off to zero in order to invoke the special- case algorithm which presumes the vehicle to be travelling in an absolutely straight trajectory. A cut-off point is required, and the minimum turning resolution serves as a good criterion for it. By including a generous margin of error, the cut-off point was set at:
rad
4 min4.0
10
(6.94)Once this minimum point was set, the turning radii of both sensors will no longer continue to approach infinity. Yet, data collected from all the test runs reveal that both radii routinely exceed 2 x 1013 m and occasionally even surpass 3 x 1013 m. These are indeed very large numbers when compared to the size of the vehicle and typical travelling distance.
It is known fact that real numbers are not represented exactly in a binary system that is typically used in modern computing (Goldberg 1991). Their approximate representations are called floating point numbers, and there is a tendency for a loss of precision as numbers get very large. This is especially true if those large numbers are derived from very small values which could lead to a loss of significance.
The processors and software used in the development of this prototype all adhere to the IEEE Standard for Floating-Point Arithmetic (IEEE 754). The standard measure of precision is the unit in the last place (ULP). This is the smallest possible difference between two consecutive numbers that can be represented. It is akin to a resolution or granularity metric, and is relative to the magnitude of a number. The smallest possible precision is measured at a value of "1" and is called the machine epsilon.
The determination of the ULP at a given numerical range is quite straightforward. MATLAB also has a built-in function to calculate the ULP which is called eps(). Since the native computing format is in binary, the calculations will use a base of two. For a given number, n,
) 1 (
)
(n
e pULP
(6.95)where β is the base
e is the integer exponent p is the number of precision bits
In a double-precision (64-bit) number, there are 53 (52 stored) significand bits, 11 exponent bits, and 1 sign bit. The range of numbers from 2 x 1013 to 3 x 1013 can be represented in base 2 as 244.19 to 244.77. For any number somewhere within this said range, the ULP is:
) 1 53 ( 44 13
2
)
10
2
(
ULP
3 1310
906
.
3
)
10
2
(
ULP
(6.96)As mentioned before, 2 x 1013 m is a value frequently exceeded in calculations of the radius length. This radius is directly used to determine the coordinates of the sensors and by extension the vehicle. While the sensors have precision levels at about 3 x 10-5 m/count, the large radii values used in the calculations can only manage a precision of just under 4 x 10-3 m. This loss of precision amounts to more than two orders of magnitude (i.e. over 100 times) and is thus considered very significant. This is certainly a serendipitous discovery. The problem is compounded by the fact that it happens quite frequently when the vehicle is travelling in nearly a straight line. Furthermore, dead-reckoning errors are cumulative.
Indeed, if the sensor resolution were set higher than the nominal 800 cpi, the minimum detectable angle would be smaller, thus allowing the maximum turning radius to reach a far larger magnitude before it has to be truncated. For example, if the maximum radius were to be increased by a factor of 10, the precision of the calculated coordinates would be in the range of well over 15 mm.
2 14
10
563
.
1
)
10
1
(
ULP
As is clearly illustrated here, bigger numbers lead to a greater loss of precision. Ironically, in order to achieve the highest precision possible, accuracy is actually lost in the process.
Thus, it is clear that although the geometric model is mathematically accurate, it is not quite so in a practical sense. Furthermore, there are other issues in addition to the limitations in
floating-point precision. To avoid situations leading to infinity, very small numbers have to be rounded to zero. At the other end of the scale, extremely large values have to be truncated. So, the ideal model is not as perfect as expected. Nevertheless, the geometric approach is still a more accurate method than Euler's linear approximation in general.
The rounding and quantisation errors as well as noise sensitivity issues of the geometric method only occur within a small range of motion, i.e. when the turning angle Δψ is near or equal to zero. Other than that, the aforementioned concerns do not apply. However, vehicles do generally move forward in somewhat of a straight line much of the time. So, although the problem is confined to a narrow range of motion, it occurs quite frequently. In contrast, Euler's method suffers from discretisation errors throughout the entire range of motion except when the vehicle is travelling in an absolutely straight line.