Slamtec RPLIDAR A1M8 Correct Wiring

Introduction

The purpose of this note is to share my findings regarding incorrect pin definitions found in Figure 3-4 of “LM108_SLAMTEC_rplidarkit_usermanual_A1M8_v2.2_en.pdf”. The same incorrect pin definitions are also found in earlier versions of this user manual.

Background

I fabricated an Nvidia Nano Jetbot some time ago and recently decided to mount this lidar unit to it even though the finished result made the Jetbot somewhat top heavy. Otherwise , it was working well except for one fault.

The A1M8 scan core voltage cannot droop below 4.9 volts. When the Jetbot is in full operation the onboard lithium battery cannot maintain this voltage level and the lidar core crashes. The A1M8 documentation is specific about this voltage requirement and gives guidance regarding how to supply power to the scan core with a separate 5 volt power source.

I found a spot on the Jetbot to fit two 18650 lithium cells in series with a buck converter that output a fixed 5.1 volts with sufficient current output. At that point I studied the existing colored-wire cable as well as Figure 3-4 along with Figure 3-1 and found disagreement between the two. For example, the yellow wire goes from P7-GND in Figure 3-4 to TX in Figure 3-1. Other wires also did not match. This left a big question. Which Figure is wrong?

Solution

The only thing to do was to measure the signals on all seven pins with an oscilloscope while running different executables from the pyRplidar library and Slamtec’s C++ SDK. In order to accomplish this it was necessary to fashion a custom cable with a breakout board for access to the pins. This was made easy with the purchase of a kit “1.25mm Pitch Connectors and Pre-Crimped Cables Compatible with Molex PicoBlade for Pixhawk Silicone 15cm Wire” from Amazon so that the existing 1.25 mm pitch receptacles on the UART board and the lidar could be used.

Pin Definitions and Correct Definitions

Presented first is the colored wire harness and its connection to the lidar and the UART board.

Shown is the lidar with its PCB that was studied. In all models, however, the seven wire cable separates into a three pin and 4 pin connector on the PCB as shown.

The next image taken from the Slamtec document is the definitions of the UART 7 pin connector annotated with wire colors on the left and actual function of each pin on the right.

One can see that P1, P2, and P3 are substantially correct except it was found that voltage was found to be normally at 3.3 volts and not constant in the fact that motor control pulses (to ground) are observed during operation. P4, P5, and P7 are wrong while P6 is correctly defined. The corrected definitions on the right were found. The oscilloscope showed clearly that the lidar was transmitting to the UART data on YELLOW and a constant 5 volts remained on ORANGE, as well as ground being on WHITE.

At the lidar PCB it was found the pin definitions were correct as seen in the next image, which is annotated with the wire colors for reference.

For completeness Figure 3-1 definitions are shown in the next image with annotations on the left showing wire color and their pin number reference on the UART.

Lastly, the descriptions for each pin function is substantially correct. For the purpose of my project, which was to supply the scan core with 5 volts from a separate power source, I spliced its ground into the WHITE wire and replaced ORANGE with a wire carrying the 5.1 volts from the power source’s buck converter output.

CRL_MOTO

This pin a somewhat mysterious because it sits at 3.3 volts and sometimes is pulsed low for very short times. The description in Figure 3-1 suggests that it should sit at a constant 5 volts to drive the motor at full speed. Alternately, it should be driven by a PWM source to vary the motor speed. There is some indications that it is tied to DTR on the UART board (USB Adapter board).

pyrplidar library

Further testing using the oscilloscope along with the pyrplidar python library showed that this pin is normally 3.3 volt but goes low immediately after connecting to the lidar using the command:

lidar.connect(port=”/dev/ttyUSB0″, baudrate=115200, timeout=3)

and stays at zero volts with the motor subsequently coming to a stop. It was found to be REQUIRED to follow connection with the command: lidar.set_motor_pwm(500) after which the pin goes high and stays high, thereby the motor continuing to run. Sending any other command will not affect this pin.

rplidar C++ library

The behavior upon serial comm connection to the device is different. A pulse to ground of 125 microseconds is seen. There is no condition where this pin remains at zero volts. Therefore, the programmer does not need to know any requirement such as that which was discovered using the pyrplidar library.

In the sdk it was found in src/arch/linux/net_serial.cpp this code:

    //Clear the DTR bit to let the motor spin
    clearDTR();

Therefore the SLAMTEC code specifically addresses this issue, that is, DTR cannot be left in the SET condition after a communication while the pyrplidar library overlooks this situation.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *