P and I values are not as per Wiki after running autotune

Hi all,

My 500mm (distance between motors diagonally @ 80 deg frame) quad with 9.4" DJI props with DJI phantom motors running latest stable version of Arducopter.

I ran autotune but i noticed that my P and I values are not as per the wiki where it states that

As a general rule, for Pitch and Roll, P and I should be equal, and D should be 1/10th P. For Yaw, I should be 1/10th P and D = 0, in most cases. But its not the case with mine values after autotune as seen in the attached pic.

Also i noticed my Yaw overshoots and its quite slow to react. Probably because my 250gm gimbal with gopro is sitting ~150mm from the CG to the front and battery away from CG as well to balance it. I ran autotune without gimbal though.

Here is my autotune and after autotune logs:

Could anyone please suggest me how can i correct Yaw overshoots.Thanks

Some of that text you quoted is just a guide, not meant to be a hard and fast mathematical rule. I find for pitch and roll D term should end up about 1/16 of P and I terms, or in the range of 1/15th to 1/20th - but again that’s only a guide and every multirotor is different.

Double the ATC ACCEL Y MAX , this will improve your yaw overshoot.

EDIT, after checking the log:
The tune is reasonable, but it can be better. Change these and run Autotune again. The top three in the list are the ones that will help the most, but definitely set the rest too.
ATC_ACCEL_Y_MAX,27000
ATC_THR_MIX_MAN,0.5
INS_GYRO_FILTER,40
BATT_ARM_VOLT,14.7
BATT_CRT_VOLT,14
BATT_LOW_VOLT,14.4
MOT_BAT_VOLT_MAX,16.8
MOT_BAT_VOLT_MIN,13.2
BATT_FS_CRT_ACT,1
BATT_FS_LOW_ACT,2
PSC_ACCZ_I,0.7
PSC_ACCZ_P,0.35

Use this spreadsheet to set initial values then follow the tuning guide (next time)

https://ardupilot.org/copter/docs/tuning-process-instructions.html

1 Like

Listen to the man.
He is the drone whisperer.

2 Likes

Run Auto tune with the gimbal and camera.

@xfacta Thanks Shawn for the detailed info. I will change above said parameters and run autotune again.I need to wait for a clam day though.

I am running 4S2P Li-ion cells and i go normally 2.8v/cell.So should i still set MOT_BAT_VOLT_MIN,13.2 ?

@OldGazer I read that any flexible item should be removed prior to autotune. My gimbal + Gopro is around 250gms and its hanging on a rubber dampers and quite flexible. Should i still mount it before autotune? Thanks.

Use MissionPlanner and press Alt A , that plugin offers values for non-lipos. Dont accept it’s other parameters in this case, you already have the other required params (now).
You can autotune with a camera if it’s fixed solid, otherwise remove it before autotune.

1 Like

And do not autotune in loiter mode. Do it in AltHold.

1 Like

@xfacta Thanks for the tip.Will try.

@amilcarlucas Good point thanks.Yes that’s what i did.I switched to Autotune from AltHold.

One more thing. I noticed that my diagonal motors 1 and 2 were little warmer than 3 and 4 after the flight.Can’t be CG as frame is CNC cut and balanced. Any suggestions please?

That motor output imbalance shows 1 and 2 working (CCW) harder to counteract 3 and 4 (CW) indicating a physical yaw bias due to frame or motor mount twist. It could even be CW and CCW props are not created equal.

Hmm… That’s interesting. There shouldn’t be a twist in the frame unless the Chinese carbon fibre square tubes are twisted. I cut this frame myself on the CNC. And props are genuine DJI phantom 4 low noise props. Not sure if it’s a visual illusion or not but if you look at the motors on a phantom4 pro, motors look like they are not sitting perpendicular?? May be you are right. Clockwise and Counter clockwise props are designed little different. May be its DJI’s strategy to reduce noise :slight_smile:

Is this imbalance a waste of energy?

The DJI Phantom motors are actually all misaligned and they’ve done that for {reasons} and accounted for it in the firmware (we presume). As far as I know the DJI props are all equal.
Arducopter works best with all motors level/square/true or some very slight upswept arms.

See if the prop tips all point at each other in a horizontal plane.

Ahhh. that’s why motors on phantom always look crooked. Learnt something today :slight_smile:

I will run a dial on the prop tips as you suggested and see if they show any deflection.

@amilcarlucas
Why Autotune in Althold and not loiter. I have not heard of this but find it curious.

It has some issues. Some of them are fixed in master now.

Thanks…you mean issues related to Loiter itself or as it pertains to Autotune.

The issues are related with wait-for-leveling in autotune: https://github.com/ArduPilot/ardupilot/pull/16471 and do not touch loiter.

Thanks for that. I just did some tuning using Loiter. I guess I will wait for a calm day and do them again.

cheers man.

I think starting from Loiter will actually be OK unless starting from a really bad tune. The Autotune/Loiter bug is something along the lines of allowing enough time to return to level (or getting close enough to level), which could take longer than expected for really big diameter multirotors or if the tune is very poor to begin with.
The Autotune code looks like it uses Loiter code anyway, just with some different constraints - in copter anyway.
@amilcarlucas please correct me if I’m wrong, happy to be educated properly - my code reading skills are rudimentary.
With the fixed code (in master) autotune could be quicker and with improved messages.

1 Like

I always get a much better tune in AltHold than in Loiter. Even tuning indoors with no wind.

@xfacta have you tested both methods? one after the other on the same day?