YDLIDAR X2 360 Degree Laser Range Scanner Instruction Manual
- June 9, 2024
- YDLIDAR
Table of Contents
Make robots serve people better
X2 360 Degree Laser Range Scanner
Instruction Manual
WORKING MECHANISM
After the X2 is powered on, the system automatically starts ranging. The following is the working process of the X2 system workflow:
FIG 1 YDLIDAR X2 WORKFLOW
SAMPLING AND RANGING
After power on, the system will automatically start ranging, and at the same time it will output to the serial port a message data to start scanning: A5 5A 05 00 00 40 81. The specific meaning of this message is as follows:
FIG 2 YDLIDAR X2 START SCAN MESSAGE DESCRIPTION
➢ Start sign: X2’s message sign is unified as 0xA55A.
➢ Response length: The response length indicates the length of the
response content, when the answer mode is continuous, the length should be
infinite, so this value is invalid.
➢ Response mode: This bit is only 2 bits, which means this time it is a
single response or continuous response. Its value and corresponding mode are
as follows:
CHART 1 YDLIDAR X2 RESPONSE VALUE AND MODE
Mode | 0x0 | 0x1 | 0x2 | 0x3 |
---|---|---|---|---|
Response mode | Single response | continuous response | Undefined |
➢ Type code: The type code of the start scan message is 0x81.
➢ Content: Scan data, see data protocol for details.
POWER-ON INFORMATION
After power-on, the system will output power-on information once, and will feedback the device model, firmware version and hardware version, as well as the factory serial number of the device. The response message is:
FIG 3 YDLIDAR X2 DEVICE INFORMATION MESSAGE
According to the protocol analysis: response length = 0x00000014, response
mode = 0x0, type code = 0x04.
That is, the number of response content bytes is 20; this response is a single
response, and the type code is 04. The response content of this type meets the
following data structure:
FIG 4 YDLIDAR X2 DEVICE INFORMATION RESPONSE CONTENT DATA STRUCTURE
➢ Model number: One-byte device model, such as the model code of X2 is
04;
➢ Firmware Version: 2 bytes. The low byte is the major version number,
and the high byte is the minor version number;
➢ Hardware version: 1 byte for hardware version;
➢ Serial number: 16 bytes, the only factory serial number.
DATA PROTOCOL
After the system starts to scan, it will output the scan data in the
subsequent message. The data protocol is sent to the external device in
hexadecimal to the serial port according to the following data structure.
Byte offset:
FIG 5 SCHEMATIC DIAGRAM OF THE DATA STRUCTURE OF THE SCAN COMMAND RESPONSE CONTENT
CHART 2 SCAN COMMAND RESPONSE CONTENT DATA STRUCTURE DESCRIPTION
Content | Name | Description |
---|---|---|
PI-1(2B) | Packet header | 2B in length, fixed at Ox55AA, low in front, high in |
back
CT(1B)| Package type| Indicates the type of the current packet, CT[bit(0)]=1
means the beginning of a lap of data, CT[bit(0)]=0 means point cloud data
packet, CT[bit(7:1)] is reserve bit
LSN( 1B)| Sample quantity| Indicates the number of sampling points contained
in the current packet. There is only one initial point of data in the zero
packet. The value is 1
FSA(2B)| Start angle| The angle data corresponding to the first sample point
in the sampled data
LSA(2B)| End angle| The angle data corresponding to the last sample point in
the sampled data
CS(2B)| Check code| The check code of the current data packet uses a two-byte
exclusive OR to check the current data packet
Si(2B)| Sample data| The sampling data of the system test is the distance data
of the sampling point, and the interference flag is also integrated in the LSB
of the Si node
➢ Start bit and scan frequency analysis:
When CT[bit(0)] = 0 is detected, it indicates that the packet data is a point
cloud data packet;
When CT[bit(0)] = 1 is detected, it indicates that the packet data is start
packet. In this packet,
LSN=1, that is, the number of Si is 1; for the specific value analysis of the
distance and angle, please refer to the following; at the same time, in the
start data packet, CT[bit(7:1)] scan frequency information, F =
CT[bit(7:1)]/10 (when CT[bit(7:1)] = 1).
Note: When CT[bit0]=0, CT[bit(7:1)] is a reserved bit, and future
versions will be used for other purposes.
Therefore, in the process of parsing CT, only bit(0) is required to determine
the starting frame.
➢ Distance analysis:
Distance solution formula: Distance
Among them, is sample data. Set the sampling data as E5 6F. Since the system
is in little endian mode, the sampling point S = 0x6FE5 is substituted into
the Distance solution formula to obtain the Distance=7161.25mm.
➢ Angle analysis:
Angle data is stored in FSA and LSA, and each Angle data has the following
data structure, where C is the check bit and the value is fixed to 1. There
are two levels of angle analysis: first-level analysis and second-level
analysis. The first-level analysis obtains the initial value of the angle, and
the second-level analysis corrects the initial value of the angle. The
specific process is as follows:
First-level analysis:
Starting angle solution formula:
AngleFSA
End angle solution formula: AngleLSA
FIG 6 ANGLE DATA STRUCTURE SCHEMATIC
( = 2,3, … , − 1)
ℎ(, 1)means shifting the data to the right by one bit. () means the
clockwise angle difference from the starting angle (uncorrected value) to the
ending angle (uncorrected value), and LSN represents the number of packet
samples in this frame.
Second-level analysis:
Angle correction formula: = + AngCorrect ( = 1,2, … , )
Among them, AngCorrect is the angle correction value, and its calculation
formula is as follows, tand−¹ is the inverse trigonometric function, and the
angle value is returned:
IF Distance == 0
AngCorrect = 0
ELSE
AngCorrect =
Assuming that the 4th to 8th bytes in the data packet are 28 E5 6F BD 79, so
LSN = 0x28 = 40(dec), FSA = 0x6FE5, LSA = 0x79BD, and the first-level solution
formula is brought into:
= 223.78°, = 243.47°, () = 19.69°
= ∗ ( − 1) + 223.78° ( = 2,3, … ,39)
Assuming that in this frame of data, Distance 1= 1000, Distance = 8000, and
the second level calculation formula is brought into it, and get:
AngCorrect1 = − 6.7622° , AngCorrect = −7.8374°,so:
= 1 + AngCorrect1 = 217.0178°
= + AngCorrect = 235.6326°
In the same way, ( = 2,3, … , − 1) can be obtained in turn.
➢ Check code parsing:
The check code uses a two-byte exclusive OR to verify the current data
packet. The check code itself does not participate in XOR operations, and the
XOR order is not strictly in byte order. The XOR sequence is as shown in the
figure. Therefore, the check code solution formula is:
CS= 1 () =1,2,…,end
FIG 7 CS XOR SEQUENCE
XOR1 indicates the XOR of the element from subscript 1 to end. However, XOR satisfies the exchange law, and the actual solution may not need to follow the XOR sequence.
MOTOR SPEED CONTROL
At the same time, users can change the scanning frequency to meet their needs according to actual needs. Adjust the motor speed by changing the input voltage of the M_SCTP pin or changing the duty cycle of the input PWM signal (for specific control methods, please refer to the data sheet).
REVISE
Date | Version | Content |
---|---|---|
4/24/2019 | 1 | Compose a first draft |
7/30/2021 | 1.1 | Modify CT information |
Copyright 2019 EAI All Rights Reserved
Documents / Resources
|
YDLIDAR X2 360 Degree Laser Range
Scanner
[pdf] Instruction Manual
X2, X2 360 Degree Laser Range Scanner, 360 Degree Laser Range Scanner, Laser
Range Scanner, Range Scanner, Scanner
---|---
Read User Manual Online (PDF format)
Read User Manual Online (PDF format) >>