首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >bno055 IMU校准

bno055 IMU校准
EN

Stack Overflow用户
提问于 2020-04-07 17:37:46
回答 1查看 673关注 0票数 0

我正试着从IMU BNO055中获得一些阅读,下面是ADA结果的实现。

https://cdn-learn.adafruit.com/downloads/pdf/adafruit-bno055-absolute-orientation-sensor.pdf

似乎我无法通过校准步骤。

BNO055手册可以在下面找到:https://cdn-shop.adafruit.com/datasheets/BST_BNO055_DS000_12.pdf

我不是使用库,而是直接使用I2C进行通信,并从设备寄存器中读取和写入。

我正在做的配置如下:

代码语言:javascript
复制
    // The opening of the device and so on, works, so the line below is not a problem.
    if (ioctl(data_exchange->file_imu_sensor, I2C_SLAVE, data_exchange->imu_addr) < 0) {
                 printf("Impossible to communicate with the IMU in the i2c. Make sure that the address you have is correct!\n");
                 exit(1);
             }
    // Here is where I start with the configuration. First I reset the device.
    //SYS_TRIGGER Register. ADD 3F
    //CLK_SEL (0 internal oscillator) REST_INT(reset interrumptions)RST_SYS(1 to reset) x x x x Self_TEST(1 to make a self test.)
    // 00xxxx0
    buf[0] = 0x3F;
    buf[1] = 0x20; //00100000
    write_buf(data_exchange,buf,3);
    printf("IMU WAS COMMANDED TO RESET");
    sleep(1); //It needs some time to reset. With one sec should be sufficient.
    // Here I start with the real configuration.

    // G range 2G xxxxxx00
    // BW 7.81Hz  xxx000xx
    // Op mod normal 000xxxxx
    //So I will write a 0 to the register ACC_condfi
    buf[0] = 0x0D;
    buf[1] = 0x00;
    write_buf(data_exchange,buf,3);
    // Now unit selection.UNIT_SEL Page 30.
    //Accelaration m/s2 xxxxxxx0b
    // Magnetic field in micro Teslas (always)
    // Angular rate defrees ps xxxxxx0xb
    // Euler angles Degress> xxxxxxxb
    // Quaternion in Quaernion units always.
    //Temperatyre deg xxx0xxxxb
    // NPI The data output format can be selected by writing to the UNIT_SEL register, this allows user to switch between the orientation definition described by Windows and Android operating systems
    // Windows> 0xxxxxxxb
    // Android> 1xxxxxxxb. Page 30.
    // Bits 5 and 6 are reserved. So it does not matter. So we write a 0.
    buf[0] = 0x03;
    buf[1] = 0x00;
    write_buf(data_exchange,buf,3);

    //We now need to set the operation mode:
    //Register OPR_MODE Page 21.
    //Fusion mode NDOF. xxxx1100b
    buf[0] = 0x1C;
    buf[1] = 0x0C; //00001100
    write_buf(data_exchange,buf,3);

    // GYR_Config_0
    buf[0] = 0x0B;
    buf[1] = 0x00; //00001100
    write_buf(data_exchange,buf,3);


    // PWR_MODE. Normal mode is xxxxxx00b
    buf[0] = 0x3E;
    buf[1] = 0x00; //00000000
    write_buf(data_exchange,buf,3);

现在,我应该等待芯片的内部校准。但它似乎并没有完成这个任务。

我正在检查它通过检查寄存器0x35,这应该是>0,如果校准完成。

代码语言:javascript
复制
         char buf[10];
         int status=0;
         read_buf(dataset_pointer,0x35,3,buf);
         status=buf[0];
         if(status>0){
//Here is where I perform all the reading and so on.
}

我是不是在配置中遗漏了什么?我在互联网上查了一下,我发现了一些建议(也是根据IMU手册),用这个设备在空气中制造一个8符号,我做到了,但是校准工作还是没有完成。

我不认为这是一个电源问题(我在Bosh论坛上找到了一些关于这个问题的参考资料),因为我将VIN连接到5.0V,3VO到3.3V,GND连接到GND。

对此的任何评论都会有很大帮助。我的设备配置错了吗?我遗漏了什么登记簿吗?

谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-04-16 12:23:10

我在ADAFruit网页上跟进了讨论。

请参见:

https://forums.adafruit.com/viewtopic.php?f=19&t=164389&p=808106#p808106

总之,采取的办法是:

  1. 进入配置模式(OP_MODE (0x3D)设置为0x00 )
  2. ,我们选择注册映射0。( 0x00)
  3. Internal (0x37)被设置为0x00 )PAGE_ID (0x3F)将设备(SYS_TRIGGER (0x3F)设置为0x20)
  4. 电源模式设置为正常模式(POWER_MODE (0x3E)被设置为在SYS_TRIGGER中选择的POWER_MODE时钟(SYS_TRIGGER (0x3F)被设置为0x00)
  5. OP_MODE,因为我想要) (OP_MODE (0x3D)设置为0x0B)

可选,根据Gammaburst ADA水果论坛的建议:

  1. //AXIS_MAP_CONFIG 0x41寄存器到0x21.
  2. //AXIS_MAP_SIGN 0x42寄存器到0x02;

代码语言:javascript
复制
buf[0] = 0X3D; //OP_MODE;
buf[1] = 0x00; // Config mode
write_buf(data_exchange,buf,3);


buf[0] = 0x07; // BNO055_PAGE_ID_ADDR
buf[1] = 0x00; // We want to access the Register Map 0. See page 51 of the Manual https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bno055-ds000.pdf
write_buf(data_exchange,buf,3);

buf[0] = 0x3F; //(SYS_TRIGGER)
buf[1] = 0x20; //00100000 Reset!
write_buf(data_exchange,buf,3);
printf("IMU WAS COMMANDED TO RESET");
sleep(0.65); //It needs some time to reset. With one sec should be sufficient.


buf[0] = 0x3E; //(POWER_MODE)
buf[1] = 0x00; //00000000 Normal mode
write_buf(data_exchange,buf,3);


buf[0] = 0x3F; // SYS_TRIGGER
buf[1] = 0x00; //00000000 Iternal clock
write_buf(data_exchange,buf,3);

buf[0] = 0X3D; //OP_MODE;
buf[1] = 0x0B; //NDOF
write_buf(data_exchange,buf,3);

//These two are optional as per suggestion from gammaburst user in ADAFruit forums
//AXIS_MAP_CONFIG
buf[0] = 0x41;
buf[1] = 0x21;
write_buf(data_exchange,buf,3);


// AXIS_MAP_SIGN
 buf[0] = 0x42;
 buf[1] = 0x02;
 write_buf(data_exchange,buf,3);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61086034

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档