# Vertical Pulsing in Altitude Modes

Hi Shawn

Thanks again and my apologies for not confirming those parameters were set.

Here is the latest log of a flight in Stabilized and AltHold.

You have suggested several changes and I would like to understand the logic behind them. Earlier you mentioned you were mainly just looking for attitude versus desired attitude, and a few other things like oscillations and noisy motor outputs to smooth things out and not jumping around so much. This includes attitude control, altitude, and motor outputs.

I list below the changes and their descriptions, and I wonder if you could please expand on what you saw in the graphs that indicated that a change was needed?

ATC_ACCEL_Y_MAX from 29700 to 50000

Maximum acceleration in yaw axis

Sets how aggressive the machine is. Whys does this need increasing?

ATC_ANG_YAW_P from 9.746 to 5.0

Yaw axis angle controller P gain.

Converts the error between the desired yaw angle and actual angle to a desired yaw rate.

ATC_ANG_PIT_P, from 8 to 10
ATC_ANG_RLL_P from 8 to 10
Roll and Pitch axis angle controller P gain.

Converts the error between the desired pitch/roll angle and actual angle to a desired pitch/roll rate

ATC_RAT_PIT_P from 0.08 to 0.10
ATC_RAT_PIT_I from 0.08 to 0.10
ATC_RAT_RLL_P from 0.08 to 0.10
ATC_RAT_RLL_I from 0.08 to 0.10

Pitch / Roll axis rate controller P gain. Corrects in proportion to the difference between the desired pitch rate vs actual pitch rate output.

Pith / Roll axis rate controller I gain maximum. Constrains the maximum motor output that the I gain will output.

ATC_THR_MIX_MAN from 0.1 to 0.5

Throttle vs attitude control prioritisation used during manual flight (higher values mean we prioritise attitude control over throttle)

How does this work???

PSC_ACCZ_I to 0.26

PSC_ACCZ_I = 2 x MOT_THST_HOVER
Acceleration (vertical) controller I gain. Corrects long-term difference in desired vertical acceleration and actual acceleration.

PSC_ACCZ_P from 0.13 to 0.2

PSC_ACCZ_P = MOT_THST_HOVER
Acceleration (vertical) controller P gain. Converts the difference between desired vertical acceleration and actual acceleration into a motor output.

INS_ACCEL_FILTER from 10 to 20

Lowpass filter on the accelerometer signals

To find what indicates that a change is needed is a mystery to me. The FFT ACCO chart is the only one I can find which doesnāt tell me much??

`INS_HNTCH_BW from 26 to 40`

Any guidance on this would be appreciated!

Peter

That is really VERY good now. Most people would struggle to see how that is not Autotuned.
What were your impressions of the flight?
Any outstanding issues?
You might want to try some fast ascents and descents and see if thereās any instability.

Iād like to invite @dkemxr Dave to have a look at this latest log, since heās more familiar with manual tuning, and give his expert opinion.

The Yaw changes I suggested where to minimise the amount of motor output taken away from pitch/roll attitude but still give acceptable yaw.

The Angle and Rate changes for pitch and roll are a bit harder to define for me.
My way of thinking is the large movements are mostly related to ATC_ANG_x_P (Angle) values.
Smaller movements, smaller oscillations, and the ability for the achieved Attitude to closely follow the desired attitude are related to the ATC_RAT_ (Rate) P,I and D terms.
So I was suggesting those changes based on your logs plus what Iāve experienced and seen in others logs.
The copter is now following every little stick input quite precisely, and maybe Autotune could sort out the very slight attitude deviations at zero stick input, but we are talking about 0.1 or 0.2 degrees.
I did check the RC Inputs too, but they were not needed to be shown here when looking at the attitude control.

Itās usual and advised to start at 0.1 until after a successful test flight and vibrations + stability are confirmed. This low value gives more weight to your throttle input and less weight to attitude control.
This sounds counterproductive, but if thereās vibrations or bad stability the copter would keep increasing throttle to gain control and you would see a fly-away. Or at least you wouldnt be able to make it descend.
After normal operation is confirmed the value can be set at 0.5 to allow attitude control enough throttle to do a proper job, and still leave enough throttle control left over for the pilot. Setting this too high means you will have less throttle to play around with (very slow ascents and descents) but attitude control will be as good as other parameters and hardware allow.
So this is a normal test and tune step.

Setting the PSC_ACCZ values after hover throttle has been learnt is also a normal step. To high or too low and the copter will have trouble tracking the desired altitude. These values relate this Z axis tracking to what the motors can actually achieve. A small overpowered quad might have very high values even though hover throttle would be almost nothing - to allow for those full speed moon shots

I think you mean from 20 to 10.
This is the new normal and Iāve asked for it to be the new default.
20 is not a bad value, but the copter may have some unnecessary instability due to a bit extra noise in the Accelerometers.

Itās good that you point this out!
This is your base frequency, like when the copter is hovering or there-abouts.
You can see the centre frequency is about 128Hz and the width of that ātermite moundā is about 112Hz to 139Hz = 27Hz

Going from my memory, I was hoping to squash a few more wayward peaks you had in previous graphs. They are not there now since you fixed wiring and PIDs evened out all the oscillations, so you could really put this back to:
`INS_HNTCH_BW,30`
so it is more correct. Having the most narrow, but still effective, bandwidth is best for attitude control.
This small change wont require special testing or anything.

Nice work here for a manual tune! If you wanted to go down the rabbit hole of a more responsive 7" you could address that with some increases in ATC_ACCELL rates and filters. If you plan on thrashing around in Acro mode it might be worth doing. I actually donāt fly much Acro but I like a responsive craft in any case.
Attached is a brief flight log of my 7" just tossing it around with some very aggressive moves in Loiter. Of course Iām not suggesting you copy any parameters but these craft are probably close enough so you can do a parameters compare and see what I was getting at above.
Chimera7

Shawn-I think you already have a log or 2 from this craft for your database but there are some changes in this one. With more tuning to do for faster Auto Mission capability.

Hi Shawn.
Great to hear you are pleased with the tune and I now have a bench mark to aim to.
I have limited multirotor time but it felt crisp and responsive. A bit like an A320, it stayed where you put it and didnāt try and turn around and bite you! . A good confidence builder with it being so stable and not wanting to wander off and do itās own thing. I think this is due to your very good tuning skills. Thanks for explanations to my questions which I am working through.
Peter