Getting odd jumps in output values

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting odd jumps in output values

1,373 Views
scottm
Senior Contributor II

I'm processing 9DOF data from a Bosch BMX055 at 40 Hz, and for the moment I'm focusing on yaw because that seems to be the most stable output value.  It's giving me some weird jumps, though.  Here's an example:

M:[278226] Roll 004 Pitch -02 Yaw 079
M:[278232] G -0095 -0057 00826  A -0012 -0010 00113  M 01129 -0575 00077
M:[278232] Roll 003 Pitch -02 Yaw 078
M:[278238] G -0124 -0148 01317  A 00014 -0010 00129  M 01129 -0575 00077
M:[278238] Roll 003 Pitch -02 Yaw 075
M:[278244] G -0101 -0180 01135  A -0034 -0020 00104  M 01065 -0591 00109
M:[278244] Roll 003 Pitch -02 Yaw 307
M:[278250] G -0058 -0028 00367  A -0009 -0010 00109  M 01065 -0591 00109
M:[278250] Roll 003 Pitch -02 Yaw 293
M:[278256] G -0077 -0036 00483  A -0017 -0010 00116  M 01049 -0599 00089
M:[278256] Roll 003 Pitch -02 Yaw 290
M:[278262] G -0057 00000 00343  A -0011 -0010 00113  M 01049 -0623 00101

The log lines alternate between raw sensor readings and the fusion results.  The raw readings show gyro X, Y, and Z, followed by accelerometer X, Y, Z and magnetometer X, Y, Z.  The board is being rotated by hand slowly around the Z axis.

At timestamp 278244 you can see that the yaw value jumps from 75 to 307 degrees.  I don't see any corresponding jumps in the input values.

Here are two more, with more samples shown:

M:[327400] G -0010 00033 00132  A -0005 -0007 00112  M 01177 -0439 00075
M:[327400] Roll 003 Pitch -04 Yaw 090
M:[327406] G -0002 -0010 00277  A -0010 -0008 00114  M 01137 -0447 00035
M:[327406] Roll 003 Pitch -04 Yaw 090
M:[327412] G -0006 -0004 00365  A -0011 -0009 00114  M 01153 -0367 00059
M:[327412] Roll 003 Pitch -04 Yaw 090
M:[327418] G -0011 00021 00276  A -0009 -0009 00114  M 01153 -0367 00059
M:[327418] Roll 003 Pitch -04 Yaw 090
M:[327424] G -0018 00035 00253  A -0005 -0007 00113  M 01129 -0415 00067
M:[327424] Roll 003 Pitch -04 Yaw 090
M:[327430] G -0011 00010 00469  A -0013 -0009 00113  M 01129 -0415 00067
M:[327430] Roll 003 Pitch -04 Yaw 089
M:[327436] G -0008 00014 00489  A -0010 -0008 00113  M 01169 -0415 00047
M:[327436] Roll 003 Pitch -04 Yaw 089
M:[327442] G -0008 00013 00488  A -0013 -0010 00115  M 01145 -0423 00073
M:[327442] Roll 003 Pitch -04 Yaw 089
M:[327448] G -0013 00023 00437  A -0009 -0007 00113  M 01145 -0423 00073
M:[327448] Roll 003 Pitch -04 Yaw 088
M:[327454] G 00000 00005 00468  A -0013 -0012 00116  M 01105 -0367 00063
M:[327454] Roll 003 Pitch -04 Yaw 088
M:[327460] G -0012 00022 00351  A -0010 -0009 00115  M 01105 -0367 00063
M:[327460] Roll 003 Pitch -03 Yaw 088
M:[327466] G -0004 00012 00341  A -0008 -0008 00112  M 01129 -0463 00035
M:[327466] Roll 003 Pitch -03 Yaw 088
M:[327472] G -0009 00007 00412  A -0009 -0008 00114  M 01073 -0455 00069
M:[327472] Roll 003 Pitch -03 Yaw 088
M:[327478] G -0001 00005 00439  A -0013 -0010 00114  M 01073 -0455 00069
M:[327478] Roll 003 Pitch -03 Yaw 088
M:[327484] G -0005 00009 00316  A -0006 -0005 00114  M 01105 -0471 00031
M:[327484] Roll 003 Pitch -03 Yaw 088
M:[327490] G -0007 00012 00296  A -0011 -0010 00112  M 01105 -0471 00031
M:[327490] Roll 003 Pitch -03 Yaw 089
M:[327496] G -0009 00015 00216  A -0007 -0009 00115  M 01105 -0471 00029
M:[327496] Roll 003 Pitch -03 Yaw 257
M:[327502] G 00005 -0024 00331  A -0013 -0011 00114  M 01081 -0479 00035
M:[327502] Roll 003 Pitch -03 Yaw 218



M:[042282] G -0009 00006 -0656  A -0005 -0006 00114  M 00921 00049 -0063
M:[042282] Roll -03 Pitch 005 Yaw 326
M:[042288] G 00004 00005 -0564  A -0006 -0008 00114  M 00921 00049 -0063
M:[042288] Roll -03 Pitch 006 Yaw 327
M:[042294] G 00001 -0008 -0570  A -0006 -0008 00113  M 00953 00113 -0043
M:[042294] Roll -03 Pitch 006 Yaw 328
M:[042300] G -0001 -0014 -0381  A -0007 -0008 00115  M 00969 00057 -0047
M:[042300] Roll -03 Pitch 006 Yaw 329
M:[042306] G 00002 -0020 -0016  A -0007 -0007 00113  M 00969 00057 -0047
M:[042306] Roll -03 Pitch 006 Yaw 329
M:[042312] G -0001 -0011 -0023  A -0004 -0008 00113  M 00961 00137 -0057
M:[042312] Roll -03 Pitch 006 Yaw 330
M:[042318] G -0018 00024 -0914  A -0007 -0010 00113  M 00961 00137 -0057
M:[042318] Roll -03 Pitch 006 Yaw 332
M:[042324] G -0021 00041 -1406  A -0006 -0008 00114  M 00929 00121 -0089
M:[042324] Roll -03 Pitch 006 Yaw 338
M:[042330] G -0008 00020 -1287  A -0006 -0005 00113  M 00945 00153 -0053
M:[042330] Roll -03 Pitch 006 Yaw 006
M:[042336] G -0003 -0031 -0418  A -0006 -0007 00114  M 00945 00153 -0053
M:[042336] Roll -03 Pitch 006 Yaw 041
M:[042342] G 00002 -0026 00006  A -0008 -0008 00113  M 00913 00129 -0069
M:[042342] Roll -03 Pitch 006 Yaw 038
M:[042348] G -0006 -0005 -0002  A -0007 -0008 00113  M 00913 00129 -0069
M:[042348] Roll -03 Pitch 006 Yaw 038
M:[042354] G 00001 -0004 -0008  A -0007 -0010 00114  M 00905 00201 -0055
M:[042354] Roll -03 Pitch 006 Yaw 038
M:[042360] G -0004 -0008 -0022  A -0007 -0009 00113  M 00929 00137 -0057
M:[042360] Roll -03 Pitch 006 Yaw 039
M:[042366] G -0009 -0012 -0088  A -0004 -0009 00114  M 00929 00137 -0057
M:[042366] Roll -03 Pitch 006 Yaw 039
M:[042372] G -0005 00011 -0484  A -0008 -0009 00113  M 00937 00209 -0059
M:[042372] Roll -03 Pitch 006 Yaw 039

Where should I start looking for the problem?  The raw values displayed here are being read straight out of the SFG FIFOs so that's what the system is working with.  My conversion factors are 33 counts per degree/sec, 128 counts per g, and 16 counts per uT.  In the last example, there's a peak gyro Z rate of -42.6 deg/sec, but the yaw jumps by 28 degrees in 1/40 sec.  What am I doing wrong?

Thanks,

Scott

Labels (1)
0 Kudos
4 Replies

1,202 Views
scottm
Senior Contributor II

Bumping - it's been a month.  There haven't been any replies by NXP employees since March. Is this forum monitored?

0 Kudos

1,202 Views
lisettelozano
NXP Employee
NXP Employee

Hello Scott,

First of all, I want to apologize for the lack of response from my side; this will not happen again. I’m working with the experts to get more inputs about the odd jumps in the yaw outputs. In the meantime, by quick reviewing the Sensor Fusion user manual, sections 9.2 and 9.5 might be interesting.  

Again, I apologize for the inconvenience caused and will work on this closely.

Have a great day,

Paulina

0 Kudos

1,202 Views
scottm
Senior Contributor II

Hi Paulina,

It's been three months and I haven't heard anything back. I'd really like to get back to working on this.  I've attached a short video demonstrating the results I'm getting now.  This is coming from four identical boards attached to a test fixture in the same orientation.  I'm moving them all by hand through about 180 degrees on one axis at a time.

You can see that the discontinuities don't all happen at the same place.

This video is currently being processed. Please try again in a few minutes.
(view in My Videos)

Any ideas?

Scott

0 Kudos

1,202 Views
scottm
Senior Contributor II

Hi Paulina,

This forum is hard enough to find that I'm not really surprised it goes unnoticed.

9.2 doesn't seem relevant since I'm not stepping through with a debugger - the output given above was generated in real time, with the sensor readings being taken at a consistent 40 Hz.

As for 9.5, the sensor readings look sane to me.  Since the original post I've implemented Bosch's magnetometer compensation code so the mag values are a little different but it's still giving me the same sudden jumps.

Over small ranges of motion the orientation data seems consistent.  It's hard to get a good test with the Sensor Fusion Toolbox, though, since the board is tethered.  The Android app is apparently no longer available, and so far I haven't been able to get the Windows app to work with Bluetooth.  Also, the shield board I built for the sake of testing the BMX055 on the FRDM-K22F does't have Bluetooth anyway and I'd have to graft that on.

The actual production device doesn't have Bluetooth at all - wireless communication is by WiFi and there's no easy mechanism provided to pipe data to the Windows app over the network.  And for the production version I've also removed the control and communications modules, since I can't afford the space to keep those in the firmware.  I could put them back in, but it seems like the system is designed more like a reference design than a library and it's a fair amount of work to adapt it to an entirely different set of communications hardware on a device that already has a lot of other stuff going on.

Do you perhaps have a way to test the fusion algorithms with offline data?  I could easily have it generate a CSV file of the raw sensor readings so that it could be replayed for analysis.  If you can do that, let me know what kind of motion you'd like to see.  I could even shoot some video and have the device flash an LED to indicate the start of the motion data for reference.

Thanks,

Scott

0 Kudos