This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ADXL362 Calibration

Hello,

We are planning to use the accelerometer in the Thingy91, we have some inconsistent results when configuring/reconfiguring, we have 2 questions:

 - When we, for example, want to change the thresholds while running, we write the values in the corresponding registers, is there anything else to do so the accel starts using the new values? Does the accel need to be reset somehow?

 - See attached a typical sequence of measurments when running the adxl362 sample included with zephyr. The z axis is measuring earths gravitation, but why the other two axis are consistently measuring values around -1.5 m/s^2? This is of course with the device motionless. Does the accel need to be calibrated somehow?

Thank you.

Xavier

Parents
  •  - When we, for example, want to change the thresholds while running, we write the values in the corresponding registers, is there anything else to do so the accel starts using the new values? Does the accel need to be reset somehow?

    The thresholds are configured in prj_thingy91_nrf9160ns.conf using:

    CONFIG_ADXL362_ACTIVITY_THRESHOLD=200
    CONFIG_ADXL362_INACTIVITY_THRESHOLD=200
    In order to configure these thresholds during runtime, you will need to use the Sensor API to send commands to the ADXL362. Have a look at the ADXL362 drivers, and especially adxl362_attr_set().
    Found under: zephyr\drivers\sensor\adxl362\
    You can also have a look at our Asset_Tracker sample (nrf\applications\asset_tracker\src\motion\motion.c) to see how they communicate with the sensor. 
    The device drivers are lacking some documentation, but is work in progress. Let me know if anything is unclear. 
    Kind regards,
    Øyvind
  • We have been looking at the codebases that you mention and as we understand it there is a hardcoded parameter in the driver. In particular when configuring the thresholds you can set the thresholds themselves but also what the documentation calls "time" which is the amount of events above the threshold that need to be measured for it to trigger. That value is hardocded in the driver to 1. We have been testing to change it with various degrees of success, we don't seem to be able to get consistent results. Is there a reason why that particular parameter is hardcoded or it's just as you said a work in progress?

  • My apologies, I see that I have referred to the wrong function to use. According to our apps team, you should be using sensor_attr_set(), which exposes adxl362_attr_set() here: https://github.com/nrfconnect/sdk-zephyr/blob/a3a6410b55fa97a9c6400c37d362c9137c5050b6/drivers/sensor/adxl362/adxl362.c#L624

    XavierN said:
    We have been testing to change it with various degrees of success, we don't seem to be able to get consistent results.

     Can you provide me with a code snippet of how you are changing? Are you getting an error?

    XavierN said:
    Is there a reason why that particular parameter is hardcoded or it's just as you said a work in progress?

     Can you please provide me with what particular parameter you are referring to? The sensor documentation in Zephyr is work in progress, adding a device driver index. Currently, the only documentation on device drivers is to read through the source code. Making this a little more complicated at the moment.

    But we will find the solution. 

    Kind regards,
    Øyvind

Reply
  • My apologies, I see that I have referred to the wrong function to use. According to our apps team, you should be using sensor_attr_set(), which exposes adxl362_attr_set() here: https://github.com/nrfconnect/sdk-zephyr/blob/a3a6410b55fa97a9c6400c37d362c9137c5050b6/drivers/sensor/adxl362/adxl362.c#L624

    XavierN said:
    We have been testing to change it with various degrees of success, we don't seem to be able to get consistent results.

     Can you provide me with a code snippet of how you are changing? Are you getting an error?

    XavierN said:
    Is there a reason why that particular parameter is hardcoded or it's just as you said a work in progress?

     Can you please provide me with what particular parameter you are referring to? The sensor documentation in Zephyr is work in progress, adding a device driver index. Currently, the only documentation on device drivers is to read through the source code. Making this a little more complicated at the moment.

    But we will find the solution. 

    Kind regards,
    Øyvind

Children
Related