> For the complete documentation index, see [llms.txt](https://docs.andymark.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.andymark.com/frc-electronics/can-sensors/can-lidar-am-5684/tuning.md).

# Tuning

CAN Lidar settings are not retained after power loss and should be applied after device initialization

Apply tuning only after basic CAN communication and default-mode readings are working. See [Device API](/frc-electronics/can-sensors/can-lidar-am-5684/device-api.md) for the available configuration methods.

{% hint style="info" %}
The device does not retain these values through a power cycle. Apply the required settings after initializing the sensor.
{% endhint %}

## Recommended workflow

1. Record baseline data using defaults.
2. Change one setting at a time.
3. Retest the actual target across the complete operating range.
4. Review status, peak signal, ambient light, and update rate.
5. Store the chosen settings in robot code and reapply them at startup.

## Distance mode

Distance mode changes the ranging profile and its balance of range, ambient-light tolerance, and short-range behavior.

* **Long:** Default and a useful starting point for general applications.
* **Medium:** Consider when the application emphasizes shorter distances and lower noise.
* **Short:** Use only after validation shows that its tradeoffs benefit the target and environment.

## Timing budget

The timing budget is the time allocated to one measurement.

* Higher values can improve stability but reduce the maximum update rate.
* Lower values increase update rate but may increase noise or rejected readings.
* Default: 50,000 µs, or 50 ms.

## Intermeasurement period

The intermeasurement period controls the time between measurement starts.

* Expressed in milliseconds.
* It must not be shorter than the timing budget after converting the timing budget to milliseconds.
* Leave additional margin if testing shows missed or irregular updates.
* Default: 50 ms.

## Request timeout

The timeout limits how long the software waits for a response.

* It does not improve measurement accuracy.
* Set it long enough for the selected timing budget and CAN conditions.
* Handle a timeout as invalid data rather than reusing an old measurement.
* Default: 100 ms.

## Sigma threshold

The sigma threshold controls how much estimated measurement uncertainty is accepted.

* Lower values are stricter and may reject more readings.
* Higher values accept noisier measurements.
* Default: 360.

## Minimum signal rate

This setting defines the minimum returned signal required for a valid measurement.

* Lower values allow weaker, longer-range returns.
* Higher values reject weak returns more aggressively.
* Default: 0.05 MCPS, or mega-counts per second.

## Region of Interest

ROI width and height select the active portion of the sensor array.

* Range: 1–16 for each dimension.
* 16 × 16 uses the full field of view and is the default.
* A smaller ROI narrows the effective view and can isolate a target.
* A smaller ROI also makes alignment more sensitive, so test vibration and mechanism tolerance.

## After tuning

Re-run the [Validation](/frc-electronics/can-sensors/can-lidar-am-5684/validation.md) procedure and document the selected values, target, lighting, and mounting conditions.
