Call for full PID settings tutorial!!

This forum is dedicated to all issues and questions related to your individual setups and configurations
Post Reply
afaf
Posts: 20
Joined: Sat Mar 30, 2013 4:35 pm

Call for full PID settings tutorial!!

Post by afaf »

I'm looking for a guide on how to set pid values (for all params - not only roll pitch yaw).
Most of tutorial are outdated (use old multiwii gui) and I find just one full tutorial (it's a video-tutorial on yt) but where author speak in french, so I can't understand what he's saying.

I wonder if some multiwii experts here can write an article or a page on wiki with a full tutorial.

It 's very frustrating to have a Quadcopter but not being able to set it properly.

Thank in advance!

User avatar
Hamburger
Posts: 2582
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Call for full PID settings tutorial!!

Post by Hamburger »

Yes, good thinking.
I propose you start asap - then maybe others will join you. That is the wiki way right?

afaf
Posts: 20
Joined: Sat Mar 30, 2013 4:35 pm

Re: Call for full PID settings tutorial!!

Post by afaf »

I'm just a newbie with MultiWii, we need someone with experience to write it. I'm looking for that infos. You seem more expert than me, so maybe you can give a good starting point :)

User avatar
Hamburger
Posts: 2582
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Call for full PID settings tutorial!!

Post by Hamburger »

Maybe I could but it is not my current focus of interest to start this.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Call for full PID settings tutorial!!

Post by copterrichie »

The issue with PID tuning in my opinion, there is no set way of doing it. I have shared my way of doing it in the past and was ridiculed. So I don't bother any more. I will share this, the major mistake is believing using the default PID setting is some badge of honor, it is not. Each copter is an unique creation and requires its own settings.

afaf
Posts: 20
Joined: Sat Mar 30, 2013 4:35 pm

Re: Call for full PID settings tutorial!!

Post by afaf »

copterrichie wrote:The issue with PID tuning in my opinion, there is no set way of doing it. I have shared my way of doing it in the past and was ridiculed. So I don't bother any more. I will share this, the major mistake is believing using the default PID setting is some badge of honor, it is not. Each copter is an unique creation and requires its own settings.


I've read some useful tutorials on how to set pid for roll pitch yaw: not a simple list of values, but a way to set them.
If i understand it correctly, for example, a too high value for P on roll/pitch makes quadcopter wobbling when I push on throttle, am I right? It's a very useful information: if my quad wobbles then I know probably it's a problem with P. It is the kind of information we (we = noobs) need.

By the way I can't understand for example why my quadcopter slide to left, or why can't keep altitude level (i have a barometer). I guess is one of tens settings out of there but I can't find anywhere information about them. (Neither a guide to MultiWiiConfGui seems to exist)

copterrichie, gives me (us) your advice on how to set them please. And put the on a wiki please!

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Call for full PID settings tutorial!!

Post by copterrichie »

I will attempt to put something together over the next few days. Building a new copter with EDFs and records my steps. I am sure it will requires its own unique PID settings.

zidlov
Posts: 16
Joined: Mon Jan 07, 2013 10:08 am

Re: Call for full PID settings tutorial!!

Post by zidlov »

Basically I'm having the same problem and have already watched and read far too many descriptions on how to set pids.
Right now I think I start to grasp the process and today played around with some values on the field and managed to get a pretty stable behaviour but I'm still far from doing this in a systematical fashion.
Actually I only wanted to give a hint to the op: Try to watch that french yt video again! It has english subtitles...
I also fou d a pretty good and short description on rcgroups but don't have a link right now.
Today on the field I remembered only: increasing p until it feels good and solid but doesn't oszillate. Increase I slowly 7ntil theres no more drift and no wobbling during rapid descent. As for D , I haven't done it yet, but it should be responsible for speed of reaction to your inputs....
Very happy with the possibility in 2.2 to set 3 different profiles. I will try and make one for chilly cameraflight, one for aerobatics and one for testing. So I won't ruin my settings by the pure urge to "try out something else" anymore....:)

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Call for full PID settings tutorial!!

Post by scrat »

If P is too high quad wobbles very fast. If I is to high quad wobbles very slow. That's it. So you must play with PID's to make your copter wobble free.

Good video for P and I tunning:
http://www.youtube.com/watch?v=YNzqTGEl2xQ

afaf
Posts: 20
Joined: Sat Mar 30, 2013 4:35 pm

Re: Call for full PID settings tutorial!!

Post by afaf »

French friend video, has subtitles only for roll pitch yaw pid, not for altitude e mag (there's a video, but no subtitle).
A centralized/official wiki page will be more useful btw :)

afaf
Posts: 20
Joined: Sat Mar 30, 2013 4:35 pm

Re: Call for full PID settings tutorial!!

Post by afaf »

scrat wrote:If P is too high quad wobbles very fast. If I is to high quad wobbles very slow. That's it. So you must play with PID's to make your copter wobble free.

Good video for P and I tunning:
http://www.youtube.com/watch?v=YNzqTGEl2xQ


That's good! But doesn't describe d, and pid for alt and mag.

We need something like this, but more complete and linked on official wiki!

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Call for full PID settings tutorial!!

Post by copterrichie »

afaf wrote:That's good! But doesn't describe d, and pid for alt and mag.

We need something like this, but more complete and linked on official wiki!


Awe!! That lets me off the hook, I personally do not use the alt or mag functions. ;)

backyardflyer
Posts: 6
Joined: Mon Apr 08, 2013 9:06 pm

Re: Call for full PID settings tutorial!!

Post by backyardflyer »

Here is a link to PID tuning.
http://www.multiwii.com/wiki/index.php?title=PID

Personally, using low pass filter is more efficient.
//#define ITG3200_LPF_42HZ
#define ITG3200_LPF_20HZ

I found increasing D term should help with vibration.

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Call for full PID settings tutorial!!

Post by scrat »

afaf wrote:
scrat wrote:If P is too high quad wobbles very fast. If I is to high quad wobbles very slow. That's it. So you must play with PID's to make your copter wobble free.

Good video for P and I tunning:
http://www.youtube.com/watch?v=YNzqTGEl2xQ


That's good! But doesn't describe d, and pid for alt and mag.

We need something like this, but more complete and linked on official wiki!


Most important are P and I. D is not that important but helps.

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Call for full PID settings tutorial!!

Post by alll »

scrat wrote:... D is not that important but helps.


??, explain us, helps to do what?

afaf
Posts: 20
Joined: Sat Mar 30, 2013 4:35 pm

Re: Call for full PID settings tutorial!!

Post by afaf »

Still no luck with tutorials :)

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Call for full PID settings tutorial!!

Post by scrat »

alll wrote:
scrat wrote:... D is not that important but helps.


??, explain us, helps to do what?


http://en.wikipedia.org/wiki/PID_contro ... ative_term

rbirdie001
Posts: 178
Joined: Fri Apr 01, 2011 10:32 pm
Location: Czech Republic, Prague

Re: Call for full PID settings tutorial!!

Post by rbirdie001 »

Hi!
I installed in my Tricopter with Crius SE board (baro BMP085) firmware MW 2.2 instead 2.1 and now I can't tune up altitude hold. I noticed that there were some changes in altitude hold code, but those should be to better, shouldn't be? ;)
With 2.1 AH wasn't perfect but in calm wather with AH active was the copter slowly "floating" in about 0.5m range. Now with 2.2 the copter is pulsing and jumping in 1-2m range and during first PID tunning "session" I was unable to tune it better.
Was someone successfull with AH at 2.2? Can you share some ideas how to tune Altitude hold PID?
Thanks!
Roman

tovrin
Posts: 705
Joined: Tue Sep 20, 2011 4:08 pm

Re: Call for full PID settings tutorial!!

Post by tovrin »

personally i think that the video posted early in this thread is one of the best PID teaching tools there is. it doesnt get explained any better and its visually informative.

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Call for full PID settings tutorial!!

Post by scrat »

rbirdie001 wrote:Hi!
I installed in my Tricopter with Crius SE board (baro BMP085) firmware MW 2.2 instead 2.1 and now I can't tune up altitude hold. I noticed that there were some changes in altitude hold code, but those should be to better, shouldn't be? ;)
With 2.1 AH wasn't perfect but in calm wather with AH active was the copter slowly "floating" in about 0.5m range. Now with 2.2 the copter is pulsing and jumping in 1-2m range and during first PID tunning "session" I was unable to tune it better.
Was someone successfull with AH at 2.2? Can you share some ideas how to tune Altitude hold PID?
Thanks!
Roman


Have the same problem. With dev version I think it was r1122 with baro code from mahowik...this was the best AltHold for me. Yeah copter did fell down for about 50cm when althold was turned on but then copter stayed at same altituted all the time.

rbirdie001
Posts: 178
Joined: Fri Apr 01, 2011 10:32 pm
Location: Czech Republic, Prague

Re: Call for full PID settings tutorial!!

Post by rbirdie001 »

scrat wrote:Have the same problem. With dev version I think it was r1122 with baro code from mahowik...this was the best AltHold for me. Yeah copter did fell down for about 50cm when althold was turned on but then copter stayed at same altituted all the time.

Does it mean that in final 2.2 there isn't baro code from Mahowik? I'm not following all the changes (it's probably impossible ;) ) so I'm confused. I thought that it's implemented 2.2 :?:
Does anyone know more about it?
Roman

afaf
Posts: 20
Joined: Sat Mar 30, 2013 4:35 pm

Re: Call for full PID settings tutorial!!

Post by afaf »

I still can't understand how to set pid for altitude and mag :) No reply in first 20 posts...

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Call for full PID settings tutorial!!

Post by scrat »

afaf wrote:I still can't understand how to set pid for altitude and mag :) No reply in first 20 posts...


Let me google that for you :)

http://lmgtfy.com/?q=multiwii+altitude+pid+tuning


For Althold PID tuning: http://www.multiwii.com/wiki/index.php? ... titude_PID

For MAG leave default.

Ok?
Last edited by scrat on Fri Apr 12, 2013 7:49 am, edited 1 time in total.

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Call for full PID settings tutorial!!

Post by scrat »

rbirdie001 wrote:
scrat wrote:Have the same problem. With dev version I think it was r1122 with baro code from mahowik...this was the best AltHold for me. Yeah copter did fell down for about 50cm when althold was turned on but then copter stayed at same altituted all the time.

Does it mean that in final 2.2 there isn't baro code from Mahowik? I'm not following all the changes (it's probably impossible ;) ) so I'm confused. I thought that it's implemented 2.2 :?:
Does anyone know more about it?
Roman


This is just my opinion - like i see there isn't :(

Maybe some coders will answer.

Newquadandtri
Posts: 16
Joined: Wed Mar 27, 2013 10:13 am

Re: Call for full PID settings tutorial!!

Post by Newquadandtri »

PID mystery simplified.
[url][http://www.rcgroups.com/forums/showthread.php?t=1873603/url]

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Call for full PID settings tutorial!!

Post by copterrichie »



This is an example of how a PID settings will work for one copter and not for another. I plugged in the PID settings for Mini-Mollie and what is seen in the video are the results. This copter is the same physical size as Mini-Mollie and a Bicopter but that is where the similarities ends. The motors have a much higher KV Rating, the props are 9" verse 8" and the AUW is 1.5Kg where as Mini-Mollie is 1Kg. There is no magic bullet when it comes to PID tuning at this stage of the game, the best we can do right now is trail and error testing. However, I do believe it is possible to create a spreadsheet or equation where we can enter variables like AUW, Motor KV, props etc and out pops a baseline PID settings, just no one has taken this task on. The copter was not damaged and I continued on with the tuning process.

squid10
Posts: 20
Joined: Sun May 12, 2013 8:24 pm

Re: Call for full PID settings tutorial!!

Post by squid10 »

Hi,
I'm new in this Multiwii, currently im reading and learning A LOT.
I also have KK2 and APM 2.5 and i have to agree with the author of this post - there are much less tutorials in Multiwii than in other platforms i know (KKMuticopter and Arducopter).
BUT,
I do found basic tutorials and how to calibrate MAG and ACC - the rest is exactly like on other platforms.
PID tuning is the same on all systems, so if you'll search on other platforms you'l find lots of materials.. also we can create tutorials based on other platforms tutorials.
the big advantage on MW is the comfortable tuning way through the bluetooth and the android app, yeah.. other platform mostly comes pre tuned for most common crafts, but in other platforms if you do need to tune its a big mess... you need to connect the board to the PC between params you tune...

felixrising
Posts: 244
Joined: Sat Mar 23, 2013 12:34 am
Location: Australia

Re: Call for full PID settings tutorial!!

Post by felixrising »

Sounds like we all need to get IDs on the wiki and start contributing... There is already a really great base of information there, but more information and more up to date is always a good thing.

Who controls access to the wiki?

User avatar
Hamburger
Posts: 2582
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Call for full PID settings tutorial!!

Post by Hamburger »

Alex and myself.
It is really only to keep away vandalism. Just contact either one of us if you are interested.

User avatar
linuxslate
Posts: 91
Joined: Mon May 13, 2013 3:55 pm

Re: Call for full PID settings tutorial!!

Post by linuxslate »

Article on wikipedia about PID Tuning:

http://en.wikipedia.org/wiki/PID_tuning#Loop_tuning

I'm not telling anyone to use any of these techniques while a expensive and heavy device with spinning blades is in the air, but the article makes informative and interesting reading.

hpcre
Posts: 8
Joined: Fri May 04, 2012 10:32 pm

Re: Call for full PID settings tutorial!!

Post by hpcre »

From the tons of information and posts I read on PID tuning, it seems they all follow the same rule on any axis, just increase P until you see a wobble them decrease a bit.
Then increase D until you see wobbles then decrease a bit. I is the last setting to be set.

The post on rcgroups called "PID thinking theory" is very good if you want to understand how P, I and D relate

User avatar
ezio
Posts: 827
Joined: Sun Apr 01, 2012 11:03 pm
Location: Paris
Contact:

Re: Call for full PID settings tutorial!!

Post by ezio »

I was looking for a quite some time to good tutorial for PID tuning for Alt Hold. And I haven't found one good enough. So this is my procedure to tune the Alt Hold based on my current knowledge.
-----
Explanation.
Baro sensor is used to detect the altitude. As baro sensor is not very precise and quite noisy, detection of small up and down movements is impossible.
So small up and down movements are detected by accelerometer. Combination of this two sensors gives good altitude hold.

PID settings for ALT works like this:

*P - means how much copter should relay on the baro sensor. Higher the value is, stronger the copter relays on the Baro reading.
*I - is used to compensate drift costed by battery voltage drop during the time. Higher the value is faster the copter will react to voltage drop ( or other factors ).
*D - means how strong the copter should react on data from the accelerator. It is used to react on small up and down movements. Higher the value is copter will react faster/stronger to the small altitude change.

Tuning:

We need to start from settings the Accelerometer.

1. So set the P and I to 0

2. Start to play with D value only. To high D may cause yoyo effect (up and down oscillations). With to low D copter will be not able to react strong/fast enough to hold altitude. Your goal here is to set D to the value when copter don't oscillate up and down and also holds altitude quite well for a not very long period of time. Copter will not hold altitude perfectly at this point during long periods. It will slowly drift up or down, but altitude should be quite stable in short periods.

3. Start to increase P to the point where copter holds altitude over long time period. If the value is to small the copter will drift slowly up and down. If the value is to high yoyo effect may appear. Goal here is to set it to the point where copter holds altitude for quite some time. Copter will still go slowly down due to battery voltage drop over time.

4. "I" is used to compensate the voltage drop. So start to increase the "I" value slowly until you get a perfect position hold during a very long time.
Now your altitude hold should be good enough.

I hope that this approach is correct. If you find a mistake let me know.
I will try to make tutorial like this for GPS soon.
Fly safe.
Bart

Sac D
Posts: 3
Joined: Tue Jun 04, 2013 9:59 pm
Location: Northern California

Re: Call for full PID settings tutorial!!

Post by Sac D »

Thank you ezio. That seems like a good approach. I'll give it a try after I figure out how to stop mine from spinning in a hard clockwise yaw all the time. Do you think proceeding the way you did would also work with yaw? Or do you have an idea how I could resolve it?

henjo
Posts: 1
Joined: Tue Jun 04, 2013 8:09 am

Re: Call for full PID settings tutorial!!

Post by henjo »

Ok
Last edited by henjo on Fri Jun 07, 2013 8:59 am, edited 1 time in total.

felixrising
Posts: 244
Joined: Sat Mar 23, 2013 12:34 am
Location: Australia

Re: Call for full PID settings tutorial!!

Post by felixrising »

Ezio, nice.. When looking at the wiki http://www.multiwii.com/wiki/index.php?title=Altitude_PID, I've always been purplexed by this line of text:
When changing PID values begin with I and D values at zero,
which seems to be contradicted three lines down by this one:
Set P and I to 0
. I'd like to update the wiki with your explanation (which doesn't overly differ) but is well worded. ps. !Relay, Rely. ;)
Last edited by felixrising on Fri Jun 07, 2013 6:54 am, edited 1 time in total.

User avatar
ezio
Posts: 827
Joined: Sun Apr 01, 2012 11:03 pm
Location: Paris
Contact:

Re: Call for full PID settings tutorial!!

Post by ezio »

felixrising wrote:Ezio, nice.. When looking at the wiki http://www.multiwii.com/wiki/index.php?title=Altitude_PID, I've always been purplexed by this
When changing PID values begin with I and D values at zero,
line of text, which seems to be contradicted three lines down by this one
Set P and I to 0
. I'd like to update the wiki with your explanation (which doesn't overly differ) but is well worded. btw. !Relay, Rely. ;)

Exactly. I have spotted this bug on the wiki too. That's why I have decided to write my own version.

Bart

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Call for full PID settings tutorial!!

Post by alll »

Tuning PID like : set I&D=0, increase P until wobble, reduce a bit, set D to reduce overshoot, finally add some I to keep steady state… is true for a « conventional/classic/standard » PID control loop :
http://en.wikipedia.org/wiki/PID_contro ... d_PID_form

Tuning pid values in multiwii is not that intuitive as we don’t really know how the PID control is implemented, unless you dig in the code.

IMO associating physical units to these PID values in the gui is confusing and sometimes difficult to remember not user friendly. On top, the PID value ranges and precision are quite different for P-I and D.
(eg P=0..20; I=0.00..0.30; D=0.000..0.250)

Could we not “hide” these physical values from the user-interface and only work in % (they can be documented). One would think in increasing / reducing PID values.
(eg P=0..100% (range 0..20), I=0..100% (range.0.00..0.30); D=0..100% (range=0.000..0.250)

manu

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Call for full PID settings tutorial!!

Post by alll »

Here a nice apple(s) to play with
http://www.pidstop.com/index.php?r_id=999
manu

alex.khoroshko
Posts: 27
Joined: Sun Jun 09, 2013 9:17 am

Re: Call for full PID settings tutorial!!

Post by alex.khoroshko »

Hello!
Let me refresh the thread a bit.
First, I'd like to say - I have no questions how to tune PIDs themselves (I have Russian equivalent of PhD in power electronics).
But! Why there are so many control loops, having no explanation? Ok, roll, pitch, yaw, altitude hold, mag, level - it is explained and intuitively understandable. But why there are 2 control loops for position hold, - ordinary and "rate"? what in fact do they control? I assume not height, because there's separate altitude control loop. And, what confuses me even more - what is navigation loop? Is it for waypoints?
As I see, there should be the loop for horizontal plane correction and for vertical axis control - compare the current position to the desired one and that's it. Why more loops? How to tune them?
P.S. I can write the complete wiki page on these extra loops after understanding the point of this all, assuming someone would revise my English after that. I can even film the full tutorial on all the settings.

carlonb
Posts: 210
Joined: Sun Apr 03, 2011 6:29 pm

Re: Call for full PID settings tutorial!!

Post by carlonb »

alex.khoroshko wrote:Hello!
......
P.S. I can write the complete wiki page on these extra loops after understanding the point of this all, assuming someone would revise my English after that. I can even film the full tutorial on all the settings.


+1
I'm waiting for this....
Cheers
Carlo

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Call for full PID settings tutorial!!

Post by alll »

I see i am not the only one that has difficulties in guessing how these PID loops are implemented ;)

Take the alt hold for example, here you can't apply the "standard" PID tuning, as far as i understood, the D-term is actually the accelerometer-only error input, P and I comes from the baro sensor?

I would prefer that all PID controls behaves the same, ie:
Error = Setpoint - Actual(got from sensors)
P=current error
I=error over time (gets the error back to 0)
D=error "prediction" (damping)

If each PID loop could be explained in speudo code, would help us better tuni the thing.

manu

PID:
Error = Setpoint - Actual
Integral = Integral + (Error*dt)
Derivative = (Error - Previous_error)/dt
Drive = (Error*kP) + (Integral*kI) + (Derivative*kD)
Previous_error = Error
wait(dt)
GOTO PID

Stiefel
Posts: 1
Joined: Fri Jun 14, 2013 12:44 am

I know this will be simple but im stuck

Post by Stiefel »

So ive built alittle micro quad to mess around inside the house with.. Ive got it dialed in enough that im happy with it but since ive got it flying stable , now i notice something else that i didnt before.. Im running the multiwii 328 board and in the multiwii GUI i have the PID settings pretty close to stock except for the roll which i increased alittle...

The problem: ill take it to just a little over half stick of throttle so that i can hover,,, which it does, until it starts to loose altitude then when it hits the ground it gains altitude and continues on that road up and down,,,... The pitch roll yaw are all good for my liking but i know it has to be something i have to set in the PID to keep it stable, i also know ive seen a youtube video describing my same problem but for the life of me, i cant find it again and i dont want to start plugging in radium numbers in the GUI. I also thought maybe its something i have to change in the code and re-upload back to the board after compiling.. Any help would be greatly appreciated...

Stiefel,,

ummagawd
Posts: 21
Joined: Fri May 24, 2013 3:47 am

Re: Call for full PID settings tutorial!!

Post by ummagawd »

+1 on a PID tuning re-write.... or even better make a video. I've seen a few videos where they show the effects of the P and I... but no one who's made a video with all 3 (P, I, and D). Or one with alt, pos, posr, navr, etc...
I've read (and still continue to read) on different PID tuning approaches and even the way some folks describe things... such as "increase parameter until it "snaps back" etc..." poses a bit of variation as everyone's definition of it is different. So that's where a video would come into play, because i think most of us can agree on the way a multirotor is visually behaving.

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Call for full PID settings tutorial!!

Post by alll »

Hi there,

Is there currently (ver.2.2) a software update ongoing in the shared trunk for altitude-hold? The current v2.2 is not satisfying. When tuned to stay quite well at a certain altitude, when big external turbulence is applied (push it up or down by hand), it start to make large yoyo's.

manu

ezio wrote:I was looking for a quite some time to good tutorial for PID tuning for Alt Hold. And I haven't found one good enough. So this is my procedure to tune the Alt Hold based on my current knowledge.
-----
Explanation.
Baro sensor is used to detect the altitude. As baro sensor is not very precise and quite noisy, detection of small up and down movements is impossible.
So small up and down movements are detected by accelerometer. Combination of this two sensors gives good altitude hold.

PID settings for ALT works like this:

*P - means how much copter should relay on the baro sensor. Higher the value is, stronger the copter relays on the Baro reading.
*I - is used to compensate drift costed by battery voltage drop during the time. Higher the value is faster the copter will react to voltage drop ( or other factors ).
*D - means how strong the copter should react on data from the accelerator. It is used to react on small up and down movements. Higher the value is copter will react faster/stronger to the small altitude change.

Tuning:

We need to start from settings the Accelerometer.

1. So set the P and I to 0

2. Start to play with D value only. To high D may cause yoyo effect (up and down oscillations). With to low D copter will be not able to react strong/fast enough to hold altitude. Your goal here is to set D to the value when copter don't oscillate up and down and also holds altitude quite well for a not very long period of time. Copter will not hold altitude perfectly at this point during long periods. It will slowly drift up or down, but altitude should be quite stable in short periods.

3. Start to increase P to the point where copter holds altitude over long time period. If the value is to small the copter will drift slowly up and down. If the value is to high yoyo effect may appear. Goal here is to set it to the point where copter holds altitude for quite some time. Copter will still go slowly down due to battery voltage drop over time.

4. "I" is used to compensate the voltage drop. So start to increase the "I" value slowly until you get a perfect position hold during a very long time.
Now your altitude hold should be good enough.

I hope that this approach is correct. If you find a mistake let me know.
I will try to make tutorial like this for GPS soon.
Fly safe.
Bart

wobbletop
Posts: 9
Joined: Fri Jun 07, 2013 4:25 am

Re: Call for full PID settings tutorial!!

Post by wobbletop »

alll wrote:Tuning PID like : set I&D=0, increase P until wobble, reduce a bit, set D to reduce overshoot, finally add some I to keep steady state… is true for a « conventional/classic/standard » PID control loop :
http://en.wikipedia.org/wiki/PID_contro ... d_PID_form

Tuning pid values in multiwii is not that intuitive as we don’t really know how the PID control is implemented, unless you dig in the code.

IMO associating physical units to these PID values in the gui is confusing and sometimes difficult to remember not user friendly. On top, the PID value ranges and precision are quite different for P-I and D.
(eg P=0..20; I=0.00..0.30; D=0.000..0.250)

Could we not “hide” these physical values from the user-interface and only work in % (they can be documented). One would think in increasing / reducing PID values.
(eg P=0..100% (range 0..20), I=0..100% (range.0.00..0.30); D=0..100% (range=0.000..0.250)

manu


Are these ranges correct? I often see D being set to 20-25 (not 0.25).

Post Reply