Lidar

61 views
Skip to first unread message

Peter Hollands

unread,
Nov 16, 2019, 10:25:12 AM11/16/19
to uavdevboard
Earlier this summer  I upgraded the Sonar Driver to work with Lidar in a branch of MatrixPilot. After discussion with Bill, I purchased a Garmin LIDAR-Lite v3HP.

Initially, the Out of Range, characteristics of the PWM measurements were very unreliable.
I enclose a screenshot below.

The yellow line shows the height of the aircraft above the origin using the IMU calculations. The blue line shows the Lidar range. If it is out of range, it should show as 30 meters.
But as you can see, the Lidar is clearly showing valid data  (e.g. less than 10 meters) for times when the Lidar must clearly be out of range. That was a problem.
By the way, the pink line on this graph is the number of measurement made by the Lidar in 1/40th of a second (Cnt for Count . See the Y axis on the right hand side for that).

 After examining the data, Bill realized that there was a feature of the data which could be used to discard invalid measurements. If the time between two successive measurements was less than 16 milliseconds then the data would be invalid. He offered to code the driver. Thanks Bill. The second screenshot below, shows the improved accuracy of the data on a real flight with Bill's driver. ALT_AGL is Altitude Above Ground Level. It is the range adjusted for the tilt of the aircraft (pitch and roll), to give height above the ground. It looks consistent.

You may notice that after landing, when the plane is on the ground (and the range is probably less than 3 centimeters), the data is inaccurate again. But post landing accuracy is not important to me. So that is fine.

So I have a useful Lidar for ranges of around 15 meters above the ground, which can be used to help with accurate landings.

My next experiment was to code up Fly By Wire with terrain following Lidar. More on that in a future post.

Best wishes, Pete



initial_lidar_test_out_of_range_unreliable.png
test_of_bill_lidar_driver.png
Lidar_installation.jpg

Guy-François MESNIL

unread,
Nov 19, 2019, 1:01:32 PM11/19/19
to uavdevboard
Hi Pete,
I am surprised by the Lidar noise you obtained.
I use the LIDAR from 3D Roboshop https://www.robotshop.com/eu/fr/capteur-distance-laser-lidar-lite-3.html.
I think it is quite the same of yours.
I connect it on the PWM input #7 directly. I have added a 100µF capacitor on UDB5 5V power.
I call Lidar measurement at 80 Hz in the libDCM heartbeat routine (udb_heartbeat_callback with HEARTBEAT_HZ =200) :
// Called at HEARTBEAT_HZ
void udb_heartbeat_callback(void)
{
#if (USE_LIDAR_ALTITUDE > 0)
    static int lidarCounter = 0;
    // Modif GFM Quadcopter to call Lidar at 80 Hz to avoid too much lag
    // These oversampled data are not filtered, for the moment.
    if (++lidarCounter >= HEARTBEAT_HZ / 80) {
        lidarCounter = 0;
        rxLidar_on_PWM(udb_lidar_callback);        
    }

#endif // USE_LIDAR_ALTITUDE 

The Excel plot below shows the Lidar respons compared to the barometer for the low altitude flight 227 that you can see on the following video.


I will be pleased if that could be usefull.

Best regards,
gfm

Vol_227.jpg

william premerlani

unread,
Nov 19, 2019, 1:27:12 PM11/19/19
to uavde...@googlegroups.com
Hi Guy,

Your observations are consistent with Peter's and my observations:

When these particular LIDAR units are operated beyond their working range, the PWM values are random noise.
I note that you maximum range was about 5 meters. For Peter's flights the range was much larger than that. Beyond about 20 meters, the PWM values were random.
I have been tracking the development of this particular LIDAR unit and have samples of all 4 versions:
Version 1: the initial kickstarter version.
Version 2: improved version.
Version 3. further improvements.
Version 3hp: "version 3 high performance".

Each new version was an improvement in performance over the previous.

However, the "PWM signature" for the case of out of range for each version is slightly different. Based on the signature of the latest version I was able to come up with an algorithm to detect an out of range situation.

In principle, the situation would be simpler with the I2C interface, because an out-of-range situation is explicitly identified in that case.

In Peter's case, he has been using LIDAR for fixed wing operation with range values between ground and 100 meters.

In my case, I have been using LIDAR for both fixed wing up to 100 meters, and for quad copter up to a few meters. I observe the noise that Peter reports when I use LIDAR for fixed wing, and I observe the sort of behavior that you report for quad copter operation.

By the way, I have observed LIDAR "out of range" behavior for "point blank" range.

If you have the time and interest, it would be useful to me if you would point your LIDAR at the sky and report your observations.

Best regards,
Bill

--
--
---
You received this message because you are subscribed to the Google Groups "uavdevboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uavdevboard...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/uavdevboard/285fcd0a-1666-4cc4-8c13-1faea6419fc9%40googlegroups.com.

Peter Hollands

unread,
Nov 19, 2019, 1:45:50 PM11/19/19
to uavdevboard
Hi Guy-Francois,

Thank you for taking the time to publish your experience with Lidar, and for making your flight video, and live telemetry video available.
It is interesting to watch that.

Yes, Bill is correct in saying that our problems was that the Lidar did not give correct readings for "Out of Range", so it was hard to know when it could be trusted.

So as Bill says, If you do have time to point your Lidar into an empty sky, it would be interesting to see the measurements that your code gives back in the telemetry.

By the Way, Either your Quad is very quiet, or your garden birds sing very loudly. I like to hear them above the background noise of the Quad.☺

Best wishes, Pete



Message has been deleted

Guy-François MESNIL

unread,
Dec 8, 2019, 12:09:12 PM12/8/19
to uavdevboard
Hi Bill and Pete,
I pointed the Lidar Lite 3 to the sky and observed same unpredictable responses, as you noticed.
I tried to understand your 16 ms criteria, without success on my Lidar version.
A short report about the investigations done to see what could be done in case of "out of range" is joined to this post.
Instead of using a hardware criteria (unspecified by Garmin) I propose to process the data to validate the measurements.
Hope that can be usefull,
Best wishes,
gfm


LidarLite3_Behavior.pdf

william premerlani

unread,
Dec 8, 2019, 7:45:40 PM12/8/19
to uavde...@googlegroups.com
Hi Francois,

Thanks for the information.

Yes indeed, the LIDAR PWM output is difficult to interpret when it is pointed at the sky.
I think that the problem is specific to the PWM interface and that the I2C interface would not suffer from the same problem.
There are a couple of work-arounds for the issue.
One way is to use another source of information to detect out of range such as GPS.
It is my preference to be able to use LIDAR by itself to validate its own PWM values.
I found a way to do this with for the LIDAR version 3, HD, by detecting the particular signature of the PWM when LIDAR is out of range.
That is the method that Peter used to reject out of range LIDAR PWM noise.

I have all 4 versions of this LIDAR and used a logic analyzer to examine their PWM signatures when they are out of range.
Unfortunately, the out of range PWM signature is different for each version, so the method that Peter and I are using on the latest version will not work on the three older versions.

Best regards,
Bill



--
--
---
You received this message because you are subscribed to the Google Groups "uavdevboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uavdevboard...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages