A kind of multiple stage filtering method and device and equipment based on gyroscope acceleration

文档序号:1770592 发布日期:2019-12-03 浏览:15次 中文

阅读说明:本技术 一种基于陀螺仪加速度的多级滤波方法和装置以及设备 (A kind of multiple stage filtering method and device and equipment based on gyroscope acceleration ) 是由 欧阳满玉 刘凯 李友余 张严林 于 2019-08-01 设计创作,主要内容包括:本发明公开了一种基于陀螺仪加速度的多级滤波方法装置以及设备。其中,所述方法包括:通过算术平均值滤波算法,计算通过陀螺仪采集机器人在行走时的三轴加速度数据的算术平均值,根据该计算得到的算术平均值,采用忽略值滤波算法,通过忽略该三轴加速度数据的剧烈变化的忽略值得到忽略值结果,以及根据该得到的忽略值结果,判断该忽略值结果是否为0,在判断出该忽略值结果是不为0时,将该忽略值进行减1操作,在判断出该忽略值结果是0时,采用限幅滤波算法,对该三轴加速度数据进行限幅滤波。通过上述方式,能够实现通过无需做浮点运算的滤波算法,采用不带浮点运算单元的单片机亦能够实现对机器人的行走方向进行实时控制。(The invention discloses a kind of multiple stage filtering method devices and equipment based on gyroscope acceleration.Wherein, the described method includes: passing through arithmetic mean of instantaneous value filtering algorithm, calculate the arithmetic mean of instantaneous value that the 3-axis acceleration data of robot when walking are acquired by gyroscope, the arithmetic mean of instantaneous value being calculated according to this, using ignoring value filtering algorithm, value of ignoring by ignoring the acute variation of the 3-axis acceleration data obtains ignoring value result, and ignore value result according to what this was obtained, judge whether the value of the ignoring result is 0, the value of ignoring is being judged the result is that when being not 0, the value of ignoring is carried out subtracting 1 operation, the value of ignoring is being judged the result is that when 0, using limit filtration algorithm, limit filtration is carried out to the 3-axis acceleration data.By the above-mentioned means, can be realized through the filtering algorithm without doing floating-point operation, it also can be realized using the single-chip microcontroller without FPU Float Point Unit and real-time control carried out to the direction of travel of robot.)

1. a kind of multiple stage filtering method based on gyroscope acceleration characterized by comprising

The 3-axis acceleration data of robot when walking are acquired by gyroscope;

The 3-axis acceleration data of robot when walking are acquired by gyroscope according to described, are calculated by arithmetic average value filtering Method calculates the arithmetic mean of instantaneous value that the 3-axis acceleration data of robot when walking are acquired by gyroscope;

It is turned to by ignoring robot in walking according to the arithmetic mean of instantaneous value being calculated using value filtering algorithm is ignored When the values of ignoring of acute variation of 3-axis acceleration data obtain ignoring value result;

According to it is described obtain ignore value as a result, what is obtained described in judgement ignores whether value result is 0, obtain described in judging Ignore value the result is that when for 0, the obtained value of ignoring is carried out subtracting 1 operation, judge it is described obtain ignore value The result is that using limit filtration algorithm, acquiring the 3-axis acceleration data of robot when walking by gyroscope to described when 0 Carry out limit filtration.

2. the multiple stage filtering method as described in claim 1 based on gyroscope acceleration, which is characterized in that described according to Robot 3-axis acceleration data when walking are acquired by gyroscope, by arithmetic mean of instantaneous value filtering algorithm, described in calculating The arithmetic mean of instantaneous value of the 3-axis acceleration data of robot when walking is acquired by gyroscope, comprising:

The 3-axis acceleration data of robot when walking are acquired by gyroscope according to described, by passing through gyro described in acquisition Instrument acquires newest ten data in the 3-axis acceleration data of robot when walking, by newest ten of the acquisition Data remove maximum value and minimum value, remove the sum of eight data of residue of maximum value and minimum value described in calculating, then move to right three The arithmetic mean of instantaneous value filtering algorithm of position calculates the arithmetic mean of instantaneous value of remaining eight data, and calculating is described to be adopted by gyroscope Collect the arithmetic mean of instantaneous value of the 3-axis acceleration data of robot when walking.

3. the multiple stage filtering method as described in claim 1 based on gyroscope acceleration, which is characterized in that described according to The arithmetic mean of instantaneous value being calculated is accelerated by ignoring robot in three axis when turning to of walking using value filtering algorithm is ignored The value of ignoring of the acute variation of degree evidence obtains ignoring value result, comprising:

According to the arithmetic mean of instantaneous value being calculated, using setting preset value as the number ignored, the corresponding meter of setting The robot of obtained arithmetic mean of instantaneous value is the number ignored in the value of ignoring when turning to of walking, and uses and ignore value filter Wave algorithm obtains ignoring value by ignoring robot in the value of ignoring of the acute variation for 3-axis acceleration data when turning to of walking As a result.

4. the multiple stage filtering method as described in claim 1 based on gyroscope acceleration, which is characterized in that described according to What is obtained ignores value as a result, what is obtained described in judgement ignores whether value result is 0, and what is obtained described in judge ignores value result When being not for 0, the obtained value of ignoring is carried out subtracting 1 operation, judge it is described obtain ignore value the result is that adopting when 0 With limit filtration algorithm, the 3-axis acceleration data progress clipping filter of robot when walking is acquired by gyroscope to described Wave, comprising:

According to it is described obtain ignore value as a result, what is obtained described in judgement ignores whether value result is 0, obtain described in judging Ignore value the result is that when for 0, the obtained value of ignoring is carried out subtracting 1 operation, judge it is described obtain ignore value The result is that the numerical value for being greater than a upper average value using the current average in the arithmetic mean of instantaneous value being calculated is super when 0 When crossing preset threshold value, the current average is replaced with a upper average value or with a upper average value and upper The difference of one average value replaces the limit filtration algorithm of the current average, is existed to described by gyroscope acquisition robot 3-axis acceleration data when walking carry out limit filtration.

5. the multiple stage filtering method as described in claim 1 based on gyroscope acceleration, which is characterized in that described according to institute That states ignores value as a result, what is obtained described in judgement ignores whether value result is 0, is judging that the obtained value of ignoring ties When fruit is not for 0, the obtained value of ignoring is carried out subtracting 1 operation, judge it is described obtain ignore value the result is that when 0, Using limit filtration algorithm, the 3-axis acceleration data progress clipping filter of robot when walking is acquired by gyroscope to described After wave, further includes:

3-axis acceleration data after the progress limit filtration are optimized, calculating with described for predetermined number is retained The immediate 3-axis acceleration data of the arithmetic mean of instantaneous value arrived.

6. a kind of multiple-stage filtering device based on gyroscope acceleration characterized by comprising

Acquisition module, ignores module and judgment module at computing module;

The acquisition module, for acquiring the 3-axis acceleration data of robot when walking by gyroscope;

The computing module leads to for acquiring the 3-axis acceleration data of robot when walking by gyroscope according to described Arithmetic mean of instantaneous value filtering algorithm is crossed, the calculation for acquiring the 3-axis acceleration data of robot when walking by gyroscope is calculated Art average value;

Described to ignore module, for being calculated according to the arithmetic mean of instantaneous value, using value filtering algorithm is ignored, by ignoring Robot obtains ignoring value result in the value of ignoring of the acute variation for 3-axis acceleration data when turning to of walking;

The judgment module, for obtained according to ignore value as a result, judgement described in obtain ignore value result whether be 0, judge it is described obtain ignore value the result is that when being not 0, the obtained value of ignoring is carried out subtracting 1 operation, is being judged Out it is described obtain ignore value the result is that using limit filtration algorithm, walking to described by gyroscope acquisition robot when 0 When 3-axis acceleration data carry out limit filtration.

7. as claimed in claim 6 based on the multiple-stage filtering device of gyroscope acceleration, which is characterized in that the calculating mould Block is specifically used for:

The 3-axis acceleration data of robot when walking are acquired by gyroscope according to described, by passing through gyro described in acquisition Instrument acquires newest ten data in the 3-axis acceleration data of robot when walking, by newest ten of the acquisition Data remove maximum value and minimum value, remove the sum of eight data of residue of maximum value and minimum value described in calculating, then move to right three The arithmetic mean of instantaneous value filtering algorithm of position calculates the arithmetic mean of instantaneous value of remaining eight data, and calculating is described to be adopted by gyroscope Collect the arithmetic mean of instantaneous value of the 3-axis acceleration data of robot when walking.

8. as claimed in claim 6 based on the multiple-stage filtering device of gyroscope acceleration, which is characterized in that described to ignore mould Block is specifically used for:

According to the arithmetic mean of instantaneous value being calculated, using setting preset value as the number ignored, the corresponding meter of setting The robot of obtained arithmetic mean of instantaneous value is the number ignored in the value of ignoring when turning to of walking, and uses and ignore value filter Wave algorithm obtains ignoring value by ignoring robot in the value of ignoring of the acute variation for 3-axis acceleration data when turning to of walking As a result.

9. as claimed in claim 6 based on the multiple-stage filtering device of gyroscope acceleration, which is characterized in that the judgement mould Block is specifically used for:

According to it is described obtain ignore value as a result, what is obtained described in judgement ignores whether value result is 0, obtain described in judging Ignore value the result is that when for 0, the obtained value of ignoring is carried out subtracting 1 operation, judge it is described obtain ignore value The result is that the numerical value for being greater than a upper average value using the current average in the arithmetic mean of instantaneous value being calculated is super when 0 When crossing preset threshold value, the current average is replaced with a upper average value or with a upper average value and upper The difference of one average value replaces the limit filtration algorithm of the current average, is existed to described by gyroscope acquisition robot 3-axis acceleration data when walking carry out limit filtration.

10. as claimed in claim 6 based on the multiple-stage filtering device of gyroscope acceleration, which is characterized in that described to be based on top The multiple-stage filtering device of spiral shell instrument acceleration, further includes:

Optimization module;

The optimization module retains default for optimizing to the 3-axis acceleration data after the progress limit filtration Number with the immediate 3-axis acceleration data of the arithmetic mean of instantaneous value being calculated.

Technical field

The present invention relates to gyroscope technology field more particularly to a kind of multiple stage filtering method based on gyroscope acceleration and Device and equipment.

Background technique

Robot when walking, if necessary to control direction, usually first acquires 3-axis acceleration number with gyroscope According to the mode for carrying out data fusion again with three axis angular rate data, to control the direction of travel of robot.Gyroscope exists When acquiring the 3-axis acceleration data of robot, there are biggish random errors, generally use Kalman filtering, single order complementation filter The filtering algorithms such as wave, second order complementary filter compensate.The Kalman filtering of the use, single order complementary filter, second order complementation filter The mode that the filtering algorithms such as wave compensate can preferably compensate the random error, but the Kalman of the use The filtering algorithms such as filtering, single order complementary filter, second order complementary filter need to do a large amount of floating-point operation can be to this with chance error Difference compensates, if using the single-chip microcontroller without FPU (Float Point Unit, FPU Float Point Unit), it is difficult to realization pair The random error carries out real-time compensation, leads to not realize the direction of travel progress real-time control to robot.

But at least there are the following problems in the prior art for inventor's discovery:

The existing filters solutions based on gyroscope acceleration, usually first acquire 3-axis acceleration data and three with gyroscope Axis angular rate data carry out the mode of data fusion again, and to control the direction of travel of robot, gyroscope is in harvester When the 3-axis acceleration data of device people, there are biggish random errors, generally use Kalman filtering, single order complementary filter, two The filtering algorithms such as rank complementary filter compensate, the filter such as Kalman filtering, single order complementary filter, second order complementary filter of the use Wave algorithm, which needs to do a large amount of floating-point operation, to compensate the random error, if using without FPU Float Point Unit Single-chip microcontroller, cannot achieve and real-time control is carried out to the direction of travel of robot.

Summary of the invention

In view of this, it is an object of the invention to propose a kind of multiple stage filtering method and device based on gyroscope acceleration And equipment, it can be realized by the filtering algorithm without doing floating-point operation, also using the single-chip microcontroller without FPU Float Point Unit It can be realized and real-time control is carried out to the direction of travel of robot.

According to an aspect of the present invention, a kind of multiple stage filtering method based on gyroscope acceleration is provided, comprising:

The 3-axis acceleration data of robot when walking are acquired by gyroscope;

The 3-axis acceleration data of robot when walking are acquired by gyroscope according to described, are filtered by arithmetic mean of instantaneous value Wave algorithm calculates the arithmetic mean of instantaneous value that the 3-axis acceleration data of robot when walking are acquired by gyroscope;

It is being walked using value filtering algorithm is ignored by ignoring robot according to the arithmetic mean of instantaneous value being calculated The value of ignoring of the acute variation of 3-axis acceleration data when steering obtains ignoring value result;

According to it is described obtain ignore value as a result, what is obtained described in judgement ignores whether value result is 0, described in judge What is obtained ignores value the result is that when for 0, carries out subtracting 1 operation for the obtained value of ignoring, judge it is described obtain neglect Slightly value, using limit filtration algorithm, acquires the 3-axis acceleration of robot when walking by gyroscope to described the result is that when 0 Data carry out limit filtration.

Wherein, described that the 3-axis acceleration data of robot when walking are acquired by gyroscope according to, pass through calculation It is flat to calculate the arithmetic for acquiring the 3-axis acceleration data of robot when walking by gyroscope for art average value filtering algorithm Mean value, comprising:

The 3-axis acceleration data of robot when walking are acquired by gyroscope according to described, by passing through described in acquisition Gyroscope acquires newest ten data in the 3-axis acceleration data of robot when walking, by the newest of the acquisition Ten data remove maximum value and minimum value, remove the sum of eight data of residue of maximum value and minimum value described in calculating, then right Three arithmetic mean of instantaneous value filtering algorithms are moved, the arithmetic mean of instantaneous value of remaining eight data is calculated, passes through gyro described in calculating Instrument acquires the arithmetic mean of instantaneous value of the 3-axis acceleration data of robot when walking.

Wherein, the arithmetic mean of instantaneous value being calculated according to, using value filtering algorithm is ignored, by ignoring machine People obtains ignoring value result in the value of ignoring of the acute variation for 3-axis acceleration data when turning to of walking, comprising:

Corresponding institute is set using setting preset value as the number ignored according to the arithmetic mean of instantaneous value being calculated The robot for the arithmetic mean of instantaneous value being calculated is stated in the number ignoring value and ignoring for described in when turning to of walking, and uses and ignores Value filtering algorithm is neglected by ignoring robot in the value of ignoring of the acute variation for 3-axis acceleration data when turning to of walking Slightly it is worth result.

Wherein, it is described obtained according to ignore value as a result, judgement described in obtain ignore whether value result is 0, In Judge it is described obtain ignore value the result is that when not being 0, the obtained value of ignoring is carried out subtracting 1 operation, judging That states ignores value the result is that when 0, using limit filtration algorithm, acquires robot when walking by gyroscope to described 3-axis acceleration data carry out limit filtration, comprising:

According to it is described obtain ignore value as a result, what is obtained described in judgement ignores whether value result is 0, described in judge What is obtained ignores value the result is that when for 0, carries out subtracting 1 operation for the obtained value of ignoring, judge it is described obtain neglect Slightly value is greater than the number of a upper average value using the current average in the arithmetic mean of instantaneous value being calculated the result is that when 0 When value is more than preset threshold value, replace the current average with a upper average value or with a upper average value and The difference of a upper average value replaces the limit filtration algorithm of the current average, acquires machine by gyroscope to described The 3-axis acceleration data of people when walking carry out limit filtration.

Wherein, it is described obtained according to ignore value as a result, judgement described in obtain ignore whether value result is 0, Judge it is described obtain ignore value the result is that when being not 0, the obtained value of ignoring is carried out subtracting 1 operation, is being judged It is described obtain ignore value the result is that using limit filtration algorithm, acquiring robot when walking by gyroscope to described when 0 3-axis acceleration data carry out limit filtration after, further includes:

3-axis acceleration data after the progress limit filtration are optimized, it is retaining predetermined number with the meter The immediate 3-axis acceleration data of obtained arithmetic mean of instantaneous value.

According to another aspect of the present invention, a kind of multiple-stage filtering device based on gyroscope acceleration is provided, comprising:

Acquisition module, ignores module and judgment module at computing module;

The acquisition module, for acquiring the 3-axis acceleration data of robot when walking by gyroscope;

The computing module, for acquiring the 3-axis acceleration number of robot when walking by gyroscope according to described According to by arithmetic mean of instantaneous value filtering algorithm, calculating is described to acquire the 3-axis acceleration number of robot when walking by gyroscope According to arithmetic mean of instantaneous value;

Described to ignore module, for being calculated according to the arithmetic mean of instantaneous value is passed through using value filtering algorithm is ignored The value of ignoring for ignoring robot in the acute variation for 3-axis acceleration data when turning to of walking obtains ignoring value result;

The judgment module, for obtained according to ignore value as a result, judgement described in obtain ignore value the result is that No is 0, judge it is described obtain ignore value the result is that when being not 0, the obtained value of ignoring is carried out subtracting 1 operation, In Judge it is described obtain ignore value the result is that using limit filtration algorithm, existing to described by gyroscope acquisition robot when 0 3-axis acceleration data when walking carry out limit filtration.

Wherein, the computing module, is specifically used for:

The 3-axis acceleration data of robot when walking are acquired by gyroscope according to described, by passing through described in acquisition Gyroscope acquires newest ten data in the 3-axis acceleration data of robot when walking, by the newest of the acquisition Ten data remove maximum value and minimum value, remove the sum of eight data of residue of maximum value and minimum value described in calculating, then right Three arithmetic mean of instantaneous value filtering algorithms are moved, the arithmetic mean of instantaneous value of remaining eight data is calculated, passes through gyro described in calculating Instrument acquires the arithmetic mean of instantaneous value of the 3-axis acceleration data of robot when walking.

Wherein, described to ignore module, it is specifically used for:

Corresponding institute is set using setting preset value as the number ignored according to the arithmetic mean of instantaneous value being calculated The robot for the arithmetic mean of instantaneous value being calculated is stated in the number ignoring value and ignoring for described in when turning to of walking, and uses and ignores Value filtering algorithm is neglected by ignoring robot in the value of ignoring of the acute variation for 3-axis acceleration data when turning to of walking Slightly it is worth result.

Wherein, the judgment module, is specifically used for:

According to it is described obtain ignore value as a result, what is obtained described in judgement ignores whether value result is 0, described in judge What is obtained ignores value the result is that when for 0, carries out subtracting 1 operation for the obtained value of ignoring, judge it is described obtain neglect Slightly value is greater than the number of a upper average value using the current average in the arithmetic mean of instantaneous value being calculated the result is that when 0 When value is more than preset threshold value, replace the current average with a upper average value or with a upper average value and The difference of a upper average value replaces the limit filtration algorithm of the current average, acquires machine by gyroscope to described The 3-axis acceleration data of people when walking carry out limit filtration.

Wherein, the multiple-stage filtering device based on gyroscope acceleration, further includes:

Optimization module;

The optimization module retains for optimizing to the 3-axis acceleration data after the progress limit filtration Predetermined number with the immediate 3-axis acceleration data of the arithmetic mean of instantaneous value being calculated.

According to a further aspect of the invention, a kind of multiple-stage filtering device based on gyroscope acceleration is provided, comprising:

At least one processor;And

The memory being connect at least one described processor communication;Wherein,

The memory is stored with the instruction that can be executed by least one described processor, and described instruction is by described at least one A processor executes so that at least one described processor be able to carry out it is described in any of the above embodiments based on gyroscope acceleration Multiple stage filtering method.

According to a further aspect of the invention, a kind of computer readable storage medium is provided, computer program is stored with, institute It states and realizes the multiple stage filtering method described in any of the above embodiments based on gyroscope acceleration when computer program is executed by processor.

It can be found that above scheme, can acquire the 3-axis acceleration data of robot when walking by gyroscope, and The 3-axis acceleration data of robot when walking can be acquired by gyroscope according to this, be calculated by arithmetic average value filtering Method calculates the arithmetic mean of instantaneous value that the 3-axis acceleration data of robot when walking are acquired by gyroscope, and can basis The arithmetic mean of instantaneous value being calculated is added by ignoring robot in three axis when turning to of walking using value filtering algorithm is ignored The acute variation of speed data ignore value obtain ignoring value as a result, and can be obtained according to this ignore value as a result, judgement What this was obtained ignores whether value result is 0, is judging that this obtained ignore value the result is that ignoring when being not 0 by what this was obtained Value carries out subtracting 1 operation, ignores value the result is that using limit filtration algorithm, passing through gyroscope to this when 0 judge that this obtains It acquires the 3-axis acceleration data of robot when walking and carries out limit filtration, can be realized through the filter without doing floating-point operation Wave algorithm also can be realized using the single-chip microcontroller without FPU Float Point Unit and carry out real-time control to the direction of travel of robot.

Further, above scheme can acquire the 3-axis acceleration of robot when walking by gyroscope according to this Data acquire newest ten stroke count in robot 3-axis acceleration data when walking by obtaining this by gyroscope According to newest ten data of the acquisition are removed maximum value and minimum value, calculate the residue for removing maximum value and minimum value The sum of eight data, then three arithmetic mean of instantaneous value filtering algorithms are moved to right, the arithmetic mean of instantaneous value of eight data of residue is calculated, is counted The arithmetic mean of instantaneous value that the 3-axis acceleration data of robot when walking are acquired by gyroscope is calculated, such benefit is can Realize that the arithmetic that the 3-axis acceleration data of robot when walking are acquired by gyroscope can be acquired by being not necessarily to floating-point operation Average value can reduce this and pass through gyroscope existing random error when acquiring the 3-axis acceleration data of robot.

Further, above scheme, the arithmetic mean of instantaneous value that can be calculated according to this are used as using setting preset value and are neglected Number slightly, it is what this was ignored that ignore value of the robot of the corresponding arithmetic mean of instantaneous value being calculated when walking steering, which is arranged, Number, and using value filtering algorithm is ignored, by ignoring robot in the violent change of 3-axis acceleration data when turning to of walking The value of ignoring changed obtains ignoring value as a result, such benefit is that by by using value filtering algorithm is ignored, and realization is ignored Robot turns to the acute variation of brief acceleration data in walking, ensures that this acquires three of robot when walking by gyroscope The stability and accuracy of axle acceleration data.

Further, above scheme, can be obtained according to this ignore value as a result, judge that this obtains ignore value the result is that No is 0, ignores value the result is that when being not 0 judge that this obtains, and the value of ignoring that this is obtained carries out subtracting 1 operation, is being judged What this was obtained out ignore value the result is that being greater than upper one using the current average in the arithmetic mean of instantaneous value being calculated when 0 When the numerical value of average value is more than preset threshold value, the current average is replaced with an average value on this or is averaged with one on this Value replaces the limit filtration algorithm of the current average with the difference of a upper average value, acquires machine by gyroscope to this The 3-axis acceleration data of people when walking carry out limit filtration, and such benefit, which is that by, avoids this from adopting by gyroscope The unusual fluctuations of the 3-axis acceleration data of the robot of collection when walking, robot should be acquired by gyroscope by further ensureing The stability and accuracy of 3-axis acceleration data when walking.

Further, above scheme can optimize the 3-axis acceleration data after the carry out limit filtration, protect Stay predetermined number with the immediate 3-axis acceleration data of the arithmetic mean of instantaneous value being calculated, such benefit is can be real Now improve the stability and accuracy that the 3-axis acceleration data of robot when walking are acquired by gyroscope.

Detailed description of the invention

In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.

Fig. 1 is the flow diagram of one embodiment of multiple stage filtering method the present invention is based on gyroscope acceleration;

Fig. 2 is that the present invention is based on the flow diagrams of another embodiment of the multiple stage filtering method of gyroscope acceleration;

Fig. 3 is the structural schematic diagram of one embodiment of multiple-stage filtering device the present invention is based on gyroscope acceleration;

Fig. 4 is the structural schematic diagram of another embodiment of multiple-stage filtering device the present invention is based on gyroscope acceleration;

Fig. 5 is the structural schematic diagram of one embodiment of multiple-stage filtering device the present invention is based on gyroscope acceleration.

Specific embodiment

With reference to the accompanying drawings and examples, the present invention is described in further detail.It is emphasized that following implement Example is merely to illustrate the present invention, but is not defined to the scope of the present invention.Likewise, following embodiment is only portion of the invention Point embodiment and not all embodiments, institute obtained by those of ordinary skill in the art without making creative efforts There are other embodiments, shall fall within the protection scope of the present invention.

The present invention provides a kind of multiple stage filtering method based on gyroscope acceleration, can be realized by without doing floating-point fortune The filtering algorithm of calculation also can be realized using the single-chip microcontroller without FPU Float Point Unit and carry out in real time to the direction of travel of robot Control.

Referring to Figure 1, Fig. 1 is the process signal of one embodiment of multiple stage filtering method the present invention is based on gyroscope acceleration Figure.It is noted that if having substantially the same as a result, method of the invention is not limited with process sequence shown in FIG. 1.Such as Shown in Fig. 1, this method comprises the following steps:

S101: the 3-axis acceleration data of robot when walking are acquired by gyroscope.

In the present embodiment, the gyroscope can be with the moment of momentum sensitivity shell relative inertness space of high-speed rotator around It is orthogonal to the angular movement detection device of one or two axis of the axis of rotation, is can be out using playing same function made of other principles The angular movement detection device of energy, the present invention are not limited.

S102: the 3-axis acceleration data of robot when walking are acquired by gyroscope according to this, pass through arithmetic average Value filtering algorithm calculates the arithmetic mean of instantaneous value that the 3-axis acceleration data of robot when walking are acquired by gyroscope.

Wherein, which should acquire the 3-axis acceleration data of robot when walking by gyroscope, flat by arithmetic Mean Filtering Algorithm calculates the arithmetic mean of instantaneous value that the 3-axis acceleration data of robot when walking are acquired by gyroscope, May include:

The 3-axis acceleration data of robot when walking are acquired by gyroscope according to this, pass through gyro by obtaining this Instrument acquires newest ten data in the 3-axis acceleration data of robot when walking, by newest ten stroke count of the acquisition According to maximum value and minimum value is removed, the sum of eight data of residue for removing maximum value and minimum value is calculated, then moves to right three Arithmetic mean of instantaneous value filtering algorithm calculates the arithmetic mean of instantaneous value of eight data of residue, and robot should be acquired by gyroscope by calculating The arithmetic mean of instantaneous value of 3-axis acceleration data when walking, such benefit is that by can acquire without floating-point operation This acquires the arithmetic mean of instantaneous value of the 3-axis acceleration data of robot when walking by gyroscope, can reduce this and passes through gyro Instrument existing random error when acquiring the 3-axis acceleration data of robot.

In the present embodiment, which can be acquired to the sampling frequency of the 3-axis acceleration data of robot when walking Rate is arranged to 500Hz (Hertz, hertz), i.e. 2ms (millisecond, millisecond) acquires three axis of a robot when walking Acceleration information, 20 milliseconds of ms acquire the 3-axis acceleration data of No. 10 robots when walking.It can in data space The 3-axis acceleration data of newest 10 robots when walking are stored to retain, which is being walked When 3-axis acceleration data remove maximum value and minimum value, calculate 8 data of residue for removing maximum value and minimum value With since 8 be precisely 2 cube, then move to right 3, do not need floating-point operation and can acquire this to acquire robot by gyroscope The arithmetic mean of instantaneous value of 3-axis acceleration data when walking can reduce this and be added by gyroscope in three axis for acquiring robot Existing random error when speed data.

S103: the arithmetic mean of instantaneous value being calculated according to this is expert at using value filtering algorithm is ignored by ignoring robot The value of ignoring for walking the acute variation of 3-axis acceleration data when turning to obtains ignoring value result.

Wherein, the arithmetic mean of instantaneous value being calculated according to this is existed using value filtering algorithm is ignored by ignoring robot The value of ignoring of the acute variation of 3-axis acceleration data when walking turns to obtains ignoring value as a result, may include:

The corresponding meter is arranged using setting preset value as the number ignored in the arithmetic mean of instantaneous value being calculated according to this The robot of obtained arithmetic mean of instantaneous value is the number ignored in the value of ignoring when turning to of walking, and uses and ignore value filtering Algorithm obtains ignoring value knot by ignoring robot in the value of ignoring of the acute variation for 3-axis acceleration data when turning to of walking Fruit, such benefit are that by by using value filtering algorithm is ignored, and robot acceleration when walking steering is ignored in realization The acute variation of degree evidence, ensure this by gyroscope acquire robot 3-axis acceleration data when walking stability and Accuracy.

In the present embodiment, robot should be acquired when the moment for changing direction of travel walking steering by gyroscope Robot 3-axis acceleration data when walking more violent variation, the violent change of the comparison of the corresponding generation can occur The 3-axis acceleration data of change must be abandoned, therefore preset value such as 3 can be set as the number ignored, in robot ambulation When steering, it is time ignored that ignore value of the robot of the corresponding arithmetic mean of instantaneous value being calculated when walking steering, which is arranged, Number, and using value filtering algorithm is ignored, by ignoring robot in the acute variation of 3-axis acceleration data when turning to of walking Value of ignoring obtain ignoring value result.

S104: ignore value as a result, judging that this obtained ignores whether value result is 0 according to what this was obtained, judging this What is obtained ignores value the result is that when for 0, and the value of ignoring that this is obtained carries out subtracting 1 operation, is judging that this obtained ignore value The result is that when 0, using limit filtration algorithm, to this by gyroscope acquire the 3-axis acceleration data of robot when walking into Row limit filtration.

Wherein, this ignores value as a result, judging that this obtained ignores whether value result is 0 according to what this was obtained, is judging What this was obtained ignore value the result is that when not being 0, and the value of ignoring that this is obtained carries out subtracting 1 operation, is judging that this obtained ignore Value is the result is that when 0, using limit filtration algorithm, to the 3-axis acceleration data by gyroscope acquisition robot when walking Limit filtration is carried out, may include:

Ignore value as a result, judging that this obtained ignores whether value result is 0 according to what this was obtained, is judging what this was obtained Ignore value the result is that when for 0, the value of ignoring that this is obtained carries out subtracting 1 operation, is judging that this obtained ignore value the result is that 0 When, it is more than preset threshold using the numerical value that the current average in the arithmetic mean of instantaneous value being calculated is greater than a upper average value When value, the current average is replaced with an average value on this or with the difference of an average value and a upper average value on this Instead of the limit filtration algorithm of the current average, the 3-axis acceleration number of robot when walking is acquired by gyroscope to this According to limit filtration is carried out, such benefit is that by three axis of the robot avoided this by gyroscope acquisition when walking The unusual fluctuations of acceleration information further ensure that this acquires the 3-axis acceleration data of robot when walking by gyroscope Stability and accuracy.

Wherein, ignore value as a result, judging that this obtained ignores whether value result is 0 according to what this was obtained at this, judging What this was obtained out ignore value the result is that when not being 0, and the value of ignoring that this is obtained carries out subtracting 1 operation, is judging that this obtained neglect Slightly value is the result is that when 0, using limit filtration algorithm, to the 3-axis acceleration number by gyroscope acquisition robot when walking After carrying out limit filtration, can also include:

3-axis acceleration data after the carry out limit filtration are optimized, retain predetermined number with the calculating The immediate 3-axis acceleration data of the arithmetic mean of instantaneous value arrived, such benefit are that by raising and should be acquired by gyroscope The stability and accuracy of the 3-axis acceleration data of robot when walking.

It can be found that in the present embodiment, the 3-axis acceleration number of robot when walking can be acquired by gyroscope According to, and the 3-axis acceleration data of robot when walking can be acquired by gyroscope according to this, it is filtered by arithmetic mean of instantaneous value Wave algorithm, calculates the arithmetic mean of instantaneous value that robot 3-axis acceleration data when walking are acquired by gyroscope, and can be with The arithmetic mean of instantaneous value being calculated according to this, using value filtering algorithm is ignored, by ignoring robot three when walking steering The acute variation of axle acceleration data ignore value obtain ignoring value as a result, and can be obtained according to this ignore value as a result, Judge that this obtained ignores whether value result is 0, is judging that this obtained ignore value the result is that obtaining this when being not 0 Ignore value and carry out subtracting 1 operation, ignores value the result is that using limit filtration algorithm, passing through top to this when 0 judge that this obtains Spiral shell instrument acquires the 3-axis acceleration data of robot when walking and carries out limit filtration, can be realized by without doing floating-point operation Filtering algorithm, also can be realized using the single-chip microcontroller without FPU Float Point Unit and the direction of travel of robot controlled in real time System.

Further, in the present embodiment, three axis of robot when walking can be acquired by gyroscope according to this to add Speed data acquires newest ten in robot 3-axis acceleration data when walking by obtaining this by gyroscope Newest ten data of the acquisition are removed maximum value and minimum value by data, are calculated this and are removed the surplus of maximum value and minimum value Remaining the sums of eight data, then move to right three arithmetic mean of instantaneous value filtering algorithms, calculates the arithmetic mean of instantaneous value of eight data of residue, The arithmetic mean of instantaneous value that the 3-axis acceleration data of robot when walking are acquired by gyroscope is calculated, such benefit is energy It is enough to realize that the calculation that the 3-axis acceleration data of robot when walking are acquired by gyroscope be acquired by being not necessarily to floating-point operation Art average value can reduce this and pass through gyroscope existing random error when acquiring the 3-axis acceleration data of robot.

Further, in the present embodiment, the arithmetic mean of instantaneous value that can be calculated according to this is made using setting preset value For the number ignored, it is that should neglect that ignore value of the robot of the corresponding arithmetic mean of instantaneous value being calculated when walking steering, which is arranged, Number slightly, and using value filtering algorithm is ignored, by ignoring robot in the play of 3-axis acceleration data when turning to of walking The value of ignoring of strong variation obtains ignoring value as a result, such benefit is that by by using ignoring value filtering algorithm, realizes Ignore the acute variation that robot turns to brief acceleration data in walking, robot should be acquired when walking by gyroscope by ensureing 3-axis acceleration data stability and accuracy.

Further, in the present embodiment, what can be obtained according to this ignores value as a result, judging that the obtained value of ignoring is tied Whether fruit is 0, ignores value the result is that when being not 0 judge that this obtains, and the value of ignoring that this is obtained carries out subtracting 1 operation, In That judges that this obtains ignores value the result is that being greater than using the current average in the arithmetic mean of instantaneous value being calculated upper when 0 When the numerical value of one average value is more than preset threshold value, the current average is replaced with an average value on this or with one on this The difference of average value and a upper average value replaces the limit filtration algorithm of the current average, is acquired to this by gyroscope The 3-axis acceleration data of robot when walking carry out limit filtration, and such benefit, which is that by, avoids this from passing through gyro The unusual fluctuations of the 3-axis acceleration data of the robot of instrument acquisition when walking, gyroscope harvester should be passed through by further ensureing The stability and accuracy of the 3-axis acceleration data of device people when walking.

Fig. 2 is referred to, Fig. 2 is that the present invention is based on the processes of another embodiment of the multiple stage filtering method of gyroscope acceleration to show It is intended to.In the present embodiment, method includes the following steps:

S201: the 3-axis acceleration data of robot when walking are acquired by gyroscope.

Can be as above described in S101, therefore not to repeat here.

S202: the 3-axis acceleration data of robot when walking are acquired by gyroscope according to this, pass through arithmetic average Value filtering algorithm calculates the arithmetic mean of instantaneous value that the 3-axis acceleration data of robot when walking are acquired by gyroscope.

Can be as above described in S102, therefore not to repeat here.

S203: the arithmetic mean of instantaneous value being calculated according to this is expert at using value filtering algorithm is ignored by ignoring robot The value of ignoring for walking the acute variation of 3-axis acceleration data when turning to obtains ignoring value result.

Can be as above described in S103, therefore not to repeat here.

S204: ignore value as a result, judging that this obtained ignores whether value result is 0 according to what this was obtained, judging this What is obtained ignores value the result is that when for 0, and the value of ignoring that this is obtained carries out subtracting 1 operation, is judging that this obtained ignore value The result is that when 0, using limit filtration algorithm, to this by gyroscope acquire the 3-axis acceleration data of robot when walking into Row limit filtration.

Can be as above described in S104, therefore not to repeat here.

S205: optimizing the 3-axis acceleration data after the carry out limit filtration, retain predetermined number with this The immediate 3-axis acceleration data of the arithmetic mean of instantaneous value being calculated.

It can be found that can be carried out to the 3-axis acceleration data after the carry out limit filtration excellent on the present embodiment Change, retain predetermined number with the immediate 3-axis acceleration data of the arithmetic mean of instantaneous value being calculated, such benefit is It can be realized and improve the stability and accuracy that acquire the 3-axis acceleration data of robot when walking by gyroscope.

The present invention also provides a kind of multiple-stage filtering device based on gyroscope acceleration, can be realized by without doing floating-point The filtering algorithm of operation also can be realized using the single-chip microcontroller without FPU Float Point Unit and carry out in fact to the direction of travel of robot When control.

Fig. 3 is referred to, Fig. 3 is the structural representation of one embodiment of multiple-stage filtering device the present invention is based on gyroscope acceleration Figure.In the present embodiment, it should include acquisition module 31 based on the multiple-stage filtering device 30 of gyroscope acceleration, computing module 32, neglect Slightly module 33 and judgment module 34.

The acquisition module 31, for acquiring the 3-axis acceleration data of robot when walking by gyroscope.

The computing module 32 should acquire the 3-axis acceleration data of robot when walking for basis by gyroscope, By arithmetic mean of instantaneous value filtering algorithm, the calculation that the 3-axis acceleration data of robot when walking are acquired by gyroscope is calculated Art average value.

This ignores module 33, the arithmetic mean of instantaneous value for being calculated according to this, using value filtering algorithm is ignored, by neglecting Slightly robot obtains ignoring value result in the value of ignoring of the acute variation for 3-axis acceleration data when turning to of walking.

The judgment module 34, for according to this obtain ignore value as a result, judge that this obtains ignore value result whether be 0, ignore value the result is that when being not 0 judge that this obtains, the value of ignoring that this is obtained carries out subtracting 1 operation, is judging this What is obtained ignores value the result is that using limit filtration algorithm, acquiring three axis of robot when walking by gyroscope to this when 0 Acceleration information carries out limit filtration.

Optionally, the computing module 32, can be specifically used for:

The 3-axis acceleration data of robot when walking are acquired by gyroscope according to this, pass through gyro by obtaining this Instrument acquires newest ten data in the 3-axis acceleration data of robot when walking, by newest ten stroke count of the acquisition According to maximum value and minimum value is removed, the sum of eight data of residue for removing maximum value and minimum value is calculated, then moves to right three Arithmetic mean of instantaneous value filtering algorithm calculates the arithmetic mean of instantaneous value of eight data of residue, and robot should be acquired by gyroscope by calculating The arithmetic mean of instantaneous value of 3-axis acceleration data when walking.

Optionally, this ignores module 33, can be specifically used for:

The corresponding meter is arranged using setting preset value as the number ignored in the arithmetic mean of instantaneous value being calculated according to this The robot of obtained arithmetic mean of instantaneous value is the number ignored in the value of ignoring when turning to of walking, and uses and ignore value filtering Algorithm obtains ignoring value knot by ignoring robot in the value of ignoring of the acute variation for 3-axis acceleration data when turning to of walking Fruit.

Optionally, the judgment module 34, can be specifically used for:

Ignore value as a result, judging that this obtained ignores whether value result is 0 according to what this was obtained, is judging what this was obtained Ignore value the result is that when for 0, the value of ignoring that this is obtained carries out subtracting 1 operation, is judging that this obtained ignore value the result is that 0 When, it is more than preset threshold using the numerical value that the current average in the arithmetic mean of instantaneous value being calculated is greater than a upper average value When value, the current average is replaced with an average value on this or with the difference of an average value and a upper average value on this Instead of the limit filtration algorithm of the current average, the 3-axis acceleration number of robot when walking is acquired by gyroscope to this According to progress limit filtration.

Fig. 4 is referred to, Fig. 4 is that the structure of another embodiment of multiple-stage filtering device the present invention is based on gyroscope acceleration is shown It is intended to.It is different from an embodiment, the multiple-stage filtering device 40 based on gyroscope acceleration described in the present embodiment further includes optimization Module 41.

The optimization module 41 retains pre- for optimizing to the 3-axis acceleration data after the carry out limit filtration If number with the immediate 3-axis acceleration data of the arithmetic mean of instantaneous value being calculated.

Each unit module of the multiple-stage filtering device 30/40 based on gyroscope acceleration can execute the above method respectively Step is corresponded in embodiment, therefore each unit module is not repeated herein, and the explanation of the above corresponding step is referred to.

The present invention provides a kind of multiple-stage filtering device based on gyroscope acceleration again, as shown in Figure 5, comprising: at least one A processor 51;And the memory 52 with the communication connection of at least one processor 51;Wherein, be stored with can quilt for memory 52 The instruction that at least one processor 51 executes, instruction is executed by least one processor 51, so that at least one 51 energy of processor Enough execute the above-mentioned multiple stage filtering method based on gyroscope acceleration.

Wherein, memory 52 is connected with processor 51 using bus mode, and bus may include any number of interconnection Bus and bridge, bus is by one or more processors 51 together with the various circuit connections of memory 52.Bus can also incite somebody to action Together with various other circuit connections of management circuit or the like, these are all abilities for such as peripheral equipment, voltage-stablizer Well known to domain, therefore, it will not be further described herein.Bus interface is provided between bus and transceiver and is connect Mouthful.Transceiver can be an element, is also possible to multiple element, such as multiple receivers and transmitter, provides for passing The unit communicated on defeated medium with various other devices.The data handled through processor 51 are carried out on the radio medium by antenna Transmission, further, antenna also receives data and transfers data to processor 51.

Processor 51 is responsible for management bus and common processing, can also provide various functions, including timing, periphery connects Mouthful, voltage adjusting, power management and other control functions.And memory 52 can be used for storage processor 51 and execute behaviour Used data when making.

The present invention provides a kind of computer readable storage medium again, is stored with computer program.Computer program is processed Device realizes above method embodiment when executing.

It can be found that above scheme, can acquire the 3-axis acceleration data of robot when walking by gyroscope, and The 3-axis acceleration data of robot when walking can be acquired by gyroscope according to this, be calculated by arithmetic average value filtering Method calculates the arithmetic mean of instantaneous value that the 3-axis acceleration data of robot when walking are acquired by gyroscope, and can basis The arithmetic mean of instantaneous value being calculated is added by ignoring robot in three axis when turning to of walking using value filtering algorithm is ignored The acute variation of speed data ignore value obtain ignoring value as a result, and can be obtained according to this ignore value as a result, judgement What this was obtained ignores whether value result is 0, is judging that this obtained ignore value the result is that ignoring when being not 0 by what this was obtained Value carries out subtracting 1 operation, ignores value the result is that using limit filtration algorithm, passing through gyroscope to this when 0 judge that this obtains It acquires the 3-axis acceleration data of robot when walking and carries out limit filtration, can be realized through the filter without doing floating-point operation Wave algorithm also can be realized using the single-chip microcontroller without FPU Float Point Unit and carry out real-time control to the direction of travel of robot.

Further, above scheme can acquire the 3-axis acceleration of robot when walking by gyroscope according to this Data acquire newest ten stroke count in robot 3-axis acceleration data when walking by obtaining this by gyroscope According to newest ten data of the acquisition are removed maximum value and minimum value, calculate the residue for removing maximum value and minimum value The sum of eight data, then three arithmetic mean of instantaneous value filtering algorithms are moved to right, the arithmetic mean of instantaneous value of eight data of residue is calculated, is counted The arithmetic mean of instantaneous value that the 3-axis acceleration data of robot when walking are acquired by gyroscope is calculated, such benefit is can Realize that the arithmetic that the 3-axis acceleration data of robot when walking are acquired by gyroscope can be acquired by being not necessarily to floating-point operation Average value can reduce this and pass through gyroscope existing random error when acquiring the 3-axis acceleration data of robot.

Further, above scheme, the arithmetic mean of instantaneous value that can be calculated according to this are used as using setting preset value and are neglected Number slightly, it is what this was ignored that ignore value of the robot of the corresponding arithmetic mean of instantaneous value being calculated when walking steering, which is arranged, Number, and using value filtering algorithm is ignored, by ignoring robot in the violent change of 3-axis acceleration data when turning to of walking The value of ignoring changed obtains ignoring value as a result, such benefit is that by by using value filtering algorithm is ignored, and realization is ignored Robot turns to the acute variation of brief acceleration data in walking, ensures that this acquires three of robot when walking by gyroscope The stability and accuracy of axle acceleration data.

Further, above scheme, can be obtained according to this ignore value as a result, judge that this obtains ignore value the result is that No is 0, ignores value the result is that when being not 0 judge that this obtains, and the value of ignoring that this is obtained carries out subtracting 1 operation, is being judged What this was obtained out ignore value the result is that being greater than upper one using the current average in the arithmetic mean of instantaneous value being calculated when 0 When the numerical value of average value is more than preset threshold value, the current average is replaced with an average value on this or is averaged with one on this Value replaces the limit filtration algorithm of the current average with the difference of a upper average value, acquires machine by gyroscope to this The 3-axis acceleration data of people when walking carry out limit filtration, and such benefit, which is that by, avoids this from adopting by gyroscope The unusual fluctuations of the 3-axis acceleration data of the robot of collection when walking, robot should be acquired by gyroscope by further ensureing The stability and accuracy of 3-axis acceleration data when walking.

Further, above scheme can optimize the 3-axis acceleration data after the carry out limit filtration, protect Stay predetermined number with the immediate 3-axis acceleration data of the arithmetic mean of instantaneous value being calculated, such benefit is can be real Now improve the stability and accuracy that the 3-axis acceleration data of robot when walking are acquired by gyroscope.

In several embodiments provided by the present invention, it should be understood that disclosed system, device and method can To realize by another way.For example, device embodiments described above are only schematical, for example, module or The division of unit, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units Or component can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, institute Display or the mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, device or unit Indirect coupling or communication connection can be electrical property, mechanical or other forms.

Unit may or may not be physically separated as illustrated by the separation member, shown as a unit Component may or may not be physical unit, it can and it is in one place, or may be distributed over multiple networks On unit.It can select some or all of unit therein according to the actual needs to realize the mesh of present embodiment scheme 's.

In addition, each functional unit in each embodiment of the present invention can integrate in one processing unit, it can also To be that each unit physically exists alone, can also be integrated in one unit with two or more units.It is above-mentioned integrated Unit both can take the form of hardware realization, can also realize in the form of software functional units.

It, can if integrated unit is realized in the form of SFU software functional unit and when sold or used as an independent product To be stored in a computer readable storage medium.Based on this understanding, technical solution of the present invention substantially or Say that all or part of the part that contributes to existing technology or the technical solution can embody in the form of software products Out, which is stored in a storage medium, including some instructions are used so that a computer equipment (can be personal computer, server or the network equipment etc.) or processor (processor) execute each implementation of the present invention The all or part of the steps of methods.And storage medium above-mentioned include: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. it is various It can store the medium of program code.

The foregoing is merely section Examples of the invention, are not intended to limit protection scope of the present invention, all utilizations Equivalent device made by description of the invention and accompanying drawing content or equivalent process transformation are applied directly or indirectly in other correlations Technical field, be included within the scope of the present invention.

18页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种加速度传感器灵敏度确认的方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!