background image

Serial interface

Overview

We suggest using the pre-built APIs for communicating with the LW24/C where possible.

The LW24/C uses a packet based binary protocol which can be accessed over the serial and I2C interfaces. All
higher-level APIs (C, Python, JavaScript) use this protocol to function.

If you require more control than the existing APIs offer or need to port the protocol to a different platform, then you
can use the information here to build a compatible system.

Communication is performed using encapsulated packets for both sending and receiving data. Every packet that is sent
to the LW24/C is known as a request and a correctly formatted request will always be replied to with a response. There
are cases where the LW24/C will send a request packet to the host, these packets are considered streaming packets as
they arrive without a direct request from the host - they do not require a response from the host.

Streaming data is only available through the Serial interface.

Requests are made using one of the available

commands

and are either flagged as read or write. When a read request

is issued then the response will contain the requested data. When a write request is issued then the contents of the
response will vary depending on the command.

Default serial interface properties

Baud rate: 115200

Data: 8 bit

Parity: none

Stop: 1 bit

Flow control: none

Packets

A packet for both requests and responses is composed of the following bytes:

Header

Payload

Checksum

**Byte:**

Start

Flags Low

Flags High

ID

Data 0 .. N

CRC Low

CRC High

LW24/C/SI microLiDAR™ sensor - Product guide

|

Version 0

|

03 March 2022

Page

20

of

36

Содержание LW24 LiDAR

Страница 1: ... at the reader s own risk and whilst every effort has been made to ensure its validity neither LightWare Optoelectronics Pty Ltd nor its representatives make any warranties with respect to the accuracy of the information contained herein LW24 C SI microLiDAR sensor Product guide Version 0 03 March 2022 Page 1 of 36 ...

Страница 2: ... 16 Serial port baud rate 17 Startup mode 17 I2C address 17 I2C bus speed 17 Update rate 17 Zero distance offset 17 Lost signal threshold 17 Enable median filter 18 Median filter size 18 Enable rolling average filter 18 Rolling average size 18 Enable smoothing filter 18 Smoothing filter strength 18 Firmware change log 18 Upgrading firmware 18 Safety maintenance 18 Safety overview 18 Laser eye safe...

Страница 3: ...8 9 User data 28 10 Token 28 12 Save parameters 28 14 Reset 28 16 Stage firmware 29 17 Commit firmware 29 27 Distance output 30 30 Stream 30 44 Distance data in cm 31 45 Distance data in mm 31 50 Laser firing 32 57 Temperature 32 66 Update rate 32 74 Noise 33 75 Zero offset 33 76 Lost signal counter 33 79 Baud rate 33 80 I2C address 34 82 Median filter enable 34 83 Median filter size 34 84 Smoothi...

Страница 4: ...93 Rolling average enable 35 94 Rolling average size 35 Document revision 36 LW24 C SI microLiDAR sensor Product guide Version 0 03 March 2022 Page 4 of 36 ...

Страница 5: ...t supports the following devices Product Hardware Firmware Supported LW24 C SI 1 2 0 0 Yes Revision Date Notes 0 01 01 2022 Initial release Specifications Performance Range 0 2 100 m 0 6 328 ft white wall in daylight conditions Update rate 48 388 readings per second Resolution 1 cm 0 033 ft Accuracy 10 cm 0 33 ft Connections Power supply voltage 4 5 V 5 5 V Power supply current 55 mA typical Outpu...

Страница 6: ... that can configure update and visualize data for the LW24 C In this guide we will use LightWare Studio to view distance data from the LW24 C LightWare Studio can be found here Download the version compatible with your operating system and proceed with installation You can safely install over an existing version of LightWare Studio if you are upgrading Insert the communication cable into the LW24 ...

Страница 7: ...ed to your computer Your USB adaptor will be recognized and displayed here LightWare Studio device connection screen You can register your device by clicking on the Register to receive firmware update notifications banner Click on the USB adaptor to establish a connection From here you can access tools to inspect and configure the LW24 C LW24 C SI microLiDAR sensor Product guide Version 0 03 March...

Страница 8: ...has the latest firmware You can see the changes that have been made to each version and the option of downgrading is also available If you choose to upgrade then click the Install button and follow the instructions LightWare Studio device upgrade screen LW24 C SI microLiDAR sensor Product guide Version 0 03 March 2022 Page 8 of 36 ...

Страница 9: ...to point the LW24 C at various surfaces to measure their distances LightWare Studio LW24 C scanning screen Parameters are shown in the panel on the top right of the LightWare Studio window Modify these parameters to fit your application LW24 C SI microLiDAR sensor Product guide Version 0 03 March 2022 Page 9 of 36 ...

Страница 10: ...see the operating concepts section What s next The next step is to integrate the LW24 C into your platform of choice Please follow one of the integration guides or consult the communication protocol reference for building your own system to interact with the LW24 C LW24 C SI microLiDAR sensor Product guide Version 0 03 March 2022 Page 10 of 36 ...

Страница 11: ...Tensility straight DigiKey 839 1553 ND Optional 1 x Tensility 90 degree DigiKey 839 10 03635 ND 5 x M2 x 12 Pan slotted screw 5 x M2 hex nut 5 x Flat washer Hardware Dimensions LW24 C dimensions LW24 C SI microLiDAR sensor Product guide Version 0 03 March 2022 Page 11 of 36 ...

Страница 12: ...comprises the laser and receiver lenses LW24 C optical assembly Heatsink EMI shield The lid lowers EMI radiation entering or leaving the LW24 C It also acts as a heatsink to draw heat away from the LW24 C LW24 C SI microLiDAR sensor Product guide Version 0 03 March 2022 Page 12 of 36 ...

Страница 13: ...ble pinout Communication cable pinout Pin Function Notes 1 5V 4 5 V 5 5 V 55mA I typical 2 RXD SDA RXD when using Serial SDA when using I2C 3 TXD SCL TXD when using Serial SCL when using I2C 4 GND Ground LW24 C SI microLiDAR sensor Product guide Version 0 03 March 2022 Page 13 of 36 ...

Страница 14: ... orientations The LW24 C can be mounted in a downward facing orientation for altimetry terrain following or precision landing applications For terrain following install the rangefinder at an angle to reduce lag time in reaction The angle depends on the speed traveled and the overall system lag but should be between 20 and 45 degrees The LW24 C can be mounted forward facing orientation for sense an...

Страница 15: ...DAR It uses time of flight technology to determine the distance of a target at a configurable update rate of 48 Hz to 388 Hz The LW24 C can be connected to a host controller with the serial or I2C interface The serial port 3 3 V logic level 5 V tolerant has a configurable baud rate The I2C serial bus 3 3 V logic level and 3 3 k pull up resistors 5 V tolerant has a configurable address and is an al...

Страница 16: ...aud rate should be as high as possible to accommodate high measurement update rates Startup mode Determines the communication behavior of the LW24 C when turned on I2C address The address used to communicate on the I2C bus I2C bus speed The speed of the I2C bus Update rate The number of measurements per second From 48 Hz to 388 Hz Zero distance offset An offset applied to the measured distance val...

Страница 17: ...s Smoothing filter strength Determines response of the smoothing filter Firmware change log Upgrading firmware The LW24 C firmware can be upgraded by using LightWare Studio Download LightWare Studio here Follow the Quick start with LightWare Studio guide for details on downloading and using LightWare Studio 2 0 0 Notes Initial release Safety maintenance Safety overview The LW24 C should not be dis...

Страница 18: ... The level of the laser emission is Class 1M which indicates that the laser beam is safe to look at with the unaided eye but must not be viewed using binoculars or other optical devices Notwithstanding the safety rating avoid looking into the beam and switch the unit off when working in the area The laser eye safety rating depends on the mechanical integrity of the optics and electronics if these ...

Страница 19: ... classification Class 1M Laser wavelength 905 nm Pulse width 16 ns Pulse frequency 20 kHz Average power 2 5 mW NOHD 15 m Distance beyond which binoculars may be used safely Approximate values only Please contact LightWare LLC if further information is required Service maintenance The LW24 C is not field serviceable For any repairs the equipment should be completely isolated removed then packaged c...

Страница 20: ...re cases where the LW24 C will send a request packet to the host these packets are considered streaming packets as they arrive without a direct request from the host they do not require a response from the host Streaming data is only available through the Serial interface Requests are made using one of the available commands and are either flagged as read or write When a read request is issued the...

Страница 21: ...ommand type Each command under the detailed command descriptions section documents how the data bytes are used The ID byte will always be present in the payload The CRC bytes form a 16 bit checksum value used to validate the integrity of the packet data Every byte in the packet except for the CRC itself is included in the checksum calculation Checksum Each packet has a 2 byte checksum which is use...

Страница 22: ...F crc code code code 7 0xFFFF crc code return crc Receiving packets Here is the process for reading the raw serial byte stream and identifying packets Once a packet has been successfully read it can be processed based on its command ID LW24 C SI microLiDAR sensor Product guide Version 0 03 March 2022 Page 22 of 36 ...

Страница 23: ...as little appreciable impact Handling request response Every request sent to the LW24 C will receive a response it is often useful to use the response to determine if the request was received and processed Here is the recommended procedure for sending a command request and reading the response LW24 C SI microLiDAR sensor Product guide Version 0 03 March 2022 Page 23 of 36 ...

Страница 24: ...using the pre built APIs for communicating with the LW24 C where possible The LW24 C uses a packet based binary protocol which can be accessed over the serial and I2C interfaces All higher level APIs C Python JavaScript use this protocol to function LW24 C SI microLiDAR sensor Product guide Version 0 03 March 2022 Page 24 of 36 ...

Страница 25: ...ata will only be transmitted when requested by the master Streaming data is only available through the Serial interface Requests are made using one of the available commands When a read request is issued then the response will contain the requested data When a write request is issued then there is no response generated Default I2C interface properties Address 0x66 LW24 C SI microLiDAR sensor Produ...

Страница 26: ... parameters W 2 14 Reset Restart the unit W 2 16 Stage firmware Upload firmware file pages RW 4 130 17 Commit firmware Apply staged firmware RW 4 0 27 Distance output Distance output configuration RW 4 4 Y 30 Stream Current data stream type RW 4 4 N 44 Distance data in cm Measurement distance data in cm R varies 45 Distance data in mm Measurement distance data in mm R varies 50 Laser firing Is las...

Страница 27: ...mand descriptions 0 Product name A 16 byte string indicating the product model name This will always be LW24 C followed by a null terminator You can use this to verify the LW24 C is connected and operational over the selected interface Read Write Persists 16 byte string 1 Hardware version The hardware revision number as a uint32 Read Write Persists uint32 2 Firmware version The version of currentl...

Страница 28: ...r performing certain operations Once a token has been used it will expire and a new token is created Read Write Persists 16 bytes 16 bytes Yes 12 Save parameters Several commands write to parameters that can persist across power cycles These parameters will only persist once the Save parameters command has been written with the appropriate token The safety token is used to prevent unintentional wr...

Страница 29: ...ption 0 to 1000 Index of successfully written page 1 Page length is invalid 2 Page index is out of range 3 Flash failed to erase 4 Firmware file has invalid header 5 Flash failed to write 6 Firmware is for a different hardware version or firmware version is too low 7 Firmware is for a different product Read Write Persists uint32 130 bytes 17 Commit firmware The second part of uploading firmware to...

Страница 30: ...eturn raw 4 Last return filter 5 Last return strength 6 Background noise 7 Temperature Read Write Persists uint32 uint32 No 30 Stream The LW24 C can continuously output data without individual request commands being issued Reading from the Stream command will indicate what type of data is being streamed Writing to the Stream command will set the type of data to be streamed Value Streamed data 0 di...

Страница 31: ... int16 2 First return strength int16 3 Last return raw cm int16 4 Last return filtered cm int16 5 Last return strength int16 6 Background noise int16 7 Temperature 1 100 degC int16 Read Write Persists varies 45 Distance data in mm This command contains distance data as measured by the LW24 C The data included will vary based on the configuration of the 27 Distance output command The data will be p...

Страница 32: ... Write Persists uint8 uint8 No 57 Temperature Reading this command will return the temperature in 100ths of a degree Read Write Persists uint32 66 Update Rate This controls the update rate of the LW24 C Reading this command will return the current update rate Writing this command will set the update rate The update rate is selected from the following table Command value Update rate samples second ...

Страница 33: ...rns that needs to be generated before a lost signal indication is output on the distance value The lost signal indication on the distance output value is 1000 Read Write Persists int32 int32 Yes 79 Baud rate The baud rate as used by the serial interface This parameter only takes effect when the serial interface is first enabled after power up or restart Reading this command will return the baud ra...

Страница 34: ...n filter Value Description 0 disabled 1 enabled Read Write Persists uint8 uint8 Yes 83 Median filter size Reading this command will return the size of the median filter Writing this command will set the size of the median filter The valid range is 3 to 32 Read Write Persists uint32 Uint32 Yes 84 Smoothing filter enable Reading this command will return the status of the smoothing filter Writing thi...

Страница 35: ...mand will return the status of the rolling average filter Writing this command will set the status of the rolling average filter Value Description 0 disabled 1 enabled Read Write Persists uint8 uint8 Yes 94 Rolling average size Reading this command will return the size of the rolling average filter Writing this command will set the size of the rolling average filter The valid range is 2 to 32 Read...

Страница 36: ...Document revision Revision Date Comments Rev 0 2022 03 03 First edition LW24 C SI microLiDAR sensor Product guide Version 0 03 March 2022 Page 36 of 36 ...

Отзывы: