Thread Tools
This thread is privately moderated by joebarteam, who may elect to delete unwanted replies.
Old Oct 13, 2011, 09:31 AM
joebarteam is offline
Find More Posts by joebarteam
J'ai remis la purée
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.
Last edited by joebarteam; Oct 14, 2011 at 02:46 PM.
Sign up now
to remove ads between posts
Old Oct 13, 2011, 09:31 AM
joebarteam is offline
Find More Posts by joebarteam
J'ai remis la purée
reserved
Old Oct 14, 2011, 04:35 PM
icedfusion is offline
Find More Posts by icedfusion
Registered User
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.
Old Oct 18, 2011, 08:07 PM
autobotix is offline
Find More Posts by autobotix
Registered User
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.
Old Oct 18, 2011, 08:08 PM
autobotix is offline
Find More Posts by autobotix
Registered User
Quote:
Originally Posted by joebarteam View Post
reserved
Smart move
Old Nov 30, 2011, 04:28 PM
Jan F. is offline
Find More Posts by Jan F.
Registered User
@joebarteam - many thx for your post - that was I was looking for - hopefully I get more understanding after studying this

Jan
Old Dec 10, 2011, 12:26 AM
mewrongway is offline
Find More Posts by mewrongway
Registered User
mewrongway's Avatar

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
Old Dec 14, 2011, 02:02 PM
Maxout is offline
Find More Posts by Maxout
Registered User
Maxout's Avatar
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!!
Old Dec 21, 2011, 03:03 PM
autobotix is offline
Find More Posts by autobotix
Registered User
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
Old Jan 03, 2012, 04:04 PM
peabody124 is offline
Find More Posts by peabody124
Registered User
Also relevant
OpenPilot TV Episode 2: PID Tuning (36 min 51 sec)
Old Mar 14, 2012, 01:31 AM
GF-Downloads is offline
Find More Posts by GF-Downloads
Registered User

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
Old Dec 25, 2014, 08:45 PM
fredylg is offline
Find More Posts by fredylg
Registered User
Quote:
Originally Posted by GF-Downloads View Post
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?

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

Sorry for my English.

Hope you can help me.

Regards
Georg
Im not an expert but I would say your P is too high, mine used to behave like that and is now way better with a p of 2.1

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 10:16 PM
Discussion automatic PID loop tuning...? davidbuzz Multirotor Talk 19 Jan 25, 2011 06:14 AM
Question PID tuning question OBH Multirotor Talk 1 Apr 07, 2010 02:48 PM