Definition of PID and other Variables

Everyone agrees that the project team are doing a fantastic job and really hate to ask for anything but would it be possible for someone to write a proper definition of all the variables over which we have control?  I have searched throughout the forum and I know that I am not the only one who would benefit from such a resource.

 

One of my reasons for asking this is that I read about members of the community who have got their multicopters flying well and, whilst mine flies okay, it still needs a little tweaking.  I'd like to do this myself rather than pester people with questions but there is precious little information out there and I am worried about experimenting without any idea of what might happen.

 

Incidentally, speaking for myself, I don't need help regarding PID theory (we can find out about that here) but we need more than is provided on the Tweaking ArduCopter Parameters page.

 

(By the way, if one of the project team want to quickly talk me through these values via Skype or similar, I'd be happy to write them up myself).

 

Cheers,

Nigel

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

Join diydrones

Email me when people reply –

Replies

  • Hi, does someone know what are the correct pids for some Turbo Ace X830 brushless motors?

  • I find the TUNE option in Cli is wery usefull. I never got Stabilize to work well until I tried the tune option. Then I could fly around while tuning P value using a potmeter on my radio. It turned out that I had to lower the P value much more than I had been trying with the mission planner. One thing I miss is the option to use "tune" on the values for baro alt hold.

  • Developer

    Nigel,

    Here is my rough pass. We can clean it up and put it on the Wiki.

     

    PID: a simple explanation.
    The P term is the direct response to an error. It's real-time and it's a scaled version of the error. For example: if you need to turn 10 degrees, you take 10 and multiply it by P. The result is the number you use to make the engines adjust. 
    The I term is the same as P, except it grows slowly over time. So if you are doing altitude hold, and your P causes you to be below target, the I term sums up that error over a few seconds until it gives you extra power to close the gap. 
    The D term gives an opposing forces based on the rate of change. If the rate is too high, the D term will grow proportionally to oppose it. There is no time delay in D as there is with I. The D term can also backfire if it's out of range.
    PIDs in AC2:
    pid_acro_rate_roll, pid_acro_rate_pitch: Only the P term is used here.
    g.pid_acro_rate_yaw : controls how fast we spin, only the P term is useful.
    I never fly Acro, so I can't help you more here.
    Here's where things get interesting:

    pid_stabilize_roll, pid_stabilize_pitch:
    P is your power - how aggressive you want your copter. Faster KV motors may need less P.
    I is limited to a half degree to make your Quad hover nicely, don't bother changing it.
    D is used to slow the rotation of the copter so It doesn't oscillate. (But if it's too high it will oscillate too!)
    A low D will appear out of control, A slightly High D will be sluggish, A very High D will backfire and oscillate wildly.


    pid_baro_throttle, pid_sonar_throttle
    This is altitude hold using the barometer or the Sonar.
    P is your throttle response to altitude error
    I is your compensation over time - very important in Alt hold
    D is your response to rapid changes in altitude - a double edged sword, higher D will be better, but will prevent you from changing altitude.
    Throttle_cruise - this is the nominal throttle value used to cancel out gravity - to hover. It is set automatically.
    The sonar has less noise and latency than the barometer, therefore P can me more aggressive because it will be more accurate.

    pid_nav_lat, pid_nav_lon 
    Used to do position hold.
    These are symmetrical so to the user they are presented as NAV_LOITER. The intent is that the pitch of the copter is proportional to the distance from the WP.

    Crosstrack error - Check out this Flash demo to better understand the variables.

    pack_capacity this is something like 80% of your battery's MAH. The RTL function to deal with a dead battery is up in the air. I think it's dangerous to have a quad fly at you and drop out of the sky;) Open for suggestions.
    pitch_max - this is how much you'll allow the copter to pitch when holding a position in Loiter.

    Compass declination - you'll need to look it up online for your location. And realize even then it may be wrong. You may have to set it through trial and error. Decimal degrees.

    Y6_MOTOR_SCALER - used to adjust the speed differential in Y6 motor setups. The tops need to spin at a different rate than the bottoms. That's all I know!

    GROUND_START_DELAY - used to slow down the startup sequence in seconds. Not such a big deal for quads.

    THROTTE_FS_VALUE - used to trigger radio failsafe - the Ch3 value dropping below a minimum threshold. Not really a well tested feature. Great for planes that can fly out of radio range.


    Any other values you need help on?
    Jason






    CrossTrack2
  • 3D Robotics

    That's a good idea. We've just been swamped getting the code and basic documentation right and haven't gotten to the more advanced functions. 

     

    Jason would be the one to talk to about this. I agree: he should only have to do it once, and then the person on the other end of the line should turn that into a document for everyone. 

     

    What time zone are you on? (We're PST)

This reply was deleted.

Activity