<?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>Concerns about Distance Measurement library</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93627/concerns-about-distance-measurement-library</link><description>Hi Nordic, 
 I am working on code which utilizes the DM library on many devices in a room. Can you please help with a few questions? 
 
 Some devices are always initiators, while others are always reflectors. Devices never switch roles like the DM example</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 21 Nov 2022 10:30:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93627/concerns-about-distance-measurement-library" /><item><title>RE: Concerns about Distance Measurement library</title><link>https://devzone.nordicsemi.com/thread/396608?ContentTypeID=1</link><pubDate>Mon, 21 Nov 2022 10:30:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d91941c-0228-4d53-9cff-aacb6ae330ef</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hi again,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve had a talk with the R&amp;amp;D team responsible.&lt;/p&gt;
&lt;p&gt;It is possible that dm_request does not result in a dm_result callback. The cause may be:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Synchronization inaccuracy. If the nrf_dm_proc_execute function returns a status other than NRF_DM_STATUS_SUCCESS, the callback will not be called. &lt;/li&gt;
&lt;li&gt;Too many requests. There must be a gap between measurement windows (timeslots), defined by DM_MIN_TIME_BETWEEN_TIMESLOTS_US&lt;/li&gt;
&lt;li&gt;Too many devices. For example, if there will be 1 advertiser and 2 scanners, a specific measurement at a given time will make between the two.&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="margin:0;"&gt;To adjust the synchronization, you can use the delay and extend the length of the measurement window. Recently was added to the dm structure parameter&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a style="background-color:rgba(0, 0, 0, 0);border-top-style:none;border-right-style:none;border-left-style:none;color:rgba(79, 82, 178, 1);cursor:pointer;display:inline;font-size:inherit;margin:0;overflow:inherit;padding:0;text-align:left;text-decoration:none;" title="https://github.com/nrfconnect/sdk-nrf/blob/main/include/dm.h#L143" href="https://github.com/nrfconnect/sdk-nrf/blob/main/include/dm.h#L143" rel="noopener noreferrer" target="_blank"&gt;https://github.com/nrfconnect/sdk-nrf/blob/main/include/dm.h#L143&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can see what the synchronization looks like by connecting a logic state analyzer to the gpio. &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/subsys/dm/Kconfig#L89-L103"&gt;https://github.com/nrfconnect/sdk-nrf/blob/main/subsys/dm/Kconfig#L89-L103&lt;/a&gt;. In the sample CONFIG_DM_GPIO_DEBUG=y is enabled.&lt;/p&gt;
&lt;p&gt;bt_addr is used to distinguish devices. This way the application knows that a given measurement result refers to a specific device.&lt;/p&gt;
&lt;p&gt;access_address now rng_seed see: &lt;a href="https://github.com/nrfconnect/sdk-nrf/pull/9254"&gt;https://github.com/nrfconnect/sdk-nrf/pull/9254&lt;/a&gt;&amp;nbsp; is used by nrf_lib_dm to generate the hopping sequence.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concerns about Distance Measurement library</title><link>https://devzone.nordicsemi.com/thread/395220?ContentTypeID=1</link><pubDate>Fri, 11 Nov 2022 03:29:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f04638a1-866a-4242-924e-d3e9b3537313</guid><dc:creator>paul</dc:creator><description>&lt;p&gt;Thanks for the details, though I can&amp;#39;t see the image you posted.&lt;/p&gt;
&lt;p&gt;Some follow ups:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In most cases, the dm_request does not result in a callback with a dm_result. I suspect this indicates a sync issue. Is there a way to make the DM attempt the procedure for longer to account for an&amp;nbsp;inexact start delay?&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Any other recommendations to improve the number of dm_results?&lt;/li&gt;
&lt;li&gt;I&amp;#39;ve read the docs several times and browsed the code. I&amp;#39;m still not quite sure&amp;nbsp;how bt_addr and access_address are intended to be used. If you&amp;nbsp;find any additional details, it would help.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;thanks,&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concerns about Distance Measurement library</title><link>https://devzone.nordicsemi.com/thread/394958?ContentTypeID=1</link><pubDate>Wed, 09 Nov 2022 15:18:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50be523c-ce52-428f-808b-e582f7928548</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hello again,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]Some devices are always initiators, while others are always reflectors. Devices never switch roles like the DM example does. Is this ok, or is there some benefit to&amp;nbsp;exercising both roles?[/quote]
&lt;p&gt;This is ok.&lt;/p&gt;
[quote user=""]I use a different sync&amp;nbsp;mechanism than the DM example does. How should I tune the initiator and reflector delay (CONFIG_DM_INITIATOR_DELAY_US and&amp;nbsp;CONFIG_DM_REFLECTOR_DELAY_US)? Trial and error?[/quote]
&lt;p&gt;The only way there is through trial and error unfortunately.&amp;nbsp;&lt;/p&gt;
[quote user=""]In the dm_request struct, how best to use the fields bt_addr and access_address? I can fill bt_addr with a nonsense value and it still works (at least on the initiator). But access_address seems to need a match.&amp;nbsp;[/quote]
&lt;p&gt;I believe this should be documented somewhere. Might be that it is just used for&amp;nbsp;is_request_exist, but I will have to get back to you on that.&lt;/p&gt;
&lt;p&gt;though I wouldnt say that what the demo does is what is recommended. We just picked a value that fit our use case.&amp;nbsp;&lt;/p&gt;
[quote user=""]Most importantly, the performance is not great. When I place devices 1m apart, DM library reports 1.5m to 2m distance using MPCD. Quality is&amp;nbsp;DM_QUALITY_OK. I was expecting better&amp;nbsp;accuracy based on the webinar. How can I improve it?[/quote]
&lt;p&gt;I see. First of all, the test presented in the webinar was done in rather ideal conditions, so it might be hard to get the exact same results.&lt;/p&gt;
&lt;p&gt;Was the estimation method you used also considered &amp;quot;best&amp;quot; among the ones MCPD gave you? MCPD gives you multiple after all, some (like RSSI) will most often perform rather bad no matter what.&amp;nbsp;I believe the webinar stated very different results depending on what method was used, a test using IFFT (with a median 3 filter) should get you a standard deviation of 80cm, which is rather close to what you&amp;#39;ve reported.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I just tried it myself and got this. Though it does vary a lot.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-components-multipleuploadfilemanager/01db3fbd_2D00_9145_2D00_4e98_2D00_8bef_2D00_52aa59150435-103347-complete/pastedimage1667914554538v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;In this example, IFFT performs best. If you want it, or any of the methods to perform better you could add filtering (eg. median3, which is what we&amp;#39;ve typically done).&lt;/p&gt;
&lt;p&gt;Though if you want a higher precision than this I would recommend going for the High Precision option, our sample doesn&amp;#39;t have this implemented by default though, unfortunately.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concerns about Distance Measurement library</title><link>https://devzone.nordicsemi.com/thread/394758?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2022 14:57:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61c2f774-9246-4c7b-8aa4-bc1b555999f7</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hello Paul,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll have to get back to you on this.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>