karla

  • *****
  • 629
MS4525DO (pixhawk) Digital airspeed sensor connection I2C
« on: December 01, 2019, 08:41:01 am »
Hello  :)

Following advise and hope to have PH, RTL, PP flight modes working better for my fixed wings I want to install an airspeed sensor to my Revo board with LP 16.09 r782. Reading up on articles it seems most suggested that digital airspeed sensors have superior range and precision to analog ones that has a lot of noise issues. Since I saw there seem to be support for a well known digital airspeed sensor from pixhawk, I got some units and installed them but the System Heath show I2C as black and AIRSPD as black red crossed over.





I have been reading up on another user, way back that tried to get that sensor to work with a Sparky board.
https://forum.librepilot.org/index.php?topic=3483.0
I am not sure but seems he got it to work after resolving some issues with 5V respectively 3.3V from the sensor?

Anyone already got this sensor working with a LP on a Revo board?

I have followed the wiki
. configured the FlexiPort as I2C
. HWsettings OptionalModules Airspeed Enabled
. Set AirSpeedSensorType to PixHawkAirspeedMS4525D0
. Connected the unit to Flexi port according wiki for pins SCL, SDA, GRD, 5V and the unit.
(I have no other i2c sensors on the system, use internal mag and a GPS on the main port)

Any ideas how to move forward?
Should I just move on and get an analog sensor that user JDL since he apparently got it to work nicely?


Re: MS4525DO (pixhawk) Digital airspeed sensor connection I2C
« Reply #1 on: December 01, 2019, 09:43:56 pm »
Hello,
  FWIW, I'm using the EagleTree V3 sensor for dynamic PID tuning.  It's working great for that, but I can't get it do display any value on the GCS when testing.  Maybe it's an arming dependency or something?  Either way, I can confirm that it actually does change the PIDs, so it might be worth trying.

Re: MS4525DO (pixhawk) Digital airspeed sensor connection I2C
« Reply #2 on: December 01, 2019, 10:36:03 pm »
@ufoDziner:
Hmmm... you should at least be able to set up and watch airspeed on the Scope page.  You will have to set up AirSpeedSensor in the Tools drop down -> Options -> Scope and then set it up on the Scope page.

@karla:
JDL and I discussed the MPXV7002 airspeed sensor and both of us got it working.  In that thread, I just changed the link to buy it to a valid link.  It sounds like you should be able to get the one you have working though.
https://forum.librepilot.org/index.php?topic=3518.0

This is the sensor.
https://www.xt-xinte.com/Ardupilot-Arduplane-Airspeed-Meter-Sensor-Kit-With-Pilot-Tube-for-APM2-5-2-6-2-8-Flight-Controller-p138778.html

karla

  • *****
  • 629
Re: MS4525DO (pixhawk) Digital airspeed sensor connection I2C
« Reply #3 on: December 02, 2019, 02:48:55 am »
Thank you @cliff, that is a fine plan b.
I will try a bit more to use this higher quality sensor.
I think user @wondersea and @f5soh already solved this in another thread:
https://forum.librepilot.org/index.php?topic=2907.msg20342#msg20342

It seems indeed be about 3.3 vs. 5 volt signal mismatch between sensor and the I2C port.
I will see if I can get mine to work and write up how to do it and where to buy things if succeed.
« Last Edit: December 02, 2019, 10:40:47 am by karla »

Re: MS4525DO (pixhawk) Digital airspeed sensor connection I2C
« Reply #4 on: December 02, 2019, 05:43:49 am »
Thanks @TheOtherCliff.  I will test.  The only place I was looking was at the airspeed indicator on the "Flight data" tab.  It makes sense to me that it would be displayed there.  While that never displayed the info, the "AIRSPD" indicator was green, and I could see the controls scale down when blowing into the tube.

f5soh

  • *****
  • 4572
    • LibrePilot
Re: MS4525DO (pixhawk) Digital airspeed sensor connection I2C
« Reply #5 on: December 02, 2019, 06:11:19 pm »
Quote
Anyone already got this sensor working with a LP on a Revo board?

Yes, works perfectly and pretty accurate without calibration.




karla

  • *****
  • 629
Re: MS4525DO (pixhawk) Digital airspeed sensor connection I2C
« Reply #6 on: December 03, 2019, 03:34:11 am »
Thanks! Very useful.

karla

  • *****
  • 629
Re: MS4525DO (pixhawk) Digital airspeed sensor connection I2C
« Reply #7 on: December 15, 2019, 08:59:59 am »
Success!

I am pretty confident to get the MS4525D0 unit to work if arranging stepdown to 3.3v for the signal.

However, what I tried was something different. I got interested in this combo unit from jDrones that in addition to the MS4525D0 has a 3.3/5V pad to just solder a blob which one you prefer and has an external compass on it. Both connected to i2c bus.
Elegant! http://store.jdrones.com/digital_airspeed_sensor_with_compass_p/senairmag03kit.htm



I soldered the blob from 5 to 3.3V and now the airspeed is working :)



Now then, happy so far and just want to see if we can get the mag to work as well.
No big deal if not, since I can likely use the onboard one just as well or like @f5soh suggest, no mag needed at all. Just think it would be cool to have this two units working on same i2c bus and deliver good undisturbed data the FC.

So, the magnetometer page in the GCS, complains the 'external mag can not be found'.
The Red I2C error message in system health say:

I2C: Critical
i2c port is working but there are
acknowledgement errors.


This setup picture was published way before, with the airspeed sensor connected
to i2c in addition to an external mag unit also connected to i2c bus.
Should whis setup still be working?
Any ideas?



Thanks a lot!
« Last Edit: December 15, 2019, 09:05:22 am by karla »

f5soh

  • *****
  • 4572
    • LibrePilot
Re: MS4525DO (pixhawk) Digital airspeed sensor connection I2C
« Reply #8 on: December 15, 2019, 10:45:38 am »
Look if you see activity into Data > AuxMagSensor UAVO ?

karla

  • *****
  • 629
Re: MS4525DO (pixhawk) Digital airspeed sensor connection I2C
« Reply #9 on: December 16, 2019, 01:31:54 am »
No data for x, y and z under the AuxMagSensor, they all remain at 0.

b t w
I read up on the documentation again and noticed the Flexi port should be set to I2C in Hardware, but the Mag type under Attitude Magnetometer settings should not be set to i2c but to Flexi (can be set to i2c but that's related to sparky board).
Anyway, that did not change anything.
« Last Edit: December 16, 2019, 05:35:49 am by karla »

Re: MS4525DO (pixhawk) Digital airspeed sensor connection I2C
« Reply #10 on: December 16, 2019, 05:36:19 am »
That unit says it has "HMC5983 compass"

5 minutes of Googling yields conflicting answers, some saying the I2C address is the same and it works (various firmwares) and some saying that even the address is different than the 5883 that LP is coded to work with.

For chips known to work, sometimes stiffer I2C pullups (say 2.2K from both SDA and SCL to 3.3V) will often make I2C work better.

karla

  • *****
  • 629
Re: MS4525DO (pixhawk) Digital airspeed sensor connection I2C
« Reply #11 on: December 16, 2019, 06:25:48 am »
Thanks a lot Cliff,
I have asked the store for what I2C address this compass uses
(pretending I understand any of this address stuff).
Awaiting their answer now, but I have asked them before and they need a lot of encouragement to answer any questions :)
Of course I should have checked this before buying it  ::)
I think I will not tamper with adding resistors since the 3.3v onboard soldering setting made the airspeed sensor work fine.

Re: MS4525DO (pixhawk) Digital airspeed sensor connection I2C
« Reply #12 on: December 16, 2019, 07:48:59 am »
One other thing I recall is the issue between the original HMC5883 and the newish clone QMC5883.  I understand that different revisions of the QMC, ending in like A or B act differently, and read a post that one of those versions acts like the HMC5983.

There is a pull request (code already written and dev tested) to make the QMC5883 work in next, and that same code might make your HMC5983 work.

@f5soh linked to that pull request.  If you are feeling particularly interested, you could pull the whole code base associated with that pull request, and try that.  :)
https://bitbucket.org/librepilot/librepilot/pull-requests/496
Or at least look at the code and see what the addresses are to compare to whatever the seller tells you the addresses are; if you even trust the seller information.

My guess is the seller will not want to tell you anything because:
- seller got the boards cheap from some place that doesn't know what chip is used or why it doesn't work
- incompatibility (especially HMC vs QMC) is a hot topic and they don't want to admit anything

If I really wanted to know, I would find an Arduino test program and try different libs to work with that program for the various mag chip flavors till I found a lib that worked.  That is probably easier than using a logic analyzer.   :P

karla

  • *****
  • 629
Re: MS4525DO (pixhawk) Digital airspeed sensor connection I2C
« Reply #13 on: December 17, 2019, 06:23:45 am »
 :P Little too deep waters for me at the moment.

Very interesting some code readily exists though.
It was written, tested and approved by two people, but still did not make it to next r782 - How come?
What is lacking to get it included? Testing?

Re: MS4525DO (pixhawk) Digital airspeed sensor connection I2C
« Reply #14 on: December 17, 2019, 07:40:04 am »
I think I recall that procedures require 3 approvals for it to be merged into next, and you shouldn't just say "Yea that is a useful piece of code"  You should read and understand the code to know that it is correct, is well written, follows our standards, doesn't conflict with the general project direction, etc.  If only one person does this, they could be wrong.
« Last Edit: December 17, 2019, 10:08:18 am by TheOtherCliff »