Your one-stop destination for everything you need to kickstart your journey with LightWare’s microLiDAR®.
Frequently asked questions
Connecting our Rangefinders to external devices such as Arduino, Raspberry Pi and Pixhawk to name a few, is not a difficult task. It just takes a few easy steps and you will be able to be up and running with out devices.
This example uses the following components and tools:
- Raspberry Pi 3 Model B+
- LW20/C
- Thonny Python
Useful tips before starting with the code:
- Ensure that you have Python V 3.0 on your Raspberry Pi
- Download the Python code using the following link: Python Code
- Configure I2C communication, a quick guide on how to do this is available using the following link: Raspberry Pi
- When using the LW20, Please use the hex address, 0x66. The rest of the code can remain the same.
The PLD (Pulsed Laser Diode) and APD (Avalanche Photo Diode) LightWare uses in their Laser Rangefinders have a lifespan of 100 000 hours.
The other electronic components have a much longer lifespan.
Caution: Electronics may degrade if subjected to high temperatures. We recommended keeping the products well within the specified operating temperatures.
The mean time between failure (MTBF) of mechanical components inside scanning devices are as follows:
– motors: approximately 6 000 hours
– slip rings: approximately 2 000 hours
In case of failure or maintenance please contact LightWare for our RMA procedure.
SF11 & SF30 product range
The lens assembly of these products are IP67, but the back-end containing the PCBA and connectors have no protection.
For the best protection install these devices in such a way that only the lenses are exposed and ensure a good seal around the housing.
SF20 product range
This product is an OEM module with an exposed PCBA and is designed to be integrated into an airframe or enclosure.
The lens assembly is IP67 and should be installed in such a way that only the lenses are exposed. Ensure a good seal around the lenses for optimal protection.
Caution:: The SF20 is an OEM module that requires the customer to provide appropriate heat sinking and EMI shielding.
SF40 product range
The SF40/C does not have protection at this time.
LW20 product range
The LW20 is fully encased and carries an IP67 rating.
Please visit our YouTube channel for application videos: https://www.youtube.com/c/LightWareLiDAR/videos
Reading altitude off a water surface is quite challenging, especially during bright sunshine. The laser signal can be lost within the water and sunshine reflecting off the water surface causes noise and false readings.
LightWare suggests changing the rangefinder’s settings before flying over water. This can be done either through the user manual or in flight, using the extensive command sets available for serial and I2C communication.
Step 1: Connect the rangefinder to the LightWare Terminal program. The rangefinder will automatically start reading.
Step 2: Press the <space bar> to stop the readings and display the menu.
Step 3: Press the <a> key to open the system menu.
The recommended measuring mode for altitude over water is long range. This means the rangefinder spends more time searching for a return signal than in quick response mode.
Step 4: Press <m> to enter the filter menu.
Step 5: p indicates the amount of seconds the rangefinder will wait before returning a lost signal output
1 second = 20 readings and is sufficient for altitudes below 50 meters
For altitudes higher than 50 meters we recommend using 2 seconds as the return signal is lost more often over the longer range.
Press <p> and enter <2> and press enter again for the new setting to be accepted.
Step 6: press <q> to switch on the median filter.
This median filter returns the most frequent result in a number of readings and is recommended for use over water due to the sunshine reflecting from the water surface as well as the lost signal conditions.
Step 7: Press <r> to set the filter size, or number of readings the rangefinder will use to determine the median output. Enter 20 and press <enter>.
The median filter will now use 20 readings and output the most frequent reading, which should discard false readings and temporary loss of signal.
The maximum median filter size is 32 readings.
By default the SF20 and LW20 are setup to communicate via I2C or Serial UART once connected to your device.
SF 20 layout
Serial Mode, this will force the rangefinder to communicate with the controller in Serial.
The SF 22 is a great tool for hobbyists who want to get their hands on a long range LiDAR at low cost. This unit has 100 m range and is able to connect via Serial UART or I2C. This amazing little unit has a resolution of 1 cm, thus it also has high precision. In this article we will connect to the SF 22 using a Serial UART connection.
In this application guide:
- We will look at the difference between first and last return signals
- How knowing this information will allow you to set up the device more optimally
- All libraries used in this document can be found in the Quickstart & API reference guide
When a LiDAR unit measures range, generally it is a solid surface that the return signal is received from. But what happens to light that passes through a surface that light is able to pass through such as glass or perspex? The result is you get two signals back. This is not apparent at close range, this is due to the wavelength of the laser. Depending on the wavelength of the sensor you are using, there will be a range where the first and last return data will appear to be the same. This is because the “length” of the light pulse is of a certain distance and at a short distance the two return signals are seen as one continuous return by the APD sensor. Both instances will be shown below, the first image shows what happens at close range. The second image shows what happens at long range.
Short Distance Return Signal
Definition
- First return – simply put is the light signal that the SF 22 receives as the first strong light signal back from the single pulse.
- Second return – is the second light signal that the SF 22 receives as the second strong signal back from a single pulse.
Connecting the Arduino for Serial UART communication:
SF 22 Serial UART connection to Arduino
Arduino Code
The code given below is available in the quick start guide (Quickstart & API reference guide), a slight addition to the code needs to be made to access the second return information.
The following lines of code were added to the code:
(sf22.lastRaw_cm,DEC) … ( access the last return distance in centimeters.)
(sf22.lastStrength_cm,DEC) …( access the last return signal strength in centimeters.)
________________________________________________________________________________________________________________________________________________
Code:
// www.Lightware.co.za Oct 2019
// Lightware example code using the lw_sf22.h library
// This library enables the use of the I2C and Serial Interface
// This library is designed to use 2 Serial ports on the Arduino
#include <lw_sf22.h>
#include <Wire.h>
LW_SF22 sf22(Serial1, Serial);
void setup() {
//this is the serial port for the terminal window
Serial.begin(115200);
// Setup the Serial port for the SF22 interface
Serial1.begin(115200);
// Disable any possible streaming data
sf22.writeDataStreamType(0);
delay(100);
// Read the data sent from the SF22
sf22.ProcessSerialInput(1);
delay(100);
// Request the SF22 Hardware Name
sf22.readRequestHardwareName();
delay(100);
// Read the data sent from the SF22
sf22.ProcessSerialInput(1);
delay(100);
// Request the SF22 Firmware Version
sf22.readRequestFirmwareVersion();
delay(100);
// Read the data sent from the SF22
sf22.ProcessSerialInput(1);
delay(100);
// Request the streaming output distance data selection
sf22.readRequestDistOutConfig();
delay(100);
// Read the data sent from the SF22
sf22.ProcessSerialInput(1);
delay(100);
// Set the streaming to distance in cm
sf22.writeDataStreamType(13);
delay(100);
// Read the data sent from the SF22
sf22.ProcessSerialInput(1);
}
void loop() {
uint8_t new_data = 0;
// Every cycle check the Serial receive buffer for data and then process it
new_data = sf22.ProcessSerialInput(0);
// if new data was received, then display the following first and last distance
if (new_data == 1){
Serial.print(sf22.firstRaw_cm,DEC);
Serial.print(” cm “);
Serial.print(sf22.firstStrength_cm,DEC);
Serial.print(” % “);
Serial.print(sf22.lastRaw_cm,DEC);
Serial.print(” cm “);
Serial.print(sf22.lastStrength_cm,DEC);
Serial.print(” % “);
Serial.print(sf22.APDTemperature,DEC);
Serial.println(” DEG Celcuis “);
new_data = 0;
}
// put your main code here, to run repeatedly:
}
________________________________________________________________________________________________________________________________________________
Results :
The results are printed in the following sequence
- First Return
- First Signal Strength
- Last Return
- Last Signal Signal Strength
- APD temperature.
Initial Startup:
Close Distance:
Long Distance:
From the two results it can be seen that the second return is at a further distance away and that the unit is actually able to detect both the transparent material and the wall behind, provided that the wall behind is not too close. So depending on the application in which the SF 22 is used, it is advantageous to know this or have an idea of this property to maximise the potential of this LiDAR.
1. Poor
Connecting unshielded wires may make the SF20 susceptible to electromagnetic interference from nearby radio transmitters or other sources of noise. This will result in a slight loss of performance and in extreme cases the SF20 may be unable to take measurements. Small high frequency emissions from the SF20 may also be detected by sensitive radio or satellite receivers.
2. Better
Connecting the shield wire to the screw on the SF20 and earthing the other end to either ground or a quiet negative rail will improve the performance of the SF20 when near to a radio transmitter. Additionally, any RF transmission from the SF20 will be reduced.
3. Best
For the very best performance the LW20 provides a shield around the electronics that connects to the shield on the wire harness. By earthing this shield the LW20 is highly resistant to RF transmissions and will produce negligible interference.
What is Servo Lag?
Using a device such as a servo for scanning applications results in a phenomena known as “servo lag”.
This is noticeable when using a range finder scanning from left to right and then from right to left at a constant speed. The data received will appear to be mismatched when compared side by side. One of the main reasons why you would see this is that you have the mechanical drawback of servos, as you experience the effect of “servo lag”, that most servos experience when moving at a constant speed. Servo lag happens because servos are designed to move to a fixed location and stop. This is what they were optimised for, thus when the servo moves continuously, the control loop isn’t able to catch up with the aiming direction and always lags behind:
The orange and black lines indicate the difference in data received when scanning from left to right (black) and right to left (orange) due to the servo lag. Using the Terminal software, a servo lag factor can be applied either by following the FAQ on getting started with my LightWare LiDAR.
Using the Terminal software navigate to the menu option that allows you to enter a value for the servo lag, note that the mechanical motion of the servo will remain consistent. Depending on the servo you are using you will have to use a specific servo lag factor. If unsure, start adjusting this value incrementally (starting at a low value) until you notice that the values scanning from side to side overlap as indicated below:
From time to time these settings should be checked in case of wear on the gears or changes to the power supply.
IP (Ingress Protection) is an international standard used to rate the degree of protection in electrical enclosures against solids and liquids. The first digit after the IP indicates the level of protection against solids like dust. The second digit indicates protection against liquids like water. View the IP ratings guide here.
LightWare microLiDAR® sensors are available in two categories – SF range and LW range. Our LW range of sensors are entirely encased for full IP protection (IP65 or IP67).
The backend of the SF range has no IP protection but the lens assembly is IP rated. For the best protection against water and dust, install the SF device so that only the lenses are exposed. Then ensure that a good seal surrounds the housing. View our mounting guidelines here.
For specific IP ratings of our products, refer to the respective device manual.
LightWare’s products use lasers that emit light with a wavelength of 905 nm. This wavelength has been chosen to provide a good balance between reliability and eye safety. Shorter wavelengths are more hazardous and lasers with longer wavelengths are less reliable.
All LightWare products use the “direct time-of-flight” principle to measure distance. This works by timing how long it takes for a flash of laser light to travel to the surface being measured and back again. The distance is calculated using the equation:
distance-to-surface = speed-of-light x time-of-flight / 2
What makes the beam spread analysis difficult is that there is an “actual” beam spread and an “effective” beam spread.
The “actual” beam spread is an optical phenomena caused by the geometry of the lenses. This is a diverging cone that increases linearly in size as the distance increases.
The “effective” beam divergence is a measure of what the detector sees when a target is in the beam. At close distances the “effective” and “actual” beam divergence are similar. As soon as the edge of the target enters the beam it is detected making the apparent position of the edge of the beam match with the theoretical position.
As the distance increases the signal gets weaker so more of the target needs to be directly in the beam before the return signal can be detected. In other words the apparent edge of the beam no longer matches with the theoretical edge. This makes the beam appear to be smaller than the “actual” beam diameter and the “effective” beam divergence reduces as the distance increases.
As an example, a field-test with an LW20/C provided the following results:
- at 10 m distance – beam spread of approx. 4.5 cm
- at 45 m distance – beam spread of 19.0 cm
- at 91 m distance – beam spread of 20.3 cm
Method 1: use a mounting bracket
These products can be mounted using a purchased 725-28055 aluminium stand kit.
Method 2: directly onto the housing
Some customers glue Velcro onto the aluminium enclosure of the unit, and fix it to their airframe. Use zip ties to secure.
Mounting orientation:
Rangefinders can be mounted with a vertical or horizontal lens orientation.
They can be mounted in a downward facing orientation for altimetery / terrain following / precision landing applications. For terrain following, angle the rangefinder 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.
They can be mounted forward facing orientation for sense and avoid / position hold applications.
Precautions
Do not mount the rangefinder within the cavity of the airframe, rather mount it directly at the surface boundary. This can prevent beam divergence from causing false readings in short range distances, or out of range conditions.
Ensure that nothing is in the path of the laser beam.
Ensure that no shiny or highly reflective surfaces are near the path of the beam.
Secure the cable with zip ties to protect it from pulling on the connnectors.
Below is a table that compares all of our products and compatibility with different Autopilot stacks:
Method 1: directly onto the housing
The LightWare rangefinder housing has two 3.1 mm diameter holes (22 mm separation), which can be used for mounting directly onto an airframe or into an enclosure. The lens section has a ridge for landing and sealing purposes.
Some customers glue Velcro onto the lid section on the back of the unit, and fix it to their airframe. Use zip ties to secure.
Method 2: use a mounting bracket
These products can be mounted using a purchased 725-28920 aluminium stand kit.
Mount using a 3D printed mounting bracket from our library.
Mounting orientation
Rangefinders can be mounted with a vertical or horizontal lens orientation.
They can be mounted in a downward facing orientation for altimetery / terrain following / precision landing applications. For terrain following, angle the rangefinder 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.
They can be mounted forward facing orientation for sense and avoid / position hold applications.
Precautions
Do not mount the rangefinder within the cavity of the airframe, rather mount it directly at the surface boundary. This can prevent beam divergence from causing false readings in short range distances, or out of range conditions.
Ensure that nothing is in the path of the laser beam.
Ensure that no shiny or highly reflective surfaces are near the path of the beam.
Secure the cable with zip ties to protect it from pulling on the connnectors.
Connecting sensors to flight controllers such as the Pixhawk should not be a daunting task and requires a few easy steps to get up and running. We at LightWare would like to make it easier for our customers to be able to integrate our sensors with their flying or ground vehicles.
A vehicle that can maintain altitude and avoid obstacles is an attractive feature to have. From hobbyists to professionals, LightWare offers a variety of rangefinders that will be able to handle your needs.
Using the following steps to connect these rangefinders to a Pixhawk.
Overview
This guide covers LightWare products that have the serial number SXX-14501 and beyond. For previous devices please see these guides:
- SF10 & SF11: http://ardupilot.org/copter/docs/common-lightware-sf10-lidar.html
- LW20/SF20: http://ardupilot.org/copter/docs/common-lightware-lw20-lidar.html
- SF02: http://ardupilot.org/copter/docs/common-rangefinder-sf02.html
- SF40C: http://ardupilot.org/copter/docs/common-lightware-sf40c-objectavoidance.html
Step 1: LightWare Upgrader tool
NOTE: The Upgrader tool in the link is for windows, for other operating systems, please contact us for further instructions. Some older units will need the I2C compatibility mode to be switched on(SF 11C/B). If your unit does not connect to the Upgrader tool, do not worry this step is not necessary, serial communication is immediately compatible. The Upgrader allows you to configure settings on your device using the “Manage” button. Please do not set Startup mode to I2C mode unless otherwise instructed to do so. If you do find your LW20/SF20 booting only in I2C mode, you can use the Devantech USB-ISS adapter which the Upgrader will respond to and allow you to change the Startup mode.
Before attempting to connect with the Pixhawk we recommend performing a firmware upgrade on your LightWare device. You will also need this tool to perform configuration for the Pixhawk later. Please follow the steps outlined below:
Use the following link to download the firmware Upgrader tool:
http://support.lightware.co.za/LightWareUpgrader-win-x64-1.56.0.zip
Extract the contents of the zipped folder and locate the LightWareUpgrader application.
Open the application and plug the rangefinder into an open USB port. The SF11C can be plugged in directly with the included USB cable. The SF20C/LW20C require a Serial UART TTL (3.3V logic, 5V Power) to USB adapter. A com port will appear on the screen in the following format COM X (FTDI).
Double check if your unit needs I2C compatibility to be switched on by navigating to the manage page:
Step 2: LightWare Terminal software
Note: This Step can be skipped. This is only done so that specific settings on the LiDAR unit need to be changed to suit very specific needs. Default settings are more than sufficient for most applications.
The latest Terminal software can be found on our website using the following link:
https://lightware.co.za/pages/software-downloads.
Install the software following the prompts that are given.
Open Terminal software and connect the rangefinder unit.
Navigate to the settings icon and ensure that the following settings are correct.
- Correct com port selected
- Correct Baud rate is selected
- Protocol is set to Serial.
Connect to the device by clicking on the “Connect” icon, the rangefinder will start streaming data immediately(SF11B/C).
However; the SF 20 B/C and LW 20 B/C units need to be “pinged”. This can be done by pushing the <up arrow> on the keyboard twice. Pushing the <up arrow> first time it will display the unit name, pushing the <up arrow> the second time will start the data streaming.
By pushing the <Space> will allow you to adjust the settings of the unit. The default address of the rangefinder is 0x66(Hexadecimal) and 102(Decimal).
Step 3: Connection Guide
SF11B / SF 11C Connection guide
a. Serial UART Connection
For a serial connection you can use any spare UART. Connect the RX line of the UART to the TX line of the Lidar, and the TX line of the UART to the RX line of the Lidar. Also connect the GND and 5V lines. You do not need flow control pins.
The diagram below shows how to connect to SERIAL4.
b. I2C Connection
Connect the SDA line of the Lidar to the SDA line of the I2C port on the Pixhawk, and the SCL line of the Lidar to the SCL line of the I2C port. Also connect the GND and 5V lines.
c. Analogue Connection
SF 20B/C and LW 20B/C Connection guide
To use a terminal emulation application to setup and test the LW20/SF20 you will need to connect the serial port of the LW20/SF20 to the USB port on a PC. This is done using a serial-to-usb converter such as the TTL-232R-3V3-WE converter cable from FTDI (https://www.ftdichip.com/Products/Cables/USBTTLSerial.htm). This converter provides both the signals and power supply to the LW20/SF20. Alternatively, one could use the ftdichip um230xb as shown in the illustration below:
a. Serial Connection
For a serial connection you can use any spare UART. Connect the RX line of the UART to the TX line of the Lidar, and the TX line of the UART to the RX line of the Lidar. Also connect the GND and 5V lines. You do not need flow control pins.
The diagram below shows how to connect to SERIAL4/5.
NOTE: This diagram is also correct for the SF 20
b. I2C Connection
Connect the SDA line of the Lidar to the SDA line of the I2C port on the Pixhawk, and the SCL line of the Lidar to the SCL line of the I2C port. Also connect the GND and 5V lines.
NOTE: This diagram is also correct for the SF 20
Step 4: Mission Planner
Download and extract the files from Pixhawk zipped folder. Open the mission planner application and plug in the Pixhawk, however, do not click the connect icon.
Open the Initial Setup page and select the firmware for the vehicle you would wish to use.
Ensure that the correct com port is selected, if you are uncertain, select “Auto” and Ardupilot will select the port the Pixhawk is connected. Click on “Connect”, select the “Config/Tuning” page and navigate to the “Full Parameter List”. In the search bar on the right on the screen type rngfnd. This will pull up all the commands with rngfnd that we need to adjust.
Ensure that the following configuration parameters are used:
1. Serial/UART Parameters
2. I2C Parameters
3. Analogue Parameters
4. SF40C (360 LiDAR) Parameters
Step 5: Viewing the rangefinder values
Once the parameters have been updated according to the rangefinder model you are using, click on “Write Parameters”.
Disconnect from the Pixhawk and then reconnect to allow the parameters to be updated to the Pixhawk. Navigate to the “Flight Data” page, the rangefinder values should be displayed either using either the “Status” tab, or the “Quick” tab.
To use the quick tab, you will need to add the “Sonarrange” and “Rangefinder 1” value. This is done by simply double clicking in the window and select these two categories.
Acknowledgements
We would like to thank Ardupilot and FTDI chip for some of the images used in this FAQ.
Ardupilot – http://ardupilot.org/copter/docs/common-rangefinder-landingpage.html
FTDI Chip – https://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_UMFT201_220_230XB.pdf
Connecting sensors to flight controllers such as the Pixhawk should not be a daunting task and requires a few easy steps to get up and running. We at LightWare would like to make it easier for our customers to be able to integrate our sensors with their flying or ground vehicles.
A vehicle that can maintain altitude and avoid obstacles is an attractive feature to have. From hobbyists to professionals, LightWare offers a variety of rangefinders that will be able to handle your needs.
Using the following steps to connect these rangefinders to a Pixhawk.
Overview
This guide covers LightWare products that have the serial number SXX-14501 and beyond. For previous devices please see these guides:
- SF10 & SF11: http://ardupilot.org/copter/docs/common-lightware-sf10-lidar.html
- LW20/SF20: http://ardupilot.org/copter/docs/common-lightware-lw20-lidar.html
- SF02: http://ardupilot.org/copter/docs/common-rangefinder-sf02.html
- SF40C: http://ardupilot.org/copter/docs/common-lightware-sf40c-objectavoidance.html
Step 1: LightWare Upgrader tool
NOTE: The Upgrader tool in the link is for windows, for other operating systems, please contact us for further instructions. Some older units will need the I2C compatibility mode to be switched on(SF 11C/B). If your unit does not connect to the Upgrader tool, do not worry this step is not necessary, serial communication is immediately compatible. The Upgrader allows you to configure settings on your device using the “Manage” button. Please do not set Startup mode to I2C mode unless otherwise instructed to do so. If you do find your LW20/SF20 booting only in I2C mode, you can use the Devantech USB-ISS adapter which the Upgrader will respond to and allow you to change the Startup mode.
Before attempting to connect with the Pixhawk we recommend performing a firmware upgrade on your LightWare device. You will also need this tool to perform configuration for the Pixhawk later. Please follow the steps outlined below:
Use the following link to download the firmware Upgrader tool:
http://support.lightware.co.za/LightWareUpgrader-win-x64-1.56.0.zip
Extract the contents of the zipped folder and locate the LightWareUpgrader application.
Open the application and plug the rangefinder into an open USB port. The SF11C can be plugged in directly with the included USB cable. The SF20C/LW20C require a Serial UART TTL (3.3V logic, 5V Power) to USB adapter. A com port will appear on the screen in the following format COM X (FTDI).
Double check if your unit needs I2C compatibility to be switched on by navigating to the manage page:
Step 2: LightWare Terminal software
Note: This Step can be skipped. This is only done so that specific settings on the LiDAR unit need to be changed to suit very specific needs. Default settings are more than sufficient for most applications.
The latest Terminal software can be found on our website using the following link:
https://lightware.co.za/pages/software-downloads.
Install the software following the prompts that are given.
Open Terminal software and connect the rangefinder unit.
Navigate to the settings icon and ensure that the following settings are correct.
- Correct com port selected
- Correct Baud rate is selected
- Protocol is set to Serial.
Connect to the device by clicking on the “Connect” icon, the rangefinder will start streaming data immediately(SF11B/C).
However; the SF 20 B/C and LW 20 B/C units need to be “pinged”. This can be done by pushing the <up arrow> on the keyboard twice. Pushing the <up arrow> first time it will display the unit name, pushing the <up arrow> the second time will start the data streaming.
By pushing the <Space> will allow you to adjust the settings of the unit. The default address of the rangefinder is 0x66(Hexadecimal) and 102(Decimal).
Step 3: Connection Guide
SF11B / SF 11C Connection guide
a. Serial UART Connection
For a serial connection you can use any spare UART. Connect the RX line of the UART to the TX line of the Lidar, and the TX line of the UART to the RX line of the Lidar. Also connect the GND and 5V lines. You do not need flow control pins.
The diagram below shows how to connect to SERIAL4.
b. I2C Connection
Connect the SDA line of the Lidar to the SDA line of the I2C port on the Pixhawk, and the SCL line of the Lidar to the SCL line of the I2C port. Also connect the GND and 5V lines.
c. Analogue Connection
SF 20B/C and LW 20B/C Connection guide
To use a terminal emulation application to setup and test the LW20/SF20 you will need to connect the serial port of the LW20/SF20 to the USB port on a PC. This is done using a serial-to-usb converter such as the TTL-232R-3V3-WE converter cable from FTDI (https://www.ftdichip.com/Products/Cables/USBTTLSerial.htm). This converter provides both the signals and power supply to the LW20/SF20. Alternatively, one could use the ftdichip um230xb as shown in the illustration below:
a. Serial Connection
For a serial connection you can use any spare UART. Connect the RX line of the UART to the TX line of the Lidar, and the TX line of the UART to the RX line of the Lidar. Also connect the GND and 5V lines. You do not need flow control pins.
The diagram below shows how to connect to SERIAL4/5.
NOTE: This diagram is also correct for the SF 20
b. I2C Connection
Connect the SDA line of the Lidar to the SDA line of the I2C port on the Pixhawk, and the SCL line of the Lidar to the SCL line of the I2C port. Also connect the GND and 5V lines.
NOTE: This diagram is also correct for the SF 20
Step 4: Mission Planner
Download and extract the files from Pixhawk zipped folder. Open the mission planner application and plug in the Pixhawk, however, do not click the connect icon.
Open the Initial Setup page and select the firmware for the vehicle you would wish to use.
Ensure that the correct com port is selected, if you are uncertain, select “Auto” and Ardupilot will select the port the Pixhawk is connected. Click on “Connect”, select the “Config/Tuning” page and navigate to the “Full Parameter List”. In the search bar on the right on the screen type rngfnd. This will pull up all the commands with rngfnd that we need to adjust.
Ensure that the following configuration parameters are used:
1. Serial/UART Parameters
2. I2C Parameters
3. Analogue Parameters
4. SF40C (360 LiDAR) Parameters
Step 5: Viewing the rangefinder values
Once the parameters have been updated according to the rangefinder model you are using, click on “Write Parameters”.
Disconnect from the Pixhawk and then reconnect to allow the parameters to be updated to the Pixhawk. Navigate to the “Flight Data” page, the rangefinder values should be displayed either using either the “Status” tab, or the “Quick” tab.
To use the quick tab, you will need to add the “Sonarrange” and “Rangefinder 1” value. This is done by simply double clicking in the window and select these two categories.
Acknowledgements
We would like to thank Ardupilot and FTDI chip for some of the images used in this FAQ.
Ardupilot – http://ardupilot.org/copter/docs/common-rangefinder-landingpage.html
FTDI Chip – https://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_UMFT201_220_230XB.pdf
Connecting sensors to flight controllers such as the Pixhawk should not be a daunting task and requires a few easy steps to get up and running. We at LightWare would like to make it easier for our customers to be able to integrate our sensors with their flying or ground vehicles.
A vehicle that can maintain altitude and avoid obstacles is an attractive feature to have. From hobbyists to professionals, LightWare offers a variety of rangefinders that will be able to handle your needs.
This guide covers LightWare SF30/D.
Step 1: LightWare Studio
Download and install lightware studio from https://lightwarestage.co.za/pages/software-downloads.
Step 2: Configure the SF30/D
Connect the SF30/D to a computer via the USB cable.
Select the SF30/D in the LightWare Studio.
Select parameters.
Ensure the serial port baud rate is set to 115200.
Set the output type (Legacy) to full communication mode.
Step 3: Connect the Pixhawk
Connect the SF30/D to thePixhawk by I2C (Port: I2C 2) or serial (Port: Telem 1).
Connect the Pixhawk via the USB port to the computer.
Step 4: Mission Planner
Open the Pixhawk Mission Planner.
Ensure that the correct com port is selected, if you are uncertain, select “Auto” and Ardupilot will select the port the Pixhawk is connected. Click on “Connect”, select the “Config/Tuning” page and navigate to the “Full Parameter List”. In the search bar on the right on the screen type rngfnd. This will pull up all the commands with rngfnd that we need to adjust.
Ensure that the following configuration parameters are used:
1. Serial/UART Parameters
SERIAL4_PROTOCOL 9 (LIDAR)
SERIAL4_BAUD 115 (115200)
RNG_MAX_CM 5000 (for SF11B/SF20B/LW20B),10000 (for SF20C/LW20C) and 12000 (for SF11C). Distance in cm that the rangefinder can reliably read in cm.
RNG_MIN_CM 5
RNGFND1_GNDCLEAR 10 (Distance of Lidar to ground in cm when vehicle is on the ground)
RNGFND_SCALING 1 (I2C, Serial/UART)
RNGFND_TYPE 8 (Serial)
2. I2C Parameters
RNGFND_ADDR 102 decimal – Default
RNG_MAX_CM 5000 (for SF11B/SF20B/LW20B),10000 (for SF20C/LW20C) and 12000 (for SF11C). Distance in cm that the rangefinder can reliably read in cm.
RNG_MIN_CM 5
RNGFND1_GNDCLEAR 10 (Distance of Lidar to ground in cm when vehicle is on the ground)
RNGFND_SCALING 1 (I2C, Serial/UART)
RNGFND_TYPE 7 (LightWare I2C)
3. Analogue Parameters
RNGFND1_PIN 14 (2nd pin of 3.3V ADC connector)
RNG_MAX_CM 4500 (for SF11B/SF20B/LW20B),9500 (for SF20C/LW20C) and 11500 (for SF11C). Distance in cm that the rangefinder can reliably read in cm.
RNG_MIN_CM 5
RNGFND1_GNDCLEAR 10 (Distance of Lidar to ground in cm when vehicle is on the ground)
RNGFND_SCALING 9,76(SF10A), 19,531 (SF10B), 39,06(SF10C),46.87 (for SF11C) or 48,0 (SF11/C)
RNGFND_TYPE 1 (Analog)
The RNGFND_SCALING value depends on the voltage on the rangefinders output pin at the maximum range. By default the SF10/B will output 2.56V at 50m, so the scaling factor is 50m / 2.56v ≈ 19.53 (the analogue distance range for each of the rangefinder variants can be found in the Rangefinder manual). The manual explains how you can confirm and change the maximum output range/voltage.
Once the parameters have been updated according to the rangefinder model you are using, click on “Write Parameters”.
Disconnect from the Pixhawk and then reconnect to allow the parameters to be updated to the Pixhawk. Navigate to the “Flight Data” page, the rangefinder values should be displayed either using either the “Status” tab, or the “Quick” tab.
To use the quick tab, you will need to add the “Sonarrange” and “Rangefinder 1” value. This is done by simply double clicking in the window and select these two categories.
The SF000/B LiDAR has an on-board servo motor driver. This and its small size make it ideal for creating a linear scanner.
This example uses the following components:
-SF000/B LiDAR
-SF000/B Communication cable
-SF000/B Breakout board
-SF000/B USB connector
-SF000/B LightWare mounting bracket
– Servo motor (FeeTech FT2331M or Micro Robotics LF-20MG are used here)
-USB Serial communicator
Connect the SF000/B via the communication cable and USB connector to a computer.
Select the tool icon on the top left and open the generic serial terminal.
Select the 115200 Baud rate and appropriate com port and connect.
Press the up arrow three times to cycle through the interface, then the right arrow key once to navigate to the scanning interface.
Set the scanning parameters to your desired servo by pressing the appropriate button indicated next to the setting. Settings above are for the FeeTech FT2331M.
Now disconnect the SF000/B from the USB adaptor and connect it to Section D of the breakout board.
Connect the servo motor to the 3 pin with pin 1 as ground.
(The “1” on the board indicates pin 1)
Connect the USB serial communicator.
Communication Rail Pin Description: 1 Power (Vin), 5V 2, Ground (GND), 3 Rx, 4 Tx
Connecting sensors to flight controllers such as the Pixhawk should not be a daunting task and requires a few easy steps to get up and running. We at LightWare would like to make it easier for our customers to be able to integrate our sensors with their flying or ground vehicles.
A vehicle that can maintain altitude and avoid obstacles is an attractive feature to have. From hobbyists to professionals, LightWare offers a variety of rangefinders that will be able to handle your needs.
This guide covers LightWare SF40/C.
Step 1: Connect the Pixhawk
Connect the SF40/C to thePixhawk to the Serial (Port: Telem 1).
Connect the Pixhawk via the USB port to the computer.
Step 2: Mission Planner
Open the Pixhawk Mission Planner.
Ensure that the correct com port is selected, if you are uncertain, select “Auto” and Ardupilot will select the port the Pixhawk is connected. Click on “Connect”, select the “Config/Tuning” page and navigate to the “Full Parameter List”. In the search bar on the right on the screen type rngfnd. This will pull up all the commands with rngfnd that we need to adjust.
Ensure that the following configuration parameters are used:
4. SF40C (360 LiDAR) Parameters
Once the parameters have been updated according to the rangefinder model you are using, click on “Write Parameters”.
Disconnect from the Pixhawk cycle the power to both the Pixhawk and SF40/C and then reconnect to allow the parameters to be updated. Navigate to the “Flight Data” page, the rangefinder values should be displayed using CTRL+F and veiwing the proximity page.
All packaging and deliveries are done to the highest standards and in pursuit of Customer’s satisfaction. For a full disclosure of our terms and conditions please refer to our Terms and conditions of sale page.
Delivery will be on DAP Incoterms* (Delivered at Place) and will be quoted using a LightWare Optoelectronics (Pty) Ltd contracted courier for all exported orders. We are using and have been using UPS (United Parcel Service) for all our deliveries. DAP means the Customer is the recipient of the shipment and importer of the ordered items and is thus responsible for all import fees levied by the destination country. Prices and delivery options are set on our Website using our special UPS rates, but require the Customer to register in order to calculate and review relevant rates. Delivery will be made to the Customer’s address specified during the completion of your online order, unless agreed upon in writing by both parties.
LightWare regrets that no collections or shipments via customer courier accounts can be allowed as this will trigger an obligation to charge 15% VAT as stipulated by South Africa tax law. LightWare endeavours to dispatch all ex-stock orders during the next business day of receipt of the paid order. Shipping turnaround time is approximately 3-5 working days**, however this is subject to uncontrollable delays**.
Upon pickup from our premises, the Customer will receive an email containing the tracking details to assist with tracking and clearing. Times and dates for delivery quoted on the Website are approximate only and dependent on third party courier services. LightWare Optoelectronics (Pty) Ltd shall not be liable for any delay in delivery. If any delivery is late, the Customer must notify LightWare Optoelectronics (Pty) Ltd, and LightWare Optoelectronics (Pty) Ltd will do our best to assist the Customer. In cases of non-delivery or lost courier parcels LightWare Optoelectronics (Pty) Ltd will endeavour to send replacement products as soon as possible.
An email with a tracking details will be issued as soon as the parcel has been picked up by the courier company. LightWare Optoelectronics (Pty) Ltd cannot assist with requests for a lower declared value to reduce customs duties. All exports must legally be declared at their commercial values.
The signature of any agent, contractor, sub-contractor, or employee of the Customer on the official delivery note, invoice or waybill or that of any authorised independent carrier will constitute prima facie evidence of delivery of the products reflected thereon.
*Incoterms are a set of rules which define the responsibilities of sellers and buyers for the delivery of goods under sales contracts.
**This is dependent on weather conditions, delays caused by incorrect delivery information, customs delays, public holidays and time of order placed.
***Weather delays include natural disasters and extreme weather conditions.
We offer technical support to ensure your success in using LightWare Studio.
Connecting our Rangefinders to external devices such as Arduino, Raspberry Pi and Pixhawk to name a few, is not a difficult task. It just takes a few easy steps and you will be able to be up and running with out devices.
This example uses the following components and tools:
- Raspberry Pi 3 Model B+
- LW20/C
- Thonny Python
Useful tips before starting with the code:
- Ensure that you have Python V 3.0 on your Raspberry Pi
- Download the Python code using the following link: Python Code
- Configure I2C communication, a quick guide on how to do this is available using the following link: Raspberry Pi
- When using the LW20, Please use the hex address, 0x66. The rest of the code can remain the same.
The PLD (Pulsed Laser Diode) and APD (Avalanche Photo Diode) LightWare uses in their Laser Rangefinders have a lifespan of 100 000 hours.
The other electronic components have a much longer lifespan.
Caution: Electronics may degrade if subjected to high temperatures. We recommended keeping the products well within the specified operating temperatures.
The mean time between failure (MTBF) of mechanical components inside scanning devices are as follows:
– motors: approximately 6 000 hours
– slip rings: approximately 2 000 hours
In case of failure or maintenance please contact LightWare for our RMA procedure.
SF11 & SF30 product range
The lens assembly of these products are IP67, but the back-end containing the PCBA and connectors have no protection.
For the best protection install these devices in such a way that only the lenses are exposed and ensure a good seal around the housing.
SF20 product range
This product is an OEM module with an exposed PCBA and is designed to be integrated into an airframe or enclosure.
The lens assembly is IP67 and should be installed in such a way that only the lenses are exposed. Ensure a good seal around the lenses for optimal protection.
Caution:: The SF20 is an OEM module that requires the customer to provide appropriate heat sinking and EMI shielding.
SF40 product range
The SF40/C does not have protection at this time.
LW20 product range
The LW20 is fully encased and carries an IP67 rating.
Please visit our YouTube channel for application videos: https://www.youtube.com/c/LightWareLiDAR/videos
Reading altitude off a water surface is quite challenging, especially during bright sunshine. The laser signal can be lost within the water and sunshine reflecting off the water surface causes noise and false readings.
LightWare suggests changing the rangefinder’s settings before flying over water. This can be done either through the user manual or in flight, using the extensive command sets available for serial and I2C communication.
Step 1: Connect the rangefinder to the LightWare Terminal program. The rangefinder will automatically start reading.
Step 2: Press the <space bar> to stop the readings and display the menu.
Step 3: Press the <a> key to open the system menu.
The recommended measuring mode for altitude over water is long range. This means the rangefinder spends more time searching for a return signal than in quick response mode.
Step 4: Press <m> to enter the filter menu.
Step 5: p indicates the amount of seconds the rangefinder will wait before returning a lost signal output
1 second = 20 readings and is sufficient for altitudes below 50 meters
For altitudes higher than 50 meters we recommend using 2 seconds as the return signal is lost more often over the longer range.
Press <p> and enter <2> and press enter again for the new setting to be accepted.
Step 6: press <q> to switch on the median filter.
This median filter returns the most frequent result in a number of readings and is recommended for use over water due to the sunshine reflecting from the water surface as well as the lost signal conditions.
Step 7: Press <r> to set the filter size, or number of readings the rangefinder will use to determine the median output. Enter 20 and press <enter>.
The median filter will now use 20 readings and output the most frequent reading, which should discard false readings and temporary loss of signal.
The maximum median filter size is 32 readings.
By default the SF20 and LW20 are setup to communicate via I2C or Serial UART once connected to your device.
SF 20 layout
Serial Mode, this will force the rangefinder to communicate with the controller in Serial.
The SF 22 is a great tool for hobbyists who want to get their hands on a long range LiDAR at low cost. This unit has 100 m range and is able to connect via Serial UART or I2C. This amazing little unit has a resolution of 1 cm, thus it also has high precision. In this article we will connect to the SF 22 using a Serial UART connection.
In this application guide:
- We will look at the difference between first and last return signals
- How knowing this information will allow you to set up the device more optimally
- All libraries used in this document can be found in the Quickstart & API reference guide
When a LiDAR unit measures range, generally it is a solid surface that the return signal is received from. But what happens to light that passes through a surface that light is able to pass through such as glass or perspex? The result is you get two signals back. This is not apparent at close range, this is due to the wavelength of the laser. Depending on the wavelength of the sensor you are using, there will be a range where the first and last return data will appear to be the same. This is because the “length” of the light pulse is of a certain distance and at a short distance the two return signals are seen as one continuous return by the APD sensor. Both instances will be shown below, the first image shows what happens at close range. The second image shows what happens at long range.
Short Distance Return Signal
Definition
- First return – simply put is the light signal that the SF 22 receives as the first strong light signal back from the single pulse.
- Second return – is the second light signal that the SF 22 receives as the second strong signal back from a single pulse.
Connecting the Arduino for Serial UART communication:
SF 22 Serial UART connection to Arduino
Arduino Code
The code given below is available in the quick start guide (Quickstart & API reference guide), a slight addition to the code needs to be made to access the second return information.
The following lines of code were added to the code:
(sf22.lastRaw_cm,DEC) … ( access the last return distance in centimeters.)
(sf22.lastStrength_cm,DEC) …( access the last return signal strength in centimeters.)
________________________________________________________________________________________________________________________________________________
Code:
// www.Lightware.co.za Oct 2019
// Lightware example code using the lw_sf22.h library
// This library enables the use of the I2C and Serial Interface
// This library is designed to use 2 Serial ports on the Arduino
#include <lw_sf22.h>
#include <Wire.h>
LW_SF22 sf22(Serial1, Serial);
void setup() {
//this is the serial port for the terminal window
Serial.begin(115200);
// Setup the Serial port for the SF22 interface
Serial1.begin(115200);
// Disable any possible streaming data
sf22.writeDataStreamType(0);
delay(100);
// Read the data sent from the SF22
sf22.ProcessSerialInput(1);
delay(100);
// Request the SF22 Hardware Name
sf22.readRequestHardwareName();
delay(100);
// Read the data sent from the SF22
sf22.ProcessSerialInput(1);
delay(100);
// Request the SF22 Firmware Version
sf22.readRequestFirmwareVersion();
delay(100);
// Read the data sent from the SF22
sf22.ProcessSerialInput(1);
delay(100);
// Request the streaming output distance data selection
sf22.readRequestDistOutConfig();
delay(100);
// Read the data sent from the SF22
sf22.ProcessSerialInput(1);
delay(100);
// Set the streaming to distance in cm
sf22.writeDataStreamType(13);
delay(100);
// Read the data sent from the SF22
sf22.ProcessSerialInput(1);
}
void loop() {
uint8_t new_data = 0;
// Every cycle check the Serial receive buffer for data and then process it
new_data = sf22.ProcessSerialInput(0);
// if new data was received, then display the following first and last distance
if (new_data == 1){
Serial.print(sf22.firstRaw_cm,DEC);
Serial.print(” cm “);
Serial.print(sf22.firstStrength_cm,DEC);
Serial.print(” % “);
Serial.print(sf22.lastRaw_cm,DEC);
Serial.print(” cm “);
Serial.print(sf22.lastStrength_cm,DEC);
Serial.print(” % “);
Serial.print(sf22.APDTemperature,DEC);
Serial.println(” DEG Celcuis “);
new_data = 0;
}
// put your main code here, to run repeatedly:
}
________________________________________________________________________________________________________________________________________________
Results :
The results are printed in the following sequence
- First Return
- First Signal Strength
- Last Return
- Last Signal Signal Strength
- APD temperature.
Initial Startup:
Close Distance:
Long Distance:
From the two results it can be seen that the second return is at a further distance away and that the unit is actually able to detect both the transparent material and the wall behind, provided that the wall behind is not too close. So depending on the application in which the SF 22 is used, it is advantageous to know this or have an idea of this property to maximise the potential of this LiDAR.
1. Poor
Connecting unshielded wires may make the SF20 susceptible to electromagnetic interference from nearby radio transmitters or other sources of noise. This will result in a slight loss of performance and in extreme cases the SF20 may be unable to take measurements. Small high frequency emissions from the SF20 may also be detected by sensitive radio or satellite receivers.
2. Better
Connecting the shield wire to the screw on the SF20 and earthing the other end to either ground or a quiet negative rail will improve the performance of the SF20 when near to a radio transmitter. Additionally, any RF transmission from the SF20 will be reduced.
3. Best
For the very best performance the LW20 provides a shield around the electronics that connects to the shield on the wire harness. By earthing this shield the LW20 is highly resistant to RF transmissions and will produce negligible interference.
What is Servo Lag?
Using a device such as a servo for scanning applications results in a phenomena known as “servo lag”.
This is noticeable when using a range finder scanning from left to right and then from right to left at a constant speed. The data received will appear to be mismatched when compared side by side. One of the main reasons why you would see this is that you have the mechanical drawback of servos, as you experience the effect of “servo lag”, that most servos experience when moving at a constant speed. Servo lag happens because servos are designed to move to a fixed location and stop. This is what they were optimised for, thus when the servo moves continuously, the control loop isn’t able to catch up with the aiming direction and always lags behind:
The orange and black lines indicate the difference in data received when scanning from left to right (black) and right to left (orange) due to the servo lag. Using the Terminal software, a servo lag factor can be applied either by following the FAQ on getting started with my LightWare LiDAR.
Using the Terminal software navigate to the menu option that allows you to enter a value for the servo lag, note that the mechanical motion of the servo will remain consistent. Depending on the servo you are using you will have to use a specific servo lag factor. If unsure, start adjusting this value incrementally (starting at a low value) until you notice that the values scanning from side to side overlap as indicated below:
From time to time these settings should be checked in case of wear on the gears or changes to the power supply.
IP (Ingress Protection) is an international standard used to rate the degree of protection in electrical enclosures against solids and liquids. The first digit after the IP indicates the level of protection against solids like dust. The second digit indicates protection against liquids like water. View the IP ratings guide here.
LightWare microLiDAR® sensors are available in two categories – SF range and LW range. Our LW range of sensors are entirely encased for full IP protection (IP65 or IP67).
The backend of the SF range has no IP protection but the lens assembly is IP rated. For the best protection against water and dust, install the SF device so that only the lenses are exposed. Then ensure that a good seal surrounds the housing. View our mounting guidelines here.
For specific IP ratings of our products, refer to the respective device manual.
LightWare’s products use lasers that emit light with a wavelength of 905 nm. This wavelength has been chosen to provide a good balance between reliability and eye safety. Shorter wavelengths are more hazardous and lasers with longer wavelengths are less reliable.
All LightWare products use the “direct time-of-flight” principle to measure distance. This works by timing how long it takes for a flash of laser light to travel to the surface being measured and back again. The distance is calculated using the equation:
distance-to-surface = speed-of-light x time-of-flight / 2
What makes the beam spread analysis difficult is that there is an “actual” beam spread and an “effective” beam spread.
The “actual” beam spread is an optical phenomena caused by the geometry of the lenses. This is a diverging cone that increases linearly in size as the distance increases.
The “effective” beam divergence is a measure of what the detector sees when a target is in the beam. At close distances the “effective” and “actual” beam divergence are similar. As soon as the edge of the target enters the beam it is detected making the apparent position of the edge of the beam match with the theoretical position.
As the distance increases the signal gets weaker so more of the target needs to be directly in the beam before the return signal can be detected. In other words the apparent edge of the beam no longer matches with the theoretical edge. This makes the beam appear to be smaller than the “actual” beam diameter and the “effective” beam divergence reduces as the distance increases.
As an example, a field-test with an LW20/C provided the following results:
- at 10 m distance – beam spread of approx. 4.5 cm
- at 45 m distance – beam spread of 19.0 cm
- at 91 m distance – beam spread of 20.3 cm
Method 1: use a mounting bracket
These products can be mounted using a purchased 725-28055 aluminium stand kit.
Method 2: directly onto the housing
Some customers glue Velcro onto the aluminium enclosure of the unit, and fix it to their airframe. Use zip ties to secure.
Mounting orientation:
Rangefinders can be mounted with a vertical or horizontal lens orientation.
They can be mounted in a downward facing orientation for altimetery / terrain following / precision landing applications. For terrain following, angle the rangefinder 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.
They can be mounted forward facing orientation for sense and avoid / position hold applications.
Precautions
Do not mount the rangefinder within the cavity of the airframe, rather mount it directly at the surface boundary. This can prevent beam divergence from causing false readings in short range distances, or out of range conditions.
Ensure that nothing is in the path of the laser beam.
Ensure that no shiny or highly reflective surfaces are near the path of the beam.
Secure the cable with zip ties to protect it from pulling on the connnectors.
Below is a table that compares all of our products and compatibility with different Autopilot stacks:
Method 1: directly onto the housing
The LightWare rangefinder housing has two 3.1 mm diameter holes (22 mm separation), which can be used for mounting directly onto an airframe or into an enclosure. The lens section has a ridge for landing and sealing purposes.
Some customers glue Velcro onto the lid section on the back of the unit, and fix it to their airframe. Use zip ties to secure.
Method 2: use a mounting bracket
These products can be mounted using a purchased 725-28920 aluminium stand kit.
Mount using a 3D printed mounting bracket from our library.
Mounting orientation
Rangefinders can be mounted with a vertical or horizontal lens orientation.
They can be mounted in a downward facing orientation for altimetery / terrain following / precision landing applications. For terrain following, angle the rangefinder 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.
They can be mounted forward facing orientation for sense and avoid / position hold applications.
Precautions
Do not mount the rangefinder within the cavity of the airframe, rather mount it directly at the surface boundary. This can prevent beam divergence from causing false readings in short range distances, or out of range conditions.
Ensure that nothing is in the path of the laser beam.
Ensure that no shiny or highly reflective surfaces are near the path of the beam.
Secure the cable with zip ties to protect it from pulling on the connnectors.
Connecting sensors to flight controllers such as the Pixhawk should not be a daunting task and requires a few easy steps to get up and running. We at LightWare would like to make it easier for our customers to be able to integrate our sensors with their flying or ground vehicles.
A vehicle that can maintain altitude and avoid obstacles is an attractive feature to have. From hobbyists to professionals, LightWare offers a variety of rangefinders that will be able to handle your needs.
Using the following steps to connect these rangefinders to a Pixhawk.
Overview
This guide covers LightWare products that have the serial number SXX-14501 and beyond. For previous devices please see these guides:
- SF10 & SF11: http://ardupilot.org/copter/docs/common-lightware-sf10-lidar.html
- LW20/SF20: http://ardupilot.org/copter/docs/common-lightware-lw20-lidar.html
- SF02: http://ardupilot.org/copter/docs/common-rangefinder-sf02.html
- SF40C: http://ardupilot.org/copter/docs/common-lightware-sf40c-objectavoidance.html
Step 1: LightWare Upgrader tool
NOTE: The Upgrader tool in the link is for windows, for other operating systems, please contact us for further instructions. Some older units will need the I2C compatibility mode to be switched on(SF 11C/B). If your unit does not connect to the Upgrader tool, do not worry this step is not necessary, serial communication is immediately compatible. The Upgrader allows you to configure settings on your device using the “Manage” button. Please do not set Startup mode to I2C mode unless otherwise instructed to do so. If you do find your LW20/SF20 booting only in I2C mode, you can use the Devantech USB-ISS adapter which the Upgrader will respond to and allow you to change the Startup mode.
Before attempting to connect with the Pixhawk we recommend performing a firmware upgrade on your LightWare device. You will also need this tool to perform configuration for the Pixhawk later. Please follow the steps outlined below:
Use the following link to download the firmware Upgrader tool:
http://support.lightware.co.za/LightWareUpgrader-win-x64-1.56.0.zip
Extract the contents of the zipped folder and locate the LightWareUpgrader application.
Open the application and plug the rangefinder into an open USB port. The SF11C can be plugged in directly with the included USB cable. The SF20C/LW20C require a Serial UART TTL (3.3V logic, 5V Power) to USB adapter. A com port will appear on the screen in the following format COM X (FTDI).
Double check if your unit needs I2C compatibility to be switched on by navigating to the manage page:
Step 2: LightWare Terminal software
Note: This Step can be skipped. This is only done so that specific settings on the LiDAR unit need to be changed to suit very specific needs. Default settings are more than sufficient for most applications.
The latest Terminal software can be found on our website using the following link:
https://lightware.co.za/pages/software-downloads.
Install the software following the prompts that are given.
Open Terminal software and connect the rangefinder unit.
Navigate to the settings icon and ensure that the following settings are correct.
- Correct com port selected
- Correct Baud rate is selected
- Protocol is set to Serial.
Connect to the device by clicking on the “Connect” icon, the rangefinder will start streaming data immediately(SF11B/C).
However; the SF 20 B/C and LW 20 B/C units need to be “pinged”. This can be done by pushing the <up arrow> on the keyboard twice. Pushing the <up arrow> first time it will display the unit name, pushing the <up arrow> the second time will start the data streaming.
By pushing the <Space> will allow you to adjust the settings of the unit. The default address of the rangefinder is 0x66(Hexadecimal) and 102(Decimal).
Step 3: Connection Guide
SF11B / SF 11C Connection guide
a. Serial UART Connection
For a serial connection you can use any spare UART. Connect the RX line of the UART to the TX line of the Lidar, and the TX line of the UART to the RX line of the Lidar. Also connect the GND and 5V lines. You do not need flow control pins.
The diagram below shows how to connect to SERIAL4.
b. I2C Connection
Connect the SDA line of the Lidar to the SDA line of the I2C port on the Pixhawk, and the SCL line of the Lidar to the SCL line of the I2C port. Also connect the GND and 5V lines.
c. Analogue Connection
SF 20B/C and LW 20B/C Connection guide
To use a terminal emulation application to setup and test the LW20/SF20 you will need to connect the serial port of the LW20/SF20 to the USB port on a PC. This is done using a serial-to-usb converter such as the TTL-232R-3V3-WE converter cable from FTDI (https://www.ftdichip.com/Products/Cables/USBTTLSerial.htm). This converter provides both the signals and power supply to the LW20/SF20. Alternatively, one could use the ftdichip um230xb as shown in the illustration below:
a. Serial Connection
For a serial connection you can use any spare UART. Connect the RX line of the UART to the TX line of the Lidar, and the TX line of the UART to the RX line of the Lidar. Also connect the GND and 5V lines. You do not need flow control pins.
The diagram below shows how to connect to SERIAL4/5.
NOTE: This diagram is also correct for the SF 20
b. I2C Connection
Connect the SDA line of the Lidar to the SDA line of the I2C port on the Pixhawk, and the SCL line of the Lidar to the SCL line of the I2C port. Also connect the GND and 5V lines.
NOTE: This diagram is also correct for the SF 20
Step 4: Mission Planner
Download and extract the files from Pixhawk zipped folder. Open the mission planner application and plug in the Pixhawk, however, do not click the connect icon.
Open the Initial Setup page and select the firmware for the vehicle you would wish to use.
Ensure that the correct com port is selected, if you are uncertain, select “Auto” and Ardupilot will select the port the Pixhawk is connected. Click on “Connect”, select the “Config/Tuning” page and navigate to the “Full Parameter List”. In the search bar on the right on the screen type rngfnd. This will pull up all the commands with rngfnd that we need to adjust.
Ensure that the following configuration parameters are used:
1. Serial/UART Parameters
2. I2C Parameters
3. Analogue Parameters
4. SF40C (360 LiDAR) Parameters
Step 5: Viewing the rangefinder values
Once the parameters have been updated according to the rangefinder model you are using, click on “Write Parameters”.
Disconnect from the Pixhawk and then reconnect to allow the parameters to be updated to the Pixhawk. Navigate to the “Flight Data” page, the rangefinder values should be displayed either using either the “Status” tab, or the “Quick” tab.
To use the quick tab, you will need to add the “Sonarrange” and “Rangefinder 1” value. This is done by simply double clicking in the window and select these two categories.
Acknowledgements
We would like to thank Ardupilot and FTDI chip for some of the images used in this FAQ.
Ardupilot – http://ardupilot.org/copter/docs/common-rangefinder-landingpage.html
FTDI Chip – https://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_UMFT201_220_230XB.pdf
Connecting sensors to flight controllers such as the Pixhawk should not be a daunting task and requires a few easy steps to get up and running. We at LightWare would like to make it easier for our customers to be able to integrate our sensors with their flying or ground vehicles.
A vehicle that can maintain altitude and avoid obstacles is an attractive feature to have. From hobbyists to professionals, LightWare offers a variety of rangefinders that will be able to handle your needs.
Using the following steps to connect these rangefinders to a Pixhawk.
Overview
This guide covers LightWare products that have the serial number SXX-14501 and beyond. For previous devices please see these guides:
- SF10 & SF11: http://ardupilot.org/copter/docs/common-lightware-sf10-lidar.html
- LW20/SF20: http://ardupilot.org/copter/docs/common-lightware-lw20-lidar.html
- SF02: http://ardupilot.org/copter/docs/common-rangefinder-sf02.html
- SF40C: http://ardupilot.org/copter/docs/common-lightware-sf40c-objectavoidance.html
Step 1: LightWare Upgrader tool
NOTE: The Upgrader tool in the link is for windows, for other operating systems, please contact us for further instructions. Some older units will need the I2C compatibility mode to be switched on(SF 11C/B). If your unit does not connect to the Upgrader tool, do not worry this step is not necessary, serial communication is immediately compatible. The Upgrader allows you to configure settings on your device using the “Manage” button. Please do not set Startup mode to I2C mode unless otherwise instructed to do so. If you do find your LW20/SF20 booting only in I2C mode, you can use the Devantech USB-ISS adapter which the Upgrader will respond to and allow you to change the Startup mode.
Before attempting to connect with the Pixhawk we recommend performing a firmware upgrade on your LightWare device. You will also need this tool to perform configuration for the Pixhawk later. Please follow the steps outlined below:
Use the following link to download the firmware Upgrader tool:
http://support.lightware.co.za/LightWareUpgrader-win-x64-1.56.0.zip
Extract the contents of the zipped folder and locate the LightWareUpgrader application.
Open the application and plug the rangefinder into an open USB port. The SF11C can be plugged in directly with the included USB cable. The SF20C/LW20C require a Serial UART TTL (3.3V logic, 5V Power) to USB adapter. A com port will appear on the screen in the following format COM X (FTDI).
Double check if your unit needs I2C compatibility to be switched on by navigating to the manage page:
Step 2: LightWare Terminal software
Note: This Step can be skipped. This is only done so that specific settings on the LiDAR unit need to be changed to suit very specific needs. Default settings are more than sufficient for most applications.
The latest Terminal software can be found on our website using the following link:
https://lightware.co.za/pages/software-downloads.
Install the software following the prompts that are given.
Open Terminal software and connect the rangefinder unit.
Navigate to the settings icon and ensure that the following settings are correct.
- Correct com port selected
- Correct Baud rate is selected
- Protocol is set to Serial.
Connect to the device by clicking on the “Connect” icon, the rangefinder will start streaming data immediately(SF11B/C).
However; the SF 20 B/C and LW 20 B/C units need to be “pinged”. This can be done by pushing the <up arrow> on the keyboard twice. Pushing the <up arrow> first time it will display the unit name, pushing the <up arrow> the second time will start the data streaming.
By pushing the <Space> will allow you to adjust the settings of the unit. The default address of the rangefinder is 0x66(Hexadecimal) and 102(Decimal).
Step 3: Connection Guide
SF11B / SF 11C Connection guide
a. Serial UART Connection
For a serial connection you can use any spare UART. Connect the RX line of the UART to the TX line of the Lidar, and the TX line of the UART to the RX line of the Lidar. Also connect the GND and 5V lines. You do not need flow control pins.
The diagram below shows how to connect to SERIAL4.
b. I2C Connection
Connect the SDA line of the Lidar to the SDA line of the I2C port on the Pixhawk, and the SCL line of the Lidar to the SCL line of the I2C port. Also connect the GND and 5V lines.
c. Analogue Connection
SF 20B/C and LW 20B/C Connection guide
To use a terminal emulation application to setup and test the LW20/SF20 you will need to connect the serial port of the LW20/SF20 to the USB port on a PC. This is done using a serial-to-usb converter such as the TTL-232R-3V3-WE converter cable from FTDI (https://www.ftdichip.com/Products/Cables/USBTTLSerial.htm). This converter provides both the signals and power supply to the LW20/SF20. Alternatively, one could use the ftdichip um230xb as shown in the illustration below:
a. Serial Connection
For a serial connection you can use any spare UART. Connect the RX line of the UART to the TX line of the Lidar, and the TX line of the UART to the RX line of the Lidar. Also connect the GND and 5V lines. You do not need flow control pins.
The diagram below shows how to connect to SERIAL4/5.
NOTE: This diagram is also correct for the SF 20
b. I2C Connection
Connect the SDA line of the Lidar to the SDA line of the I2C port on the Pixhawk, and the SCL line of the Lidar to the SCL line of the I2C port. Also connect the GND and 5V lines.
NOTE: This diagram is also correct for the SF 20
Step 4: Mission Planner
Download and extract the files from Pixhawk zipped folder. Open the mission planner application and plug in the Pixhawk, however, do not click the connect icon.
Open the Initial Setup page and select the firmware for the vehicle you would wish to use.
Ensure that the correct com port is selected, if you are uncertain, select “Auto” and Ardupilot will select the port the Pixhawk is connected. Click on “Connect”, select the “Config/Tuning” page and navigate to the “Full Parameter List”. In the search bar on the right on the screen type rngfnd. This will pull up all the commands with rngfnd that we need to adjust.
Ensure that the following configuration parameters are used:
1. Serial/UART Parameters
2. I2C Parameters
3. Analogue Parameters
4. SF40C (360 LiDAR) Parameters
Step 5: Viewing the rangefinder values
Once the parameters have been updated according to the rangefinder model you are using, click on “Write Parameters”.
Disconnect from the Pixhawk and then reconnect to allow the parameters to be updated to the Pixhawk. Navigate to the “Flight Data” page, the rangefinder values should be displayed either using either the “Status” tab, or the “Quick” tab.
To use the quick tab, you will need to add the “Sonarrange” and “Rangefinder 1” value. This is done by simply double clicking in the window and select these two categories.
Acknowledgements
We would like to thank Ardupilot and FTDI chip for some of the images used in this FAQ.
Ardupilot – http://ardupilot.org/copter/docs/common-rangefinder-landingpage.html
FTDI Chip – https://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_UMFT201_220_230XB.pdf
Connecting sensors to flight controllers such as the Pixhawk should not be a daunting task and requires a few easy steps to get up and running. We at LightWare would like to make it easier for our customers to be able to integrate our sensors with their flying or ground vehicles.
A vehicle that can maintain altitude and avoid obstacles is an attractive feature to have. From hobbyists to professionals, LightWare offers a variety of rangefinders that will be able to handle your needs.
This guide covers LightWare SF30/D.
Step 1: LightWare Studio
Download and install lightware studio from https://lightwarestage.co.za/pages/software-downloads.
Step 2: Configure the SF30/D
Connect the SF30/D to a computer via the USB cable.
Select the SF30/D in the LightWare Studio.
Select parameters.
Ensure the serial port baud rate is set to 115200.
Set the output type (Legacy) to full communication mode.
Step 3: Connect the Pixhawk
Connect the SF30/D to thePixhawk by I2C (Port: I2C 2) or serial (Port: Telem 1).
Connect the Pixhawk via the USB port to the computer.
Step 4: Mission Planner
Open the Pixhawk Mission Planner.
Ensure that the correct com port is selected, if you are uncertain, select “Auto” and Ardupilot will select the port the Pixhawk is connected. Click on “Connect”, select the “Config/Tuning” page and navigate to the “Full Parameter List”. In the search bar on the right on the screen type rngfnd. This will pull up all the commands with rngfnd that we need to adjust.
Ensure that the following configuration parameters are used:
1. Serial/UART Parameters
SERIAL4_PROTOCOL 9 (LIDAR)
SERIAL4_BAUD 115 (115200)
RNG_MAX_CM 5000 (for SF11B/SF20B/LW20B),10000 (for SF20C/LW20C) and 12000 (for SF11C). Distance in cm that the rangefinder can reliably read in cm.
RNG_MIN_CM 5
RNGFND1_GNDCLEAR 10 (Distance of Lidar to ground in cm when vehicle is on the ground)
RNGFND_SCALING 1 (I2C, Serial/UART)
RNGFND_TYPE 8 (Serial)
2. I2C Parameters
RNGFND_ADDR 102 decimal – Default
RNG_MAX_CM 5000 (for SF11B/SF20B/LW20B),10000 (for SF20C/LW20C) and 12000 (for SF11C). Distance in cm that the rangefinder can reliably read in cm.
RNG_MIN_CM 5
RNGFND1_GNDCLEAR 10 (Distance of Lidar to ground in cm when vehicle is on the ground)
RNGFND_SCALING 1 (I2C, Serial/UART)
RNGFND_TYPE 7 (LightWare I2C)
3. Analogue Parameters
RNGFND1_PIN 14 (2nd pin of 3.3V ADC connector)
RNG_MAX_CM 4500 (for SF11B/SF20B/LW20B),9500 (for SF20C/LW20C) and 11500 (for SF11C). Distance in cm that the rangefinder can reliably read in cm.
RNG_MIN_CM 5
RNGFND1_GNDCLEAR 10 (Distance of Lidar to ground in cm when vehicle is on the ground)
RNGFND_SCALING 9,76(SF10A), 19,531 (SF10B), 39,06(SF10C),46.87 (for SF11C) or 48,0 (SF11/C)
RNGFND_TYPE 1 (Analog)
The RNGFND_SCALING value depends on the voltage on the rangefinders output pin at the maximum range. By default the SF10/B will output 2.56V at 50m, so the scaling factor is 50m / 2.56v ≈ 19.53 (the analogue distance range for each of the rangefinder variants can be found in the Rangefinder manual). The manual explains how you can confirm and change the maximum output range/voltage.
Once the parameters have been updated according to the rangefinder model you are using, click on “Write Parameters”.
Disconnect from the Pixhawk and then reconnect to allow the parameters to be updated to the Pixhawk. Navigate to the “Flight Data” page, the rangefinder values should be displayed either using either the “Status” tab, or the “Quick” tab.
To use the quick tab, you will need to add the “Sonarrange” and “Rangefinder 1” value. This is done by simply double clicking in the window and select these two categories.
The SF000/B LiDAR has an on-board servo motor driver. This and its small size make it ideal for creating a linear scanner.
This example uses the following components:
-SF000/B LiDAR
-SF000/B Communication cable
-SF000/B Breakout board
-SF000/B USB connector
-SF000/B LightWare mounting bracket
– Servo motor (FeeTech FT2331M or Micro Robotics LF-20MG are used here)
-USB Serial communicator
Connect the SF000/B via the communication cable and USB connector to a computer.
Select the tool icon on the top left and open the generic serial terminal.
Select the 115200 Baud rate and appropriate com port and connect.
Press the up arrow three times to cycle through the interface, then the right arrow key once to navigate to the scanning interface.
Set the scanning parameters to your desired servo by pressing the appropriate button indicated next to the setting. Settings above are for the FeeTech FT2331M.
Now disconnect the SF000/B from the USB adaptor and connect it to Section D of the breakout board.
Connect the servo motor to the 3 pin with pin 1 as ground.
(The “1” on the board indicates pin 1)
Connect the USB serial communicator.
Communication Rail Pin Description: 1 Power (Vin), 5V 2, Ground (GND), 3 Rx, 4 Tx
Connecting sensors to flight controllers such as the Pixhawk should not be a daunting task and requires a few easy steps to get up and running. We at LightWare would like to make it easier for our customers to be able to integrate our sensors with their flying or ground vehicles.
A vehicle that can maintain altitude and avoid obstacles is an attractive feature to have. From hobbyists to professionals, LightWare offers a variety of rangefinders that will be able to handle your needs.
This guide covers LightWare SF40/C.
Step 1: Connect the Pixhawk
Connect the SF40/C to thePixhawk to the Serial (Port: Telem 1).
Connect the Pixhawk via the USB port to the computer.
Step 2: Mission Planner
Open the Pixhawk Mission Planner.
Ensure that the correct com port is selected, if you are uncertain, select “Auto” and Ardupilot will select the port the Pixhawk is connected. Click on “Connect”, select the “Config/Tuning” page and navigate to the “Full Parameter List”. In the search bar on the right on the screen type rngfnd. This will pull up all the commands with rngfnd that we need to adjust.
Ensure that the following configuration parameters are used:
4. SF40C (360 LiDAR) Parameters
Once the parameters have been updated according to the rangefinder model you are using, click on “Write Parameters”.
Disconnect from the Pixhawk cycle the power to both the Pixhawk and SF40/C and then reconnect to allow the parameters to be updated. Navigate to the “Flight Data” page, the rangefinder values should be displayed using CTRL+F and veiwing the proximity page.
All packaging and deliveries are done to the highest standards and in pursuit of Customer’s satisfaction. For a full disclosure of our terms and conditions please refer to our Terms and conditions of sale page.
Delivery will be on DAP Incoterms* (Delivered at Place) and will be quoted using a LightWare Optoelectronics (Pty) Ltd contracted courier for all exported orders. We are using and have been using UPS (United Parcel Service) for all our deliveries. DAP means the Customer is the recipient of the shipment and importer of the ordered items and is thus responsible for all import fees levied by the destination country. Prices and delivery options are set on our Website using our special UPS rates, but require the Customer to register in order to calculate and review relevant rates. Delivery will be made to the Customer’s address specified during the completion of your online order, unless agreed upon in writing by both parties.
LightWare regrets that no collections or shipments via customer courier accounts can be allowed as this will trigger an obligation to charge 15% VAT as stipulated by South Africa tax law. LightWare endeavours to dispatch all ex-stock orders during the next business day of receipt of the paid order. Shipping turnaround time is approximately 3-5 working days**, however this is subject to uncontrollable delays**.
Upon pickup from our premises, the Customer will receive an email containing the tracking details to assist with tracking and clearing. Times and dates for delivery quoted on the Website are approximate only and dependent on third party courier services. LightWare Optoelectronics (Pty) Ltd shall not be liable for any delay in delivery. If any delivery is late, the Customer must notify LightWare Optoelectronics (Pty) Ltd, and LightWare Optoelectronics (Pty) Ltd will do our best to assist the Customer. In cases of non-delivery or lost courier parcels LightWare Optoelectronics (Pty) Ltd will endeavour to send replacement products as soon as possible.
An email with a tracking details will be issued as soon as the parcel has been picked up by the courier company. LightWare Optoelectronics (Pty) Ltd cannot assist with requests for a lower declared value to reduce customs duties. All exports must legally be declared at their commercial values.
The signature of any agent, contractor, sub-contractor, or employee of the Customer on the official delivery note, invoice or waybill or that of any authorised independent carrier will constitute prima facie evidence of delivery of the products reflected thereon.
*Incoterms are a set of rules which define the responsibilities of sellers and buyers for the delivery of goods under sales contracts.
**This is dependent on weather conditions, delays caused by incorrect delivery information, customs delays, public holidays and time of order placed.
***Weather delays include natural disasters and extreme weather conditions.