Skip to content

Multiple Slamtec LIDAR Connection Issues with MATLAB #2

@ismet55555

Description

@ismet55555

I'm running into some initial LIDAR connection issue with simultaneously connecting 4 Slamtec RPLIDAR A3 using this MATALB interface llibrary.

The issue is that I am having to retry the connection on at least one of the LIDARs before it connects.
And it can also vary with LIDAR that is. That is, all but one LIDAR connects the first time.
One time, it could be LIDAR on one COM port, another time it could be a LIDAR on another COM port.

This is the way it is set up right now.
Basically MATALB loads the provided interface library, hardwarex.dll. That exposes some library methods to be used by MATLAB.

The method to connect the LIDAR does the following:

  1. Opens the RS232 port
  2. Sets port options
  3. Gets some info and health statuses form lidar
  4. Sets the motor PWM to zero (stop lidar motor)
  5. Uses express scan mode option

Here somewhere the communication will error out.
Using a serial sniffer I was able to see that the LIDAR errors out after the following message to the LIDAR:

a5 f0 02   ff 03 ab   a5 25   a5 82 05 00 00 00 00 00 22

Which I tracked to the following library methods, in that order

SetMotorPWMRequestRPLIDAR()
CheckMotorControlSupportRequestRPLIDAR()
StopRequestRPLIDAR()
StartExpressScanRequestRPLIDAR()   <-- Error here

To which the LIDAR responds with:

a5 5a 54 00 00 40 82 

Where as a successfully connection response from the LIDAR much longer in content.


Things I've tried

  • Drain (force all write data) the write buffer with the interface libraries DrainComputerRS232Port() method before and/or after any write to lidar.
  • Setting the TX/Write OS FIFO buffer to FILE_FLAG_NO_BUFFERING (ie. WriteFile()).
  • Changing the Hardware FIFO buffer form max (16) to min (1).
  • Using MATLAB's serial() command to flush any input or output buffers prior to loading the library or trying the connections.

This is the system and settings I am working with

Lidar (x4):

  • Slamtec RPLIDAR A3
  • Firmware 1.26
  • Connected via USB (no USB hub used)
  • No other COM port devices connected

Computer

  • OS: Windows 10 Pro - Build 1903
  • CPU: Intel Xeon 3.00Ghz
  • RAM: 64 GB
  • HD: SSD - 512GB NVMe

Serial Port Settings

  • Boud Rate: 256000
  • Timeout: 1000

Software

  • MATLAB R2018b (9.5.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions