Skip to content
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions boards/amovlab/flycore/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CONFIG_COMMON_INS=y
CONFIG_DRIVERS_ADC_BOARD_ADC=y
CONFIG_DRIVERS_BAROMETER_MS5611=y
CONFIG_COMMON_DISTANCE_SENSOR=y
CONFIG_DRIVERS_DISTANCE_SENSOR_PTGL100=y
CONFIG_COMMON_MAGNETOMETER=y
CONFIG_COMMON_TELEMETRY=y
CONFIG_DRIVERS_CDCACM_AUTOSTART=y
Expand Down
1 change: 1 addition & 0 deletions boards/px4/sitl/test.px4board
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CONFIG_BOARD_NOLOCKSTEP=y
CONFIG_DRIVERS_DISTANCE_SENSOR_LIGHTWARE_LASER_SERIAL=y
CONFIG_DRIVERS_DISTANCE_SENSOR_PTGL100=y
CONFIG_DRIVERS_RC_CRSF_RC=y
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/en/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
- [ARK DIST SR (CAN/UART)](dronecan/ark_dist.md)
- [ARK DIST MR (CAN/UART)](dronecan/ark_dist_mr.md)
- [Benewake TFmini LiDAR](sensor/tfmini.md)
- [JRT PTGL-100 Laser Rangefinder](sensor/ptgl100.md)
- [LeddarOne Lidar](sensor/leddar_one.md)
- [Lidar-Lite](sensor/lidar_lite.md)
- [Lightware Lidars (SF/LW/GRF)](sensor/sfxx_lidar.md)
Expand Down
13 changes: 7 additions & 6 deletions docs/en/flight_controller/amovlab_flycore.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ Pin 1 starts from the right side of the connector, as shown below:

### TELEM3 Port

| Pin | Signal |
| --- | ------ |
| 1 | RX |
| 2 | TX |
| 3 | GND |
| 4 | VCC |
| Pin | Signal |
| --- | --------- |
| 1 | RX |
| 2 | TX |
| 3 | GND |
| 4 | VCC (5 V) |

### I2C1 Port

Expand Down Expand Up @@ -187,6 +187,7 @@ The default Flycore PX4 port matches the hardware as shipped:
- **Onboard GNSS:** UM982 connected to `GPS1`.
- **External GPS:** `GPS2` is available for an external GPS receiver, but does not provide compass I2C lines.
- **Default firmware:** `rc.board_sensors` starts only the onboard IMUs and barometer. It does not start magnetometers or other external sensors that are not fitted by default.
The firmware also includes the [JRT PTGL-100](../sensor/ptgl100.md) rangefinder driver, which is disabled until [SENS_PTGL100_CFG](../advanced_config/parameter_reference.md#SENS_PTGL100_CFG) is set.

Flycore has no onboard magnetometer and its GPS connectors do not include compass I2C.
If a magnetometer is required, use a supported external magnetometer connected through `I2C1`, `I2C4`, or another compatible interface provided by the vehicle setup.
Expand Down
1 change: 1 addition & 0 deletions docs/en/releases/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ Please continue reading for [upgrade instructions](#upgrade-guide).

- Enable [u-blox Diagnostics with u-center](../gps_compass/u-center.md) while the vehicle's GPS runs as usual. ([PX4-Autopilot#28280](https://github.com/PX4/PX4-Autopilot/pull/28280)).
- [Benewake TFmini Plus](../sensor/tfmini.md) rangefinder support: select it with [SENS_TFMINI_HW](../advanced_config/parameter_reference.md#SENS_TFMINI_HW) = `4` (0.1–12m, 3.6° field of view). For `TFMINI / TFMINI-S` (`1`) the driver now reports a 2° field of view (was 2.3°). ([PX4-Autopilot#29575](https://github.com/PX4/PX4-Autopilot/pull/29575))
- [JRT PTGL-100 Laser Rangefinder](../sensor/ptgl100.md): new `ptgl100` UART rangefinder driver (included in the [Amovlab Flycore](../flight_controller/amovlab_flycore.md) firmware). ([PX4-Autopilot#29088](https://github.com/PX4/PX4-Autopilot/pull/29088))

### Simulation

Expand Down
198 changes: 198 additions & 0 deletions docs/en/sensor/ptgl100.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
# JRT PTGL-100 Laser Rangefinder

<Badge type="tip" text="main (PX4 v2.0)" />

The [JRT PTGL-100](https://www.jrt-measure.com/) is a time-of-flight (ToF) laser [rangefinder](../sensor/rangefinders.md) operating at 905±5nm, with a specified measurement range of 0.2–100m (100m against a 30% reflectance target) and a measurement rate of 100Hz.
It connects to the flight controller using a UART (serial) port.

![JRT PTGL-100 module showing its two optical apertures](../../assets/hardware/sensors/ptgl100/ptgl100_hero.webp)

::: info
The driver is not included in the firmware for most boards.
See [Firmware Support](#firmware_support) for how to check your board and add it.

The rangefinder has been tested on the [Amovlab Flycore](../flight_controller/amovlab_flycore.md) `TELEM3` port, using a custom-made adapter cable.
The Flycore includes the driver in its default firmware.
:::

## Specifications {#specifications}

- **Technology:** ToF (IR laser), 905±5nm
- **Range:** 0.2m (90% reflectance) – 100m (30% reflectance)
- **Update rate:** 100Hz
- **Beam divergence:** ≤5mrad (typical)
- **Accuracy:** ±3cm up to 30m, ±7cm at 30–50m, ±15cm at 50–100m (90% reflectance target)
- **Interface:** UART, 3.3V TTL, 460800 baud (factory default)
- **Input voltage:** 3.3–5V DC
- **Power consumption:** ≤0.45W at 3.3V and 25°C (≤0.56W at 60°C)
- **Dimensions:** 10.7 × 16.8 × 22mm
- **Weight:** 6±0.5g
- **Operating temperature:** −20 to +60°C
- **Ingress protection:** IP67
- **Laser class:** Class 1 (IEC 60825-1)

## Where to Buy {#store}

For PTGL-100 purchasing enquiries, contact Amovlab at [shudajun@amovauto.com](mailto:shudajun@amovauto.com) or JRT at [sales@jrt-measure.com](mailto:sales@jrt-measure.com).

## Sensor Configuration {#sensor_configuration}

PTGL-100 modules ship configured for 460800 baud, which is the rate the PX4 driver uses (8N1, no flow control).
The 115200 baud factory default given in the [PTGL-100 manual](#further_information) (§4.1) is incorrect.
After purchase, the module's baud rate can be changed under JRT's guidance, but it must be set to 460800 baud for use with this PX4 driver.
The driver doesn't change the module's baud rate.
To check or change a module's baud rate, contact JRT at [sales@jrt-measure.com](mailto:sales@jrt-measure.com) for instructions.

## Hardware Setup {#hardware_setup}

### Mounting {#mounting}

The driver assumes the sensor is mounted facing downward.
For any other direction, set [SENS_PTGL100_ROT](../advanced_config/parameter_reference.md#SENS_PTGL100_ROT) (see [PX4 Configuration](#px4_configuration)).

The [PTGL-100 manual](#further_information) (§7(2)) states that the sensor should not be used in direct sunlight.
Contact JRT at [sales@jrt-measure.com](mailto:sales@jrt-measure.com) for guidance on outdoor use and any questions about this restriction.

Keep glass and mirror-like surfaces out of the sensor's blind zone (closer than 0.2m), and don't mount it facing another laser rangefinder at close range.
If the sensor is fitted behind a protective window, the manual (§3.4) recommends H-K9L or fused-silica glass, 2–4mm thick, with an 855–955nm anti-reflection coating and an air gap of less than 0.5mm to the sensor.

### Pinouts {#pinouts}

The module has a six-pin `HC-0.8-6PWT` connector (0.8mm pitch).
An adapter cable is needed to connect to flight controllers that follow the [Pixhawk Connector Standard](https://github.com/pixhawk/Pixhawk-Standards/blob/master/DS-009%20Pixhawk%20Connector%20Standard.pdf) (which use 1.25mm pitch JST-GH connectors).

On the module socket, the pins are numbered 1–6 towards the two optical apertures: pin 1 (`GND`) is furthest from them and pin 6 (`EN`) nearest.

![JRT PTGL-100 module socket with pins numbered 1 to 6 towards the optical apertures](../../assets/hardware/sensors/ptgl100/ptgl100_pinout.png)

Connector drawing reproduced with permission from JRT.

The supplied cable is wired pin-to-pin: 1–1, 2–2, 3–3, 4–4, 5–5 and 6–6.
With the cable connector viewed as in the photograph below (wires pointing downwards), the contacts are numbered 1–6 from left to right, so pin 1 (`GND`) is the leftmost.
The wires shown are all black, so use the connector orientation in the photograph to identify the contacts.

![Supplied PTGL-100 cable connector with wires pointing downwards and contacts numbered 1 to 6 from left to right](../../assets/hardware/sensors/ptgl100/ptgl100_cable_pinout.webp)

| Pin | Signal | Description |
| --- | ------ | --------------------------------------------------------- |
| 1 | GND | Ground |
| 2 | VCC | 3.3–5V supply |
| 3 | NC | Not connected |
| 4 | TXD | UART TX (3.3V TTL) |
| 5 | RXD | UART RX (3.3V TTL) |
| 6 | EN | Enable: low for normal operation, high for low-power mode |

### Wiring {#wiring}

The manufacturer's packing list includes one module and one power/data cable.
The supplied cable has six-pin connectors at both ends for the module's `HC-0.8-6PWT` interface, and carries power, UART TX/RX and `EN` (pin 6).
It can be used as a module-side pigtail by adapting the flight-controller end to the required connector and pinout.

The PTGL-100 can be connected to any unused serial port (UART), such as `TELEM2`, `TELEM3` or `GPS2`.
UART signals use 3.3V TTL levels.

| Module Pin | Module Signal | Connect To |
| ---------- | ------------- | ------------------------- |
| 1 | GND | Flight controller GND |
| 2 | VCC | 3.3–5V supply |
| 4 | TXD | Flight controller UART RX |
| 5 | RXD | Flight controller UART TX |
| 6 | EN | GND |

For example, connect the module to the Flycore [`TELEM3`](../flight_controller/amovlab_flycore.md#telem3-port) port as follows:

| Module Pin | Module Signal | Flycore TELEM3 Pin | Flycore TELEM3 Signal |
| ---------- | ------------- | ------------------ | --------------------- |
| 2 | VCC | 4 | VCC |
| 1 | GND | 3 | GND |
| 4 | TXD | 1 | RX |
| 5 | RXD | 2 | TX |
| 6 | EN | 3 | GND |

Pin 6 (`EN`) must be connected to GND for normal operation.
You must join module pins 1 and 6 to `TELEM3` pin 3 in the adapter cable.
The `TELEM3` VCC pin supplies 5V, within the module's 3.3–5V input range.
This wiring, including `EN` connected to GND, has been tested on Flycore.

Both TX and RX are required because PX4 sends the module a command to start continuous measurement.

## Firmware Support {#firmware_support}

The rangefinder is supported by the [ptgl100](../modules/modules_driver_distance_sensor.md#ptgl100) driver, which is built into firmware by the [board configuration](../hardware/porting_guide_config.md) key `CONFIG_DRIVERS_DISTANCE_SENSOR_PTGL100=y`.
The driver is not part of the common set of rangefinder drivers (`CONFIG_COMMON_DISTANCE_SENSOR`), so it is only present in the firmware for boards that set this key.
At the time of writing, this is the [Amovlab Flycore](../flight_controller/amovlab_flycore.md).

To check your board, look for the key in its configuration file, `boards/<vendor>/<board>/default.px4board`, or check whether [SENS_PTGL100_CFG](../advanced_config/parameter_reference.md#SENS_PTGL100_CFG) is listed in _QGroundControl_ (parameters are only shown for drivers that are in the firmware).

If the driver is missing, add the key to the board's `default.px4board` file, or enable it in [`boardconfig`](../hardware/porting_guide_config.md#px4-menuconfig-setup) under **Drivers > Distance sensors**, and then [build and upload the firmware](../dev_setup/building_px4.md).

The driver does not start until [SENS_PTGL100_CFG](../advanced_config/parameter_reference.md#SENS_PTGL100_CFG) is set (see [PX4 Configuration](#px4_configuration)).

## PX4 Configuration {#px4_configuration}

1. Ensure that the wired UART is not used by another function, such as MAVLink or GNSS.
If it is, see [Deconflicting Ports](../peripherals/serial_configuration.md#deconflicting-ports) in _Serial Port Configuration_.
2. [Configure the serial port](../peripherals/serial_configuration.md) on which the rangefinder will run using [SENS_PTGL100_CFG](../advanced_config/parameter_reference.md#SENS_PTGL100_CFG), and then reboot.
3. If the sensor is not mounted facing down, set [SENS_PTGL100_ROT](../advanced_config/parameter_reference.md#SENS_PTGL100_ROT) to its mounting direction and reboot.

For example, select `TELEM 3` (`103`) for a module connected to the Flycore `TELEM3` port.
There is no need to set the baud rate for the port (460800), as this is configured by the driver.
By default, the port is `Disabled` (`0`) and the orientation is `Downward facing` (`25`).

If `SENS_PTGL100_CFG` is not available in _QGroundControl_, the driver is not in the firmware: see [Firmware Support](#firmware_support).

The configuration that is common to all rangefinders, such as the sensor position offsets used by the estimator, is covered in [Rangefinders > Configuration/Setup](../sensor/rangefinders.md#configuration).

## Testing {#testing}

In the [_QGroundControl_ MAVLink Console](../debug/mavlink_shell.md#qgroundcontrol-mavlink-console), run:

```sh
ptgl100 status
listener distance_sensor -n 10
```

`status` reports the UART, baud rate, topic instance, last distance and sample age, measurement status, and error counters.
If no measurement reply has arrived in the last second, it warns "no recent measurement replies" and lists what to check: the sensor's power, the `EN` connection to GND, the TX/RX wiring, and the module's baud rate (see [Sensor Configuration](#sensor_configuration)).

If several distance sensors are connected, select the instance reported by `status`, for example:

```sh
listener distance_sensor -i 1 -n 10
```

See [Rangefinders > Testing](../sensor/rangefinders.md#testing) for how to view the data in the _QGroundControl_ MAVLink Inspector and other generic steps.

The driver publishes the sensor type (laser), the 0.2–100m range limits, and the selected orientation.

## Developer Information {#developer_information}

The [ptgl100](../modules/modules_driver_distance_sensor.md#ptgl100) driver starts continuous measurement and publishes the standard `distance_sensor` topic used by MAVLink and ULog.

### Diagnostics

The driver rejects corrupt frames and does not publish distance bytes from failed measurements.
During a communication outage it does not repeat an old distance with a new timestamp.
After one second without a complete measurement reply it retries the continuous measurement command, at most once per second.
Measurement failure replies count as communication with the module and are reported separately from communication errors.

To run the driver manually, first disable automatic startup (set [SENS_PTGL100_CFG](../advanced_config/parameter_reference.md#SENS_PTGL100_CFG) to `Disabled` and reboot), then run:

```sh
ptgl100 start -d /dev/ttyS3 -R 25
ptgl100 status
ptgl100 stop
```

The device name above corresponds to the Flycore `TELEM3` port.
When stopped, the driver attempts to send the stop measurement command before closing the UART.

### Protocol

The driver sends the `0x69` (continuous measurement) and `0x8E` (stop) commands, accepts `0x68`/`0x69` measurement replies, and rejects replies that use `0x88`/`0x89`.
Comment thread
hamishwillee marked this conversation as resolved.
Resolved
For the frame format and checksums, request the PTGL-100 User and Maintenance Manual from JRT (see [Further Information](#further_information)).

## Further Information {#further_information}

- [Modules Reference: Distance Sensor (Driver): ptgl100](../modules/modules_driver_distance_sensor.md#ptgl100)
- Contact [JRT](https://www.jrt-measure.com/) at [sales@jrt-measure.com](mailto:sales@jrt-measure.com) to obtain the latest PTGL-100 User and Maintenance Manual (Chinese).
9 changes: 9 additions & 0 deletions docs/en/sensor/rangefinders.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ There may also be other DroneCAN rangefinders than those listed here.
| [Benewake TFmini] _(disc.)_ | ToF (IR) | 0.3 m – 12 m | UART | ~ | Discontinued |
| [Garmin LIDAR-Lite v3] | ToF (IR laser) | up to 40 m | I2C, PWM | ~ | PX4 caps range to 35 m or less |
| [Holybro ST VL53L1X Lidar] | ToF (IR) | up to ~4 m | I2C | ~ | |
| [JRT PTGL-100] | ToF (IR laser) | 0.2 m – 100 m | UART | ~ | High update rate (100 Hz) |
| [LeddarOne] | ToF (IR) | 1 cm – 40 m | UART | ~ | |
| [LightWare SF11/C] | ToF (IR laser) | up to ~120 m | UART, I2C | ~ | |
| [LightWare LW20/C] | ToF (IR laser) | up to ~100 m | I2C | ~ | Waterproof (IP67) + servo |
Expand All @@ -51,6 +52,7 @@ There may also be other DroneCAN rangefinders than those listed here.
[Benewake TFmini]: ../sensor/tfmini.md
[Garmin LIDAR-Lite v3]: ../sensor/lidar_lite.md
[Holybro ST VL53L1X Lidar]: #holybro-st-vl53l1x-lidar
[JRT PTGL-100]: ../sensor/ptgl100.md
[Lanbao PSK-CM8JL65-CC5]: ../sensor/cm8jl65_ir_distance_sensor.md
[LeddarOne]: ../sensor/leddar_one.md
[LightWare Lidar]: ../sensor/sfxx_lidar.md
Expand Down Expand Up @@ -147,6 +149,13 @@ It has a sensing range from 1cm to 40m and needs to be connected to a UART/seria

The [Benewake TFmini](../sensor/tfmini.md) LiDAR rangefinders (TFmini-S and TFmini Plus) have a range of 0.1–12 m and connect to a serial port (UART).

### JRT PTGL-100

<Badge type="tip" text="main (PX4 v2.0)" />

The [JRT PTGL-100](../sensor/ptgl100.md) is a laser rangefinder with a 0.2 m to 100 m range and a 100 Hz measurement rate.
It must be connected to a UART/serial bus.

### PSK-CM8JL65-CC5

<Badge type="info" text="Discontinued" />
Expand Down
17 changes: 17 additions & 0 deletions src/drivers/distance_sensor/ptgl100/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2026 PX4 Development Team. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause

px4_add_module(
MODULE drivers__distance_sensor__ptgl100
MAIN ptgl100
SRCS
PTGL100.cpp
ptgl100_parser.cpp
MODULE_CONFIG
module.yaml
DEPENDS
drivers_rangefinder
px4_work_queue
)

px4_add_unit_gtest(SRC PTGL100ParserTest.cpp EXTRA_SRCS ptgl100_parser.cpp)
5 changes: 5 additions & 0 deletions src/drivers/distance_sensor/ptgl100/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
menuconfig DRIVERS_DISTANCE_SENSOR_PTGL100
bool "ptgl100"
default n
---help---
Enable the JRT PTGL-100 UART laser rangefinder driver.
Loading
Loading