DW1000 Lib from Jremington Question for higher Speed and maybe error in "ESP32_anchor_autocalibrat" example

@jremington

Hi.

First of all thank you very much Jremington (if you are reading this) for your great work.
I have a question about using the Lib from Jremington:

In the examples it seems that i get about 10 distance measurements per second. To get a higher accurancy and to make some filter operations: Is it possible to get a higher rate? Where do i find the constant to change?

And one more maybe silly question: ist the range measurement initiated by the tag or by the anchors?

The second question ist about the "ESP32_anchor_autocalibrate" example:
As far as i understand there is only a new distance value when newRange() is called. So there is no average because the value read by "DW1000Ranging.getDistantDevice()->getRange()" is always the same.

void newRange()
....
for (int i = 0; i < 100; i++) {
// get and average 100 measurements
dist += DW1000Ranging.getDistantDevice()->getRange();
}
dist /= 100.0;
...
}

It has been some time since I worked on that system, so my recollection of the details is not fresh, but your question depends on what you mean by "initiate".

In one sense the ranging is initiated by the anchor. The anchor has to broadcast its ID, the tag responds to that ID and starts the back and forth timing sequence. In any case, that is all carried out in the DW1000 library (which I did not write and do not completely understand), so check the library code for the best understanding.

I don't know if it is practical to get a significantly higher range update rate. Obviously with several anchors, there will be collisions and dropped packets.

You may be right that the function .getDistantDevice()->getRange() returns the same values, but the average of a constant is that constant, so the averaging just wastes a little time.

I'll check that but will have to set up a system to test. If there is a mistake there, it is trivial to move the averaging into the main loop, maybe use an exponential low pass filter.

Thank you very much for your fast reply. No need to make a setup for the filtering question. It just was a question if my understanding is wrong. For the other People reading this my suggestion changing the ESP_anchor_autocalibrate example would be:

The following variables have to be now above the Setup:

NUMBER_OF_DISTANCES = 200 // it takes about 5 min to find a value with 200 measurements
volatile float last_delta = 0.0;
volatile float dist = 0.0;
volatile int i = 0;

void newRange() {
//Serial.print(DW1000Ranging.getDistantDevice()->getShortAddress(), DEC);
Serial.print("."); //This is only to see Progress.
i++;
dist += DW1000Ranging.getDistantDevice()->getRange();
// get and average NUMBER_OF_DISTANCES measurements
if (i >= NUMBER_OF_DISTANCES) {
dist /= NUMBER_OF_DISTANCES;
i = 0;
Serial.println();
Serial.println(dist,4);
if (Adelay_delta < 3) {
Serial.print(", final Adelay ");
Serial.println(this_anchor_Adelay);
Serial.print("Check: stored Adelay = ");
Serial.println(DW1000.getAntennaDelay());
while (1)
; //done calibrating
}

@Wingcommander

I have the same problem with the 10 measurements. Have you already solved the problem and if so how?

Thank you very much!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.