Pixhawk 2.1 with maxbotic I2CXL-maxsonar-EZ issues

Awesome thank you much for that! So all I do is splice (not cut and replace as the GPS still needs it?) in the appropriate wires into the GPS1 port with the I2C plug and then I should be able to have AP read the sonar connected?

Can by any chance I connect an additional sonar, or does the additional need to be seen separately on another port?

Why do you say be careful with the 5V from the pixhawk? Just make sure im not over driving it? So to be safe run a 5v PS?

Thanks.

I just realized the sonar im using is the analog XL sonars not the i2c. Here is how its supposed to be connected to the pixhawk:

http://ardupilot.org/copter/docs/common-rangefinder-maxbotix-analog.html

Im not sure how to hook it up to the 2.1, its ADC port has 3 wires, and I cant find a pinout like you provided above. Could you let me know where to findthe 2.1 pinouts? I dont see them in the literature here from the downloads folder:

http://www.proficnc.com/system-kits/31-pixhawk2-suite.html

This is the Sonar I am using:

http://www.maxbotix.com/documents/XL-MaxSonar-EZ_Datasheet.pdf

Can someone explain how the compass is the GPS can work if the range finder is also wired to the SCL and SDA pins? I’m can’t see how both the compass and rangefinder can be wired to the same pins?

I2C is a serial bus : all devices have an indivifdual adress and the FC is the master that initiate conmunication by sending the sensor adress first and then send an instruction or read a value

Ah right great, that makes sense. Didn’t realise it worked like that with my analog brain. Might actually consider hacking my Here GPS cable now. I have the 1240 sensor which I’ve had some success using the analog output (cos i ddidn’t want to hack the GPS cable without knowing it would work). When I say some success I mean I’m getting a voltage that roughly changes when I move the copter around on the bench.
When I arm and fly however it’s not current working. In the field it just got stuck at 6.5m and didn’t do anything else. Read the troubleshooting guide and I think it’s most likely noise on the power supply for which I’m going to wire in a filter as advised here:

It could also be radiated noise, acoustic noise or vibration but I’m trying the power filter first, then Ill try moving the sensor further away from the motors etc onto the copter landing gear. Soft mounting is also something i’ll try.
If all that doesn’t work I’ll try I2C but one quick question - reading the manual it looks like I can output either I2C or analog becasue it has pins for both, however elsewhere on the internet it says you need to order a different sensor depending on whether you want analog or I2C.
Can anyone clarify that.
Thanks

The I2C is the MB1242 look here
http://ardupilot.org/copter/docs/common-rangefinder-maxbotixi2c.html

Sonar are not very effective as rangefinder, lidar are much better.

I’m starting to see that, but the lidar options all seem quite expensive (>$150 (£110)) to me,unless anyone knows different? Thanks

Yes its the case, the cheapest being the Garmin Lidar Lite v3 for the moment.
We might have an interesting option pretty soon ,

its just been release, we will need to write driver for it … stay tuned :wink:

Oooh looks interesting. I’ll keep on fighting with the sonar for now then! Thanks.

Hi, friends, pls allow me to share, the Benewake inexpensive micro LiDAR sensor TFmini is available. You could pls check OzRobotics link for more details.

1 Like

Hi

Can this be used in Arducopter/Pixhawk yet? I guess this will still need a driver writing for it to work? This looks like the same one as referenced above?

Thanks

@Michael_Brooks I suppose you are asking about TFmini? TFmini is compatible with Arduino, Pixhawk, APM. It does not need a driver like Sonar.
You can please check this TFmini LiDAR development routines on Arduino for reference. Thanks.
Development Routines of TF LiDAR on Arduino-170726.pdf (778.3 KB)

Yes, I am talking about the TFmini. I’ve just bought one since it will work with Pixhawk.
I’m sorry but the document you’ve attached is way over my head.
In mission planner there is an option to setup a range finder and you have to select the type. Is this now listed as an available lidar in the latest firmware version?

@Michael_Brooks
I am looking to publish an update and implement drivers soon.
In the meantime you can make it work with a slight modification of code:

Hi again, I’ve actually just found a manual here:

http://www.benewake.com/en/down.html

So you are also saying it needs a change to the driver (change ‘\r’ to ‘\n’ ).
I clicked on the link in your post but it’s no longer there:

https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_Ran

Edit: But if I change the path a bit I think I the driver I need to change is in here?:
https://github.com/ArduPilot/ardupilot/tree/master/libraries/AP_RangeFinder

Line 61 of AP_RangeFinder_LightWareSerial.cpp??

Edit 2:
Is there a guide anywhere on how to edit the code/drivers and recompile? I’m a total noob at this sort of stuff.

Thanks

Yes thats the one
https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_RangeFinder/AP_RangeFinder_LightWareSerial.cpp#L61

You can use any editor to change this line and than you need to recompile using WAF
https://github.com/ArduPilot/ardupilot/blob/master/BUILD.md

Here is an example of how to build, based on the wiki of the BBBMINI :

Great thanks for you advice. Will have a go at this over the next few days.

Please note that the new Benewake firmware makes use of the driver natively :wink:

Ah good! Does that mean the one I’ve just bought will work with Pixhawk 2.1 out of the box?
Suppose it depends on the firmware version I have.

I’ve been fighting with linux since my last post, mainly, I think, due to out of date info here:
http://ardupilot.org/dev/docs/building-ardupilot-onwindows10.html
Some of the steps wouldn’t work and I was stuck.

Never mind, hopefully I can get it working anyway
Thanks!

Hi!
This idea works, if you change pin4 from HERE to pin 2, and HERE pin 5 to pin 3.
Worked with my LW20 lidar

2 Likes