New tuning needed when change from Lipo to Li-ion

Hi

There is a Velcro fastener between the Li-ion battery 6S14000mAh 1.2 Kg and battery holder in purpose to prevent the battery to slipping. Then the battery is attached with three straps to the holder.

Hi Shawn

I modified the parameters and was able to do a shorter test flight. Machine shook violently and I landed again. Attaches the flight log. I have checked all fasteners
I’ve checked all the fasteners and can’t find anything loose. Pixhawk 6C is fixed with 3M on a polycarbo plate which is then screwed into the CF frame. Can this bring about something undesirable?.

That was a bit unexpected :frowning:
I can see roll had an issue with oscillations.
Let’s set:

INS_HNTC2_ENABLE,0
MOT_THST_EXPO,0.71

and see if that get it back to normal.

No worries, i had saved the parameters and already made a 15 minutes test fligt. So good so far. Perhaps the Tarot 680 frame is a bit instabil ?

Hi Shawn.
After it flies perfectly, it has started to vibrate. I have checked that nothing is loose and have also reassembled the Pixhawk 6c. RCOUT vibrates and the motors get hot. Maybe I should redo the autotune?

Try these lower PID values, especially the D terms seemed high to me
ATC_RAT_PIT_D,0.007
ATC_RAT_PIT_I,0.21
ATC_RAT_PIT_P,0.21
ATC_RAT_RLL_D,0.0073
ATC_RAT_RLL_I,0.22
ATC_RAT_RLL_P,0.22

There is still two or three frequencies and so many harmonics occurring - there’s got to be something vibrating and resonating…
Roughly these that I listed before

  • 49Hz, 98Hz, 200Hz and 300Hz
  • 35Hz, 67Hz and 134Hz

image

Hi Shawn and thanks for your help

The Tarot 680 frame is of folding type and I believe that the instability och the arm clamping is a part of the problem with harmonics. I made a flight on bad wind conditions, and on landing happened something I can not explain, was it wind or something else. The copter loses the stability but lands with minor damages. Propably I gonna change the frame to someting more stiff construction.

Those old style Tarot frames with folding arms had no room between the plates to mount anything much, so you ended up with things hanging off the sides, or everything stacked on top :frowning:

The newer tarot frames, like X4, are much better in that regard, but I dont like the plastic motor mounts and fibreglass/PCB bottom plate. If I was to use one I would buy the aluminium motor mounts and get the bottom plate copied in carbon fibre - I wouldnt need the power connections built into the bottom plate anyway.

I’ve used a couple of these frames in 650mm size, and it has two clamps per arm where they meet the base plates - but there’s plenty others around:
https://www.aliexpress.com/item/32878387445.html

In that log attitude control looks great right up unit pitch and roll go bad right at the end.
It made me wonder about the ESCs - weren’t they BLHELI32 ESC’s ?

Do you have the Low Voltage Protection = OFF especially since this might be confused by the Li Ion batteries going to lower voltages than a Lipo.

UPDATE : changed some values. Complete list so we dont get any wrong!
Use

INS_HNTCH_HMNCS,7  // not 47

I ran that log through the new Harmonic Notch Filter tool and came up with these settings that I think you should use, at least while you are using the same frame and all.

INS_HNTCH_ATT,40
INS_HNTCH_BW,20
INS_HNTCH_ENABLE,1
INS_HNTCH_FM_RAT,0.7
INS_HNTCH_FREQ,42
INS_HNTCH_HMNCS,7  // I had 47 here before
INS_HNTCH_MODE,1
INS_HNTCH_OPTS,1
INS_HNTCH_REF,0.18
INS_HNTC2_ATT,40
INS_HNTC2_BW,8
INS_HNTC2_ENABLE,1
INS_HNTC2_FM_RAT,0.7
INS_HNTC2_FREQ,37
INS_HNTC2_HMNCS,1
INS_HNTC2_MODE,0
INS_HNTC2_REF,0

In this diagram the vertical black lines are where HNOTCH will have an effect, and the vertical black dotted line is the second static notch.

For reference:
https://firmware.ardupilot.org/Tools/FilterReview/

Hi Shawn.

I have changed the landing gear and fixed the foldable tube arms. Then I changed the motor bearings, it seemed that one of them was not quite healthy. The machine took off smoothly and flew fine, but when I pushed the stick it started to wobble. It could be the same phenomenon that caused the landing from a height of 4 meters. This time the machine was only at a height of one meter so everything went well. It had the same type of behavior as last time.
The Gyro FFT values are now much lower.
image

Regards //YB

There is still a whole spread of noise pre-filter.
It would be nice for that to be more resolved. Until that day comes :slight_smile: carefully put in the HNTOCH settings I formulated above. For your confidence, we’ve had a good definite win using the new Filter Review tool to determine HNOTCH settings for another copter, the same method I’ve used to determine your new values.

For that deviation from pitch and roll I think we can safely reduce all the PIDs a bit just so the problem is not exaggerated. It’s like the battery pack is wobbling or something…

ATC_ANG_PIT_P,11.5
ATC_ANG_RLL_P,13.0
ATC_RAT_PIT_D,0.006
ATC_RAT_PIT_I,0.18
ATC_RAT_PIT_P,0.18
ATC_RAT_RLL_D,0.0063
ATC_RAT_RLL_I,0.19
ATC_RAT_RLL_P,0.19

At the moment I cant see what else is causing that oscillation, but something is randomly or periodically affecting attitude control. The motor outputs show this problem nearly occurred twice before your saw the bad oscillation and landed.

Hi Shawn and thanks for all your help.

I have modified the parameters and made sure the battery is firmly attached. The arms of the machine are no longer foldable. The Pixhawk 6C is attached with 3M pads. Here comes the log from the last flight today.
I wish you a nice Midsummer as we celebrate here in Sweden.

Regards //YB

Yes! - to me that looks great now. Attitude control is tight but could maybe do with an autotune or a couple of tiny tweaks, but nobody is going to notice.
Thanks for persisting and running more test flights.
Let us know your thoughts on the tuning as it is now, and feel free to ask if there’s more you want to do with it. The yaw is a bit fuzzy and could do with a yaw Autotune.

The noise and harmonics shows a BIG change:
Pre-filter
image

Post-filter
There’s nothing here of significance
image

Thank you Shawn for your patience. I have one more machine, an Hexa and I tried in May to set up flight FFT. Autotune was run at 0.075 so performance-wise there is some room for improvement. Where should I continue?

Regards //YB

Attitude control is quite good, even if a bit noisy, so we are half way there.
I would try to fix the vibrations first, then (later) rerun Autotune with AUTOTUNE_AGGR,0.1 when all this is sorted out.
Next I would look at the physical yaw bias evident in motor outputs. One or more motor mounts are not perfectly aligned, slightly twisted on the arm, something like that…
This has the effect of the counter-clockwise motors working harder than the clockwise motors to counteract the misalignment, and you can see in this graph they get clearly separated out into two groups of motors.

This has the side effect of making it hard for the FFT to target anything valid, and even makes it difficult for us humans to decide on what frequency to target. Now we have two almost-merged / barely discernible base frequencies and a broad spread of harmonics.
If we look very closely at the graphs there’s a pair of frequencies at 73Hz and 87Hz (pictured), but also a much smaller pair at 33Hz and 49Hz - so until the motor mount/yaw bias issue is fixed we are a bit unsure what to target. The base frequency will become more obvious when all motors are working approximately equally.
The likely target frequency for your prop size will be around 50Hz , so the lower set seems like they may be the actual motor noise and everything above that will be harmonics.

image

image

We can see FFT has picked up on the harmonics, and selected an unusually wide bandwidth to try and cover everything

FFT_FREQ_HOVER,157.8328
FFT_BW_HOVER,100

mainly because of the yaw bias issue, and also FFT_MINHZ,80

To keep using FFT, which is a good idea but sometimes it doesnt work well at the lower frequencies, set these and do another test flight after fixing the motor mount issue and hopefully finding some way of improving vibrations

FFT_MINHZ,40
FFT_MAXHZ,300
FFT_NUM_FRAMES,2
INS_HNTCH_FREQ,40
INS_HNTCH_BW,20

When the harmonic notch filter is driven by a dynamic source, such as FFT or ESC RPM, the frequency and bandwidth set by INS_HNTCH_FREQ and _BW can be scaled UP but cannot be scaled down. So these values must be at the minimum values that would ever be encountered.

You can set these right away, since they wont change regardless of vibrations and other work.

ATC_THR_MIX_MAN,0.5
INS_ACCEL_FILTER,10
INS_LOG_BAT_MASK,3
LOG_BITMASK,180222
PSC_ACCZ_I,0.50
PSC_ACCZ_P,0.25

Hi Shawn.

I modified the parameters and run a test flight
From what I understand, the filter now works well ?

I got very tricky values when I ran an autotune

Regards //YB

Although the FFT is squashing all the noise, it’s still targeting the harmonic with an unusually wide bandwidth.

FFT_BW_HOVER,142.2634
FFT_FREQ_HOVER,158.929

The new Autotune values don’t look unreasonable, but I couldnt say how they would perform since they are not in that log.

Here is what I would do.

  • Lift the Gyro filter and related filter params because you have low noise down low - this will help to keep very good response
  • Change to throttle-based harmonic notch filtering
  • Run Autotune again

To accomplish that, set these:

ATC_RAT_PIT_FLTD,20
ATC_RAT_PIT_FLTT,20
ATC_RAT_RLL_FLTD,20
ATC_RAT_RLL_FLTT,20
ATC_RAT_YAW_FLTT,20
FFT_ENABLE,0
INS_GYRO_FILTER,40
INS_HNTCH_MODE,1
INS_HNTCH_FREQ,76
INS_HNTCH_BW,30
INS_HNTCH_REF,0.2
INS_HNTCH_FM_RAT,0.7
INS_HNTCH_HMNCS,3

and this is the sort of filtering you would have:

Hi Shawn.

I modified the parameters and run a new autotune. I copy the values from massages and find a big differens betweenn roll and pitch ?
The frame is symmetrical, Tarot 690 Hexa.

Regards //YB

The filters are working well.

I cant tell why Autotune would come up with such different results between pitch and roll. Apart from asymmetry this could be caused by very uneven weight distribution.
Hex’s are not quite symmetrical in the same way as a quad or octo - there’s either a motor directly at front/rear or at left/right (depending on the configuration) and pitch and roll tuning is always a little bit different - but not by a surprising amount.

Attitude control before and after the aborted Autotune is quite good apart from a bit of nervousness.
Let’s just soften the PIDs a bit and it should smooth out.

ATC_ACCEL_P_MAX,81500
ATC_ACCEL_R_MAX,68700
ATC_INPUT_TC,0.20
ATC_RAT_PIT_D,0.0064
ATC_RAT_PIT_I,0.16
ATC_RAT_PIT_P,0.16
ATC_RAT_RLL_D,0.0072
ATC_RAT_RLL_I,0.18
ATC_RAT_RLL_P,0.18

This is somewhere around values you’ve had before so it should all work reasonably OK.