Hi, this is my first time using hobby wing motors and they are giving me quite some trouble. usually with all the t motors I have to do an auto-tune and the copter is ready even when using x11 motors with t motor prop I think it has to do something with vibration as well as a plastic propeller so I require some help from the community experts. I have gone through methodic tuning without much success as I cannot set a notch filter due to no rpm input and fft doesn’t seem to work too well for slow setups. I am uploading a few logs as well as a spreadsheet that contains data from a DIY thrust stand that gets the voltage from a 10-1k resistor network and thrust data from a 40kg load cell hooked up to an hx711. any help regarding thst_expo, filter, and pids will be much appreciated and I think will be helpful for all the upcoming large copter projects.
link for x9 data:x9 Hexacopter - Google Drive
link for x9 plus data:x9 plus hexacopter - Google Drive
I couldnt quite be sure which motors and props you are using, please be more specific.
Also there are some ESCs that require a specific PWM range and cant be calibrated.
You can use this spreadsheet to put in your prop size and battery details - this gives a good estimate of thrust expo except for a few specific cases. It also give a lot of other settings related to your prop size. This is the same as if you use the Initial Parameters in MissionPlanner, or the Methodic Configurator.
https://www.dropbox.com/s/w2ru1gmk7h7ga7m/Initial%20parameters.xlsx?dl=0
Download a copy, dont try to use it online.
I am using hobbywing x9 (34 inch) and x9 plus (36 inch) i have uploaded the thrust data for both motors in their respective links but they seem to have some sort of odd curve these motors have fixed pwm range from 1100 to 1940 for x9 and 1050 to 1950 for x9 plus. I used the expo calculated by mp initial params but there are oscillations. I have already halved my p and i for vertical position controller but it seems the problem runs deeper than that. So that why I measured the thrust myself and wanted to come up with estimated thst expo.
According to our usual formula your
34 inch props would use MOT_THST_EXPO,0.79
and 36 inch would use MOT_THST_EXPO,0.80
You would have to judge for yourself how far away these values are from your collected data.
The one thing to remember about a thrust stand is you are measuring static thrust - which is not what always happens in flight.
Looking at the latest X9 log, I would say:
Use MOT_THST_EXPO,0.79
Reduce the D terms:
ATC_RAT_PIT_D,0.013
ATC_RAT_RLL_D,0.013
and set these:
ATC_RAT_PIT_SMAX,50
ATC_RAT_RLL_SMAX,50
ATC_RAT_YAW_SMAX,50
Relax yaw somewhat, it can be tuned again later if necessary:
ATC_RAT_YAW_I,0.050
ATC_RAT_YAW_P,0.50
PILOT_Y_EXPO,0.3
These could probably be at defaults too, I almost never change them (only MIX_MAX for small quads)
ATC_THR_MIX_MAX
ATC_THR_MIX_MIN
This is way too low, set it back to normal:
AUTOTUNE_AGGR,0.10
For safety, set this and check the related settings - it’s quite important for big copters:
FENCE_ENABLE,1
Set this to settle down the position controller in Loiter:
PSC_VELXY_D,0.25
Set these to suit your RC inputs and to gather more data:
PILOT_THR_BHV,7
INS_HNTCH_ENABLE,1
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4
LOG_BITMASK,180222
Then let’s see how that looks in a .bin log - we should be able to work out more of what’s going on.
Much of the same would apply to the X9+ but concentrate on one for now and get it right.
There is a good template for x11plus motors on ArduPilot methodic configurator software. It also has all those parameters that @xfacta said in there. You could use that as a starting point and save yourself a lot of trouble
@xfacta lNS_LOG_BAT_OPT 4 is no longer recommended acording to @iampete . The template already uses the latest recommendations from @xfacta and @andyp1per
@sauravhobyy how are your tests progressing?
I disagree with this. There are reasonable reasons to use 4 in some cases.
Hi everyone
I have flown the x9 plus (36 inch) copter today rerun the tuning log no 6. And flown a auto mission log no 7. In both logs ins logging pre and post was enabled. I changed the aggressivness to 0.1 but it caused an increase in the oscillations. @amilcarlucas @xfacta please have a look and guide me if i should restart the whole process and follow methodic configurater or there are params that i should adjust. Also please guide me how to setup filters. Thst_expo was already at 0.8. I always change the min_man, max and min to their their max values of 0.5, 0.9 and 0.25 respectively they seem to improve stability when lowering the attitude.
This AUTOTUNE_AGGR,0.10
by itself doesnt change anything unless you run Autotune. You had a value in there that would produce very bad Autunes and the copter would likely have very bad attitude control and maybe even crash.
If you set all the values I gave before, you could now go back to some tuning.
It’s important to keep ATC_THR_MIX_* params at defaults while doing basic tuning, and ATC_THR_MIX_MAN should be kept low to avoid a possible fly-away.
With higher values the copter tries to maintain stability even if you lower throttle, and could cause the copter to rise as it continually increases motors outputs (for stability) regardless of your input. The low value ensure throttle is followed regardless of stability so that you CAN land if you need to.
I’ll check the logs…
I have rerun the autotune (log no 6)
The Yaw P and I is way too high, usually when these are over 1.0/0.1 they can induce oscillations. I would set them back to something conventional for now, and if necessary they can be adjusted up again later:
ATC_RAT_YAW_I,0.08
ATC_RAT_YAW_P,0.8
You could probably just reduce all of these by 10% ( x 0.9)
ATC_ACCEL_P_MAX
ATC_ACCEL_R_MAX
ATC_ANG_PIT_P
ATC_ANG_RLL_P
ATC_RAT_PIT_D
ATC_RAT_PIT_I
ATC_RAT_PIT_P
ATC_RAT_RLL_D
ATC_RAT_RLL_I
ATC_RAT_RLL_P
And set:
INS_RAW_LOG_OPT,0
plus the other things I already mentioned
I have used the params suggested by you @xfacta and everything is much better alt hold oscillations are completely gone, but there are still some oscillations when loitering or in any auto mode. A new log is uploaded to the drive log no 8 x9 plus folder. thanks a lot for your help. fft and harmonic notch filter were also enabled. Also, I am observing higher vibrations with imu 0 and 1 which I guess indicates that cube orange + 's soft mounting is not ideal for my current setup what should I do about it?
Hi, I have uploaded another log log no 9 with another attempt at autotuning my filter setting don’t seem to be ok can you help me with that.
drive
Set these:
ATC_INPUT_TC,0.20
FFT_ENABLE,0
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4
INS_RAW_LOG_OPT,0
PSC_VELXY_D,0.25
Use these to give the harmonic notch filter a fighting chance:
INS_HNTCH_MODE,1
INS_HNTCH_REF,0.11
INS_HNTCH_FREQ,25
INS_HNTCH_BW,13
INS_HNTCH_FM_RAT,0.7
Now just do a flight with some AltHold and Loiter - no missions or Autotune.
Your link to logs is wrong, it links to Mateksys products.
My bad here’s the correct link.
https://drive.google.com/drive/folders/1oc0lmCxI9PQ4EzVRYSI9dSZN8OoolQDa
In log 15 Attitude control seems quite good.
Adjust these:
INS_HNTCH_FREQ,44
INS_HNTCH_REF,0.24
PSC_ACCZ_I,0.56
PSC_ACCZ_P,0.28
You will have to decide if you think Autotune is warranted. If you saw anything that needs fixing point to a specific log with that issue.
Compass calibration was a bit off, set all these:
COMPASS_OFS_X,-681.11096
COMPASS_OFS_Y,5.305791
COMPASS_OFS_Z,694.3203
COMPASS_DIA_X,1
COMPASS_DIA_Y,1
COMPASS_DIA_Z,1
COMPASS_ODI_X,0
COMPASS_ODI_Y,0
COMPASS_ODI_Z,0
COMPASS_MOT_X,0.35541514
COMPASS_MOT_Y,-14.871573
COMPASS_MOT_Z,18.651085
COMPASS_SCALE,1
COMPASS_ORIENT,0
COMPASS_OFS2_X,99.57111
COMPASS_OFS2_Y,-458.1398
COMPASS_OFS2_Z,31.590935
COMPASS_DIA2_X,1
COMPASS_DIA2_Y,1
COMPASS_DIA2_Z,1
COMPASS_ODI2_X,0
COMPASS_ODI2_Y,0
COMPASS_ODI2_Z,0
COMPASS_MOT2_X,19.539148
COMPASS_MOT2_Y,-6.5888677
COMPASS_MOT2_Z,-35.737823
COMPASS_SCALE2,1
COMPASS_ORIENT2,0
COMPASS_MOTCT,2
@andyp1per please review this commit FEATURE: Use MCU series to make parameter values decisions by amilcarlucas · Pull Request #120 · ArduPilot/MethodicConfigurator · GitHub Thanks.
Does it take care of the cases where batch logging is recommended and/or desired?