3.3. Results and Evaluation of Attitude Estimation
In order to use the complementary filter, it is necessary to find appropriate values for four parameters: three parameters
, and a parameter
for finding parameters
for magnetic disturbance. The
parameters are only related to
correction, while
is only related to
correction. Therefore, we evaluated
using the time until
becomes stable and evaluated
using the time until
becomes stable. In the complementary filter, increasing
means increasing the considered value of the current acceleration. Because the acceleration should be 0 at the moment of stationary, larger
indicates shorter time to stability. However, a larger considered value of the current acceleration value means that the estimation error during acceleration and deceleration becomes larger. This point can be somewhat mitigated by setting appropriate values of
; however, if
is set too large, then the error is considered to be unacceptable. Hence, we set a new criterion for evaluating the change in attitude during acceleration and deceleration based on the fact that no rotation around the
axis occurs when the horizontal plane is moved.
Figure 6 shows the results of
estimation when the sensor is placed on the horizontal plane and moved back and forth.
From
Figure 6, it can be seen that rotation around the
axis should not occur when the sensor is moved back and forth in the horizontal plane; however, the error is caused by increasing
, which is the considered value of the current acceleration value. In finding the values of
, we calculate the norm
of the maximum value of the rotation around
axis in the round-trip movement and find
such that
becomes as small as possible.
Table 4 shows the values of
when
is varied with
. Note that
is the average of ten times.
From
Table 4, it can be seen that the error
becomes smaller by decreasing
.
Table 5 shows the values of
when
is varied with
. Note that
is the average of ten times.
From
Table 5, it is found that the error
becomes smaller by decreasing
. The smaller
are, the smaller
is; however, if
is set too small from Equation (
29), the value of acceleration is hardly taken into account during acceleration, and a large error is considered to occur in the estimation results during acceleration. Therefore, we use
and set
.
Table 6 shows the ten averages of
when
is fixed and
is varied.
From
Table 6, it can be seen that the error
becomes smaller by decreasing
. However, the larger
is, the shorter the time to stability becomes; thus, we set
to improve the estimation results for both
and
. From the above, the parameters for the correction of
are determined to be
.
Next, we evaluated how the change in
affects the stability and obtained the parameters.
Figure 7 shows the results of attitude estimation when
and the sensor is kept stationary.
As can be seen from
Figure 7 (Right), the estimated value is not stable even after the sensor becomes stationary when
was increased.
Therefore, the parameter for the correction of is set to .
Next, the parameters
for coping with magnetic disturbance are obtained. The value of Equation (
37) takes a value from 0 to 1, and the final maximum value of Equation (
35) must be
; thus, we set
. The value of
should be determined by the magnitude of the difference between the measured geomagnetic field under normal conditions and that under disturbance. In the following
Table 7, we show the measured values when an iPhone and an AppleWatch are placed close to the measured device. The measured values are averaged over 10 s. The measured geomagnetic field under normal conditions was averaged for 100 s, and the result of the measurement was
T.
From
Table 7, the error is found to occur at a distance as close as 20 cm, and becomes very large when the distance is closer than 10 cm. In practical applications, smartwatches and similar devices may be closer than 10 cm; thus, errors that occur in such cases must be dealt with. In order to avoid large errors in the estimates, we do not consider the geomagnetic values when the absolute error is about
T. From the shape of the graph of
, the value of
is set to about
.
From the above results, the parameters of the correction in the complementary filter are determined as follows: .
To evaluate how the geomagnetic sensor copes with disturbances, we compare the results between the cases with and without a geomagnetic sensor value as well as the cases with a fixed value of and a variable value of . Because the only error that can occur in each case is the value, only the value is considered for the error assessment. Each estimated value is the error from the initial state when the sensor is rotated in various directions for 10 s and then stopped.
The following
Table 8 shows the error values of
axis estimation without and with the geomagnetic sensor in addition to the angular velocity and acceleration sensors.
From
Table 8, the errors are within 1 degree in each case when the geomagnetic sensor is used, whereas the errors are more than about 10 degrees in the case when the geomagnetic sensor is not used. This indicates that the geomagnetic sensor is important for attitude estimation.
The following
Table 9 shows the error of the
axis estimation with the AppleWatch in close contact both when the value of
is fixed and when it is changed dynamically to cope with the disturbance.
Table 9 shows that the error is within 2 degrees when
is changed dynamically, while the error is more than about 100 degrees when
is fixed. Thus, the dynamic change of
is very important to cope with the disturbance. Although the error is a little larger than in the case without disturbance (
Table 8), if
is set such that the geomagnetic field is not taken into account when there is even a small deviation from the normal geomagnetic field value, then even a small change in value due to changes in the surrounding environment will cause the geomagnetic field to not be considered. Therefore, we believe that the value set in this study is appropriate. If the error between the geomagnetic field and the normal geomagnetic field value becomes small, then the geomagnetic field value is referred to again to correct the correct attitude; thus, the error in
Table 9 is not considered to be a problem.
Various estimations were performed using the complementary filters obtained from the above results.