How to use the " POZYX_DEVICES_CALIBRATE " Code

Hello Everyone, i looked into the pozyx datasheet and came across the " POZYX_DEVICES_CALIBRATE " command which i saw that this command helps the calibrate the coordinates of the anchors. However i don't know how to use this command to auto calibrate and print out on the serial monitor.

Because all these while i have been using manual calibration for the coordinates of my anchor, as a result the coordinates that i am getting for my tag deviates a lot, which i think may be due to inaccuracy when i calibrate manually.

Thus i hope someone can teach me how to use the " POZYX_DEVICES_CALIBRATE " command to auto calibrate and give me a more accurate coordinates of the anchor and print it out in the Serial monitor.

Thank you very much

What did Pozyx say about using the command, its their product after all ?

Hi srnet thank you so much for the reply. :):slight_smile:

Yes they did but sadly i do not understand what they mean.
Below is what they write about the code that i am asking about, If you can understand what they mean, please teach me. Thank you very much :):slight_smile: i really appreciate your effort to reply :slight_smile:

This function estimates the relative position of up to 6 pozyx devices within range. This function can be used for quickly setting up the positioning system. This procedure may take several hundres of milliseconds depending on the number of devices in range and the number of range measurements requested. During the calibration proces LED 2 will turned on. At the end of calibration the corresponding bit in the POZYX_CALIB_STATUS register will be set. Note that only the coordinates of pozyx devices within range are determined. The resulting coordinates are stored in the internal device list. It is advised that during the calibration process, the pozyx tag is not used for other wireless communication. More information can be found here.

INPUT PARAMETERS
This function takes a number of optional bytes as input parameters. When omitted, the default values are used. Also, when no network id's of the anchors are supplied, the anchors will be automatically discovered.

byte number Description
byte 0 Calibration options (optional). Possible values:

0x02 : 2D (default). The relative x and y coordinates of the anchors are estimated. It is expected that all anchors are located in the same 2D plane.

0x01 : 2.5D. The relative x and y coordinates of the anchors are estimated. However it is not expected that all anchors are located in the same 2D plane. For this option to work, the z-coordinates of the anchors must be available in the device list.

byte 1 Number of Measurements (optional). This describes the number of range measurements that should be made for the estimation. Note that a larger number of measurements will increase the accuracy of the relative coordinates, but will also make the process take longer. The default value is 10 measurments.

Type: uint8_t

byte 2-3 Network id anchor 0 (optional). Optionally the network id of the first anchor is given. This anchor will be used to define the origin, i.e., it's coordinates will be forced to zero.

Type: uint16_t

byte 4-5 Network id anchor 1 (optional). Optionally the network id of the second anchor is given. This anchor will be used to determine the x-axis, i.e., its y coordinate will be forced to zero.
Type: uint16_t

byte 6-7 Network id anchor 2 (optional). Optionally the network id of the third anchor is given. This anchor will be used to determine the which way is up for the y-coordinate, i.e., its y coordinate will be forced to be positive.

Type: uint16_t

byte 8-9 Network id anchor 3 (optional). Optionally the network id of the fourth anchor is given.
Type: uint16_t

byte 10-11 Network id anchor 4 (optional). Optionally the network id of the fifth anchor is given.

Type: uint16_t

byte 12-13 Network id anchor 5 (optional). Optionally the network id of the sixth anchor is given.

Type: uint16_t

OUTPUT
The function returns one result byte for success or failure. 0 is failure. 1 is success.