Loiter mode causes fly away, good calibration etc etc,

I have what used to be a Cheerson CX-20 which I have transplanted over to a S500 frame and added 5.8G FPV.

For the past 2 weeks I have been having horrid problems with Loiter mode, flight in Stabilized and Alt-hold mode are rock solid, but switching to loiter causes the copter to just start wandering off.

I was having this issue with the stock compass so I installed a Ublox NEO-6M GPS/Compass combo.

Compass calibration was easy and checking against another compass the headings are correct ±2 degrees in every direction. I also ran the motors through the cycles to check for interference, none found.

I’ve done the compass calibration countless times, I’ve checked GPS and Im getting 8-10 sats and my HDOP is 2.0 or less so it doesn’t seem to be an issue of GPS reception.

I’m really completely out of ideas at this point, stabilize and alt hold are rock solid, and this is the SECOND GPS and Compass, and its having the exact same problem as the first, so the probability of a hardware defect is pretty much zero.

I’ve only been at this a few months, so I certainly don’t know everything, is there anything else I can check or try?

@Wingnutt,
Please provide tlogs and/or dataflash logs if possible to help troubleshoot your issue.
Regards,
TCIII GM

I would love to…

But I’m one of the apparently countless folks who get " Error receiving log list" when trying to download via mavlink, and if I try to use terminal, i get endless strings of gibberish.

Here is a question though, and I dont know if this is normal because frankly if never tried it

Sitting level, right now the compass is facing North reading 0 degrees, however if I lean the copter to the left or right the reading changes the more I lean it, its still facing 0 degrees, but if I lean it left a few degrees it changes to 330, right a few degrees 30 degrees.

The new GPS is mounted about 4 inches above the APM on a post. Is this variation when leaning normal? if so what is a good way to correct it?

I assume you have correctly adjusted the compass orientation parameter? Seems most compass/gps combos coming out of china at least require “roll 180” since the compass is upside down on the gps circuit board. My latest gps/compass required both roll 180 and yaw 45.

You need to look at the Mission Planner HUD and watch what happens to the heading indicator when you rotate (yaw) the copter around. You will notice that the yaw gyros make immediate changes to this heading indicator, but wait several seconds and you will see the compass slowly makes fine adjustments to the heading. I’ve seen many people have the gyros say the copter rotates one direction but the compass indicates the opposite direction rotation. This will cause a crash in GPS modes. Both compass and gyro need to agree in the same direction. If they are opposite, this is when compass roll 180 parameter needs to be enabled. If you are pointing the aircraft in a known direction such as north, but the copter is facing east in mission planner, this is where you adjust the compass yaw parameter.

The compass tracks in the correct direction when I rotate it. East and west are not swapped.

I verified with a standalone compass that the HUD reading matches the orientation.

How can I see what the gyros are reading?

[quote=“Wingnutt”]I would love to…

But I’m one of the apparently countless folks who get " Error receiving log list" when trying to download via mavlink, and if I try to use terminal, i get endless strings of gibberish.
[/quote]

It has been quite well documented that Terminal was removed from 3.2 on-wards.
When you say Mavlink, are you using wireless radio or USB lead? as it can only be done on USB.

[quote=“MarkM”][quote=“Wingnutt”]I would love to…

But I’m one of the apparently countless folks who get " Error receiving log list" when trying to download via mavlink, and if I try to use terminal, i get endless strings of gibberish.
[/quote]

It has been quite well documented that Terminal was removed from 3.2 on-wards.
When you say Mavlink, are you using wireless radio or USB lead? as it can only be done on USB.[/quote]

USB

Sorry for the out of order replies, and the several hour delays, since Im new all of my posts have to be approved.

I tried asking but the post never showed, You mentioned that the Compass has to match what the Gyro sees.

I can obviously see the compass readings, but how do I see what they gyro is seeing?

Also, I have changed and messed with so many things its hard to remember what all I have changed.

is there any way to flash a “default” config file to the copter, so I can sort of start over?

I cannot find any fault with the hardware, so Im thinking it might be a setting.

When you yaw the aircraft around, the first motion of the heading indicator are the gyros. The compass will creep to the exact magnetic heading after several seconds.

I see what you are saying.

So if they are out of sync, the initial movement will show one direction, then move the other, indicating the gyro thinks its turning one way, and the compass another.

It was doing that before I switched the compass setting to Roll 180, but I THINK they are in agreement now, I will double check here shortly.

Exactly! The gyros will show the immediate reaction in yaw, then the compass will lag behind once the gyros stabilize and notice no further movement. Continue watching the heading indicator in mission planner and you will see the yaw creeps around in the opposite direction (if set up incorrectly).

A good gyro/compass setup will show in mission planner the aircraft yaw in the direction you twist it, and stay there.

Ok, it looks like they are in sync, when I turn the copter it moves only in the direction I turn it and settles quickly at the heading I point it to, and the heading is correct to within less than 2 degrees. according to my standalone magnetic compass.

I’m suspecting more and more that this is a config/setting issue. If it were a calibration issue I would think the problem would get better or worse with each change and each new attempt at compass calibration etc etc, but the problem is always the same. Not only that, the problem has persisted through 2 different compasses and 2 different GPSs… same exact issue, totally different hardware, mounted differently and re calibrated… exact same problem…

That’s why I was asking, is there just a stock, basic config/param file I can load to sort of start over?

Also, I never got an answer, is it normal that the compass reading changes if I lean the quad left or right, even though its still pointing the same direction? if not, whats the fix?

Getting really fed up really fast.

Found and flashed stock CX-20 params

Went through accel and compass calibration again, all good,

Checked compass reading against external compass, spot on within a degree or 2

Verified compass orientation is correct.

Still having the same problems and STILL cannot download the flash log via mavlink, yes mavlink not the terminal, and yes with a USB cable…

At this point 90% of my time with my copter is spent in front of this computer. :imp:

Flashed older version of APM then flashed back to 3.2 to see if maybe that was the issue.

Redid everything etc etc

same problem, also still cannot download log files.

Did you try using the older firmware, pulling logs etc?

I have heard of some versions of the APM boards not having the flash chip installed so the logs were never able to be saved :confused:

All of my apm 2.5 boards only allowed downloading the logs via mavlink, not USB.

[quote=“MarkM”]Did you try using the older firmware, pulling logs etc?

I have heard of some versions of the APM boards not having the flash chip installed so the logs were never able to be saved :confused:[/quote]

Yep when I flashed the older firmwares I went through the full setup, calibration and test flight, then tried to pull logs, both through Mavlink and terminal.

There must be something faulty about the CX20 autopilot then. I used to have one, but I almost immediately put an APM 2.5 in since that is the hardware I know best.

I’m starting to come to the same conclusion, the APM is the only thing that has not been changed.

Crapola.

UPDATE!!!

Ok, new APM 2.6, Ublox Neo 6m Gps/compass installed…

Mission planner setup complete…

SAME GODDAMN PROBLEM!!!@!

Literally NOTHING has changed… NOTHING

Stabalized and alt hod flight is fine, switching to loiter causes it to just start to fly off…

the only, THE ONE AND ONLY thing that $70 and a lot of waiting has achieved… is I can now DL the stupid log files…

Log File C:/Users/JTS/AppData/Local/Temp/tmp25A0.tmp.log
Size (kb) 57.5712890625
No of lines 1049
Duration 0:00:29
Vehicletype ArduCopter
Firmware Version V3.2.1
Firmware Hash 36b405fb
Hardware Type
Free Mem 0
Skipped Lines 0

Test: Autotune = NA -
Test: Balance/Twist = NA -
Test: Brownout = GOOD -
Test: Compass = GOOD - No MAG data, unable to test mag_field interference

Test: Dupe Log Data = GOOD -
Test: Empty = GOOD -
Test: Event/Failsafe = GOOD -
Test: GPS = GOOD -
Test: IMU Mismatch = UNKNOWN - No IMU log data
Test: Parameters = GOOD -
Test: PM = NA -
Test: Pitch/Roll = NA -
Test: Thrust = NA -
Test: VCC = GOOD -

I don’t get it…