

Aug 28, 2013, 08:10 PM  
Joined Feb 2013
920 Posts

Try and search RCG to start, several posts on this and other forums, addressing this. Level is the accelerometers, don't forget to cal them in the GUI with the aircraft on a deadlevel surface, first off. "P" is the amount of corrective feedback. More will make it snap back to level with more force than lower numbers. If turned waaay too high, the corrective loop will oscillate, making the aircraft "shiver". Before you reach this value, the aircraft will become much too "stiff" for really fluid flight motion, stop here. Even with this value, the aircraft may still shiver occasionally with high incedent wind conditions. "I" is the integral or damping of this corrective loop. Raising this value will slow down the "seek a level condition" correction action. The stock MW value is almost always very close to correct, maybe 20% either way, max. "D" is the derivitive or rate of this loop. Amounts to an acceleration or "speed up" of the correction loop. Too high makes the aircraft "jumpy", or overly responsive to control inputs. It feels "too hot", if this is high. The stock MW values are usually too high for anything but flyweight sport aircraft. FWIW on my 4.2 lb/585mm quad with big props I run, P=12, I=0.12, D=43 on the level loop.

Aug 29, 2013, 05:35 PM  
United States, ID, Moyie Springs
Joined May 2004
1,724 Posts

Electro 2, I'm sorry, but your explanation of the I & D terms is wrong.
The best place to start for learning to tune MulitWii is the Wiki: http://www.multiwii.com/wiki/index.php?title=Main_Page The explanations aren't always the best, but it's a start. The effect of the classical PID terms is relative to the 'position error'. The position error is the difference between where the multirotor 'is' and where it should 'be'. That difference can be because a change has been commanded, or because some other force has moved the multirotor away from its static (current commanded) position. The units of E (for error) can be anything: degrees, inches, meters, or whatever. The P term is a corrective force to reduce E directly proportional to the value of E. The P value we set is a multiplier. The greater the error, the greater the corrective force. This is usually easy to understand. Because the P force reduces as the error goes to zero, P alone will not reduce the error to zero. If the P value is increased to get the error to zero, the velocity of the correction will cause the system to overshoot. To get the error to zero, the I term is needed. Contrary to what many think, the I term does not slow down the correction. The corrective force from the I term is in the SAME DIRECTION as the P term. The I term is the timeintegral of the error. The longer the error persists, the larger the I term grows. As the error goes to zero, the P term also goes to zero, and if the P term is small enough not to cause overshoot, it results in a small, but constant, error. As the error persists, the I term will slowly grow to add enough force to overcome the resistance (friction, if you will) to push the system to an error value of zero. Too large a value of the P and I terms will cause overshoot and oscillation. The D term is proportional to the derivative of the error value. It is important to understand that the force applied by the D term is OPPOSITE of the force from the P and I terms. The D force tends to INCREASE as the error goes to zero. The D force acts as a brake to reduce overshoot. If the D term is too large, the resulting force will actually 'repell' the system from reaching a zero position error. This can also cause oscillation. To better understand the D term, consider that the system is a large 'distance' away for the commanded position (large error value) and moving towards the goal at a constant velocity. (This is a simplification, or course, because the velocity won't be constant.) Let's say that it's 100 units away and moving at 5 units/unit time: the derivative is about 0.05 (5%), or quite small. If the error is 10 units and the velocity is 5, then the derivative is about 0.5 (50%), or much larger. If the corrective velocity is nonzero, the derivative of the error will go to infinity as the error approaches zero. When the system is 'well' tuned, the P term will push towards the goal reducing the error, the I term will grow slowly to give the last 'push' to overcome any resistance, and the D term will act as a brake allowing the P & I terms to be increased, giving faster error correction, without overshoot or oscillation. Ideally, the force from all three terms will reduce to zero just as the error goes to zero. When tuning the Baro PID's, refer to the Wiki because they ARE NOT classical PID's. Nick 
Aug 30, 2013, 04:55 PM  
United States, ID, Moyie Springs
Joined May 2004
1,724 Posts

While I would change some of the explanations in the MultiWii Wiki for the pitch/roll/yaw/level PID's, the tuning sequence is consistent with my understanding and explanation.
The MultiWii Baro mode PID's are not classical in function. I'm not going to claim any expertise in tuning them because I still can't work them out for myself very well. I can get my quadrotor to maintain a stable altitude good enough when in a stable hover. But, when moving horizontally, my quadrotor tends to decend slowly until horizontal movement stops and then it 'zoom's' back up to the set altitude. If I'm flying high enough, above 20m, it's not so noticeable. The explanation in the MultiWii Wiki was, I believe, written by the guy that developed the code. Nick 
Aug 31, 2013, 04:55 AM  
Belgium, Flemish Region, Geel
Joined Jun 2013
329 Posts

All the above is a good explanation for acro (roll/pitch) PIDs. There is a lot of info out there on that subject and I I pretty much understand that part, and I think I got that tuned fairly well.
What I (still) dont understand is the interaction with level PIDs (and Pos, PosR, and all the others really). Increasing acro PID seems to cause level mode to behave completely differently. IN my case, I significantly increased both P and I values for acro, and the result was that in level mode, it reacted far more sluggish and unstable. In acro all is well, considerably better than before the tuning. What little info I can find on level PID suggests I should further decrease level PID to keep the sum of both PI values constant. My brief experiments suggests that only makes it even worse. I cant test any further ATM due to a crash, but would love someone explaining this part, as well as the other PID values for multiwii. 
Aug 31, 2013, 07:41 PM  
Joined Feb 2013
920 Posts

FWIW, I set both functions independently. Since many flight modes depend on another being correct prior, one is building a house of cards. Gyros (rateofroll) first, accels, (level) second. Then, onward to automated flight modes MH, AH, GPS PH, and lastly, RTH. I never used any "magic" formulas involving sums and differences.

Thread Tools  
Similar Threads  
Category  Thread  Thread Starter  Forum  Replies  Last Post 
Discussion  PID settings for multiwii and areosky  jasonsdad  Multirotor Talk  1  Aug 23, 2013 02:26 AM 
Discussion  Rcexplorer 2.5 multiwii megapirate PID settings  Brenno  Scratchbuilt Multirotors  0  Jun 28, 2013 05:48 PM 
Discussion  turnigy talon tricopter  multiwii pro , what are you're PID settings ?  dubzn1  Multirotor Talk  0  Apr 24, 2013 06:33 AM 
MiniReview  Multiwii RTH works, even using default settings/PID for everything  tecdux  Multirotor Talk  2  Feb 20, 2013 07:39 AM 