<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>ADXL362 Calibration</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69176/adxl362-calibration</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 18 Dec 2020 13:39:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69176/adxl362-calibration" /><item><title>RE: ADXL362 Calibration</title><link>https://devzone.nordicsemi.com/thread/285845?ContentTypeID=1</link><pubDate>Fri, 18 Dec 2020 13:39:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:885efd82-328d-48cd-8e5a-667b448428f9</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;That&amp;#39;s great news!&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADXL362 Calibration</title><link>https://devzone.nordicsemi.com/thread/285752?ContentTypeID=1</link><pubDate>Fri, 18 Dec 2020 07:34:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2592ef26-9e29-49c3-ba9f-b1107a7c9142</guid><dc:creator>XavierN</dc:creator><description>&lt;p&gt;We modified the driver in order for us to be able to modify that value via KCONFIG variables and it seems to work fine. We&amp;#39;ll send the changes upstream shortly.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADXL362 Calibration</title><link>https://devzone.nordicsemi.com/thread/285591?ContentTypeID=1</link><pubDate>Thu, 17 Dec 2020 11:24:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e69b6c1-6a06-49b9-8d60-16b9897518ac</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;My apologies for the late reply. I have been OoO for some days.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Our team have not been able to provide a good answer to why it is set to &amp;quot;1&amp;quot;. This originates from the initial commit found here:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/commit/8e27ad430edcd5834af5a99977a1baad8a0bcdc6"&gt;https://github.com/nrfconnect/sdk-zephyr/commit/8e27ad430edcd5834af5a99977a1baad8a0bcdc6&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADXL362 Calibration</title><link>https://devzone.nordicsemi.com/thread/284286?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2020 10:37:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91791a47-d888-4a31-91b7-e81e12d7f1ac</guid><dc:creator>XavierN</dc:creator><description>&lt;p&gt;I understand that the THRESHOLD is configurable via prj.conf or &lt;span&gt;sensor_attr_set() and I have read the sheet maaaaany times believe me&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What I was trying to get at is that, other than the THRESHOLD, the parameter that determines the behaviour of the trigger is what AD call TIME, ie the number of times that the accelerometer values need to be above/under the threshold for it to fire.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;From the data sheet (ACTIVITY TIME REGISTER):&lt;/span&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;&lt;span style="font-family:serif;font-size:15.8px;left:90.0158px;top:743.482px;"&gt;The value in this register sets the number of consecutive &lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:90.0158px;top:763.88px;"&gt;samples that must hav&lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:229.609px;top:763.88px;"&gt;e at least one axis greater than the a&lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:452.01px;top:763.88px;"&gt;ctivity &lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:90.0158px;top:784.072px;"&gt;threshold (set by THRESH_ACT) for an&lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:344.222px;top:784.072px;"&gt; activity event to be &lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:90.0316px;top:804.265px;"&gt;detected.&lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:90.0316px;top:831.062px;"&gt;The &lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:118.63px;top:831.062px;"&gt;time &lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:151.035px;top:831.062px;"&gt;(in seconds&lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:222.846px;top:831.062px;"&gt;) is given by&lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:298.449px;top:831.062px;"&gt; the following equation:&lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:120.067px;top:858.238px;"&gt;Time = TIME_ACT&lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:244.872px;top:858.269px;"&gt;/&lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:250.07px;top:858.238px;"&gt;ODR&lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:90.0632px;top:884.876px;"&gt;where&lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:128.663px;top:884.876px;"&gt;: &lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:90.0632px;top:905.037px;"&gt;TIME_ACT&lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:164.86px;top:905.069px;"&gt; is the value set in this register&lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:353.67px;top:905.069px;"&gt;. &lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:90.079px;top:925.435px;"&gt;ODR&lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:121.474px;top:925.467px;"&gt; is the o&lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:170.074px;top:925.467px;"&gt;utput data rate set in the FILTER_CTL register &lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:90.079px;top:945.659px;"&gt;(Address&lt;/span&gt;&lt;span style="font-family:serif;font-size:15.8px;left:146.88px;top:945.659px;"&gt; 0x2C)&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Now, when the initialization of the chip is performed by the driver, the activity threshold is configured here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/3026111719563ecdc89cf34490cbe9f26c91113f/drivers/sensor/adxl362/adxl362.c#L644"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/3026111719563ecdc89cf34490cbe9f26c91113f/drivers/sensor/adxl362/adxl362.c#L64&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you examine this call, you will see that the 4th parameter is hardcoded to 1.&lt;/p&gt;
&lt;p&gt;In the function definition this 4th parameter that in the call is hardcoded to 1 is received in a variable called &amp;quot;time&amp;quot; as per:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/3026111719563ecdc89cf34490cbe9f26c91113f/drivers/sensor/adxl362/adxl362.c#L395"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/3026111719563ecdc89cf34490cbe9f26c91113f/drivers/sensor/adxl362/adxl362.c#L395&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That parameter called &amp;quot;time&amp;quot; that is hardcoded to 1 is used here to set the ADXL362_REG_TIME_ACT register value:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/3026111719563ecdc89cf34490cbe9f26c91113f/drivers/sensor/adxl362/adxl362.c#L427"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/3026111719563ecdc89cf34490cbe9f26c91113f/drivers/sensor/adxl362/adxl362.c#L427&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Which according to the following line is the register at the address 0x22:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/3026111719563ecdc89cf34490cbe9f26c91113f/drivers/sensor/adxl362/adxl362.h#L44"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/3026111719563ecdc89cf34490cbe9f26c91113f/drivers/sensor/adxl362/adxl362.h#L44&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is the register that I cited above.&lt;/p&gt;
&lt;p&gt;So, for some reason the driver hardcodes that parameter, both for activity and inactivity, to 1.&lt;/p&gt;
&lt;p&gt;And hence my question, since we are getting very inconsistent results using this parameter, is there a reason for that parameter to be hardcoded to 1?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADXL362 Calibration</title><link>https://devzone.nordicsemi.com/thread/283976?ContentTypeID=1</link><pubDate>Wed, 09 Dec 2020 09:22:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60ab0018-a2ca-43dd-af3b-92133ed489d0</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure I follow.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The default value is&amp;nbsp;1000 for the the&amp;nbsp;CONFIG_ADXL362_ACTIVITY_THRESHOLD according to our source code, which is the Scale Factor at X&lt;sub&gt;out&lt;/sub&gt;, Y&lt;sub&gt;out&lt;/sub&gt;, Z&lt;sub&gt;out&lt;/sub&gt;. This converts to 2g range (LSB/g), according to ADXL362 datasheet. The value is default&amp;nbsp;at start up if not configured in application (prj.conf or dts), and you should be able to change this to&amp;nbsp;what fits your application either via prj.conf/dts or via sensor API.&lt;/p&gt;
&lt;div&gt;CONFIG_ADXL362_ACTIVITY_THRESHOLD is the one that affects the driver and makes the accelerometer_poll() function kick in. From that you get the x,y,z acceleration values and can do processing on that.&lt;/div&gt;
[quote user="oys"]&lt;p&gt;The thresholds are configured in prj_thingy91_nrf9160ns.conf using:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;a href="#"&gt;Fullscreen&lt;/a&gt;&lt;div style="width:100%;height:28px;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;[/quote]
&lt;p&gt;I referred to&amp;nbsp;&lt;span&gt;CONFIG_ADXL362_ACTIVITY_THRESHOLD=200 which converts to 0.2g. This is the default value for when using the Thingy:91. Then to change this value during runtime you will need to use sensor_attr_set() and the correct register setting in ADXL362. See&amp;nbsp;&lt;em&gt;zephyr\drivers\sensor\adxl362\adxl362.h&amp;nbsp;&lt;/em&gt;for an overview of API calls.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;For more details on how to communicate with the ADXL362, &lt;a href="https://www.analog.com/media/en/technical-documentation/data-sheets/ADXL362.pdf"&gt;please read the ADXL362 datasheet.&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Øyvind&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADXL362 Calibration</title><link>https://devzone.nordicsemi.com/thread/283874?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2020 15:15:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7fb60b0-fadd-42c8-bb0e-134d11bd0070</guid><dc:creator>XavierN</dc:creator><description>&lt;p&gt;In particular I am referring to this change:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/compare/v2.3.0-rc1-ncs1-branch...parkme24:p24-branch"&gt;https://github.com/nrfconnect/sdk-zephyr/compare/v2.3.0-rc1-ncs1-branch...parkme24:p24-branch&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;We needed to add the time_act an time_inact parameters ourselves.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADXL362 Calibration</title><link>https://devzone.nordicsemi.com/thread/283730?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2020 09:14:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d83a8d04-c73d-4631-a350-ff558c1324e5</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;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:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/a3a6410b55fa97a9c6400c37d362c9137c5050b6/drivers/sensor/adxl362/adxl362.c#L624"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/a3a6410b55fa97a9c6400c37d362c9137c5050b6/drivers/sensor/adxl362/adxl362.c#L624&lt;/a&gt;&lt;/p&gt;
[quote user="XavierN"]We have been testing to change it with various degrees of success, we don&amp;#39;t seem to be able to get consistent results.[/quote]
&lt;p&gt;&amp;nbsp;Can you provide me with a code snippet of how you are changing? Are you getting an error?&lt;/p&gt;
[quote user="XavierN"]Is there a reason why that particular parameter is hardcoded or it&amp;#39;s just as you said a work in progress?[/quote]
&lt;p&gt;&amp;nbsp;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.&lt;br /&gt;&lt;br /&gt;But we will find the solution.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADXL362 Calibration</title><link>https://devzone.nordicsemi.com/thread/283714?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2020 08:30:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6cd3253e-9344-48a5-9b5a-66e049c6b5d7</guid><dc:creator>XavierN</dc:creator><description>&lt;p&gt;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 &amp;quot;time&amp;quot; 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&amp;#39;t seem to be able to get consistent results. Is there a reason why that particular parameter is hardcoded or it&amp;#39;s just as you said a work in progress?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADXL362 Calibration</title><link>https://devzone.nordicsemi.com/thread/283561?ContentTypeID=1</link><pubDate>Mon, 07 Dec 2020 13:36:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae32d4df-c588-4126-9c48-2cd0957cbd57</guid><dc:creator>&amp;#216;yvind</dc:creator><description>[quote user=""]&amp;nbsp;- 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?[/quote]
&lt;p&gt;The thresholds are configured in prj_thingy91_nrf9160ns.conf using:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class="ui-code" data-mode="c_cpp"&gt;CONFIG_ADXL362_ACTIVITY_THRESHOLD=200
CONFIG_ADXL362_INACTIVITY_THRESHOLD=200&lt;/pre&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;In order to configure these thresholds during runtime, you will need to use the Sensor API to send commands to the ADXL362. &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/a3a6410b55fa97a9c6400c37d362c9137c5050b6/drivers/sensor/adxl362/adxl362.c"&gt;Have a look at the ADXL362 drivers&lt;/a&gt;, and especially &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/a3a6410b55fa97a9c6400c37d362c9137c5050b6/drivers/sensor/adxl362/adxl362.c#L350"&gt;adxl362_attr_set()&lt;/a&gt;.&lt;em&gt;&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;&lt;em&gt;Found under:&amp;nbsp;zephyr\drivers\sensor\adxl362\&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;You can also have a look at our Asset_Tracker sample (nrf\applications\asset_tracker\src\motion\motion.c) to see how&amp;nbsp;they communicate with the sensor.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;em&gt;&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;The device drivers are lacking some documentation, but is work in progress. Let me know if anything is unclear.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADXL362 Calibration</title><link>https://devzone.nordicsemi.com/thread/283491?ContentTypeID=1</link><pubDate>Mon, 07 Dec 2020 10:26:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d4b778b-86e3-4e9d-bbcd-333925214eca</guid><dc:creator>XavierN</dc:creator><description>&lt;p&gt;Hello, you can scratch the second question, we figured that x and y axis weren&amp;#39;t completely perpendicular to the gravity force vector and they are just showing those components. The first question stands though. Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>