Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Errors in moving tilt measurement
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: Errors in moving tilt measurement

by Adomaino on Tue Feb 04, 2020 4:39 pm

Code: Select all | TOGGLE FULL SIZE
/**************************************************************************/
/*
    Display sensor calibration status
*/
/**************************************************************************/
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BNO055.h>
#include <utility/imumaths.h>
Adafruit_BNO055 bno = Adafruit_BNO055(55);

void displayCalStatus(void)
{
  /* Get the four calibration values (0..3) */
  /* Any sensor data reporting 0 should be ignored, */
  /* 3 means 'fully calibrated" */
  uint8_t system, gyro, accel, mag;
  system = gyro = accel = mag = 0;
  bno.getCalibration(&system, &gyro, &accel, &mag);

  /* The data should be ignored until the system calibration is > 0 */
  Serial.print("\t");
  if (!system)
  {
    Serial.print("! ");
  }

  /* Display the individual values */
  Serial.print("Sys:");
  Serial.print(system, DEC);
  Serial.print(" G:");
  Serial.print(gyro, DEC);
  Serial.print(" A:");
  Serial.print(accel, DEC);
  Serial.print(" M:");
  Serial.println(mag, DEC);
}

Adomaino
 
Posts: 13
Joined: Fri Jan 31, 2020 1:32 pm

Re: Errors in moving tilt measurement

by adafruit_support_bill on Tue Feb 04, 2020 4:40 pm

Please post the full text of the error message.

adafruit_support_bill
 
Posts: 79109
Joined: Sat Feb 07, 2009 10:11 am

Re: Errors in moving tilt measurement

by adafruit_support_bill on Tue Feb 04, 2020 4:50 pm

Your code is missing a setup and a loop function. These are required in all Arduino programs.

The displayCalStatus function from the tutorial just shows how to display the output of the getCalibration function.

See the "RawData" example from the library.

adafruit_support_bill
 
Posts: 79109
Joined: Sat Feb 07, 2009 10:11 am

Re: Errors in moving tilt measurement

by Adomaino on Sun Feb 23, 2020 7:40 pm

Hello
I followed your advice and performed the calibration using the example "RAW DATA" proceeding as follows:
1- I installed a separate power system for the sensor using a battery.
2- Once the "RAW DATA" example was installed, I opened the Arduino series monitor and started calibration according to the instructions. Both the magnetometer, accelerometer and gyroscope yielded value (3).
3- Once I calibrated the BNO055 I installed the program that I have already published in the first message and, without losing voltage at any time thanks to the independent battery, I installed the project on the motorcycle, so that the Arduino NANO board and the servo motors are powered the voltage provided by the motorcyclist, while the sensor is powered by the independent battery, having common GND.

Test.
When performing the test I have not improved the behavior and continues to perform drifting movements, so that the center continues to move to one side.
Observation.
As I have already mentioned, in previous tests where the supply voltage was common, both for the control board and the sensor, when I observed that the drift occurred, it turned off the system and turned it back on so that a reboot would occur and , for a short period of time he re-behaved correctly, until he again accumulated drift.
My theory at the time was that the problem was in the sensor, either because of calculation defects, or for poor calibration, or for whatever reason. But now I'm baffled, because thanks to the independent battery that powers the sensor, when I short envoltage and restart it, I do it only for the control board and the servo motors (the servo motors are 12 kg, overpower for what I pretend), but not for the sensor, which has never been restarted because it has independent battery. However the behavior is the same.

Personal conclusion.
If the error were with the sensor, which gradually accumulated errors, the fact that I reset the control board would not prevent, at the time the control board starts to receive the sensor data, it would continue to provide incorrect data and therefore servo motors would continue to deviate from their logical position. However, once the control plate is reset, the servo motors correct their position for a few seconds or just a minute.
But on the other hand, I can't understand what kind of problem, on the control board or on the servo motors, can lead to something like this.
Can anyone think of any theory about what might be going on?
Can it affect the sensor's position relative to the center of gravity of the motorcycle?

Thanks a lot. Greetings.

Adomaino
 
Posts: 13
Joined: Fri Jan 31, 2020 1:32 pm

Re: Errors in moving tilt measurement

by adafruit_support_bill on Mon Feb 24, 2020 7:26 pm

If the error were with the sensor, which gradually accumulated errors, the fact that I reset the control board would not prevent, at the time the control board starts to receive the sensor data, it would continue to provide incorrect data and therefore servo motors would continue to deviate from their logical position. However, once the control plate is reset, the servo motors correct their position for a few seconds or just a minute.


When the controller board is reset, the first thing it does is to re-initialize the sensor:
Code: Select all | TOGGLE FULL SIZE
void setup(void)
{
  Serial.begin(9600);
  Serial.println("Orientation Sensor Test"); Serial.println("");
 
  /* Initialise the sensor */
  if(!bno.begin())
  {
    /* There was a problem detecting the BNO055 ... check your connections */
    Serial.print("Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!");
    while(1);
  }


After that, it simply reads values from the sensor and writes them to the servos. Nothing is retained between iterations of the loop.
Code: Select all | TOGGLE FULL SIZE
  event.orientation.y = map(event.orientation.y, -73, 73, 0, 180);
 
  servo_1.write(event.orientation.y);
  servo_2.write(event.orientation.y);


So I think it is more likely an issue with the sensor. We can try replacing the sensor to see if that improves things. Please contact support@adafruit.com with a link to this thread to arrange a replacement.

adafruit_support_bill
 
Posts: 79109
Joined: Sat Feb 07, 2009 10:11 am

Re: Errors in moving tilt measurement

by Adomaino on Tue Feb 25, 2020 6:55 am

oh! go! Of course it resets the sensor even if it continues with power. Then I agree that the problem will be in the sensor. I have acquired it through Amazon, so if you still allow me the return I will do it by that means. Thank you.

Adomaino
 
Posts: 13
Joined: Fri Jan 31, 2020 1:32 pm

Re: Errors in moving tilt measurement

by adafruit_support_bill on Tue Feb 25, 2020 7:43 am

Yes. You can refer the Amazon vendor to this post as authorization for a replacement.

adafruit_support_bill
 
Posts: 79109
Joined: Sat Feb 07, 2009 10:11 am

Re: Errors in moving tilt measurement

by Adomaino on Fri Feb 28, 2020 7:43 am

While I wait for the new sensor, some questions have been raised.
As described in the Bosch datasheet, it is possible to choose between different modes of operation. In my case, the ones I'm interested in are the blending modes. By default, as I've been informed, it runs in NDOF MODE.
Table 3.3 provides that the magnetometer is not used with IMU MODE. From what I am being able to see, it seems that the sensor that gives the most problems is the magnetometer and I think that, in my specific case, I do not need a magnetometer, because it is not about following a course, but of orienting itself with respect to the terrestrial horizontal. I just need to rotate two servo motors based on the inclination relative to the horizontal. Therefore, I suspect that the magnetometer does not need to use it and perhaps it is this sensor that, either due to poor calibration, electromagnetic interference or whatever, is introducing erroneous data into the calculations that cause the deviation. What do you think about this?
Then I'd like to make a suggestion. It is a matter of that for the clumsy likes that we do not dominate the Arduino, some example swirlofit is added to their page on how to make the mode of operation. You may find it strange that I've set out on projects without doing any prior learning, but I really got to this point almost by accident without knowing where I was going. It's a long story. That's also why you chose your sensor instead of a simple IMU with which to perform complex programmings that are totally out of my reach, in addition to your technical support.
Thank you very much for your patience.

Adomaino
 
Posts: 13
Joined: Fri Jan 31, 2020 1:32 pm

Re: Errors in moving tilt measurement

by adafruit_support_bill on Fri Feb 28, 2020 9:19 am

IMUs try to mitigate the weaknesses of some sensors with the strengths of others. Unlike inertial sensors such as gyros and accelerometers, magnetometers are not subject to drift.
However, calibration has always been tricky due to local variations and disturbances in the field. Although the symptoms you describe sound like a drift problem, it is also possible that they are due to problems with the magnetometer calibration. You can try testing with some of the other operating modes to see if there is any improvement.

The BNO055 is unique in that it incorporates the complex datafusion algorithms in firmware. Overall, it has been well received by the market. But there have been some reports of problems with Bosch's implementation of those algorithms. One common issue seems to be maintaining magnetometer calibration in a moving vehicle (cars, boats planes etc). Here is one such report:
https://experimentalavionics.com/bno055 ... ointments/

adafruit_support_bill
 
Posts: 79109
Joined: Sat Feb 07, 2009 10:11 am

Re: Errors in moving tilt measurement

by Adomaino on Fri Feb 28, 2020 2:35 pm

Oh! Wow That is exactly what is happening to me. Do you offer any tutorial or sample code for the change of mode of operation?

Adomaino
 
Posts: 13
Joined: Fri Jan 31, 2020 1:32 pm

Re: Errors in moving tilt measurement

by adafruit_support_bill on Fri Feb 28, 2020 3:23 pm

We do not have a tutorial on it. But the library gives you two ways to set the operating mode as defined in the library's .h file:

https://github.com/adafruit/Adafruit_BN ... t_BNO055.h
Code: Select all | TOGGLE FULL SIZE
  bool begin(adafruit_bno055_opmode_t mode = OPERATION_MODE_NDOF);
  void setMode(adafruit_bno055_opmode_t mode);


You can optionally specify the operating mode in the "begin" function. Or you can change it at any time using the "setMode" function.

The operation mode options are also defined in the .h file:

Code: Select all | TOGGLE FULL SIZE
 /** Operation mode settings **/
  typedef enum {
    OPERATION_MODE_CONFIG = 0X00,
    OPERATION_MODE_ACCONLY = 0X01,
    OPERATION_MODE_MAGONLY = 0X02,
    OPERATION_MODE_GYRONLY = 0X03,
    OPERATION_MODE_ACCMAG = 0X04,
    OPERATION_MODE_ACCGYRO = 0X05,
    OPERATION_MODE_MAGGYRO = 0X06,
    OPERATION_MODE_AMG = 0X07,
    OPERATION_MODE_IMUPLUS = 0X08,
    OPERATION_MODE_COMPASS = 0X09,
    OPERATION_MODE_M4G = 0X0A,
    OPERATION_MODE_NDOF_FMC_OFF = 0X0B,
    OPERATION_MODE_NDOF = 0X0C
  } adafruit_bno055_opmode_t;

adafruit_support_bill
 
Posts: 79109
Joined: Sat Feb 07, 2009 10:11 am

Re: Errors in moving tilt measurement

by Adomaino on Sat Feb 29, 2020 7:01 pm

Hi,
In section 3.10 "Calibration" of the BOSCH technical data brochure, something about this problem is discussed, but honestly, I don't know it will be because of a translation problem or because it requires more knowledge than I have, but I don't understand what they are trying to explain, since it seems incoherent to me.
They indicate the need to calibrate the sensor, especially the magnetometer, for proper operation. In addition, in section 3.10.4 it indicates the possibility of reusing the calibration profile, but at the same time it tells us that at the moment the sensor enters the internal calibration routine, the calibration profile is overwritten. So, why advise us to calibrate if the sensor has an automatic self-calibration routine that will erase the work done? It's illogical!
They also talk about compensations of the sensor radius. What is the sensor radius?
And if the correct radio data and displacements are not written (?), This can result in incorrect data even with a calibration level 3.
They indicate three steps to follow to establish the calibration profile that I do not understand either.
That is to say; it seems that there is a way to make corrections in the calibration that I cannot understand, but at the same time it seems that it is of little use to pass that work because, as "Oleg" says in the report of the link that you have published, it seems that it is impossible to deactivate the internal recalibration of the magnetometer.
If you can understand section 3.10 of the technical specification brochure better than me, please let me know.
Anyway, I suspect that although this problem has a solution, a tutorial explaining the calibration correction process will be necessary, since it is obvious that I am not the only one who has been very confused.
If this problem has no solution, I fear that this device becomes somewhat unusable, at least for use on the move. An MPU6050 for example, with an Arduino programming download of internet tutorials, you can do a job of this type in static mode, being a much cheaper solution.
  I am sure that the BNO055 has to be able to make correct measurements in motion, otherwise it makes no sense to manufacture a device which highlights its ease of handling and its ability to fuse sensors that in reality, is unusable.
I look forward to your rationing on this issue.
Greetings.

Adomaino
 
Posts: 13
Joined: Fri Jan 31, 2020 1:32 pm

Re: Errors in moving tilt measurement

by adafruit_support_bill on Sun Mar 01, 2020 8:56 am

Can you post a link to the document you are referring to?

adafruit_support_bill
 
Posts: 79109
Joined: Sat Feb 07, 2009 10:11 am

Re: Errors in moving tilt measurement

by Adomaino on Sun Mar 01, 2020 11:24 pm

The document I am referring to is the BOSCH BNO055 technical data sheet https://www.bosch-sensortec.com/product ... no055.html

Adomaino
 
Posts: 13
Joined: Fri Jan 31, 2020 1:32 pm

Re: Errors in moving tilt measurement

by adafruit_support_bill on Mon Mar 02, 2020 7:46 am

The BNO055 is a rather complex device. And some of the operating details are not quite intuitive. It would be helpful if Bosh could publish some application notes showing how they intended for it to be used.

What is the sensor radius?

The 'radius' of a sensor is the distance between the sensing element and the axis of rotation. In the case of your motorcycle, when measuring tilt from side to side, the 'radius' would be the height of your sensor above the ground.

adafruit_support_bill
 
Posts: 79109
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.