Drone yaw drift while in Position hold and Loiter mode

Hello,

I have seen two issues with my new build. First of all - There is an unwanted yaw drift when in loiter and poshold.
Secondly - I am unable to enter autotune, it says that there is pilot input although no input has been given.

Log is here. I know that there is something wrong with the parameters, but i have no clue anymore.

No link to a log.
Sounds like the transmitter sticks are not centered or there is trim set. Make sure there is no trim set in the transmitter and redo the RC Calibration.

1 Like

ah, sorry

This is probably learned from the last RC calibration (centre position 1494)
image

But now the transmitter is doing this (centre position 1531)

That’s a fair difference, when the usual deadzone is only 20 PWM

1 Like

Depending on the radio you have, check that you haven’t accidentally touched the trim switches. On OpenTX/EdgeTX you can easily disable the trim switches so this can’t happen and you can use them for other functions.

Yes, there were some trims on the remote, i removed them but it still was the same. I did also autotune all of the axis, but it still did not remain stable in the air. The last log you can see what it was doing. Unfortunately the log is short because I was at the last end of my battery.

Logs are here - WeTransfer - Send Large Files & Share Photos Online - Up to 2GB Free

I think it kind of fixed the issue, but I still see that the drone does not want to hover stable.
I also see from the logs that can accel0 clipping - not safe to fly. Maybe this comes from the arkflow imu?

Set these

ATC_THR_MIX_MAN,0.5
DISARM_DELAY,5
GPS_GNSS_MODE,65  //  less is more
INS_HNTCH_BW,50
INS_HNTCH_FM_RAT,0.7
INS_HNTCH_FREQ,100
INS_HNTCH_MODE,1  //  you dont have any ESC data to support mode 3
INS_HNTCH_REF,0.29
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4

Then do a flight in AltHold and Loiter with lots of yaw and circles. We can use that log to check and fix the compass calibration settings. Use Loiter instead of PosHold.

So here are the next flight logs.
I had couple of issues why i didnt like the loiter mode. In loiter, the drone sometimes changed altitude, it accended and decended without my input. It also toiletbowled in loiter. When I switched to poshold it was stable in the air. The same was with RTL. first RTL it was toiletbowling and on the second RTL it was ok.
The Drone after takeoff yaws usually to the right without any input. I also tried flowhold for a second, but I think there is an issue with how I have mounted it.

Use
GPS_GNSS_MODE,65 or 5
Dont pick unnecessary options or constellations. Beidou always gives me a poorer HDOP and position despite having a large number of satellites. Use GPS and one of Galileo or GLONASS - these are the options I’ve given above.

Adjust the harmonic notch filter

INS_HNTCH_BW,30
INS_HNTCH_FREQ,60
INS_HNTCH_REF,0.25

I couldnt get complete results from Magfit since you’ve got a missing compass in between two (possibly) working compasses.
In MissionPlanner, go to
Setup / Mandatory / Compass
Click on “Remove Missing” and reboot and reconnect the flight controller.
Wait for a good GPS 3D fix then do the Onboard Mag Calibration with “Start”

Now you should be able to do another flight with plenty of turns, circles and yaw all in one flight, and we can check and fix any calibration issues with Magfit.
If it’s just one log with one flight that is easiest for magfit.

Hello,

here is 2 logs. The first log I had those compasses enabled. For some weird reason it sees two of the same compasses on i2c. BMM150 as 2 and 3rd compass. I disabled them and physically unplugged the compass from the AP. And only used compass 1 on the second flight.
I still have some weird position issues, it sometimes appears and sometime it does not.
logs - WeTransfer - Send Large Files & Share Photos Online - Up to 2GB Free

The magfit gave me these results -

what do you think about the latest logs?

I only checked the latest log.

Attitude control is very good.
Vibrations are bit much for the second IMU. Are you able to improve the damping a bit more?
Try these for the compass

COMPASS_OFS_X,14
COMPASS_OFS_Y,132
COMPASS_OFS_Z,-517
COMPASS_DIA_X,0.986
COMPASS_DIA_Y,0.800
COMPASS_DIA_Z,0.800
COMPASS_ODI_X,-0.200
COMPASS_ODI_Y,-0.048
COMPASS_ODI_Z,-0.200
COMPASS_MOT_X,10.000
COMPASS_MOT_Y,2.732
COMPASS_MOT_Z,-10.000
COMPASS_SCALE,1.00
COMPASS_MOTCT,2

The big difference is adding in the compass/motor corrections.

I dont think i can do anything to the ap mount, but i can loosen some of the folding props. They seem a bit too riggid and maybe they are the source. The ap is pix32 v6 and i have a 3 axis gimbal connected to the frame. I think that the gimbal might also be a factor in that high vibrations.

If you run Autotune with the gimbal onboard you will need to disconnect its power and totally secure the mechanism so it cant move or vibrate.
If you remove it for Autotune, we can adjust the ACCEL values by comparing the low take off weight to the heavier take off weight.


new ATC_ACCEL_P_MAX = ATC_ACCEL_P_MAX x (min_TOW / max_TOW)
new ATC_ACCEL_R_MAX = ATC_ACCEL_R_MAX x (min_TOW / max_TOW)
new ATC_ACCEL_Y_MAX = ATC_ACCEL_Y_MAX x (min_TOW / max_TOW)

Hmm. Ok. Yes. The latest autotune was done with the gimbal stabilizing and onboard. I can try to remove it from the drone and run the autotune again without the gimbal. Do you think that will make a difference in the imu vibrations?

Or do you think that it might make the attitude control better?

I think it will make attitude control better. And we just dial back a few things to suit the gimbal, or some other payload.

Hmm, Ok. I will try to do a autotune flight without the gimbal. Do you have any tips on how to reduce the vibrations in the video? I do have some dampners inbetween the gimbal frame and camera itself.
TBH i have no idea if the vibrations come from the frame or from the gimbal dampners.
termo2 - YouTube - The video is here.

@xfacta
can you help me with this log also? I have tried multiple times, but i am unable to get a good compass cal out of it. Can you please tell me what settings you used?

Thanks

You have some fairly terrible interference on the compass that Magfit probably won’t solve. These are both equivalent really in terms of highlighting a problem. The correlation is so good you could use sqrt of the mag as a current monitor :smirk: