I am trying to set up a LidarLite sensor from PulsedLight.
I set it up according to the wiki (new sensor, manufactured Feb 2015, interfaced with a Pixhawk)
In the wiki it points to the Flight Data Screen to test the sensor,
but I only get zero as reading in this window.
But if I check in the terminal,
I can see that the sensor is working (see attached file),
so is it working ok? Is the wiki wrong?
Thanks a lot,
yes - the sensor has to be connected to AUX5 and AUX6 for PWM
Thanks for the quick replies.
I have watched that video during my installation as well.
We are coming here close to midnight soon. I will let you know what I find tomorrow.
Thanks a lot
Sorry coming back to you so late.
Tonight I have tried with my second Pixhawk setup ( both trad. Helicopters)
and it worked by the first attempt.
Same setup, same cable, same LIDAR.
Still have to find the reason why it did not work with the other unit.
I herewith thank you very much for you help and time.
@ Felix and others:
I'm using a Lidar-Lite v2 connected via I2C, and I'm trying to make sense of the readings. It seems to me that there is a scaling being applied. I'm seeing similar readings in Copter 3.3 as well as 3.4-dev
|Ruler (cm)||Lidar (meters?)||Lidar to cm (/100)||Difference||Scaling?|
The data certainly doesn't correlate well to the accurate, linear results Felix showed in his testing.
RNGFND_FUNCTION: 0 / Linear (only required for analog I believe)
RNGFND_RMETRIC: 0 (only required for analog)
RNGFND_SCALING: 1 ((only required for analog)
Any idea what's going on here? I'm going to continue testing, as well as try PWM shortly. Thanks!
Thanks for the details Stephan,
I've just rewired my Lidar Lite to connect via PWM. Here's where things get baffling:
sonarvoltage reads what appears to be proper voltage levels to distance: IE: 0.80 v for 80cm. This looks great - however:
sonarrange for that value is reading 2.52. You would think I've got RNGFND_SCALING set to a value other than "1", but it's set correctly. Just as with i2c, there's some sort of scaling factor being applied - but I don't know what or where. I'm currently testing this on the Copter 3.3 release and have just reset default parameters and only set up the necessary Lidar params.
I can set RNGFND_SCALING to somewhere around 0.33 and get more approximate values for closer distances , but the scaling factor doesn't seem totally linear.
I don't have a second Lidar, but I do have a second copter I will test this with to rule out something strange with this Pixhawk.
So I've connected this Lidar to another copter I have, currently running 3.4-dev. Using PWM, I see sonarvoltage and sonarrange both correlate well to actual distances.
So it seems the problem resides with my original Pixhawk, on a 3DR Iris+. I can't think what would cause the unusual scaling issue, especially over both i2c and PWM, and different versions of firmware with parameters restored to defaults before configuring.
I'll leave this here, just in case anyone else experiences this bizarre issue.
how do you supply the 5V to the Lidar sensor?
Can you maybe double check that the power supply is ok?
Felix, good thought - The 5V supply is looking clean, coming from a BEC. I think I just discovered the fix, posting below.
After considering the strange Lidar readings I was getting, even in PWM where sonnarrange did not match sonarvoltage were not from the following:
The issue was some sort of non-editable parameter and/or corruption in the Pixhawk's EEPROM.
To Resolve the issue:
I installed the firmware for APM:Plane, then reinstalled APM:Copter. By changing the vehicle type, the Pixhawk resets it's EEPROM.
Then I reloaded my parameters back in, and using PWM, my sonarrange and sonarvoltage values correlate now.
Definitely a weird one - I'll remember this fix for any other explainable issues.
And just like that, I'm having the problem again. This time on the new copter using PWM (where data initially looked good on first boot).
Pretty dumb-founded on this one. I also switched to APM:Plane, where I'm seeing the same issue.