LibrePilot Forum

General Category => General Discussion => Topic started by: datapool on August 23, 2016, 05:02:32 pm

Title: DJI Naza GPS/Comp setup problems with INS13
Post by: datapool on August 23, 2016, 05:02:32 pm
I need some help from the cracks for my quad setup... quad flying fine without GPS so far...I want to use a DJI Naza GPS/Compass combo as mentioned in some threads on the flexi port. Installed and all detected signals from mag / gps coming in.... All calibration done, deviation between ext and onboard comp. +-/ 2 degrees, alarms green, and I did all checks from this page more than twice...

https://librepilot.atlassian.net/wiki/display/LPDOC/Aux+Mag+Setup+and+Calibration (https://librepilot.atlassian.net/wiki/display/LPDOC/Aux+Mag+Setup+and+Calibration)

However if I switch over to INS13 mode, I get wired up/downs vibration on either yaw/pitch/roll - please see the short 30secs video sequence attached.

I went over all procedures during the last days... always the same. No idea where to look now.

Can anyone give some hints why the INS13 gives these "vibrations" (unflyable). A normal Comp+Map+GPS mode works.

Any ideas? Help would be greatly appreaciated... Maybe I did something wrong and am not able to get it ...I am lost after those days of redoing all things...



Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: f5soh on August 23, 2016, 10:38:41 pm
There is a issue with Auxmag calibration appeared recently, you may need to follow this workaround waiting the fix:
https://forum.librepilot.org/index.php?topic=2187.msg15708#msg15708

Redo the calibration, booth mag should be perfectly sync... seems that not the case here looking at the 3 bars.
https://forum.librepilot.org/index.php?topic=1110.msg15449#msg15449
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: TheOtherCliff on August 23, 2016, 10:45:22 pm
Vibration in the video is absolutely no problem, normal, expected.  :)
You are a little out of level (caused by the mag).  I would:
set INS13
use Attitude mode, no Assisted Control (GPS Assist)
use Attitude -> RotateVirtual to get it hovering motionless
"if it is drifting forward and left you subtract from both pitch and roll"

(better setup, assuming you are using aux mag in the DJI/Naza GPS)
Use Basic Attitude Estimation with Attitude mode and set RotateVirtual for motionless hover.,
then use INS13 with Attitude mode and set aux mag rotation for motionless hover.
(this keeps it level when you switch between Basic and INS13)

Then do your other GPS stuff.  I highly recommend you take off in Attitude mode and your first GPS mode should be VelocityRoam.  :) :)
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: TheOtherCliff on August 23, 2016, 10:46:25 pm
beat me to it.
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: chromvis on August 24, 2016, 02:43:50 am
You developers did a  great job with this project and should be proud of it. In such complex project verification for cross-influence is very tedious job. I hope we as testers could help. Although, if there would be some at least minimal description (functional) of UAVOs it will be helpful. I would be happy to help in writing, but do not feel confident. I often stumble in understanding of functionality of some objects. E.g. without the description from TheOtherCliff of "SmoothQuick" I would never get this great feature of PID variation.
Any way, we all have to wait until it fixed. I played yesterday with Sparky2-Ublox and Revo-DJI combinations and consistently got less than 1% error for onboard mag and over 30% for AuxMag no matter what.
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: TheOtherCliff on August 24, 2016, 05:15:03 am
Did you try the work arounds and still have a large calibration error?
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: chromvis on August 24, 2016, 06:55:57 am
Actually, I did not. Will try tomorrow morning.
As I understand, I just need to save the UAVObject state right after calibration start, yes?
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: datapool on August 24, 2016, 08:41:39 am
thanks for your great comments and help! Very kind of you. I will try your suggestions during the next days. Weather conditios too bad right now. Will report back here once calib procedure with workaround done.
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: datapool on August 26, 2016, 06:07:32 pm
calibration worked with the workaraound above! great.

I still see sometimes -1 / +1 deviations on some of the 3 bar magnetometer setup page if I rotate the plane, does it matter? Does it have to be exact 0 on all three or is a -1/+1 on some bars allowed in some positions?

In flight, INS13 is not that stable as Complementary mode right now - maybe the toilet bowl? - seems I need to move the GPS/mag of the DJI/Naza more out on an antenna stand for my 250...
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: TheOtherCliff on August 26, 2016, 06:28:53 pm
It gets onboardmag sensor then it gets auxmag sensor.  Just because you are moving it, it will compare an old version of one with a new version of the other and you will get some non-zero number even if it is calibrated perfectly.  Once you stop, does it go to zero no matter where you stop?

I don't know what the numbers represent, if they are just the difference in the raw sensor numbers (that go about +-400) then +-1 is very tiny and doesn't matter.  :)

My largest number is about 3, but I change my aux mag orientation to get a motionless hover in INS13 with Attitude mode.

When you say INS13 is not as stable, what mode are you using?  Simple Attitude mode should be very stable.  If you are getting signs of toilet bowl when you use some GPS mode like VelocityRoam, then it is probably caused by mags.  On such a small quad, you are just about required to put mag up on a post to get it away from motor wiring, to avoid toilet bowl.
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: datapool on August 27, 2016, 12:00:27 am
When I stop moving it, the 3 bars go back to nearly zero in all postions - however, on some bars I see after stopping still a -1 or +2. Like a 0,-1,0 or -2,0,1 ... But this in all positions after moving and stopping. So no real great deviations, but not exactly 0 in all 3 bars.

However, during all these tests, it looks like I crashed my DJI/Naza clone. My voltage is going break now if I plugin the DJI gps in the flexi port. Once I pull it out, all system/power run. But if the GPS is in again in flexis, works for 2secs but then main voltage seems to go down on all revo areas (also main port for SBUS)...

I only get my revo working after unplugging the gps from flexi....not sure what happened... it worked for some time.... but now the GPS plugged in, revo and TX on main port dont receive enough voltage to run.. Did anyone experience such behaviour before? I think I crashed my GPS clone somehow as everything works when I unplug it again. strange...
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: chromvis on August 27, 2016, 03:24:43 am
Looks like power supply problem. How do you power your revo? You may have bad connection in some wires which may add high resistance (or low resistance drain to ground), then additional consumption bring it below tolerable threshold. This may be dangerous, and cause high heat generation.
I usually power revo through PWR port from V1.05 Pixhawk power module. Never had any problem and very accurate voltage and current sensors.
I do not like ESC BECs - during flight load voltage fluctuates a lot.
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: TheOtherCliff on August 27, 2016, 04:19:44 am
Use a magnifying glass to look very carefully in the FC port where you plug in the GPS.  If there are bent pins, they could short out when you plug the GPS in.

To fix, it requires a magnifying glass, a thin, narrow model knife (#11 Xacto) to get the pin started back to correct, and then a VERY thin needle nose pliers or hemostat to clamp the pin hard, to straighten it out.
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: datapool on August 27, 2016, 08:17:29 am
i power the revo via a PDB delivering 5V which goes into the pins +/- where also the motor ESC signal cables only (servos chanel 1-6) are connected. The port delivers straight 5V.

When I plug in the GPS, current breaks down and if I measure directly at the PDB BEFORE the revo, voltage somtimes goes down to 3.x volts.

Interesting: If I leave the GPS (flexi port) in and pull out the transmitter (main port SBUS FRSky xsr) then the GPS works. So it currents breaks down if both GPS & transmitter are plugged into main and flexi port. However, it did work before for a longer time. Not sure what happened here.

I observed it first after I did a high discharge on one lipo which lead to system failure / crash inflight. Was hovering low - so no damage. However, afterwards I observed this behaviour.

Can the low voltage from the lipo have caused some components to break? Pins in both ports (flexi/main) look quite good and straight.

The reason I would think about the GPS as root cause is the following:
If I unplug it from the flexi port and put the +/- 5v cables of the GPS directly to the PDB before the revo, the current also breaks down. So I was thinking the GPS consumes too much or has a shortage because the full PDB breaks down if power is also directly taken from the PDB to GPS - even the revo goes down if GPS is powered directly from PDB 5v. However, GPS only or transmitter only - each single one works...

Not sure where to look or measure current to get to the root cause.
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: TheOtherCliff on August 27, 2016, 06:58:15 pm
Measure the current that comes from the PDB while it is powering everything.  You may have a bad PDB +5V.

Before doing that, it's very important that you know how to measure current or you could short things out.
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: datapool on August 28, 2016, 04:25:24 pm
thanks for giving me direction!

Yes, it was a bad PDB with "fluctuating" +5V - not stable. I installed a new PDB with clean 5.1v in any situation and now GPS and transmitter work fine without any breakdown. I also mounted the GPS on an antenna stand ~17cm. Now adjusting the flight characteristics - quite different with that mast above ;-) I am thinking of cutting the mast down a little to get better CG. But I will start with full atenna mount first.

Will calibrate and check GPS once I adjusted the PIDs for stable flight later today. But everyting mounted now to see if the magnometor on mast delivers more clean data to get a stable GPS position hold.

Before, I was comparing attitude hold with a clean stable auto height in complementary mode versus a GPS INS13 position hold. The auto height in attidue in complementary was more stable than the INS13 position hold. So hopefully with the antenna mount INS13 will get better for position hold.

Anyway... took some time to nail down the root cause for the bad PDB 5v distribution and reassemble everything. Will report back once GPS/mag calibration was done.
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: TheOtherCliff on August 29, 2016, 11:07:42 am
Don't worry about being top heavy.  That shouldn't be a problem.  :)

Did you know that you must twist ALL your high current wiring so it has less effect on the mags?  Battery -> PDB -> ESC -> motor.  All of them.  If you suspect mag issues, this is the first thing you should check.  Also, I personally find that for normal FC locations, I must use an aux mag on quads smaller than 500mm.

The mast isn't going to help ALtitude stability in GPS flight modes.  GPS simply doesn't have good vertical accuracy, although a better GPS that tracks more sats can help.

You may consider building or downloading "next" which has AutoTune (see wiki).
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: datapool on August 29, 2016, 07:59:15 pm
Thanks Cliff and colleagues helping me out. GPS/mag looks like working now. VelocityRoam works. Need to finetune the stuff, but I am able now to get the GPS flight modes working. Will move on to finetune/recalibrate and start an autotune session.

THANKS!

Added:
I am so happy to have my first stable and controlled flights in GPS modes. Really fun getting this working!

Please allow one final questions:
It looks like there are some minor oscillations in GPS modes when I am in velocityroam on hovering - keeping sticks away. These oscillations are not there if hovering in non-gps modes. Are there different PIDs when using GPS flight modes? If so, can you give me a hint where to look and tune those?
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: TheOtherCliff on August 30, 2016, 05:51:56 am
Yes there are PIDs in System -> Settings -> VtolPathFollowerSettings

But first question: "Is it Toilet Bowl?"  That is caused by bad high current wiring (twist all high current wire pairs / triplets).
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: datapool on September 05, 2016, 08:47:05 pm
All fine and stable now. Thanks for all hints. It would be impossible for me without this forum!

In INS13 mode now with no wind; I get I slow/light left-forward drift when hovering in attitude. So I should adjust the virtual aux mag rotation values to get a stable hover? Can you give me a short hint on which values to adjust if I see a very small left-forward drift?

Thanks!
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: chromvis on September 06, 2016, 05:24:07 am
Were you hovering in Stabilize or in PositionHold? If in Stabilize, very slow drift is almost inevitable, although you can try to repeat board level calibration. If in PositionHold, unidirectional drift is a bit strange, but sometime GPS error could be up to 10 or even 20 m depending on the environment (tall buildings etc.). Horizontal position is mainly dependent on GPS, direction of position correction is dependent on magnetometer. If this direction is wrong the quad movement will look like water rotation while flushing toilet bowl - "Toilet Bowling". I got once swing-like movements, but there was a combination of wrong mag calibration and vibration.
In Stabilize mode some air flow reflected from some asymmetry in motor arms (ESC position, wires, LED etc) can create sufficient force to slowly move your quad in certain direction.
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: datapool on September 06, 2016, 08:25:58 am
I am in stabilize. PositionHold is like a rock in the air.

So I think I will stop to "overoptimize"... I am quite happy so this little drift is only visible with no wind. No issue at all. Thanks for your comments. Helps me to learn and understand.
Title: Re: DJI Naza GPS/Comp setup problems with INS13
Post by: TheOtherCliff on September 24, 2016, 07:19:39 pm
Sorry for late reply.  I have been away for a while.

I do the following so that Attitude mode hovers as level and drift-free as possible, whether I use Basic or INS13.  Basic only uses accels for leveling, but INS13 uses accels plus mag for leveling, so first adjust accels with Basic, then adjust mags with INS13 so both are as good as they can be.

I use Attitude mode with Basic algorithm and adjust "rotate virtual" till I get a hover that moves very little / none (no wind, using down to 1/10ths of a degree); then I use Attitude mode with INS13 algorithm and adjust the mag rotations till I get a hover  moves very little (only degree whole numbers are allowed, so it won't be as perfect).