Having a hard time tuning the PID on a large Hexa

It’s been 4 days of PID tuning and I can’t seem to find the right PID values for a stable flight. I keep seeing ghost (or unwanted) movements besides the drone being sluggish even when flying in stabilize mode and it is quite scary!

I set the initial values using this spreadsheet, and then followed these instructions.

At first, I was able to manually tune the PID and achieved a relatively stable flight for AutoTune. However, after letting ArduPilot do the autotune, the result was still not so good. As I said, I can still see ghost movements which I think it can get worse on windy days.

I’ll appreciate it if anyone can help me tuning the PID. The few blogs I found about tuning PID on big drones were not really helpful. Maybe sharing your PID values could be a good start. Thanks!

Here are the specs of my drone:

  • DJI M600 Pro frame and original motors with 21in props (foldable)
  • Flycolor X-Cross HV 80A Blheli_32 ESC using Dshot150
  • Pixhawk CubeBlue with ArduCopter 4.1-rc1
  • Dummy payload of 2.4kg so that the motors don’t run at too low rpms

Here is the autotune flight log (only roll):
https://1drv.ms/u/s!ArMDLLLI-JmigYYzBBZkWGPTM9Xq7w?e=7Vvhfh

Here is a flight log in stabilize mode after autotune:
https://1drv.ms/u/s!ArMDLLLI-JmigYYyDstuHTcjV1wegw?e=zxWXsb

Did you enabled and tuned the dynamic notch filter? On the Cube Orange you can simply use the FFT input method or even better the ESC telemetry if you have dshot telemetry.

Did you temperature compensate the IMUs and barometer to minimize drift?

There is documentation for every step I described.

It looks like you disarmed in Stabilize in the Auto Tune log so it wouldn’t have saved the changes. And set the aggression back to default (.1) you will likely not get a good tune at .05.

And as @amilcarlucas says configure the Dynamic Notch filter before running Auto Tune again.

I haven’t enabled the dynamic notch filter and FFT because I’m using a CubeBlue (which is basically a CubeBlack) and I’m afraid it could overwhelm the cpu. Unless you tell me that it’s going to be fine. Will this make all the difference?

What are the steps for compensating for temperature? I thought that the Cube had a self-heating feature.

Sorry, my mistake I taught you where using a CubeOrange.

You can use the ESC telemetry RPM data to dynamically configure the notch filter center frequency at run time with no added CPU cost. FFT on the CubeBlueF4 would be a bad idea, AFAIK there are “CubeBlue F4” and “CubeBlue H7”. The second one would do FFT just fine.

Please do read about temperature drift compensation here:

And as always google is your friend! :slight_smile:

No it’s not. Black (discontinued) has an F427 process, Blue is an H7. Worlds of difference. Configure the Dynamic Notch filter. If you have ESC telemetry use RPM reference if not use either throttle reference or FFT.

Yes… you are talking about the CubeBlue H7. Mine is just plain CubeBlue which has the F427 prcessor. Ok I will try this! Thanks!

Thanks @amilcarlucas, I’ll try the Dynamic notch with the rpm telemetry since I have the CubeBlue F4. I’ll let you know how this goes later in the week

Huh, OK. I didn’t know those existed!

I ran into another problem now. I can only get rpm telemetry through the bidirectional dshot feature but there’s no CubeBlack-bdshot board target. Is it really necesary to have Dynamic Notch filter enabled to improve the flight stability? The logs don’t show high vibrations

Have you analyzed the log files? what does the mission Planner FFT say?

And you can open a github issue requesting a CubeBlueF4-bdshot target.

I don’t think you can run 6 motors in bdshot on a F4 FC with IOMCU.

Well AFFAIK 6 is the limit for those boards, you need to use all 6 aux pin outputs. @andyp1per correct me if I am wrong here.

You can use the 6 outputs but all of the boards only have bdshot on the first 4 - so you would use regular dshot on the last 2. bdshot on F4 is fine regardless of IOMCU but requires a configuration. CubeBlack might be hard as DMA allocation is pretty congested anyway on that board.

Follow-up. I did a full advanced re-calibration of the IMU by recommendation of @amilcarlucas and I noticed that the drone was way more stable right after take-off and doing some twitches in stabilize mode. So I decided to engage Autotune (I also increased the aggressiveness from .05 to .08), but things went really bad after few minutes into the autotune. I was reading in the messages that the Autotune was decreasing the D term quite a lot of times until the drone became very unstable!! I tried to take over by switching to stabilize but it was too late, the drone landed hard and broke some parts. Here’s the log of the flight:
https://1drv.ms/u/s!ArMDLLLI-JmigYY1tf5m26diAb3xnw?e=uPcXwc
What went wrong with the autotune?

Why didn’t you configure the Dynamic Notch Filter before running Auto Tune?

It looks like this is a strong requirement then. I thought that the autopilot could handle it without the DNF as it was doing it before the introduction of the DNF in copter-4.0.

It is a strong recommendation:

  1. Tuning process instructions
  2. Test it
  3. Dynamic Notch Filter
  4. Test it
  5. Autotune
  6. Test it

And lowering the aggression won’t do you any favors. And perhaps for Auto Tune set the ANGLE_MAX back to default 45°. You can lower it when you are done tuning.