ldrobotSensorTeam / ldlidar_stl_ros2

LDROBOT DTOF LiDAR ROS2 Package
MIT License
45 stars 43 forks source link

How to make lidar stop scanning #10

Open altineller opened 1 year ago

altineller commented 1 year ago

Hello,

Is there a command I can send to the lidar to make it stop scanning, and still accept serial commands, and then start scanning again?

Can there be a hardware solution?

Best Regards, C.A.

alcor55 commented 1 year ago

My case, LD06 lidar. The sensor doesn't have an RX serial pin, so you can't send serial commands. It has a PWM in (pin 2). In theory, if you send a 3.3v PWM signal by the RPi GPIO18 pin, with a duty cycle of 46-54% and frequency 20-50khz, you can drive the sensor motor (start/stop/custom velocity). Though I'm trying it, the lidar ignores completely the PWM signal. I think I should add a mosfet in order to cut off the 5v Vin.

altineller commented 1 year ago

The Lidar does not ignore the pewm but only pwm=0 condition. To make it stop you have to cut the power off.

On 20 Oct 2023 Fri at 13:51 alcor55 @.***> wrote:

My case, LD06 lidar. The sensor doesn't have an RX serial pin, so you can't send serial commands. It has a PWM in (pin 2). In theory, if you send a 3.3v PWM signal by the RPi GPIO18 pin, with a duty cycle of 46-54% and frequency 20-50khz, you can drive the sensor motor (start/stop/custom velocity). Though I'm trying it, the lidar ignores completely the PWM signal. I think I should add a mosfet in order to cut off the 5v Vin.

— Reply to this email directly, view it on GitHub https://github.com/ldrobotSensorTeam/ldlidar_stl_ros2/issues/10#issuecomment-1772519259, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ5M4GGWH3VT56KXULUKX3YAJJSXAVCNFSM6AAAAAA3EUK5OSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZSGUYTSMRVHE . You are receiving this because you authored the thread.Message ID: @.***>