kriswiner / ICM42688

Collection of Arduino sketches for TDK's combo accel/gyro motion sensor
MIT License
32 stars 4 forks source link

Gyro self test fails #6

Closed rohithr2597 closed 2 years ago

rohithr2597 commented 2 years ago

Accelerometer self-test works fine but the gyro always fails in the self-test. I tried debugging using the library and checked everything but nothing worked. 00> accelerometer self test 00> Ax dif : 95.1538 mg 00> Ay dif : 106.567 mg 00> Az dif : 724.304 mg 00> should be between 50 and 1200 mg 00> gyro self test 00> Gx dif : 13.5269 dps 00> Gy dif : 13.7253 dps 00> Gz dif : 13.7405 dps 00> should be > 60 dps 00> ares 6.10352e-05 00> gres 0.00762939 00> AX ratio: 92.7708 00> AY ratio: 95.001 00> AZ ratio: 218.31 00> should be between 50 and 150% 00> GX ratio: 12.4669
00> GY ratio: 12.4005
00> GZ ratio: 12.4143
00> should be between 50 and 150%

kriswiner commented 2 years ago

Are you setting the accel and gyro configuration properly?

_i2c_bus->writeByte(ICM42688_ADDRESS, ICM42688_REG_BANK_SEL, 0x00); // select register bank 0 _i2c_bus->writeByte(ICM42688_ADDRESS, ICM42688_PWR_MGMT0, 0x0F); // turn on accel and gyro in low noise mode delay(1); _i2c_bus->writeByte(ICM42688_ADDRESS, ICM42688_ACCEL_CONFIG0, AFS_4G << 5 | AODR_1kHz); // FS = 2 _i2c_bus->writeByte(ICM42688_ADDRESS, ICM42688_GYRO_CONFIG0, GFS_250DPS << 5 | GODR_1kHz); // FS = 3 _i2c_bus->writeByte(ICM42688_ADDRESS, ICM42688_GYRO_ACCEL_CONFIG0, 0x44); // set gyro and accel bandwidth to ODR/10

On Thu, Aug 18, 2022 at 1:57 AM Rohith Ravichandran < @.***> wrote:

Accelerometer self-test works fine but the gyro always fails in the self-test. I tried debugging using the library and checked everything but nothing worked. 00> accelerometer self test 00> Ax dif : 95.1538 mg 00> Ay dif : 106.567 mg 00> Az dif : 724.304 mg 00> should be between 50 and 1200 mg 00> gyro self test 00> Gx dif : 13.5269 dps 00> Gy dif : 13.7253 dps 00> Gz dif : 13.7405 dps 00> should be > 60 dps 00> ares 6.10352e-05 00> gres 0.00762939 00> AX ratio: 92.7708 00> AY ratio: 95.001 00> AZ ratio: 218.31 00> should be between 50 and 150% 00> GX ratio: 12.4669 00> GY ratio: 12.4005 00> GZ ratio: 12.4143 00> should be between 50 and 150%

— Reply to this email directly, view it on GitHub https://github.com/kriswiner/ICM42688/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKSKQGG7PLNJLDZGJYLVZX3FZANCNFSM564L5LBA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

kriswiner commented 2 years ago

Looks like the main code is not quite right. That is, if you select an accel scale different from 2 G or a gyro scale different from 250dps the self test will be wrong.

On Thu, Aug 18, 2022 at 8:17 AM Tlera Corporation @.***> wrote:

Are you setting the accel and gyro configuration properly?

_i2c_bus->writeByte(ICM42688_ADDRESS, ICM42688_REG_BANK_SEL, 0x00); // select register bank 0 _i2c_bus->writeByte(ICM42688_ADDRESS, ICM42688_PWR_MGMT0, 0x0F); // turn on accel and gyro in low noise mode delay(1); _i2c_bus->writeByte(ICM42688_ADDRESS, ICM42688_ACCEL_CONFIG0, AFS_4G << 5 | AODR_1kHz); // FS = 2 _i2c_bus->writeByte(ICM42688_ADDRESS, ICM42688_GYRO_CONFIG0, GFS_250DPS << 5 | GODR_1kHz); // FS = 3 _i2c_bus->writeByte(ICM42688_ADDRESS, ICM42688_GYRO_ACCEL_CONFIG0, 0x44); // set gyro and accel bandwidth to ODR/10

On Thu, Aug 18, 2022 at 1:57 AM Rohith Ravichandran < @.***> wrote:

Accelerometer self-test works fine but the gyro always fails in the self-test. I tried debugging using the library and checked everything but nothing worked. 00> accelerometer self test 00> Ax dif : 95.1538 mg 00> Ay dif : 106.567 mg 00> Az dif : 724.304 mg 00> should be between 50 and 1200 mg 00> gyro self test 00> Gx dif : 13.5269 dps 00> Gy dif : 13.7253 dps 00> Gz dif : 13.7405 dps 00> should be > 60 dps 00> ares 6.10352e-05 00> gres 0.00762939 00> AX ratio: 92.7708 00> AY ratio: 95.001 00> AZ ratio: 218.31 00> should be between 50 and 150% 00> GX ratio: 12.4669 00> GY ratio: 12.4005 00> GZ ratio: 12.4143 00> should be between 50 and 150%

— Reply to this email directly, view it on GitHub https://github.com/kriswiner/ICM42688/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKSKQGG7PLNJLDZGJYLVZX3FZANCNFSM564L5LBA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

rohithr2597 commented 2 years ago

I just messed up with setting up the register gyro config0. I didn't do left shift by 5 (GFS_250DPS << 5) .

Now it's working fine. Thanks for your suggestion and quick reply!!

rohithr2597 commented 2 years ago

Accelerometer self-test works fine but the gyro always fails in the self-test. I tried debugging using the library and checked everything but nothing worked. 00> accelerometer self test 00> Ax dif : 95.1538 mg 00> Ay dif : 106.567 mg 00> Az dif : 724.304 mg 00> should be between 50 and 1200 mg 00> gyro self test 00> Gx dif : 13.5269 dps 00> Gy dif : 13.7253 dps 00> Gz dif : 13.7405 dps 00> should be > 60 dps 00> ares 6.10352e-05 00> gres 0.00762939 00> AX ratio: 92.7708 00> AY ratio: 95.001 00> AZ ratio: 218.31 00> should be between 50 and 150% 00> GX ratio: 12.4669 00> GY ratio: 12.4005 00> GZ ratio: 12.4143 00> should be between 50 and 150%

AZ ratio seems to be high in this. But other self-tests are passed for accel and gyro. Do you have any suggestion for this issue?

kriswiner commented 2 years ago

These results are not using the correct scale factor, but for ratios shouldn't matter. But might want to try again with correct scale factors.

In any case, self test is not critical; it has no bearing on the quality of the data output unless the values are so far off those expected that the sensor is likely broken.

On Fri, Aug 19, 2022 at 12:21 PM Rohith Ravichandran < @.***> wrote:

Accelerometer self-test works fine but the gyro always fails in the self-test. I tried debugging using the library and checked everything but nothing worked. 00> accelerometer self test 00> Ax dif : 95.1538 mg 00> Ay dif : 106.567 mg 00> Az dif : 724.304 mg 00> should be between 50 and 1200 mg 00> gyro self test 00> Gx dif : 13.5269 dps 00> Gy dif : 13.7253 dps 00> Gz dif : 13.7405 dps 00> should be > 60 dps 00> ares 6.10352e-05 00> gres 0.00762939 00> AX ratio: 92.7708 00> AY ratio: 95.001 00> AZ ratio: 218.31 00> should be between 50 and 150% 00> GX ratio: 12.4669 00> GY ratio: 12.4005 00> GZ ratio: 12.4143 00> should be between 50 and 150%

AZ ratio seems to be high in this. But other self-tests are passed for accel and gyro.

— Reply to this email directly, view it on GitHub https://github.com/kriswiner/ICM42688/issues/6#issuecomment-1221022645, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKS55YDGCRIL6HNMGZTVZ7NB3ANCNFSM564L5LBA . You are receiving this because you commented.Message ID: @.***>

kriswiner commented 1 year ago

Fixed now.

On Thu, Aug 18, 2022 at 8:22 AM Tlera Corporation @.***> wrote:

Looks like the main code is not quite right. That is, if you select an accel scale different from 2 G or a gyro scale different from 250dps the self test will be wrong.

On Thu, Aug 18, 2022 at 8:17 AM Tlera Corporation @.***> wrote:

Are you setting the accel and gyro configuration properly?

_i2c_bus->writeByte(ICM42688_ADDRESS, ICM42688_REG_BANK_SEL, 0x00); // select register bank 0 _i2c_bus->writeByte(ICM42688_ADDRESS, ICM42688_PWR_MGMT0, 0x0F); // turn on accel and gyro in low noise mode delay(1); _i2c_bus->writeByte(ICM42688_ADDRESS, ICM42688_ACCEL_CONFIG0, AFS_4G << 5 | AODR_1kHz); // FS = 2 _i2c_bus->writeByte(ICM42688_ADDRESS, ICM42688_GYRO_CONFIG0, GFS_250DPS << 5 | GODR_1kHz); // FS = 3 _i2c_bus->writeByte(ICM42688_ADDRESS, ICM42688_GYRO_ACCEL_CONFIG0, 0x44); // set gyro and accel bandwidth to ODR/10

On Thu, Aug 18, 2022 at 1:57 AM Rohith Ravichandran < @.***> wrote:

Accelerometer self-test works fine but the gyro always fails in the self-test. I tried debugging using the library and checked everything but nothing worked. 00> accelerometer self test 00> Ax dif : 95.1538 mg 00> Ay dif : 106.567 mg 00> Az dif : 724.304 mg 00> should be between 50 and 1200 mg 00> gyro self test 00> Gx dif : 13.5269 dps 00> Gy dif : 13.7253 dps 00> Gz dif : 13.7405 dps 00> should be > 60 dps 00> ares 6.10352e-05 00> gres 0.00762939 00> AX ratio: 92.7708 00> AY ratio: 95.001 00> AZ ratio: 218.31 00> should be between 50 and 150% 00> GX ratio: 12.4669 00> GY ratio: 12.4005 00> GZ ratio: 12.4143 00> should be between 50 and 150%

— Reply to this email directly, view it on GitHub https://github.com/kriswiner/ICM42688/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKSKQGG7PLNJLDZGJYLVZX3FZANCNFSM564L5LBA . You are receiving this because you are subscribed to this thread.Message ID: @.***>