Trying to interface an i2c ultrasonic sensor + range finder

Hi all,
I am trying to install a maxbotics i2c ultra sonic sensor onto my aircraft. I am running a cube with the 3.6.5rc2 firmware

I am already running a lightware SF11c lidar as my downward facing range finder, so I am putting my i2c ultrasonic sensor into my RNGFND2 Params, I have it all set up correctly but am not getting any return values from the SonarRange value in the status menu.

I dont know if I need to set the RNGFND2 address to a value and if so, what should it be?
My range finder is set to address 102, so I can’t use that.
I am connecting these two plus an optical flow sensor to an i2c splitter on my aircraft, the range finder and the optical flow both work fine.

any help is appreciated

What orientation have you set ?
Generally we set one facing down (25) as it it default and output values to ‘‘sonar range’’ on Mission Planner. The other(s) rangefiner or sonar must be facing other direction like “0” for forward and the values can be seen when you do CTRL-F and click on Proximity and you will see the distance showned on a “RADAR”

1 Like

@ppoirier I have my RNGFND set to 25 with the lidar, and my RNGFND2 is set to 0 for forwards.

I didn’t know how to check the proximity so I will take a look at that today.

I did try to fly it last night and it didn’t seem to be actively working since the copter did not stop when I got close to a wall.

You need to set avoidance
http://ardupilot.org/dev/docs/code-overview-object-avoidance.html

1 Like

I am reading through that link, I somewhat understand what Randy is saying in it, but I don’t understand how to configure the UltraSonic sensor to set avoidance.

@ppoirier I can see in the proximity radar that the sensor is indeed working, it reacts to objects moving in its field of view… so that’s good, I just am not sure how to set the avoidance? that link doesn’t really tell me what I need to alter in the params to make it recognize and avoid

oups… its easier with user wiki… :wink:
http://ardupilot.org/copter/docs/copter-object-avoidance.html

1 Like

that was more helpful, thank you.
I have one more question, In the “PRX_TYPE” param, if I set that param to 4, is it also going to set my SF11 Range Finder as a proximity sensor? I don’t want to do that. I just want the forward facing maxbotix to be the prox. sensor. I want to keep the LIDAR acting as altitude measurement and keep avoiding terrain.

PRX_TYPE = “4” means that the library will be using range finders as proximity sensors , that is the case here.

1 Like

Ok I don’t want my lidar to be used as a proximity sensor.

I tried setting it up according to the wiki but it still won’t stop before impacting objects =/
I’m flying within a meter of them and it wants to continue on when I have the avoid behave
param set to STOP.

I’m not sure what I am doing wrong.

Can I have you take a look at this log for me? maybe you can see what I have done wrong or haven’t properly set up. Thank you in advance

Make sure that Avoidance is controlled with a switch on your RC
http://ardupilot.org/copter/docs/parameters.html#ch7-opt-channel-7-option
40 Object Avoidance

Note: never worked with SONAR , they have the bad reputation of being "washed’’ by the airflow. I would suggest you try a different sensor.

I have heard that some sonar have issues with prop wash, what is the alternative then for forward facing obstacle avoidance on a multirotor?

I didn’t realize we had to program avoidance to a switch, i feel like that kind of defeats the purpose.

I did give it a try with obstacle avoidance on the chan 8 switch also, still no luck.

Not sure if it’s the sonar just not working correctly, or if it’s something else.

I dont think you can make a good avoidance with such a signal, you should try with a TFMINI RangeFinder , it is the same price range and it works great

1 Like

ok good to know, i may have one of those lying around already

@ppoirier I do have a TFMini v 1.5.3 lying around, is this an i2c lidar? or is it only serial or something else.

Should be serial
There is a driver for this now it is type 20

Is there any easy way to update the TFmini? It doesn’t have a usb port or anything, so i assume the pixhawk can passthrough the update through the serial port?

I am using a mini carrier board for my cube, so i am unsure yet which port I can use for this lidar.

I dont think you need to update for the moment just use any available serial port

1 Like

ok thats good to know, do I need to set the PRX_TYPE to 4? or can I get away with not touching that param since I don’t want my downward facing range finder to be a proximity sensor?