Understanding/Interpretation of XM125 result data

Hello alltogether,

Some information about my case:

im working on a POC research project in which i want to use an XM125 for presence detection. Due to certain limitations, im using the XM125 not via an adruino, tho using a debian and connecting the device via the usb-c spi. Im also working on a custom golang client package that connects to the XM125 and uses the default firmware for exptool usage. (as mentioned its a POC).

My issue:

While i was successful to the point of connecting , configuring the device, starting the scanning and parsing the framedata - im now at a point where i feel kinda lost. Even tho i read through the documentation multiple times, i still dont understand how i can use the parsed tuples ( already calculated the phase and amplitude as described here https://docs.acconeer.com/en/latest/rad … _data.html ) to calculate the distance of a detected reflector. It’s probably obvious to someone experienced in working with such sensors, tho to me its a book with 7 seals.

My Question:

Could anyone explain me in simple (non to-depth math terminology ^^) how i can use the data i got to calculate the distance to a reflecting object?

Additional Information:

Im aware that “d” (which seems related to the start_point, num_points and step_length) plays a role in the calculation - but i still dont really understand “how”. Also the current configuration i use to setup the XM125 (maybe its relevant for the answer):

{
   "groups":[
      [
         {
            "sensor_id":1,
            "config":{
               "sweep_rate":0.0,
               "frame_rate":5.0,
               "continuous_sweep_mode":false,
               "double_buffering":true,
               "inter_frame_idle_state":"deep_sleep",
               "inter_sweep_idle_state":"ready",
               "sweeps_per_frame":1,
               "subsweeps":[
                  {
                     "start_point":1,
                     "num_points":10,
                     "step_length":4,
                     "profile":1,
                     "hwaas":16,
                     "receiver_gain":0,
                     "enable_tx":true,
                     "enable_loopback":false,
                     "phase_enhancement":false,
                     "prf":"19_5_MHz"
                  }
               ]
            }
         }
      ]
   ],
   "cmd":"setup"
}

I hope i choose the right section for this post and wanne thank anyone taking time to answer in advance :slight_smile:

Here’s a simplified explanation:

Key Parameters

  1. start_point: The starting point of the measurement in the sensor’s range profile.

  2. num_points: The number of points (samples) taken in each sweep.

  3. step_length: The distance between each point in the range profile.

Distance Calculation

The distance to a reflecting object can be calculated using the following formula:

distance = start_point + (index * step_length)

Where:

index is the position of the detected peak in the range profile data (i.e., the point where the reflection is strongest).

Steps to Calculate Distance

  1. Parse the Frame Data: After starting the scan and parsing the frame data, you will have a set of tuples containing phase and amplitude information.

  2. Identify the Peak: Determine the index of the peak amplitude in the parsed data. This peak corresponds to the strongest reflection, indicating the presence of an object.

  3. Apply the Formula: Use the identified index in the distance formula to calculate the distance.

Example

Given your configuration:

start_point: 1

num_points: 10

step_length: 4

If the peak is detected at index 3, the distance calculation would be:

distance = 1 + (3 * 4) = 1 + 12 = 13

So, the distance to the reflecting object is 13 units (the units depend on the sensor’s configuration and calibration)

And a more thorough explainer:

  1. Understanding the basics:

The XM125 is a radar sensor that uses swept-frequency continuous-wave (FWCW) technology. It measures the phase and amplitude of the reflected signal at different frequencies.

  1. Key parameters for distance calculation:
  • start_point: The starting point of the sweep

  • num_points: Number of data points in the sweep

  • step_length: The step size between data points

  1. Calculating the distance:

The basic principle is that the phase difference between the transmitted and received signal is proportional to the distance of the reflecting object. Here’s a simplified approach to calculate the distance:

a) Calculate the wavelength (λ) of the radar signal:

λ = c / f, where c is the speed of light (3e8 m/s) and f is the center frequency of the radar (typically around 60 GHz for the XM125)

b) Calculate the phase difference (Δφ) between consecutive data points:

Δφ = phase [index + 1] - phase [index]

c) Calculate the distance (d) using the phase difference:

d = (Δφ * λ) / (4π)

d) Adjust for the start_point and step_length:

actual_distance = start_point * step_length * d

  1. Practical implementation:
  • Iterate through your parsed phase data

  • Calculate the phase difference between consecutive points

  • Apply the distance formula to each phase difference

  • Average the results to get a more stable distance estimate

Additional Considerations:

  • Multiple reflections can cause ambiguity in distance measurements

  • The sensor’s resolution and accuracy depend on the configuration parameters

  • Calibration: Ensure that the sensor is properly calibrated for accurate distance measurements.

  • Environmental Factors: Be aware that environmental factors such as temperature, humidity, and object material can affect the accuracy of the measurements.

By following these steps, you should be able to calculate the distance to a reflecting object using the data from your Acconeer XM125 sensor. If you need further assistance, referring to the Acconeer documentation and using their visualization tools can provide additional insights and validation for your calculations

Here’s a simple pseudocode example of how you might implement this in Go:

func calculateDistance(phases []float64, startPoint, stepLength int, centerFrequency float64) float64 {
    c := 3e8 // Speed of light in m/s
    wavelength := c / centerFrequency

    var totalDistance float64
    for i := 0; i < len(phases)-1; i++ {
        phaseDiff := phases[i+1] - phases[i]
        distance := (phaseDiff * wavelength) / (4 * math.Pi)
        totalDistance += distance
    }

    avgDistance := totalDistance / float64(len(phases)-1)
    actualDistance := float64(startPoint * stepLength) * avgDistance

    return actualDistance
}

Remember that this is a simplified approach, and you may need to refine it based on the specific characteristics of your XM125 sensor and the environment in which you’re using it

Thanks alot for the detailed response :)!

That answers all my outstanding questions.

If the go package i’m working on is finished and works as expected it might get published open source - if so i will post it here so maybe others also can use it :slight_smile:

best regards

Good stuff, I’m attempting to calculate the maximum detectable speed in meters per second to see if this device is good for a muzzle velocity application. Wavelength (λ)= c / f = 3e8/60e9 = .005 And speed is Wavelength (λ) / 2PRT. PRT is 1497 nano seconds(from documentation Timing — Acconeer docs). Thus max speed for this device is .005/ = 0.000001497 = 1668 meters per second?

That may be the sensor’s max speed, but keep in mind the data has to get translated, recorded and moved…so real-world figures might not match

But do post your test results if you attempt to max it out!

When I use the portable exploration tool and shoot a air soft plastic 6mm bb it doesn’t detect it at all. According to my calculations it should be able to detect it. I tried from different angles indoor and outdoor but no results. The portable exploration tool has a max speed of 100 meters per second but given the calculations it should detect it but it might be that it is detecting but can’t process it? Any ideas would be appreciated. I’m still super happy with it even if it doesn’t support my application idea.

Update, see ticket(https://support.acconeer.com/support/tickets/3717). It seems that this sensor will only detect speeds under 168 m/s for small objects. Thanks for responding, I’ll need to find a device that can measure 2000m/s. I’ve looked through the sparkfun catalogue but didn’t see anything. Any suggestions would be appreciated?

I came across this cool looking dealie.

I’m not a shooter myself but this looks like a really neat bit of hobbiest-turned-fulltimer produced gear.

1 Like