BadOptFlow Health/No Readings on VL53L0X

Hi everyone! I am a wee beginner to this, and have spent many hours of fun setting up my drone with my PX4 with no troubles at all until now:

I searched for many hours and couldn’t find a solution to my error, so thought I would turn to you all…I’ve got the VL53L0X hooked up to my i2c port via a splitter (has to share with the GPS) and I’ve never managed to get the Pixhawk to recognize it. I’ve even tried unhooking the GPS and plugging the VL53L0X directly into the i2C line without the splitter with the same result.

I followed the instructions on all the settings under Config/Tuning in Mission Planner EXACTLY and still can’t get any readings on “sonarrange” or “sonarvoltage”. I am fairly sure I wired it up exactly right, so doubt that’s the problem. I have NO IDEA how to troubleshoot this.

I have the RNGFND_TYPE as 16, the RNGFND_ADDR as 41, the SCAILING as 1, the min and max set to 5 and 120, and the GNDCLEAR at 10 (which is actually close to where I have it set up temporarily on my frame). I followed the instructions HERE.

Sorry for the dumb question. As I said, I’ve been teaching myself how to use the Pixhawk over the last month or so and got stuck on this one.

And after redoing all my wiring now it works! BUT…it still gives me Bade OptFlow Health.

So, a few items, first I think you have a px4flow optical flow board? You state px4, and that’s the name of a flight controller. easy to confuse but a very different thing.

You talk about the VL53L0X. I think this a lidar rangefinder? I did find some specs for that, my concern is the maximum device range was listed at 2000 millimeters, 2 meters. That’s not much help for a drone.

So bad lidar health is a common issue. Read the support blogs. But first:

  1. It is recommended by most that you do not power the lidar or px4flow from the i2c bus, but rather use an independent BEC for clean adequate power.
  2. Can you verify the ground wires, power and communication are all tide together to create a common ground?
  3. first you need to make the lidar work by verifying current correct data on your ground station, only then look for any data reported from the px4flow.
  4. If you still get bad opt flow heath, then start experimenting with the order of the start up, try powering the FC by usb, then apply battery power.

Thanks for your response!

I am using the cheap Pixhawk that’s been around for a while…the px4 flight controller. Sorry for the confusion.

I am only trying out this cheap lidar to see if I can even get it running. I know the range is limited but I am curious to see how well it will do to follow the ground at a very low altitude. If I can get it running then I will try something like the TF Mini. I didn’t want to invest lots of money in a sensor only to find out I don’t know how to get it running.

I found that I had accidentally clicked the box on one of the unrelated optflow sensors under optional hardware. I no longer have that message. That was my stupid mistake!

What I am getting now is a “Bad LiDAR Health” message from time to time, though the sonar range under “Status” seems accurate. This message doesn’t pop up all the time, oddly. One thread I read says this is when the LiDAR isn’t enabled for landing, and changing the “RNGFND_LANDING” setting should change this…but that’s only for Plane Pixhawk settings.

Meany have concluded that the power supplied by the flight controller thru the i2c port or other ports can be insufficient to be reliable with lidar or the px4flow. The solution is to provide a separate BEC, this is effectively a voltage regulator that will provide clean consistent power without drawing power from the flight controller. These devices are super sensitive, and can be effected by slight changes in the power supply.

Since I am still figuring this out, is there a how-to out there that will show me how to wire up the lidar so it gets it own power but still communicates with the Pixhawk somehow? I am not exactly sure how to do that. Thanks again for your help!

So you will need to cut the positive , red wire from the i2c cable to the px4flow and lidar, and solder in a BEC to provide independent clean power to the devices. Check all voltages in the device specs and measure the bec voltage prior to powering up the first time. The ground wires for the BEC, lidar and px4flow also need to be connected, but for the ground wire maintain the connection to the flight controller.

You should search the forums, Lidar and PX4flow topics as this has been discussed, perhaps someone created a wiring diagram.

Thank you! I will check it out.