Quad Copter Marvelmind Accuracy

I am using Marvelmind as an “indoor” gps.

The issue we are seeing is that the loitering mode causes the drone to oscillate around 2 feet.

We have tried many combinations on the advanced params, but nothing seems to fix it.

I have also changed code inside https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_NavEKF3/AP_NavEKF3_PosVelFusion.cpp, but is is very difficult to understand, I would like to see if someone can point me to the correct file so I can do the changes on my end.

This is what I changed:

I changed values from “0.05f, 5.0f” to “0.03f, 0.5f”

// calculate additional error in GPS velocity caused by manoeuvring
R_OBS[0] = sq(constrain_float(frontend->_gpsHorizVelNoise, 0.05f, 5.0f)) + sq(frontend->gpsNEVelVarAccScale * accNavMag);
R_OBS[2] = sq(constrain_float(frontend->_gpsVertVelNoise, 0.05f, 5.0f)) + sq(frontend->gpsDVelVarAccScale * accNavMag);

and changed “0.1f, 10.0f” to “0.1f, 0.5f”:
R_OBS[3] = sq(constrain_float(frontend->_gpsHorizPosNoise, 0.1f, 10.0f)) + sq(posErr);
Decreasing it further makes the copter fly worse.

The goal is to have this drone fly autonomously and Marvelmind has an accuracy of ±2cm. So, something in the firmware is causing the drone to oscillate way too much.

Thanks! I am happy to answer any more questions you might have.

Thanks!

One of the issues is the marvelmind FW. It does not provide the RAW distances to the beacons so that we can feed them in our EKF. So until marvelmind fixes this (they know the problem) we can not do anything about it. And please change the title of your post to “Copter indoor Marvelmind accuracy”

Once they fix it, ping me and I will update the Marvelmind device driver.

Hello Amilcarlucas. Thanks for responding so quickly.

Is this anything that can be forced by changing the firmware code and forcing through the advanced params to be able to feed the raw distance?

Also, where can I take a look at this driver code? Can you point me to the location?
Thanks!

No, it is not possible via marvelmind FW configuration. It is possible via new marvelmind FW. Their FW is closed source, so the only thing to do is ask them to implement it. We already did it once. Would be nice if you also do it.

The ardupilot driver code is available in:
ardupilot\libraries\AP_Beacon\

I see. I just made a post about this on their forums.

But I still have one question. So Marvelmind is supposed to be used as a GPS and that’s is why it is connected into the GPS port on the Pixhawk.

If you are pointing me to the AP_Beacon code that means that marvelmind should be used as a beacon and not as a gps?
I have seen some other people trying to use as a beacon and not having anything on the GPS connected, but that does not make much sense to me.

Can you explain further? Thanks!

  • The GPS port of Pixhawk is a serial port.
  • Marvelmind is a serial device
  • If you are flying indoors you do not have a GPS connected, hence the GPS serial port is free, hence we connect marvelmind there.

Is that clear ?

Yes, if we use it as a becon feeding data into our EKF we will probably get better than 2cm accuracy.
If we use it as a NMEA GPS (Marvelmind supports this already) then it only has +/- 22cm accuracy. and their NED -> lat,lon coordinate transformation is buggy, so it will probably will be a lot worse than 22cm. The higher latitude values you have the higher the error.

So again … please ask them to implement that feature, please.

Thank you so much for clarification! Yes I will tell them to implement it. Thanks!

Hello. I posted about this on the Marvelmind forums and the post is still pending for approval.

One last question I have. You mention that the NMEA protocol provides around ±22cm of accuracy, but they advertise ±2cm and also when I look at the Marvelmind dashboard seems to be very accurate. So, is it correct to assume that the beacons tracking is pretty good, but when this information is converted to lat/lon it gets bugged?

Thanks again! Will update as soon as they provide an answer!

Hello. I am talking to marvelmind right now. Can you five me your email address so I can add you to the email chain?

Please continue comunication here, not on private e-mails to me. And keep the first post updated with the latest project status.

Hello,

Here is a PixHawk to Marvelmind integration manual: https://marvelmind.com/pics/PixHawk_Marvelmind_Integration_Manual.pdf

We will be happy to help you more with answering your additional questions.

BR,
Maxim