-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SF30/d lidar support #20809
base: main
Are you sure you want to change the base?
SF30/d lidar support #20809
Conversation
Adds support for the SF30/D
Parameter update to include SF30/d
SF30/d
Cool. When this goes in, can you do a PR to update http://docs.px4.io/main/en/sensor/sfxx_lidar.html ? It would be good if you could check the whole doc - it is old. If you're feeling particularly charming, also update the hardware connection diagram: http://docs.px4.io/main/en/sensor/sfxx_lidar.html#hardware Especially if it comes with a cable so you don't have to do anything with new Pixhawks. |
@hamishwillee no prob. Will go through it all. |
@ryanjAA Re #20809 (comment) - great! Any progress on this one? |
Test flew this today. Logs to follow. No issues. |
Just an interesting thing to note about this unit. If you have an MS4525 airspeed (aka the commonly used old one), your i2c bus will shutdown. It is likely a hardware issue. We tried quite a few of them and different internal revisions of the SF30. This should just be in the docs when (when this gets pulled in) but we've done quite a few flights with this hardware and with different revisions of it. @hamishwillee just so this is on your radar but i'm happy to do the docs on this. |
@ryanjAA We have had some problem with LW20/C and MS4525 on the same bus. In our case I identified the problem to be these line: The LW20/C does not handle the I2C SW reset all command well, and garbles up the bus afterwards. I suspect the MS4525 only changes the startup timing slightly, which can cause the problem to appear or not. If you have the opportunity, you could try to just remove the lines from your version of PX4, and see if the problem persists. It is what we have done in our fork. Thanks for this PR, by the way. We will receive a SF30/D soon, I will test it then and report any findings. |
Cherry picked and squashed commits from PX4#20809
Cool. We’ll try it today or tomorrow. Have you flown it? |
@kibidev Confirmed that fixes it - not flight tested though. Checked with SF30/d, MS4525do and RM3100 on same bus. |
@ryanjAA I needed to connect with usb and set the correct legacy mode for the sensor to work. This is not the same procedure as currently described in the documentation for other Lightware sensors (unsure if this is because the sensor is difference, or the current documentation is outdated), so great if you are able to update documentation as well. Regarding update rate, we do not need any higher rate at least. If a higher rate should be added, I think it should be configurable, so it is possible to limit the I2C traffic, and PX4 resource usage in general. |
Interestingly the bus issue popped back up today. MS4525 airspeed and with the SF30, it doesnt work (and the above commented out), swap to the same MS4525 but made by MRO (which has an LDO on it), it works all together. I tested 12 of these on the bench for good measure. Only the MRO ones work so there is something strange and if you unplug the sf30, all non MRO work fine (aka not the sensor per se). |
Writing for tracking purposes. Just saw this again today with the init commented out on an MS4525 without an LDO... Strange but since 2 months later and different hardware, maybe an ms4525 batch issue (we buy them in packs of 100 but this is a different batch) MRO ones are working but will buy a non-MRO, non LDO one and write back. |
The lightware LW20/C and SF30/d require the i2c reset here to be removed for it to work properly. If you plug in the commonly used MS4525do airspeed without this PR the entire i2c bus stops responding. This fixes it. Been flown without issue since early June. The LW20/c just doesnt handle the reset command and won't work so this is needed for that as well (see here PX4#20809 (comment))
#22149 is required. |
Batch issue - it doesnt make sense (unplug the SF30/d and it works) but no other explanation... |
This adds support for the lightware SF30/d lidar (laser altimeter) with 200m range.
Bench tested and works as intended.
It outputs 250m when out of range (and the SF11/c outputs 650m) so we may want to filter those exact numbers out by anything that is consuming this lidar data.
Also, I have this set at 39hz but it can go up to 20k hz with little to no range degradation. Is there a reason to not increase the this (ie is it useful to have faster refresh rate and can that fast data data even be consumed? Concerns here would be overloading the i2c bus, if relevant).
https://www.documents.lightware.co.za/SF30%20D%20-%20LiDAR%20Datasheet%20-%20Rev%200.pdf