Servers by jDrones

Avoidance Experiments with the POC and Benewake TFMINI

(ppoirier) #1

Ahhh… Winter in Canada …
While the kids play hockey outside with sticks and a puck , I play inside with sticks and a POC !!

A few month ago I started experimenting with the Avoidance Library:

And I designed The POC : Proximity Obstacle Collision avoidance system based on an Arduino Pro Mini and VL50LX0 TOF rangefinders. This unit works pretty well, the only drawback is that it is shortsighted. This inexpensive Laser device is limited to a range of 1,7 Meter and it makes it hard to implement a fully functional Avoidance System.

Then came the Benewake TFMINI RangeFinder, that offers indoor range up to 12 Meter (6M Outdoor) for a price that makes the POC concept a reality. Some of you might have seen a previous Blog explaining how to make this RangeFinder talk I2C with the use of an Arduino:

Configuration of the TFMINI-POC:
The actual prototype is using 4 TFMINI
One looking UP
3 Looking @ -45 Forward + 45
TFMINI are Serial devices and its quite difficult to multiplex serial without buffering.
I did some test with a Teensy 3.5 that offers 6 serial ports, but without handshake (hardware or software) its is quite difficult to have a stable unit, that can work in a variety of configuration and speeds (baudrate).

This is why I opted to ‘‘transform’’ the TFMINI into a I2C device. With the Use of Attiny85 we can read the serial flow @ 115200 and do all sorts of signal manipulation and store results in registers, ready to be consumed by the I2C bus. The controler is an Arduino Pro Mini that sequentially read the I2C devices and transmits over serial on a MavLink DISTANCE SENSOR message


You can download the code here:

To make a system set the I2C address for each ATtiny and you assign the corresponding vector to the I2C Address:

On Mission Planner you set Proximity and Avoidance (as per Avoidnce wiki above) and you can set the avoidance enabling using a transmitter switch, I used ch7 = 40 for Object Avoidance.

And this is how it goes in Alt-Hold Mode:
I use the transmitter to ‘‘push’’ the quad against the garage door and the avoidance system makes it ‘‘bounce’’ back. The harder we push , the harder it bounce back… just like a hockey puck…

This is how the different signals look on the Logs:

ArduPilot, you blinded me with science…
I would like to thanks the development team and more specifically Randy Mackay for this excellent library that makes me play like a kid in these cold winter days :wink:

How to make the TFMINI rangefinder talk I2C
Configuring Multiple Rangefinders w/ Weighting
(ppoirier) #2

I will probably make a 3D printed enclosure for the TFMINI - Just like I did for the initial POC

(Luís Vale Gonçalves) #3

Thanks for another excellent article @ppoirier

So, I believe we should encourage you to go live on the North Pole to keep you happy and productive :joy:

(Siya Liu) #4

Amazing Avoidance Experiments ! ! I believe it will help many users to build their own avoidance system at very low cost! I’ll share this with others and I believe they will visit Ardupilot to learn more about it. :two_hearts:

(griff) #5

thanks. one interesting and useful article.

(Tarek) #6

Hello, good work ! , what is the electronic card or chip used to convert signal sensor uart to i2c ?

(ppoirier) #7

@Tarek-H Thanks

As written in the text , I am using Attiny85 and if you look at the 3rd picture, you can see the 4 DIP chips mounted in row.

(Natapat) #8

Hi, Does it work only Alt Hold mode? Can it use with px4flow and still have avoidance system in loiter mode?

(ppoirier) #9

Hello, yes you can fly in loiter using opticalflow.