RC India

RC Models => Multirotors => Topic started by: Dharmik on April 16, 2012, 04:47:40 PM



Title: TUTORIAL - MultiRotors PI tuning by KapteinKUK
Post by: Dharmik on April 16, 2012, 04:47:40 PM
This video originally posted by KapteinKUK so all credit goes to him. This is really nice tutorial to tune your gyro pots and really useful if you have recent kk firmware flashed. Proper tuning makes your multirotor rock stable.

PID tuning theory and configuration guide for MultiRotorCraft

Proportional-Integral-Derivative

When the MultiRotor orientation is changed in any pitch/roll/yaw axis, the gyros indicate an angular change from it's initial position.
The MultiRotor controller records the original position and by utilising a "PID" program loop, drives the motors to attempts to return the MultiRotor to its initial position.
This is done my a combination of the measured angular deviation, sampling the change over time and predicting the future position. This provides enough information for the controller to drive the motors to return equilibrium.

P is the dominant part of PID and gets you in the ballpark for good flight characteristics.


Basic PID Tuning - on the ground

Set PID to the designers default recommended settings
Hold the MulitiRotor securely and safely in the air
Increase throttle to the hover point where it starts to feel light
Try to lean the MultiRotor down onto each motor axis
You should feel a reaction against your pressure for each axis.
Change P until it is difficult to move against the reaction. Without stabilisation you will feel it allow you to move over a period of time. That is OK
Now try rocking the MultiRotor. Increase P until it starts to oscillate and then reduce a touch.
Rrepeat for Yaw Axis.

Your settings should now be suitable for flight tuning.


Advanced Tuning - understanding impact of P, I and D

P - this is the amount of corrective force applied to return the MultiRotor back to its initial position.
The amount of force is proportional to a combination of the the deviation from initial position minus any command to change direction from the controller input.
A higher P value will create a stronger force to resist any attempts to change it's position.
If the P value is too high, on the return to initial position, it will overshoot and then opposite force is needed to compensate. This creates an oscillating effect until stability is eventually reached or in severe cases becomes completely destabilised.

Increasing value for P:
It will become more solid/stable until P is too high where it starts to oscillate and loose control
You will notice a very strong resistive force to any attempts to move the MultiRotor

Decreasing value for P:
It will start to drift in control until P is too low when it becomes very unstable.
Will be less resistive to any attempts to change orientation

Aerobatic flight: Requires a slightly higher P
Gentle smooth flight: requires a slightly lower lower P


I - term - this is the time period for which the angular change is sampled and averaged.
The amount of force applied to return to initial position gets is increased the longer the deviation exists until a maximum force value is reached
A higher I will increase the heading hold capability

Increasing value for I:
Increase the ability to hold overall initial position and reduce drift, but also increase the delay in returning to initial position
Will also decrease the importance of P.

Decreasing value for I:
Will improve reaction to changes, but increase drift and reduce ability to hold position
Will also increase the importance of P.

Aerobatic flight: Requires a slightly lower I
Gentle smooth flight: Requires a slightly higher I


D - this is the speed at which the MultiRotor is returned to its original position.
A higher D (as it is negative value this means a lower number - i.e. closer to zero) will mean the MultiRotor wil snap back to its initial position very quickly

Increasing value for D: (remember, that means a LOWER number as it is a negative value)
Improves the speed at which deviations are recovered
With fast recovery speed comes a higher probability of overshooting and oscillations
Will also increase the effect of P

Decreasing value for D: (remember, that means a HIGHER number as it is a negative value - i.e. further from zero)
Reduces the oscillations when returning any deviations to their initial position
Recovery to initial position becomes slower
Will also decrease the effect of P

Aerobatic flight: Increase D (remember, that means a LOWER number as it is a negative value - i.e. closer to zero)
Gentle smooth flight: Decrease D (remember, that means a HIGHER number as it is a negative value - i.e. further from zero)


Advanced Tuning - practical implementation

(at this moment - these are proposals only!)

For Aerobatic flying:
Increase value for P until oscillations start, then back of slightly
Change value for I until until hover drift is unacceptable, then increase slightly
Increase value for D (remember, that means a LOWER number as it is a negative value - i.e. closer to zero) until recovery from dramatic control changes results in unacceptable recovery oscillations
P may now have to be reduced slightly

For stable flying (RC):
Increase value for P until oscillations start, then back of slightly
Change value for I until recovery from deviations is unacceptable, then increase slightly
Decrease value for D (remember, that means a HIGHER number as it is a negative value - i.e. further from zero) until recovery from dramatic control changes becomes too slow. Then Increase D slightly (remember - lower number!)
P may now have to be reduced slightly


For stable flying ( AP / FPV):
Increase value for P until oscillations start, then back of slightly
Change value for I until recovery from deviations is unacceptable, then increase slightly
Decrease value for D (remember, that means a HIGHER number as it is a negative value - i.e. further from zero) until recovery from dramatic control changes becomes too slow. Then Increase D slightly (remember - lower number!)
P may now have to be reduced slightly

You will have to accept a compromise of optimal settings for stable hover and your typical mode of flying. Obviously factor it towards your most common style.


Other factors affecting PID
Taking known good PID values from an identical configuration will get you close, but bear in mind no two MultiRotors will have the same flying characteristics and the following items will have an impact on actual PID values:

Frame weight /size / material / stiffness
Motors - power / torque /momentum
Position - Motor-->motor distance
ESC / TX - power curves
Prop - diameter / pitch / material
BALANCING
Pilot skills

References
http://en.wikipedia.org/wiki/PID_controller


http://www.youtube.com/watch?v=YNzqTGEl2xQ


Title: Re: TUTORIAL - MultiRotors PI tuning by KapteinKUK
Post by: satyagupta on April 16, 2012, 06:07:35 PM
BTW PI?? what does P and I means??

Yaw, Pitch or Roll?? what do we need to adjust ?? any idea?


Title: Re: TUTORIAL - MultiRotors PI tuning by KapteinKUK
Post by: Swapnil on April 17, 2012, 12:24:58 PM
'P' stands for proportional and 'I' stands for integral. PI is a method used in stabilizing control systems. It's quite easy to understand and is frequently used in line follower robots.


Title: Re: TUTORIAL - MultiRotors PI tuning by KapteinKUK
Post by: Dharmik on April 17, 2012, 01:28:18 PM
Swapnil is correct. I have edited my first post with PID theory information that i found somewhere. Please have a look at that.


Title: Re: TUTORIAL - MultiRotors PI tuning by KapteinKUK
Post by: satyagupta on April 17, 2012, 06:06:58 PM
Great stuff Dharmik thanks for sharing :)