how to calculate PIDs?!

Hello,

I've "build" my own version of a hexacopter - and I just can't get it to fly stable with the APM. I am close to rip my hair off.

The hexa is nothing fancy. "Regular" 800-type electric motors, 3-blade props (9x5), diameter from center of one motor to the center of the opposite motor is 62 cm (24,41 inch), 4S LiPo, and weighs fully loaded apprx. 1.5kg (3,3 pounds).

Since I am reading documents back and forth, and since there are so many of them, and since every document says something different, I believe I have reached a dead end when it comes to PIDs and their correct settings, respectively. I can't help myself but more and more I believe that finding the correct settings is somewhat "black magic".

  • I have heard that the values can be calculated?!
  • Is that true?
  • How would it work?

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • MR60

    Hi,

    I try also to tune the PIDs of my quad. I find it very difficult to have a working method for tuning. For example trying to apply Dave's blog on tuning, I do not get the wobbling or oscillations that he describes, even with very high P values.

     

    So I decided to try the simulator of Jason Short. The issue is I do not find the link between the names of the P,I,D parameters between mission planner naming conventions and this simulator's names. For example where are the P-I-D rate roll/pitch parameters int he simulator ? I can't find a user manual neither on the internet for this simulator. Does anyone knows how to configure it ?

  • MR60

    Flight is directly impacted by lift torque (you pushing down on a jack handle to lift a car) and weight torque (starting to tilt a couch is hard, but once the tilt starts to near 45 degrees, gravity is helping as much it is hurting so rotation of the couch becomes easier).  Both are true for your quad copter.

    Lift torque is the ability of your propulsion system to accelerate the craft around it's center of gravity (CG) or the speed at which it can make your craft flip.  So lift torque is impacted by two things:  force (motor size, watts, prop type, etc.) times the distance from CG.

    Weight torque is where the location of your batteries/camera/motor mass matter and if they are negatively or positively impacted by gravity.  Weight torque is the distance times mass up or down from the plane that your propellers create times the gravitational component.  If you were to place a piece of cardboard on top of your propellers, that would define the the plane of lift.  Put your batteries and camera above that plane and you have an unstable craft (gravity and motor variation are working together to flip your craft).  The further the batteries are below the lift plane, the more stable your craft, the more force it takes to tilt it, and the less motor and wind variation impact stability (gravity is working to stabilize the craft).

    So batteries can impact an optimal PID in two ways.  If voltage changes, wattage to the motors changes giving them more or less force (a change to lift torque).  The motor will try to draw the amps required to respond to the throttle command.  If you are only changing the mAh (Amp hours) of the battery, then the only impact is the mass (a change to the weight torque) and flight time.  If either or both change, the optimal PID values will change.  But less than optimal doesn't mean that the craft will be too unstable.

    This is why we need an auto PID routine on take-off so when lift or load (relative to the center of the lift plane) changes, the PIDs can be quickly optimized for stable flight control.

  • Developer

    Florian,

         You should focus first on the Rate Roll and Pitch P values.  Those are the most critical and you could even do it using the inflight CH6 tuning.  Next I'd say do the throttle (if you're interested getting alt-hold working well) by adjusting the throttle accel P and I values.  normally people move them down (not up) but remember to keep the ratio of P and I the same for throttle accel (I is always 2x P).

  • Interesting question.

    About the fact that the PIDs are originally configured for 3S batteries, that's new to me.

    When I've bought my hexa at udrones, I've asked them what kind of batteries I should buy, and they've recommended (and linked) 4S batteries with 6000mAh at the hobbyking store.

    All my batteries are 4S, and the copter flies very well, even tough in loiter mode isn't as steady as I would like, like I've seen in some videos.Perhaps it's exactly because it's a 4S battery. But one thing is for sure, with those batteries I can easily pass the 15 minutes of flight.

    This is a subject that I will to follow up.

    Best regards,

    António

  • T3
    I'd lose the 3-blade props and use 2 blade props. Easier to balance and the PIDs are tuned for them. Also try to use a 3S battery, again the default PIDs work better with a 3S battery.
  • Hi Florian,

    I read over the Forums that for a 4S LIPO battery the settings for PID are much more different than for using 3S LIPO (due to weight and some other reasons). Can you check out the forums (via google) for 'Arducopter 4S LIPO PID'. I am sure some people have used settings for this.

    This maybe one possible reason. Also, make sure the board is correctly placed in the center and the props are balanced (i.e. all props weigh equal/ not damaged and have correct rotations CW/CCW respectively).

    Regards,

    Shyam.

This reply was deleted.