1. Technical Field
The present invention relates to an attitude calculation apparatus and an attitude calculation method.
2. Related Art
In an inertial navigation system, a method is known in which an attitude of an apparatus equipped with the system or a moving object equipped with the apparatus is calculated by using output of an angular velocity sensor.
JP-A-2001-280970 discloses that, in order to compute an attitude angle with relatively high accuracy at a high speed, an initial value for performing an attitude reference computation at a relatively high calculation frequency through relatively low-order approximate calculation is corrected by using a result in which an attitude reference computation is performed at a relatively low calculation frequency through relatively high-order approximate calculation.
In JP-A-2001-280970, the correction is performed by using the result in which an attitude reference computation is performed at a relatively low calculation frequency. Calculation having a low calculation frequency uses gyro data which is input in a cycle which is lower than calculation having a high calculation frequency. For this reason, there is a large amount of gyro data which is not used for the calculation, and thus there is a probability that accurate correction may not be performed.
Particularly, in a case where a moving object which changes greatly in angular velocity for a short time is targeted, such as a human, if there is a large amount of data which is not used, errors increase, and accuracy of a calculated attitude angle tends to be reduced. On the other hand, since calculation of an attitude requires a large calculation amount, there is a need for reducing a load on a system which performs the calculation.
An advantage of some aspects of the invention is to provide an attitude calculation apparatus and an attitude calculation method in which a load on a system can be minimized, and attitude calculation accuracy is barely reduced even if a moving object whose angular velocity changes greatly is targeted.
(1) An aspect of the invention relates to an attitude calculation apparatus including a gyro sensor that detects angular velocity in a first coordinate system for an inertial coordinate system, of a living body or a moving object (hereinafter, collectively referred to as a “moving object”) which moves by using energy of the living body as a power source; an attitude change calculation unit that calculates an attitude change of the moving object on the basis of the angular velocity which is input at a first frequency f1; and an attitude update unit that updates an attitude of the moving object on the basis of the attitude change which is input at a second frequency f2, in which the first frequency and the second frequency satisfy f1>f2≧20 Hz.
In the attitude calculation apparatus according to the aspect of the invention, angular velocity is input to the attitude change calculation unit at the first frequency f1, and an attitude change is input to the attitude update unit at the second frequency f2. As a result of examination conducted by the present inventors, it is found that, if f1>f2≧20 Hz, an attitude change is calculated at the first frequency f1 higher than the second frequency f2, and thus the attitude change can be calculated with higher accuracy than in a case where the attitude change is calculated at the second frequency f2. Therefore, even in a case where an angular velocity change is relatively great as in a moving object which walks and moves, it is possible to minimize a reduction in attitude calculation accuracy. On the other hand, an attitude change is input to the attitude update unit at the second frequency f2 which is lower than the first frequency f1. Thus, a load on the CPU in calculation after an attitude is updated is reduced.
(2) In the aspect of the invention, the attitude change calculation unit may calculate exp([αibb(t+τ1)]×)exp([αibb(t+2τ1)]×) . . . exp([αibb(t+kτ1)]×). Here, τ1 is 1/f1; k is an integer satisfying (f1/f2)−1<kf1/f2; t indicates time; and [αibb(t+nτ1)] indicates a rotation matrix obtained from the angular velocity at a time point t+nτ1 (where n is an integer satisfying 1≦n≦k).
By using the n-th attitude change exp[α(t+nτ1)] every first cycle τ1, multiplication and calculation are performed k times such as exp([α(t+τ)]×)exp([α(t+2τ)]×) . . . exp([α(t+kτ)]×), and thus an attitude change of the moving object can be calculated with high accuracy. In addition, the first cycle τ1 and the second cycle τ2 and the above-described first and second frequencies f1 and f2 have relationships of τ1=1/f1 and τ2=1/f2. Therefore, k=f1/f2 is satisfied. Further, even if f1/f2 does not become an integer, k is the number of α matrices which can be multiplied within a period, and thus k can be made an integer satisfying (f1/f2)−1<k≦f1/f2.
(3) In the aspect of the invention, the attitude calculation apparatus may further include an acceleration sensor that detects acceleration in the first coordinate system for the inertial coordinate system; and a coordinate conversion unit that converts coordinates of the acceleration from the first coordinate system into a second coordinate system on the basis of the attitude and the acceleration which is input at the second frequency f2.
An attitude is updated by using an attitude change which is calculated on the basis of angular velocity input at the first frequency f1. For this reason, coordinates of acceleration can be converted with high accuracy by using the attitude.
(4) In the aspect of the invention, the attitude calculation apparatus may further include a sensor unit that includes the gyro sensor, and the attitude change calculation unit may be configured by hardware which is accommodated in the sensor unit.
Typically, an attitude change can be obtained through common calculation regardless of a specification of the system. Therefore, the attitude change calculation unit is configured by hardware, and thus it is possible to reduce a load on the CPU due to calculation using the relatively high first frequency f1.
(5) In the aspect of the invention, the attitude calculation apparatus may further include an addition averaging unit that adds and averages the m accelerations (where m is an integer of 2 or higher, and satisfies f3/f2) which have been input at a third frequency f3 (f2<f3<f1), and inputs the acceleration to the attitude update unit at the second frequency f2.
A frequency at which the acceleration sensor detects acceleration may not match the second frequency f2. In a case where acceleration is detected at the third frequency f3, higher than the second frequency f2, m (=f3/f2) accelerations which are acquired may be added and averaged. The accelerations are integrated for a smaller number of times, for example, when a position is calculated rather than the angular velocities, and thus even if the accelerations are added and averaged, there is less influence of an increase in an error due to the integration. For this reason, a calculation amount can be minimized, and a reduction in accuracy of subsequent calculation can be prevented.
(6) In the aspect of the invention, the attitude update unit may output a request signal for a request for outputting the attitude change from the attitude change calculation unit at the second frequency f2, to the attitude change calculation unit.
Since the request signal is output from the attitude update unit, a frequency at which an attitude change is input to the attitude update unit can be accurately maintained, and thus it is possible to minimize a reduction in calculation accuracy of an attitude.
(7) Another aspect of the invention relates to an attitude calculation method including detecting angular velocity in a first coordinate system for an inertial coordinate system, of a living body or a moving object (hereinafter, collectively referred to as a “moving object”) which moves by using energy of the living body as a power source; calculating an attitude change of the moving object on the basis of the angular velocity which is input at a first frequency f1; and updating an attitude of the moving object on the basis of the attitude change which is input at a second frequency f2, in which the first frequency and the second frequency satisfy f1>f2≧20 Hz.
Also in the another aspect of the invention, even if an angular velocity change is relatively great as in a moving object which walks and moves, it is possible to minimize deterioration in integration accuracy and thus to reduce a load on the CPU when an attitude is calculated for updating the attitude.
The invention will be described with reference to the accompanying drawings, wherein like numbers reference like elements.
Hereinafter, with reference to the drawings, an example of a preferred embodiment of the invention will be described. However, an embodiment to which the invention is applicable is not limited to the embodiment described below.
In the present embodiment, at least three types of coordinate systems are defined. A first coordinate system is a local coordinate system which is a three-dimensional orthogonal coordinate system (sensor coordinate system) correlated with an inertial measurement unit (IMU) 10 provided in the position calculation apparatus 1. In the present specification, the local coordinate system is also referred to as a body (B) frame which represents detection axes of an inertial sensor in a right-handed system. In the present embodiment, three axes of the local coordinate system are denoted by an x axis, a y axis, and a z axis.
A second coordinate system is a three-dimensional orthogonal coordinate system (absolute coordinate system) which is a coordinate system for defining a movement space of a moving object. In the present specification, the absolute coordinate system is also referred to as an absolute (A) frame. The A frame is defined as, for example, a north east down (NED) coordinate system (N frame), or an earth centered earth fixed (ECEF) coordinate system (E frame). In the present embodiment, three axes of the absolute coordinate system are denoted by an X axis, a Y axis, and a Z axis.
The second coordinate system may be a three-dimensional orthogonal coordinate system (moving object coordinate system) correlated with a moving object. In the present specification, the moving object coordinate system is also referred to as a vehicle (V) frame. In the present embodiment, a front and rear direction with a front side of a moving object as a positive side is set to a roll axis (R axis), a left and right direction with a right side as a positive side is set to a pitch axis (P axis), and an up and down direction with a vertical lower side as a positive side is set to a yaw axis (Q axis).
The third coordinate system is an inertial coordinate system (not illustrated) which is a three-dimensional orthogonal coordinate system used as a reference when the IMU 10 performs detection. In the present specification, the inertial coordinate system is also referred to as an inertial (I) frame. The I frame is a coordinate system which has the center of the Earth as an origin, and has the Earth's axis of rotation as one axis. The rotation of the Earth is disregarded. In the present embodiment, three axes of the inertial coordinate system are denoted by an L axis, an M axis, and an N axis. In the present embodiment, the N axis is set to the Earth's axis of rotation.
The IMU 10 is a sensor unit which is mounted in the position calculation apparatus 1, and is known as an inertial navigation unit. The IMU 10 includes, as illustrated in
The acceleration sensor 11 detects acceleration vectors for the respective axes (the L axis, the M axis, and the N axis) of the inertial coordinate system corresponding to the three axes (the x axis, the y axis, and the z axis) of the local coordinate system. As the acceleration sensor 11, for example, a micro electromechanical systems (MEMS) sensor is used. A value measured by the acceleration sensor 11 is acceleration of a moving object measured in the local coordinate system.
In the present specification, in principle, unless otherwise mentioned, acceleration or velocity indicates acceleration or velocity (that is, an acceleration vector or a velocity vector) which takes into consideration a direction and a magnitude thereof.
The gyro sensor 13 detects angular velocity (hereinafter, referred to as “local coordinate angular velocity”) for the respective axes (the L axis, the M axis, and the N axis) of the inertial coordinate system corresponding to the three axes (the x axis, the y axis, and the z axis) of the local coordinate system in the same manner as in the acceleration sensor 11 provided in the position calculation apparatus 1.
A global positioning system (GPS) sensor 15 illustrated in
The position calculation apparatus 1 further includes a processing section 100, an operation section 20 provided with the operation buttons 3 illustrated in
The processing section 100 collectively controls the respective sections of the position calculation apparatus 1 according to various programs such as a system program stored in the storage unit 60.
In
As illustrated in
The processing section 100 includes an A/D converter 121 which samples acceleration detected by the acceleration sensor 11, for example, at a third frequency f3 (for example, f3=100 Hz) so as to A/D convert the acceleration; an acceleration bias correction unit 122 which corrects a bias of the acceleration; and an addition averaging unit 123 which adds and averages m accelerations (where m is an integer of 2 or higher, and satisfies (f3/f2)−1<m≧f3/f2); for example, m=5) which have been sampled at the third frequency f3, and outputs the acceleration at an output frequency of the second frequency f2. As illustrated in
As illustrated in
The processing section 100 further includes the coordinate conversion unit 125. The coordinate conversion unit 125 calculates acceleration (hereinafter, referred to as “second coordinate system acceleration”) of the moving object whose coordinates are converted from the first coordinate system to the second coordinate system on the basis of the attitude of the moving object which is updated by the attitude update unit 124 according to the second frequency f2 and the acceleration which is input at the second frequency f2. As illustrated in
The processing section 100 further includes a velocity/position calculation unit 126. As illustrated in
As mentioned above, the position calculation apparatus 1 calculates a position of a moving object which walks and moves in the second coordinate system (the absolute coordinate system, the moving object coordinate system, or the like). When coordinate conversion is performed from the first coordinate system into the second coordinate system, an attitude of the moving object which is updated by the attitude update unit 124 is used. An attitude (angle) of the moving object can be obtained by updating the previous attitude by using an attitude change which is obtained by the attitude change calculation unit 113 integrating angular velocity which is detected by the gyro sensor 13. The more the data amount (the number of samples) of angular velocity in an integral period, that is, the higher the frequency (input frequency) of the angular velocity which is input to the attitude change calculation unit 113, the higher the accuracy of a calculated attitude. In the present embodiment, a frequency of the angular velocity which is input to the attitude change calculation unit 113 is the first frequency f1, and is higher than the attitude change frequency (the second frequency f2) which is input to the attitude update unit 124. Therefore, even in a case where an angular velocity change is relatively great as in a moving object which walks and moves, it is possible to minimize a reduction in integration accuracy when compared with a case of performing integration at the second frequency f2. On the other hand, the attitude change frequency which is input to the attitude update unit 124 is the second frequency f2 which is lower than the first frequency f1. Thus, a load on the CPU in calculation after an attitude is updated is reduced when compared with a case where an attitude change is input to the attitude update unit 124 at the first frequency f1.
The processing section 100 further includes an extended Kalman filter calculation unit 127 and an error correction unit 128. As illustrated in
The analog circuit 110 performs Q-V conversion on an output of the gyro sensor 13 so as to amplify the output. The MPU 114 controls the analog circuit 110, the A/D converter 111, the DSP 112, the attitude change calculation unit 113, and the SPI 115 on the basis of command/data which is input from the SPI 115. For this, the MPU 114 includes a command decoder 114A and a register 114B. Various control data items are stored on the basis of commands decoded by the command decoder 114A, and each unit of the gyro sensor IC 14 is controlled on the basis of the control data. The SPI 115 is provided with an interrupt terminal INT in addition to a chip select terminal CS, a data-in terminal DI, a data-out terminal DO, and a clock terminal CLK connected to the processing section 100. The MPU 114 receives a request command from the attitude update unit 124 of the processing section 100 via the SPI 115. The request command is a command for a request for outputting an attitude change from the attitude change calculation unit 113 with the second frequency f2 as an output frequency. The request decoded by the command decoder 114A is sent to the attitude change calculation unit 113 via the register 114B, and thus an attitude change is output. An interrupt output may be output from the interrupt terminal INT to the processing section 100 in the cycle of the second frequency f2, and a command (request signal) for a request for outputting an attitude change may be issued during the occurrence of interruption.
As control values which are set in the register 114B by a write (W) command decoded by the command decoder 114A, there may be the order of an approximate function, bias update timing, an angular velocity conversion (quantization unit LSB→rad/s) coefficient, DRDY output timing, attitude calculation start/stop, writing of a bias estimation value, and the like. In addition, reading of an attitude change calculation result may be performed following a read (R) command decoded by the command decoder 114A. Attitude change calculation start/stop timing may match a second cycle τ2 (τ2=1/f2) of the second frequency f2.
Here, an example of calculation performed by the attitude change calculation unit 113, the attitude update unit 124, and the coordinate conversion unit 125 is represented in the following Equation (1).
C
b
e(t+τ2)=Cbe(t)Cchange−ΩieeCb(t)τ2 (1)
In the present specification, a coordinate conversion matrix is indicated by the capital letter “C”. In each coordinate conversion matrix, a subscript character indicates a coordinate system before coordinate conversion, and a superscript character indicates a coordinate system after the coordinate conversion. For example, “Cbe” indicates a coordinate conversion matrix from the local coordinate system (B frame) into the absolute coordinate system (E frame).
The left side of Equation (1) indicates an attitude at the time point t+τ2. C(t) indicates a rotation matrix of an attitude at the time point t. Cchange indicates an attitude change between the time point t and the time point t+τ2. The negative term of the right side of Equation (1) indicates influence of the rotation of the Earth. The influence of the rotation of the Earth may be omitted.
Cchange of Equation (1) can be expressed by Equation (2).
C
change=exp([αibb(t+τ1)]×)exp([αibb(t+2τ1)]×) . . . exp([αibb(t+kτ1)]×) (2)
In Equation (2), τ1 is 1/f1, and k is an integer satisfying (f1/f2)−1<k≦f1/f2. In the present specification, the base e=2.781 . . . of a natural logarithm, raised to the power of d is indicated by “exp(d)” (where d is any value, matrix, expression, or the like). In the present specification, exp([α(t+nτ1)]×) is referred to as a coordinate conversion matrix. Equation (2) indicates that attitude changes are calculated for each second cycle τ2 by multiplying a total number k of coordinate conversion matrices which are calculated at intervals of the first cycle τ1 in the period of the second cycle τ2 by each other.
In Equation (2), α(t+n′τ1) is a matrix obtained from angular velocity, and satisfies the following Equation (3). Here, n is an integer satisfying 1≦n≦k.
αibb(t±nτ1)=ωibb(t+nτ1)τi (3)
The right side of Equation (3) is to express a rotation angle between the I frame and the B frame in the B frame at the time point (t+nτ1), and is angular velocity obtained from a detected value of the gyro sensor 13. Thus, the matrix ([α(t+nτ1)]×) of the right side of Equation (2) is a matrix obtained from angular velocity, and is as in the following Equations (4-1) and (4-2).
As expressed in Equation (4-2), each element of the right side of Equation (4-1) is a value obtained by applying the first cycle τ1 to a value which is obtained by correcting a detected value for each axis of the gyro sensor at the time point (t+nτ1) with a gyro bias.
Here, in order to calculate exp(α), first-order to third-order approximation expressed in the following Equations (5) to (7) may be used.
In an exp(α) calculation portion 137, any one of approximate calculation of Equations (5) to (7) is selected by a control signal SelApp which is set in a register (not illustrated) on the basis of a write command of the command decoder 114A illustrated in
Among operations of the attitude change calculation unit 113 illustrated in
In step ST3 of
Next, step ST6 of
The calculation operation of attitude changes illustrated in
The velocity/position calculation unit 126 of
Next, the following (9) is calculated by using the acceleration obtained from Equation (8) and velocity obtained in the past, and thus velocity in the E frame is obtained. Here, Vebe(t) is to express velocity in the B frame for the E frame at a time point t, in the E frame. In addition, Equation (9) takes into consideration the gravity and the rotation of the Earth in the third and fourth terms of the right side.
V
eb
e(t+τi)=vebe(t)+[fibe(t+τi)+gbe−2Ωieevebe(t)]τi (9)
Next, the following Equation (10) is calculated by using a mean value of the present velocity obtained from Equation (9) and velocity obtained in the past, and a previously obtained position, and thus a position in the E frame is obtained.
Here, for example, in a case where both operations of calculating an attitude and a position by integrating angular velocity are performed at a frequency of 500 Hz in the processing section 100 illustrated in
As a comparative example of a method of reducing a load on the processing section 100, averaging will be described. As in the following Equation (11), angular velocities corresponding to a plurality of data items (a plurality of cycles) are added together without multiplication. This is referred to as averaging. As shown in Equation (11), a single coordinate conversion matrix is not computed every first cycle τ1, but a coordinate conversion matrix is computed by using a matrix which is obtained by adding angular velocities during a predetermined period (from τ3 to nτ3). In this comparative example, since angular velocities of cycles of n=5 are averaged, calculation following computation of exp(α) is performed at f=100 Hz, and thus a computation load can be reduced. In Equation (11), τ3 indicates a third cycle, and is τ3=1/f.
C
b
e(t+nτ3)=Cbe(t)exp([αibb(t+τ3)+αibb(t+2τ3)+ . . . +αibb(t+5τ3)]×) (11)
The averaging of Equation (11) has few errors and can be suitably used in a case where a vehicle or the like which changes relatively a little in angular velocity for a short time is a moving object. However, since a moving object which walks and moves as in the present embodiment has relatively great changes in angular velocity for a short time, it has been found that errors of the averaging are considerable, and attitude calculation accuracy is insufficient.
In the present example employed in
Embodiments to which the invention is applicable are not limited to the above-described embodiment, and may be modified as appropriate within the scope without departing from the invention. Hereinafter, Modification Examples will be described. In addition, the same constituent elements as in the above-described embodiment are given the same reference numerals, and repeated description will be omitted.
In addition, since the attitude update unit 124 is also configured by hardware, the second frequency f2 can be set to 1 kHz which is considerably higher than 20 Hz in the above-described embodiment, and thus attitude update can also be performed with high accuracy.
In the above-described embodiment, an example in which the position calculation apparatus 1 includes a function of an attitude calculation apparatus has been described, but the attitude calculation apparatus may be configured as a standalone apparatus. For example, the attitude calculation apparatus may include the gyro sensor 13, the gyro sensor IC 14, and the attitude update unit 124.
In the above-described embodiment, an example in which the attitude change calculation unit 113 is configured by hardware has been described, but the attitude change calculation unit 113 may be configured by software. In this case, the attitude change calculation unit 113 may be configured as part of the processing section 100.
In the above-described embodiment, an example in which the position calculation apparatus 1 includes the GPS sensor 15 has been described, but the GPS sensor may be omitted.
6-5. Moving object
In the above-described embodiment, an example in which a human is a moving object has been described, but a moving object is not limited to a human. In a case where an error of an attitude or a position calculated by applying averaging is not allowable, applying the invention to the case is effective. For example, a living body may be an animal other than a human. Actions of a moving object are not limited to walking or running, and may be jumping, swimming, sliding, flying, and the like. As examples of moving objects which move by using energy of a living body as power source, there are skis, skates, bicycles, hang gliders, boats, sleighs, and the like. The IMU 10 may be mounted on a living body, and may be mounted on a moving object which moves by using energy of a living body as a power source.
It can be easily understood by a person skilled in the art that a lot of modifications can occur without substantially departing from the novel matters and the effects of the invention. Therefore, these modification examples are intended to be included in the scope of the invention. For example, a term which is described at least once along with another term with a broader meaning than or the same meaning as the term may be replaced with another term in any location of the specification or the drawings. In addition, the first and second coordinate systems are not limited to three dimensions, and may be two dimensions.
The entire disclosure of Japanese Patent Application No. 2013-233373, filed Nov. 11, 2013 is expressly incorporated by reference herein.
Number | Date | Country | Kind |
---|---|---|---|
2013-233373 | Nov 2013 | JP | national |