HobbyKing.com New Products Flash Sale
Reply
Thread Tools
This thread is privately moderated by joebarteam, who may elect to delete unwanted replies.
Old Oct 13, 2011, 08:31 AM
J'ai remis la purée
Netherlands, ZH, Zoetermeer
Joined Mar 2011
196 Posts
Mini-HowTo
MegaPirate PId tuning

In this mini 'how to' I try to show how to tune the behavior of a MegaPirate multicopter. This 'how to' is based on the excellent OpenPilot instructions.

Because the MegaPirate is suitable for a wide selection of frames, controllers and multi sensor the defaults in the code needs to be tuned for your specific platform.

Most MegaPirate users, or (it's parent code) the ArduCopter users concentrate on the stable mode only. I tend to take another approach because of the nature of the PId loop.
First the inner loop or rate is used and when in stable the outer loop will kick in. In this picture you can see the structure.



Because of that, I like to tune the rate (acro mode) and make it as flyable and stable as possible. It will however not level, thats the stable mode.

Rate (acro) mode tuning
Rate will only use the gyro.
In the first step, concentrate solely on the rate 'P', 'P' is the rotation value to counter external rotation effects caused by influences like wind for example. The gyro will detect such rotations and feed the control loop.

High frequency oscillations will occur when 'P' is to high, if is feels to sluggish or it is not flyable at all (see vid) it is to low.

The rate 'I' value is normally not used, but as I explained, I like to tune the rate as good as possible so the next step is tuning the rate 'I'
The 'I' in rate is used for angle hold, if it is 0 or close to 0 the copter will never hold an angle and swing around it's axis. Increase the 'I' to a level that you feel comfortable with and the copter holds its angle.

Ok, an instruct able video; (open in hd full screen)

MegaPirate PID tuning - rate (acro) (3 min 20 sec)


Now that rate (acro mode) is actually flyable it will influence the stable mode PId as well. In general you can lower the 'P' because the Rate 'P' is now more prominent.

Stable mode tuning
Stable mode uses the Gyro and accelerometers. Accelerometers will detect the direction of the acceleration. With some coding the accelerometers can measure the angle and use it to level the copter.

In the stable mode again first concentrate on the 'P' value. 'P' is the power for the motor to achieve the angle. A to high 'P' will also introduce oscillations but in a different frequency than the rate 'P'.
A to low 'P' will not hold level.

I is the time needed to reach the maximum 'P'.
And ... if 'I' feels good, try to decent rapidly.
If it wobbles :
Further increasing 'I' will try to eliminate the vortex effect (strong wobble) when descending rapidly with quads.

(open in hd full screen)
MegaPirate PID tuning - stabilize mode (1 min 37 sec)


Be careful with tuning, keep it safe and keep lots of usable area round your multicopter.

If nothing helps getting the platform stable:
- Is the IMU (sensors) located in the center of gravity?
- Mounted on anti vibration isolation (gyro foam, rubber / silicone mounts)
- Experiment with different props, maybe a smaller prop diameter.
- Larger props = lower P, Smaller props = higher P.
- Vibrations: remove the props, speed up the motors and feel if any vibrations originate from the motors.
- Balance the props, motor bells and prop adapters.
joebarteam is online now Find More Posts by joebarteam
Last edited by joebarteam; Oct 14, 2011 at 01:46 PM.
Reply With Quote
Sign up now
to remove ads between posts
Old Oct 13, 2011, 08:31 AM
J'ai remis la purée
Netherlands, ZH, Zoetermeer
Joined Mar 2011
196 Posts
reserved
joebarteam is online now Find More Posts by joebarteam
Reply With Quote
Old Oct 14, 2011, 03:35 PM
Registered User
Joined Aug 2011
179 Posts
Fantastic!! Exactly what I was looking for to get me started on PID tuning including vids to actually show the behaviors and how they change - previously I was just changing them and not really knowing what the effect would be!

You sir deserve a pint of fine ale!

Cheers

ice.
icedfusion is offline Find More Posts by icedfusion
Reply With Quote
Old Oct 18, 2011, 07:07 PM
Registered User
Canada, ON, Toronto
Joined Jan 2008
455 Posts
Here here, I raise a pint and challenge others who agee to raise a pint as well,
Cheers and thank you from myself and Many others.
Paul and friends


Quote:
Originally Posted by icedfusion View Post
Fantastic!! Exactly what I was looking for to get me started on PID tuning including vids to actually show the behaviors and how they change - previously I was just changing them and not really knowing what the effect would be!

You sir deserve a pint of fine ale!

Cheers

ice.
dowlinger is offline Find More Posts by dowlinger
Reply With Quote
Old Oct 18, 2011, 07:08 PM
Registered User
Canada, ON, Toronto
Joined Jan 2008
455 Posts
Quote:
Originally Posted by joebarteam View Post
reserved
Smart move
dowlinger is offline Find More Posts by dowlinger
Reply With Quote
Old Nov 30, 2011, 03:28 PM
Registered User
Deutschland, HE, Kassel
Joined Sep 2005
139 Posts
@joebarteam - many thx for your post - that was I was looking for - hopefully I get more understanding after studying this

Jan
Jan F. is offline Find More Posts by Jan F.
Reply With Quote
Old Dec 09, 2011, 11:26 PM
Registered User
mewrongway's Avatar
United States, KS, Pratt
Joined Jan 2009
23 Posts
PID Tuning

Hello, joebarteam,

I now feel confident that I have my PID settings correct.
The video's are great!!

Many bottles of ale to you,
Darrell
mewrongway is offline Find More Posts by mewrongway
Reply With Quote
Old Dec 14, 2011, 01:02 PM
Registered User
Maxout's Avatar
United States, MI, Bridgeport Charter Township
Joined Feb 2006
30 Posts
Thanks joebarteam, this is also the information I was looking for. I have my custom frame all built and my Wii motion plus, arduino pro mini, and NK already to go, just waiting on motors and esc's. Great job!!
Maxout is offline Find More Posts by Maxout
Reply With Quote
Old Dec 21, 2011, 02:03 PM
Registered User
Canada, ON, Toronto
Joined Jan 2008
455 Posts
one of the banners that popped up on the site was
an idiots guide to PID tuning. ( not that we are idiots but )
Though it may also be useful forr a lot of us here

http://www.learnpidcontrol.com/learn...FQMDQAoddVOGnQ

Hope it helps someone
Paul
dowlinger is offline Find More Posts by dowlinger
Reply With Quote
Old Jan 03, 2012, 03:04 PM
Registered User
Joined May 2011
425 Posts
Also relevant
OpenPilot TV Episode 2: PID Tuning (36 min 51 sec)
peabody124 is offline Find More Posts by peabody124
Reply With Quote
Old Mar 14, 2012, 12:31 AM
Registered User
Hamburg, Germany
Joined Aug 2010
96 Posts
Problem

I hope you can help me. I installed on Black Vortex board the mega version 2.049. My quad not fly stable.
Did the P value of 0.3 and it's a bit better. I value and IMAX values ​​are still default.
I've replaced landing gear. Engines and propellers are balanced. The gas paths from the controllers are not programmed. Is this the problem?

Quadro problem (0 min 24 sec)


Sorry for my English.

Hope you can help me.

Regards
Georg
GF-Downloads is offline Find More Posts by GF-Downloads
Reply With Quote
Reply

Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion First Quad build and maiden complete. PID tuning help needed ScooterInVegas Multirotor Talk 8 Oct 09, 2011 09:16 PM
Discussion automatic PID loop tuning...? davidbuzz Multirotor Talk 19 Jan 25, 2011 05:14 AM
Question PID tuning question OBH Multirotor Talk 1 Apr 07, 2010 01:48 PM