Single Copter PID tuning

Hi, Can anyone suggest me the good approach for PID tuning for single copter(one main motor with 4 servos for fins at the bottom)? I am following the multicopter PID tuning but that doesn’t work out with the same result described in tha document. Although i have come to some points in which i am getting the exact replica of ATTITUDE.roll vs ACTUATOR_CONTROL_TARGET.0 (for roll).

I have made a custom airframe with mixer files for that. The thing is it just topples when i start the flight.
Thanks.

Edit: my previous answer (in the quoted text below) was incorrect, even if the thrust is below the CG the system doesn’t become unstable because the thrust rotates with the body frame unlike an inverted pendulum where the gravity is in the inertial frame and applies a force proportional to cos(tilt).

Summary

Stabilizing a multicopter is much easier than what you are trying to do, that’s most likely why you have issues.
From what I understood, your vehicle is something like a thrust vectoring ducted fan (but uses fins instead of moving the nozzle). I also assume that the CG is above the thrust point.
This is a similar problem than balancing an inverted pendulum which is less actuated and more unstable than a standard quadcopter. The rate controller should then be tightly tuned since any growth in attitude error is more and more challenging to recover. The maximum tilt you could recover might be something like 10 degrees sloppy tuning is not an option.

A few things to consider:

  • The torque you can produce with your system highly depends of the position of the CG, if you hold the drone on the CG point and that it can barely produce torque, move the CG higher
  • You first have to tune the inner (rate loop) correctly, I recommend to hold it on the CG on a test bench with one free rotation at a time.
  • The integral gain might need to be quite high

Otherwise, if you want to avoid having to stabilize a complicated unstable system, you could try to place the CG under the thruster, this would make things much easier.

edit: this is not true, the system has the same stability whether the thruster is above or below the CG and can easily be stabilized with a PID rate loop.

Hi bresch,
Thanks for the suggestion. As you stated about the CG, i did the same with my design. And now it is flying well. Also Altitude hold is done with a maxbotics I2C sonar. The thing is that now i am integrating the px4flow with an i2c splitter. After that my sonar data gets fluctuated and sometime it is not able to hold the position. Sometime it shows unpredictable spiral motion. Is there any precaution need to be done for px4flow integration? I have also ordered a sheilded i2c cable(similar to GPS i2c cable). I am thinking it is cable issue and will check with the shielded one. Any suggestion from your side?
Thanks.

Nice! Do you have videos or/and pictures?
I never used the px4flow, but having shielded I2C cables (and as short as possible) is a good idea.
If you have an oscilloscope, check the clock and data signals to make sure they are clean.

Hi bresch,
sure i will share the video. Just trying to integrate the px4flow.

Hi bresh,
I am sorry not able to take good videos as i am stuck with my px4flow integration.
You can see pics that was clicked randomly at first flight.

The thing is that i am able to see optical flow sensor data on qgroundcontrol. But when i put this on position hold, it glows red RGB on pixhawk mini. And then the motion is unpredictable spiral, keep going downword, sometime keep going upword (when only put Altitude hold). The altitude hold also does not work properly when i joined the i2c wires for flow sensor. I am a bit confused what can be the problem.

1 Like

Dear @sharmarahul999,
is it possible to share your PX4 config to realize a single copter? Did you made a modification of the FC code, or is it a config mixer file?
Any hint would be much appreciated :).
Cheers!

@cmb87 I’ve done a similar project and had to add a gyroscopic torque cancellation loop since I only had a single high-speed fan: Add gyroscopic torque cancellation loop for single-rotor drones by bresch · Pull Request #21489 · PX4/PX4-Autopilot · GitHub
In this PR I also added a new control allocation option for thrust vectoring when using fins to deflect the airflow.
For the rest you don’t need anything special to control such a drone, it just requires enough control effectiveness and good tuning of the rate loop.

it is possible to achieve the same with 2dof gimbal connected to the motors

If you have two rotors to counter the yaw torque, then yes, it should work.