Benewake TFmini LIDAR works on Ardupilot

@ppoirier I have a question about implementing the tfmini if you have the time:

I am currently trying to test if the tfmini is functioning properly, using the benewake app but unfortunately I am not getting any readout in standard or pix mode. Connecting to the correct serial port via Tera Term isn’t giving any readout either. I wonder if this is because I am using an sparkfun redboard instead of a ttl to usb converter. Could this be the issue? I can see the red light on the transmitting lens of the tfmini indicating it is receiving power, and the right voltage too.

Anything helps, thanks

Hi!

I bought two Benewake Lidar Lite which I received yesterday.
I connect one of them to Telemetry1 port on a Pixracer (not Pixhawk).
I adjusted all the parameters as described in the documentation.

When I connect Pixracer to Mission Planner I have the message “Bad Lidar” flashing and some times I get som random meassure readings like 599 4 39 but often it is 0.
I have only 0 for volt.

What to do?

I have not test it with computer and the application but I assume it would work without any changes.

I have not change Lidar Lite to “pixmode”, I thought it was default from factory.

Should it tell me volt when I connected to Telemetry port?

I’m a bit confused because I have some measurement from the Lidar but It is not correct and not consistent. Do someone know If it is because Lidar is NOT in Pixmode?

I use Telemetry 1 instead of 2, but I think they are the same, or?

Hi. Regarding to your questions, pls contact bw (at) benewake (dot) com for TFmini connected to Pixhawk operation manual or download from the Benewake website. As you mentioned bad LiDAR health, pls check whether you’ve selected Pix mode, check the picture. And double check whether the TFmini cable connection is right. also, check whether it’s caused by lack of power supply, if yes, pls provide separate power supply to the TFmini.

Micaelkarlsson, Default the Benewake TFmini is not in pix mode, you need to change it (and the change needs to stay).
With a serial adapter you should see some output, in either mode. Also in the benewake software you should see an output. If you do not please check all connections and the serial adapter.

Telem 1 or 2 doesn’t matter, as long as you change the settings in arducopter.

1 Like

Hello! Great!

Then I will check with ftdi adapter and change the settings. I was a bit puzzled (is that right word?) when the distance some time changed but the response in mission planner felt randomized.

Hello,
The red board is like an arduino uno and there’s only one serial port. You cannot use the usb and the tx-rx concurently on a uno because its the same port. Please get a ftdi, its a good little tool for only 2$

2 Likes

I just set the lidar to Pixmode and suddenly everything workes! Thanks for all the help Nando and ppoirer!

could be cool referencing the TFMINI there.

Testing the TFMINI on Pixhawk serial (Telem2). When I read on MP the sensor values I get sonarrange around 0.7, real distance. When moving the drone, I can measure the length of my office, around 4 meters, so it works.
TFMINI2
When I take off, I read altitude (in Yaapu interface) 0. When I land, windy day, I read altitude 3.5m (drone landed). So for me this is the baro altitude, not the RangeFinder altitude which should be activated between 30 and 600cm. So what did I missed in parameters? Thanks.

TERRAIN_ENABLE=0
TERRAIN_FOLLOW=0

I am flying outdoor with opticalflow and TFMINI as the altitude source.
In order to do that we have to set the ekf altitude source for rangefinder.
Here is the wiki pages for the EKF_TYPE 2
http://ardupilot.org/plane/docs/common-apm-navigation-extended-kalman-filter-overview.html#commonly-modified-parameters

Please note that they are making reference to terrain follwing as well, I never tried this mode

Thanks, If I understand, setting EK2_ALT_SOURCE=1 means that Range Finder will be used from 30 to 600cm and then the Baro will be the altitude source, right? I’m using a GPS, not an Optical Flow, does it change something?

When I fly with this setup in alt-hold, loiter and guided, it is generally cannot go above rngfnd_max.
In order to go above this limit, I switch to manual mode (stabilize) and push throttle to get above the limit and automatically force baro.

Reading the doc, I see:

“Setting 1 uses the range finder and is only available in combination with optical flow navigation (EK2_GPS_TYPE = 3)”

So I assume this is not an option to me?
I understand that you use lidars for object avoidance, but I would use it as an “assistance” to have an accurate altitude. So with no Optical Flow there seems to be no option, do you agree??

Try it, experiment, have fun and report back :wink:

Sorry, no, I reported back months ago my fly away problem with terrain follow, and the issue is still opened for more than one year https://github.com/ArduPilot/ardupilot/issues/4697, I will not take the risk to destroy something…

1 Like

I told you before , recovery == Switching back to manual and get the bird back, is something you must practice and master so it comes automatically. Otherwise you can test with simulator, this is what I do when I implement complex systems.

Anyway, I do not understand why changing EKF parameters, as written in Wiki:
“Downward facing Lidar are used in flight modes which have height control, such as Altitude Hold, Loiter and PosHold Mode. The data from the sensor will be used until you exceed RNGFND_MAX_CM, after that it switches to the barometer.”

So it shoud work without changing your EKF parameter, no?

Sorry, this doesn’t work, read the issue…

Hi Patrick,
I don’t think it’s necessary to set the EKF_ALT_SOURCE to range finder in order to use the optical flow sensor.

Hello Randy,
You are right, optical flow works with any config on ekf alt source. I just mentioned that My setup is using rangefinder as the primary source.