Continuous Yaw in copter stabilize mode

Hello,

We have an Octa and we are using arducopter V3.5.5. we had some good flying, after replacing battery, took off quad with stabilize mode, the quad rotates around yaw automatically; there’s no gust; I saw the log, desired yaw was continuously changing and causing the quad to rotate. what are the possible reasons for this?
rc_in is having a constant value, however rc_out seems to fluctuate which is understandable considering there is a change in desired yaw angle, what is not understandable is why is there a change in desired yaw?
log_26_2022-12-30-11-19-50.bin (436.0 KB)

The Yaw RC channel should center on 1514 PWM according to what’s been calibrated
image

Yet in the test flight the Yaw channel is held up around 1540 PWM and drops back to around 1500 after landing. This is causing the Yaw.

So it’s either pilot error, or there’s some mixing going on in the transmitter.
Use the MissionPlanner RC Calibration screen to check if any of the other channels affect the yaw channel.

What flight controller is that? If arducopter 3.5 works there’s a good chance it can be updated to the latest firmware.
If you do that I would suggest loading the latest firmware then resetting all parameters to defaults and start the whole mandatory and configuartion process from the beginning.
Let us know if you need help with that.

EDIT
Was the pilot trying to correct the yaw?
It’s hard to tell from that very short flight if there’s some physical issue with the motor mounts or arms being twisted.

1 Like

As @xfacta says, the pilot yaw stick is indeed offset from neutral, past the deadzone. This leads to a demanded yaw rate.
I also notice that the basis tuning process has not been followed. It looks like default tune, thrust linearisation not setup (see MOT_BAT parameters and MOT_THST_EXPO)
I suggest you use a more recent version of ArduPilot (eg. 4.3.2) and follow this guide:
https://ardupilot.org/copter/docs/tuning-process-instructions.html

Thank you, tried your suggestions of changing the RC mid point value, it worked.

1 Like

What flight controller is it? You might be able to update the firmware to gain more features and stability.

I was using Emlid hence the older version. Now upgraded flight controller to pixhawk cube and flashed latest version (4.3.2).

OK good.
Let me know if you want help with the setup process, initial parameters and harmonic notch filter
Set up the voltage monitoring first, and current monitoring if you can.

Thank you! Today completed all the calibrations did two short good flights, had the following issues:

  1. No log got generated so i cant send any log, when can this happen? did i miss any settings?
  2. Vibration in z axis was higher than 30 but less than 40, what is the safe limit

30 is the highest you want to allow, below 15 is good.
Try to fix whatever is stopping the logging, otherwise it’s impossible to know what is going on.
Make sure you use a well known SD Card - they cheap ones are misreporting their size and they go corrupt.

1 Like

Thank you Shawn! both vibration and recording issue resolved. Unable to do autotune as the aircraft AUW is around 40 kgs and it is quad octa configuration. Currently have tuned the quad in alt hold mode for both pitch, roll and yaw, found the performance satisfactory.

However, when in Auto mode, target pitch and target roll are oscillatory. Can you please let me know which parameters in the advanced tuning that i can tune to better pitch and roll performance. I have attached logs and tlog


2023-01-10 12-01-37.tlog (788.2 KB)

A tlog is not much use, need a .bin log

pfa .bin file

upon further analysis, i see that target velocity north and east are oscillatory, current velocity north and east are also not following target velocities in auto mode.

assuming is the loop structure, i think i can attempt tuning psc_posxy_p gain would that work?

Try this instead of the controversial “0.2” value that we used to recommend for the T-Motor Flame ESCs
MOT_THST_EXPO,0.6

and set all these
INS_ACCEL_FILTER,10
INS_HNTCH_ENABLE,1 ← set this then refresh params to see the rest
INS_HNTCH_MODE,1
INS_HNTCH_REF,0.24
INS_HNTCH_FREQ,30
INS_HNTCH_BW,15
INS_HNTCH_FM_RAT,0.7
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4

You are on the right track for the position related oscillations, setting these to half their original values should settle it down (these are the adjusted values)
PSC_POSXY_P,0.5
PSC_VELXY_D,0.25
PSC_VELXY_I,0.5
PSC_VELXY_P,1.0

Now do a test flight in AltHold , hover for a while and just do gentle pitch and roll movements. If everything is OK then use Loiter for a while too.
Let’s see that log.

EDIT:
and set
ATC_THR_MIX_MAN,0.5
PSC_ACCZ_P,0.34
PSC_ACCZ_I,0.68

2 Likes

Hi Mark,

Did flight with and without enabling the harmonic notch filter. With harmonic notch filter on there was a constant loss in altitude and we had to keep adjusting the altitude.
So today done one more flight by disabling harmonic notch increasing expo to 0.4 and then tuning velocity gains. Please find logs of both yesterdays and todays flight below.

yesterdays log:

todays log:

I could only find one .bin file so I cant tell what would be happening in the log with HNOTCH enabled. I cant really see that being an issue for holding altitude - it never has been before. It maybe just not learnt a new hover thrust value or something like that.

You still need to set
INS_ACCEL_FILTER,10
ATC_THR_MIX_MAN,0.5
PSC_ACCZ_P,0.34
PSC_ACCZ_I,0.68
PSC_POSXY_P,0.5
PSC_VELXY_D,0.25
PSC_VELXY_I,0.5
PSC_VELXY_P,1.0
I see you started changing some PSC settings but these should help a lot.

And these are the correct HNOTCH settings for you
INS_HNTCH_ENABLE,1 ← set this then refresh params to see the rest
INS_HNTCH_MODE,1
INS_HNTCH_REF,0.21
INS_HNTCH_FREQ,63
INS_HNTCH_BW,32
INS_HNTCH_FM_RAT,0.7
INS_HNTCH_HMNCS,1

If you can set all those and do a test flight in AltHold and Loiter that would be good. Then we can check on the PIDs

For reference
image

2 Likes

please find the logs of 11th Jan:

12th Jan outside flying all the logs:

I looked in one of those logs, and you can see where hover throttle is still changing, relearning.
Probably because you had just changed MOT_THST_EXPO
It settled right before you landed.
I dont think the harmonic notch filter had anything to do with it. use the latest settings I posted directly above.

1 Like

ok will test with those values

Hi Shawn,

Please find logs with the updates made on params as was suggested by you, tested only ALT hold today.

First flight pilot didn’t adjust the throttle so it just kept oscillating in altitude, second flight he gave input twice and then it held onto the altitude very accurately. Tuesday we would be further testing on loiter and Auto, will keep you posted. Thanks a ton!

I only looked at the last log in that list.
Adjust these and the harmonic notch filter should be good now! It took a couple of tries to gather enough clear data.

INS_HNTCH_FREQ,35
INS_HNTCH_BW,17
INS_HNTCH_HMNCS,7
INS_HNTCH_REF,0.24

Danger point!
You are destroying the battery - see the rapid drop off at the end? That battery will be of very limited use now.
EDIT: actually I apologize if I missed these bad battery settings earlier, I usually pick up on that stuff. I guess I just checked if they were present and skimmed over them.

You have the battery settings wrong, I cant work out what they would relate to.
Assuming you have a 12 cell Lipo - change them to these:
BATT_ARM_VOLT,44.30
BATT_CRT_VOLT,42.00
BATT_LOW_VOLT,43.20
MOT_BAT_VOLT_MAX,50.40
MOT_BAT_VOLT_MIN,39.60
and
BATT_FS_LOW_ACT,2 or 3

If those values give you trouble, DO NOT change them - recalibrate your voltage sensor or get a new battery.

Try these PIDs and see if there is better stability.
ATC_ANG_RLL_P,6.0
ATC_ANG_PIT_P,6.0
ATC_ANG_YAW_P,4.5
ATC_RAT_RLL_P,0.12
ATC_RAT_RLL_I,0.12
ATC_RAT_RLL_D,0.005
ATC_RAT_PIT_P,0.12
ATC_RAT_PIT_I,0.12
ATC_RAT_PIT_D,0.005
If stability is worse just land immediately and put back the old values.
You should be able to run a pitch and roll Autotune though, AUTOTUNE_AXES,3
When you initiate Autotune let it finish and just reposition and land without changing out of Autotune mode.
Disarm and wait a couple of seconds for new PIDs to save.
Then you can arm and fly with the new values.

You can do Yaw Autotune separately if everything is working well.

1 Like