Part 3 - PIDs: Complete ArduPilot Tuning Guide (ArduCopter)

Estimated read time: 1:20

    Learn to use AI like a Pro

    Get the latest AI workflows to boost your productivity and business performance, delivered weekly by expert consultants. Enjoy step-by-step guides, weekly Q&A sessions, and full access to our AI workflow archive.

    Canva Logo
    Claude AI Logo
    Google Gemini Logo
    HeyGen Logo
    Hugging Face Logo
    Microsoft Logo
    OpenAI Logo
    Zapier Logo
    Canva Logo
    Claude AI Logo
    Google Gemini Logo
    HeyGen Logo
    Hugging Face Logo
    Microsoft Logo
    OpenAI Logo
    Zapier Logo

    Summary

    In this segment of Chris Rosser's ArduPilot Tuning Guide, viewers delve into the intricacies of PID tuning specifically for the ArduCopter. The guide covers the setup of various PID controllers and progresses through a detailed manual tuning process, emphasizing a methodical approach over automatic tuning tools. The transcript provides a comprehensive explanation of PID theory, detailing components like proportional, integral, and derivative terms, their roles, and how to adjust them for optimal drone performance. Listeners are guided through practical steps for conducting tuning flights, analyzing data using Mission Planner, and incrementally adjusting PID settings to achieve an ideal flight response.

      Highlights

      • Explore detailed PID tuning methods for improved drone control. 🎮
      • Get insights into various PID terms and how they affect drone stability. 📚
      • Understand why manual tuning often outperforms auto-tuning features. 💡
      • Learn to analyze flight data for better tuning decisions. 📈
      • Discover tips for incremental PID adjustments to fine-tune drone performance. ⚙️

      Key Takeaways

      • Always opt for a methodical manual tuning approach over auto-tuning functionalities for optimal results. 🛠️
      • PID tuning involves understanding and adjusting proportional, integral, and derivative terms effectively. 📊
      • Properly tuned PIDs lead to improved flight performance in various drone modes like stabilize and loiter. 🚁
      • Each axis of the drone requires separate tuning for precision in performance. 🎯
      • Advanced tuning may involve derivative feed forward and PID filter tuning for larger drones. 🚀

      Overview

      In this detailed installment, Chris Rosser walks drone enthusiasts through the specifics of tuning PIDs in the ArduPilot software. He highlights the importance of manual tuning over automatic scripts, especially for larger, professional drones, to ensure optimal flight performance and safety.

        The video dives into the theory behind PID controllers, explaining in depth how the proportional, integral, and derivative terms work together. Rosser provides insights into how to adjust these terms based on flight logs to align the drone's actual movements with desired targets, which is crucial for seamless flight control.

          Practical advice is given on how to conduct effective tuning flights and how to utilize tools like Mission Planner to analyze flight data. The emphasis is on achieving a critically damped response where the PID balance is just right, ensuring the drone responds accurately and swiftly to commands.

            Chapters

            • 00:00 - 00:30: Introduction and Course Offer The chapter introduces a tuning course for RG Pilots, highlighting the availability of a comprehensive PDF guide. This document is accessible via Patreon and serves as a supplementary resource to aid in the tuning process. It is particularly beneficial for those working on larger drones for professional purposes. The convenience of having detailed terms and adjustment locations in a readily accessible format is emphasized.
            • 00:30 - 01:00: Course Overview The chapter titled 'Course Overview' introduces the RG pilot tuning course, highlighting its focus on tuning larger drones using sophisticated tools available in RG pilot. This video is the third installment in a series dedicated to a comprehensive guide on RG pilot tuning. Previously covered topics include initial RG pilot setup and tuning gyro filters to optimize flight performance. The current chapter shifts focus to the process of pit tuning, setting the stage for advanced drone tuning techniques.
            • 01:00 - 02:00: Introduction to PID Tuning The chapter introduces PID tuning, focusing on different PID controllers in RG pilot, their setup, and necessary components for tuning. It includes an overview of PID tuning theory, explaining the terms and how to adjust them based on logs. The chapter outlines a systematic tuning method, starting with rate PID controllers.
            • 02:00 - 03:00: Understanding PID Controllers in ArduPilot In this chapter, the focus is on understanding PID controllers in the context of ArduPilot. It is explained that ArduPilot uses a cascade of PID controllers to manage various aspects of drone flight, including position, velocity, acceleration, angle, and rate of rotation. The chapter suggests the necessity of correctly tuning each of these controllers to achieve optimal autonomous flight performance and outlines the approach of beginning with foundational elements and progressively building upwards.
            • 03:00 - 04:00: Manual PID Tuning vs Autotune The chapter discusses the necessity of tuning lower level controllers to achieve optimal performance in higher level controllers. It highlights the importance of manual PID tuning but also mentions the existence of RG pilot autotuning functions. While these autotuning scripts can provide reasonable PID values for rate and angle controllers, they are generally more suitable for hobby use on small drones. Large drones, which respond slower, may not benefit as much from these autotuning functions.
            • 04:00 - 05:00: Theory of PID Tuning The chapter titled 'Theory of PID Tuning' discusses the limitations of autotune in achieving optimal flight tunes. It emphasizes that manual tuning is superior due to the availability of more information and parameters in log files, which a human can interpret and adjust more effectively than an autotune system. Manual tuning is portrayed as providing better flight performance over autotuning, suggesting that a methodical manual approach leads to better tuning results.
            • 05:00 - 06:00: Proportional Term (P) in PID The chapter focuses on the Proportional Term (P) in the PID controller, specifically within the context of the rate pit controller. It highlights the importance of understanding the theoretical aspects of PID control to effectively adjust the parameters for achieving desired outcomes. The discussion begins with a schematic of the rate pit controller in RG pilot, including key inputs like the target rate of rotation.
            • 06:00 - 07:00: Derivative Term (D) in PID The chapter titled 'Derivative Term (D) in PID' discusses how a quadcopter is controlled by analyzing its rate of rotation around each axis. This involves two main inputs: the target rate of rotation and the actual rate of rotation. The target rate is determined either by pilot stick inputs in Acro mode or by the angle controller in other flight modes. Meanwhile, the actual rate is measured by the gyro in the IMU (Inertial Measurement Unit) on the flight controller, which provides feedback on the quadcopter's current rotation rate.
            • 07:00 - 08:00: Balancing P and D Terms This chapter discusses the PID control system used in balancing tasks, specifically focusing on the P (proportional) and D (derivative) terms within the system. The system uses the target and actual rotation rates as inputs. Different terms like feed forward and derivative feed forward are applied, which consider the time derivative of the target rotation rate. The PID error term is essential, calculated by subtracting the actual rate from the target rate to identify any discrepancies. This error is fed into the proportional term (P) and the integral term (I). The integral term takes into account the time integral of the PID error.
            • 08:00 - 09:00: Integral Term (I) in PID In this section, the focus is on the Integral (I) term in PID controllers used in quadcopters. The discussion highlights the presence of the derivative term, which computes the rate of change in rotation over time. Each of these PID terms (Proportional, Integral, and Derivative) is associated with specific gain values. These gain values are configured in autopilot software. The combined effect of these terms, when added together, provides a control output. This output is sent to the motor mixer, which adjusts the motors to properly command the quadcopter's rotation. When the PID terms are correctly balanced, they ensure the quadcopter rotates as needed.
            • 09:00 - 10:00: Feed Forward Term This chapter discusses the importance of precise tuning of the feed forward term in drone operation to ensure that the actual rate of rotation matches the target rate of rotation. It emphasizes that incorrect values can result in poor flight performance, highlighting the goal of methodically tuning the system to achieve optimal alignment between actual and target rotation rates.
            • 10:00 - 11:00: Derivative Feed Forward Term This chapter discusses the 'Derivative Feed Forward Term' in control systems, focusing on the behavior of each term, starting with the proportional term. The proportional term reacts to the 'pit error'—the difference between the target and actual rate of rotation—and scales its response accordingly. This scaling ensures that as the pit error increases, the proportional term exerts a stronger force to bring the rate back to its target, thereby reducing the error.
            • 11:00 - 12:00: Overview of PID Tuning Methodology The chapter provides an overview of PID tuning methodology, focusing on the Proportional (P) and Derivative (D) terms. The P term is compared to a spring in a suspension strut, aiming to minimize the error between the actual and target rate of rotation. As the error increases, the P term becomes larger, continuously working to reduce this discrepancy. The Derivative term, or D term, is introduced next, which aims to maintain a constant rate of rotation, counteracting any changes to keep the system stable.
            • 12:00 - 13:00: Step-by-Step Tuning Process The chapter explains the role of the derivative (D) term in the tuning process, emphasizing its function in slowing down the rate of change in rotation. The D term acts like a shock absorber, attempting to moderate how quickly a quadcopter or drone responds to input changes, thus stabilizing its movements.
            • 13:00 - 14:00: Analyzing Flight Data and Logs The chapter titled 'Analyzing Flight Data and Logs' focuses on the importance of achieving proper balance in the rate of rotation, akin to the balance in a suspension strut for a vehicle. It explains the significance of balancing the Proportional (P) term and the Derivative (D) term while avoiding excessive P term, which leads to bounce and oscillation, or excessive D term, which results in sluggish response. The goal is to achieve a critically damped response.
            • 14:00 - 17:00: Tuning Pitch and Roll Axes This chapter discusses how to achieve a smooth response when adjusting the pitch and roll axes of a drone. It compares the desired response to that of a well-balanced suspension strut. The chapter notes that while the default PD balance for the RG pilot can often work, it may sometimes have an overly strong P term, leading to oscillation. Therefore, it’s crucial to evaluate its effectiveness for a specific drone configuration. Additionally, the chapter promises to explore tuning the PD balance further along in the guide, emphasizing that finding the right P and D balance is the essential first step.
            • 17:00 - 18:00: Tuning Yaw Axis The chapter 'Tuning Yaw Axis' focuses on the intricacies of tuning a PID controller with a specific emphasis on the yaw axis. It starts by highlighting the importance of achieving an optimal pit tune for effective control. The core discussion revolves around PID tuning, particularly the integral term, which accumulates PID error over time and intensifies its response as the error persists. The chapter uses a diagram to illustrate how a small constant positive pit error can cause the integral term to push back increasingly over time, emphasizing the need for precise tuning to manage these dynamics effectively.
            • 18:00 - 19:00: Finalizing Rate PID Tuning In this chapter titled 'Finalizing Rate PID Tuning,' the discussion focuses on the behavior of the integral term in a PID controller when the error goes negative. It explains that the integral term continues to accumulate in the opposite direction to counteract the negative error, aiming to bring the error back to zero over time. Furthermore, it introduces the concept of a feed-forward term in ARG pilot, which operates as another proportional aspect, separate from the PID error, to aid in effectively managing the system's control.
            • 19:00 - 21:00: Introduction to Attitude Controllers The chapter discusses attitude controllers, focusing on how the feed forward term in the controller works. The feed forward term increases its push in the same direction as the target value, helping to overcome resistance. This capability is particularly important in the vertical velocity controller, especially when trying to move upwards with high vertical velocity to counteract gravity.
            • 21:00 - 25:00: Tuning Attitude Controllers This chapter delves into tuning attitude controllers, particularly focusing on the concept of feed forward terms in PID controllers. Feed forward terms are useful for compensating for resistance that increases with vertical velocity. They reduce the workload of the proportional (P) term by helping to overcome this resistance. Although not always necessary, feed forward terms can be particularly beneficial in specific PID controllers. The chapter also explains the role of derivative feed forward terms in ARG pilot PID controllers, which respond to the rate of change of the target by pushing in the target's direction.
            • 25:00 - 30:00: Setting Maximum Lean Angle The chapter titled 'Setting Maximum Lean Angle' explains the function of the derivative feed-forward term in a Proportional-Integral-Derivative (PID) controller, particularly within the context of an AR pilot. It illustrates how the derivative feed-forward helps the controller to react more quickly to changes in the target by reducing or eliminating delays between target and actual values. This quick reaction is essential in managing sudden changes in the target value, thus enhancing the controller's performance. The chapter concludes with an understanding of the theoretical foundation of PID terms used in AR pilot systems.
            • 30:00 - 32:00: Preparing for the Next Video The chapter titled 'Preparing for the Next Video' provides an overview of the pit tuning methodology. The tuning process is described in a specific order, starting with the derivative term, followed by the proportional term, then the integral term. The process concludes with the derivative feed forward term and the feed forward term. It is emphasized that tuning in this specific order is important due to the relationships between these terms, notably how the D term prevents oscillation in the P term, highlighting the importance of maintaining correct term ratios.
            • 32:00 - 34:00: Conclusion In the conclusion chapter, the focus is on explaining the relationship and interaction between the Proportional (P), Integral (I), and Derivative (D) terms in a control system. The text emphasizes the importance of balancing these components to prevent oscillations and ensure proper system tuning. The derivative feed forward term heavily relies on the correct value of the P term, and by carefully tuning the controller, particularly in the order of DP, DF, and FF, optimal performance can be achieved.

            Part 3 - PIDs: Complete ArduPilot Tuning Guide (ArduCopter) Transcription

            • 00:00 - 00:30 if you'd like to have access to my entire RG pilot tuning course in PDF format and that's not just the content in this video but the entire course then that PDF is available on my patreon and I'll put a link to that down in the video description it really is the perfect accompaniment this video series and it's nice to have it on the bench next to you while you're tuning so you can quickly refer to it to see what the terms are called that you need to adjust and where to find them if you're looking to tune larger drones for professional applications then you might also o want
            • 00:30 - 01:00 to consider my RG pilot tuning course and I'll put a link to that down in the video description as well that's going to cover tuning larger drones in more detail and using some of the more sophisticated Tools in RG pilot to achieve that hi there everyone and welcome back to the channel this video is the third part in my complete RG pilot tuning guide in the first two parts of this video series we've looked at setting up RG pilot for the first time and tuning the gyro filters for the best possible flight performance but now it's time to move on to pit tuning in this video we're going to be going
            • 01:00 - 01:30 through all the different pit controllers that are in RG pilot we're going to be looking at how they're set up and the different components that we're going to need to tune we're going to be going into a little bit of pit tuning Theory so that you understand what all the different terms do and how you should adjust them depending on what you see in the logs and then we're going to be going through a methodical tuning approach starting with the rate pit controllers and working our way up it's a lot to cover in this video so let's not waste any more time let's Dive Right into into it before we dive into the
            • 01:30 - 02:00 theory of pit tuning RG pilot I just want to give you some background on all of the different pit controllers that RG pilot has inside it RG pilot uses a Cascade of pit controllers to control the position the velocity the acceleration the angle and the rate of rotation of the Drone and to get good autonomous flight performance you need every single one of these pit controllers to be correctly tuned and so we're going to start at the bottom and work our way up and that's the way that
            • 02:00 - 02:30 we have to tune these things because you can't tune these high level controllers if the lower level controllers are not performing brilliantly before we dive into manual pit tuning I would be remiss if I didn't mention the RG pilot autotune functions now RG pilot has a couple of different autotuning scripts which try to find reasonable PID values for the rate and angle controllers in general these tools can produce suitable tunes for hobby use on small drones but they often struggle with larger drones drones that are slower to respond
            • 02:30 - 03:00 and they can produce suboptimal Tunes which in rare cases can be dangerously unflyable a methodical manual tuning approach is always going to give you a better result than what you can achieve with autotune you as a human have much more information available to you in the log file that helps guide the tune and you can also access more parameters adjust more parameters the autot tune doesn't touch which allows you to get a tune that gives you much better flight performance manual tuning and that methodical manual tun tuning approach is
            • 03:00 - 03:30 what we're going to cover in this guide before we dive into the methodical tuning approach for the rate pit controller which is the first one we're going to look at it's important to have a theoretical understanding of pit control an understanding of what all the different terms are within the pit controller and what they do so that we know how to adjust them to achieve the desired outcome the desired effect this diagram shows you a schematic of the rate pit controller in RG pilot on the left we have the two inputs the first is the Target rate of rotation this is um
            • 03:30 - 04:00 how fast the quad is being asked to rotate around each axis and that Target rate of rotation can come from the pilot stick inputs in Acro mode or more likely from the angle controller when you're flying in any of the other modes the second input is the actual rate of rotation and that comes from the gyro in the IMU on your flight controller this tells the quad how fast it's actually rotating around each of the axes so we
            • 04:00 - 04:30 have the Target and the actual rate of rotation these are fed into a number of different terms we have the feed forward term the derivative feed forward term which looks at the time derivative of the target rate of rotation and then we also have a PID error term which is calculated by subtracting the actual rate from the target rate to get an error and that is then fed into two terms a proportional term and an integral term the integral term looks at the time integral of pit error and then
            • 04:30 - 05:00 we also have a derivative term which is just the time derivative of the actual rate of rotation all of these terms are multiplied by different gains which we're going to set in the um AG pilot software and then they are all added together to give a commanded control output which is going to be fed into the motor mixer which will drive the motors and that will command the quad to um do the correct rotation if all of these terms are correctly balanced then the
            • 05:00 - 05:30 quad will um follow the target rate of rotation very very closely if any of these terms are incorrect they've got the value that's too high or too low then the actual rot of rotation won't follow the target rate of rotation very well and the Drone won't fly well so the whole purpose of the methodical pit chune is to get the actual rate of rotation to match the target rate of rotation as closely as possible by tuning the game of all of these
            • 05:30 - 06:00 different terms now that we've seen each of these terms in the schematic let's dive into how each of them behave starting with the proportional term the proportional term acts on pit error so the pit error is the difference between the Target and actual rate of rotation and it simply is a multiple of the pit error so the larger the pit error gets the harder the proportional term pushes back towards the target so if the pit error is positive then the proportional term will push to reduce that error and
            • 06:00 - 06:30 try and bring it down to zero the P term acts like the spring in a suspension strut the further away the actual rate of rotation is from the target rate of rotation the bigger the P term gets and it's always pushing to try and reduce that pit error the next term we're going to talk about is the derivative term and the derivative term wants the actual value of the rate of rotation to stay the same all the time so the derivative term the D term pushes back against any
            • 06:30 - 07:00 change in the actual rate of rotation so if the actual rate of rotation is increasing the D term pushes to try and slow the rate of that increase if the actual rate of rotation changes a lot then the D term becomes very large and it pushes back against that change the derivative term acts like the shock absorber in a suspension strut it's always looking to slow down how quickly the quad responds or the Drone responds to um any input and to keep that actual
            • 07:00 - 07:30 rate of rotation as low as possible just like in the suspension strut for a car or bike the balance between the spring the P term and the shock absorber the D term is very very important if you have too much P term then um everything's going to be too bouncy and too liable to oscillate if you have too much dterm everything is going to be very slow to respond with the correct balance of P term to D term you get what's called a critically damped response that gives
            • 07:30 - 08:00 you a very smooth response to changes in input just like a really nicely balanced suspension strut the RG pilot default PD balance is usually a suitable starting point but can often be a bit heavy on the P term and so prone to oscillate you're going to have to see how it Stacks up for your particular drone and we're going to be looking at how you tune that PD balance later in this guide the right balance between the P and D terms is the first step
            • 08:00 - 08:30 of a really good pit tune for a pit controller so getting that right is going to be the first thing that you're going to want to look at similar to the proportional term the integral term looks at the PID error but unlike the proportional term the integral term adds up the PID error over time and pushes back harder and harder the longer the error persists we can see in this diagram that we have a small constant positive pit error and the integral term is pushing back harder and harder and harder as that pit error builds up over
            • 08:30 - 09:00 time when the pit error goes negative the integral term doesn't stop pushing right away but instead it starts accumulating in the opposite direction which means that the integral term starts reducing down again obviously if this negative pit error was to continue for a long period of time we would expect to see the integral term build up in the opposite direction and again pushing back to try and reduce that pit error to zero the feed forward term in ARG pilot is another proportional term but rather than looking at the PID eror ER the feed forward term looks at the
            • 09:00 - 09:30 Target the larger the value of the target the harder the feed forward term pushes in the same direction as the target this feed forward term helps to overcome resistance that increases in proportion to the Target value there aren't that many situations where that's a an important and useful capability to have but one of them is in the vertical velocity controller if you're trying to move upwards with a high Vertical Velocity then gravity provides a
            • 09:30 - 10:00 resistance that increases in proportion to the vertical velocity that you're looking to achieve so in this case the feed forward term helps overcome that resistance and it reduces the amount of work that the P term has to do so you're not always going to need feed forward but there are certain pit controllers where it can be very very useful the derivative feed forward term in the ARG pilot pit controller looks at the rate at which the target is changing and it pushes in the direction that the target
            • 10:00 - 10:30 is changing in proportion to how fast the target is changing the main purpose of the derivative feed forward term is to allow the pit controller to react more quickly before pit error builds up and if you have derivative feed forward correctly set it can reduce or even eliminate the delay between changes in Target and actual values and that really helps the controller respond much more quickly to sudden changes in the Target now that you've seen the theory behind all of the terms in the AR pilot pit
            • 10:30 - 11:00 controller it's time to give you an overview of the pit tuning methodology we are going to be taking the tune in a certain order we're going to start with the derivative term move on to the proportional term then do the integral term before finishing off with the derivative feed forward term and finally the feed forward term the reason we're doing the tune in this order is that there are particular relationships between these terms that need to be respected the D term prevents the p term oscillating so there is a correct ratio
            • 11:00 - 11:30 between the P and D terms similarly the P term prevents the I term oscillating so there is a correct relationship between the p and I terms the derivative feed forward term depends on the value of particularly the P term and the correct feed forward value is um going to depend on how tightly the rest of the controller is tuned by tuning in the order DP DF f f
            • 11:30 - 12:00 FF we won't need to go back and adjust earlier terms based on what we do later in the tuning process so we have a one-way flow through the tuning methodology we start with the D term and move through sequentially all the way through to the feed forward term and once we've done that the tune is finished if you do the tune in any other order apart from this then you may find that you you change the P term and then you have to go back and adjust the D term um later on and you can get in a
            • 12:00 - 12:30 real muddle because there isn't a clear flow and things are dependent on each other so that's why we're going to be taking this approach going through the tuning process in order to get the best possible pit tune it's important to know how to do Pit tuning flights now pit tuning flights consist of sharp wobbles on all three axes and you're going to do the sharp moves by rapidly moving the stick back and forth and then bringing it quickly back to Center
            • 12:30 - 13:00 when you do these sharp moves make sure you keep hold of the stick as it comes back to Center if you just release the sticks and let them kind of bounce back to Center under their own spring action they can oscillate and bounce around the center and that can make the Drone oscillate which might make you think you have too much P gain when you actually don't you can do these sharp moves in stabilized mode I would suggest that that's the best or you could do it in altitude hold but if you're doing in altitude hold mode that does rely on the
            • 13:00 - 13:30 altitude controller being reasonably well tuned to begin with which it may not be if you're getting um any oscillations try switching to stabilize mode because that will take the altitude controller out of the equation and will allow you just to be looking at the rate and angle pit controllers so for a typical pit tuning flight you're just going to want to take off and hover in stabilized mode and then give the Drone small oscillations first on the roll axis
            • 13:30 - 14:00 then on the pitch axis and then finally on the your axis and just do that for maybe 10 to 20 seconds on each axis and then bring the Drone into land that's all you need to do for a pit tuning flight once you finished your test flight it's time to land and then download the log using Mission planner the way we did before and open the log file in RG pilot web tools PID review so
            • 14:00 - 14:30 you can do that by just going and clicking the choose file button selecting the log file that you downloaded with Mission planner and then loading it in check that the flight data graph which should appear immediately after you've loaded in the log looks correct that it kind of reflects what you did during the flight that there are no gaps or logging dropouts and that everything is working correctly once you've done that select the PID roll PID pitch or PID your graph to look at and I would move through them in order so start with R then move to pitch and
            • 14:30 - 15:00 finally Y when you scroll down to the time domain you'll see a graph that looks something like this and you can see that it's pretty much completely unreadable at the default zoom level you're going to want to zoom in on a part of the flight where you were wobbling the drone on the target axis the axis that you're looking at right now so let's say we're starting with the roll axis you're going to zoom into a part of the flight where you doing those sharp wobbles on the row axis once you've zoomed in to the right amount you should see a chart that looks something
            • 15:00 - 15:30 like this you should be able to see the Target in blue the actual in Orange and the error in green the goal is to get the actual to sit directly on top of the Target and that's what we're going to be trying to do as we go through our pit tuning process it is possible to tune PD balance and in fact to tune all the pids using only time series data and it's actually useful to learn how to do this because for some controllers like the throttle controller we will only ever have access access to time series data
            • 15:30 - 16:00 we're not going to be able to get step responses or anything like that because the tooling doesn't really exist for it so if you can learn to tune using just time series data that's great although we will also be using the step response as well when we're tuning PD balance based on time series data what we're going to be looking at is the relationship between the actual value and the target value we will find that without any derivative feed forward the actual value is always going to lag behind the Target value a little bit and
            • 16:00 - 16:30 that's okay that's normal that's what we want what we need to look at is the relationship between the actual Peak value and the target Peak value in the time series data to determine if we've got the right PD balance if you look at the um the waveform for the Target and the waveform for the actual and you see that the peak of the actual graph is bigger than the target graph that indicates that you have too much P term so your PD balance is too P term heavy so you need to reduce your P term or
            • 16:30 - 17:00 increase your D term if you have um a Target graph that is larger the peak is higher than in the actual graph like this one down here then that means that your PD balance is too dterm heavy your dterm is um too large and so that that's meaning that your actual movement of the Quad doesn't ever reach the same peak level as the target is requesting if you have the ideal PD balance what you'll see is that the target Peak and the
            • 17:00 - 17:30 actual Peak will be of exactly the same amplitude if you're seeing this so the actual is delayed a little bit from the target but that the peak value is the same then that means that your PD balance is exactly correct and that means you can move on to the next stage of tuning that access it's also possible to tune the PD balance using the step response and if you scroll down in ARG pilot PID riew you'll find the step response graph you'll see lots of uh faint gray lines and then one blue line
            • 17:30 - 18:00 which is the average of all the gray lines what we're looking for is to have the blue line rise as quickly as possible to the 1.0 level and then just continue straight flat from there if we look at this chart down here you can see that if we have a graph like this green line where we shoot way past 100% or 1.0 and then bounce up and down for a long time that indicates that we have too much P term if we look at a line like this purplish line here that kind of
            • 18:00 - 18:30 takes a long long time to gradually reach up to 1.0 that indicates that we've got too much D term and so we need to either increase P term or reduce D term if you have something that looks like the red line which is a rapid rise to 1.0 with without any overshoot then that indicates that your PD balance is correct and you have the right ratio of P term to D term so you can use a step response this is giving you exactly the same information as the time series data
            • 18:30 - 19:00 that we were looking at previously just in a different form some people find it easier but for different controllers on RG pilot you will eventually have to do some pit tuning using only the time series data so it's good to practice that if you can it's important to know when tuning the PD balance that it is the ratio between the P term and D term that is important not the individual values I would suggest only changing the P term while you're tuning the PD balance because that will keep things very simple and if you change the P term
            • 19:00 - 19:30 of course you're changing the ratio between the p and the D terms you can do this in Mission planner config extended tuning and you can just kind of move the P term up and down unless you have a completely symmetric drone the pitch and roll values are likely to be a bit different so you can probably unlock the pitch and roll values and then tune them individually um especially the more asymmetric your drone is on pitch and roll the more different the ideal p balance for pitch and roll is likely to
            • 19:30 - 20:00 be if during this process you find you are suffering from oscillations so the quad is kind of oscillating on one of the axes and you reduce the P term and the oscillations don't improve then this could be two things you might be experiencing dterm oscillation if your dains are too high then the D term can self oscillate independent of the P term and in that case reducing the P term doesn't help to fix this reduce both the D and P
            • 20:00 - 20:30 terms in steps of 10% so um divide the D and P term by 1.1 and see if the oscillations improve and if they do keep dividing the D term and P term together by 1.1 so you're keeping that ratio the same but you're reducing the values until the oscillations go away excessive filter delay can also cause oscillations now hopefully if you followed through my gyro filter tuning video you should not have excessive filter delay but if you
            • 20:30 - 21:00 haven't looked at the gyro filters yet you may want to go back and watch that video and make sure that you've got your gyro filtering as clean as it possibly can be and you've got the delay of the gyro filters as low as you can possibly get to avoid um oscillations due to excessive filter delay but that's another thing to check once you found the overall correct PD balance for the pitch and roll axes we're going to want to try and increase the overall PID gains to improve the
            • 21:00 - 21:30 responsiveness of the quad and reduce PID error we want to do this without changing the ratio between the P and D terms that we've already found and so the way that I would suggest you do this is to increase Pi I and D by the same multiple so to find the new P term multiply the old P term by 1.1 that's an increase of 10% for the I term again it's the old I term * 1.1 and the new D term will be the old D term * 1.1
            • 21:30 - 22:00 because we're multiplying all the values by the same multiple the ratio between P term and D term and the ratio between P term and I term won't change and that means that the um Step response of the Quad also shouldn't change we just increasing those pit gains tightening up the PID controller and reducing pit error whilst keeping that critical PD ratio exactly the same keep increasing p i and D using this rule by just multiplying by temp % until you start to
            • 22:00 - 22:30 see oscillations coming in the logs and that the quad will kind of feel very very tight and you will start to hear little sort of uh trilling oscillations particularly after sharp moves once you start to hear or start to see oscillations in the logs back the PD gains down by 10 or 20% what you're looking to find is the maximum value for the pi and D gains where you don't see any hint of oscillation at all and that's the ideal value you're going to need to adjust the roll and Pitch axes
            • 22:30 - 23:00 separately Because unless your quad is perfectly symmetric you will have a different maximum P andd gain for um the pitch and roll axes in many cases increasing the overall pit gains with the correct PD balance is going to give you a pretty drastic improvement in flight performance and hopefully this should tell you that you're on the right track with your tuning now that you found the overall maximum P and D gains for your quad it's time to look at the iterm now the iterm typically has a very
            • 23:00 - 23:30 wide tuning window so it is not always necessary to directly tune the item once you found the absolute pit gains the the magnitude of them that works really well however theoretically increasing the item can give Target tracking improvements because it means that that that item responds more quickly to um help reduce consistent errors between the Target and the actual value iterm be increased gradually in steps of 10 to
            • 23:30 - 24:00 20% until you see evidence of itemm oscillation in your logs and then you need to back it down again each axis is going to need to be adjusted separately and again unless you have a perfectly symmetric quad you may find there's a different maximum it term for the roll and Pitch axes tuning the your axis is a little different from tuning pitch and roll because the y axis typically has significant physical damping in the system um it's a lot less responsive
            • 24:00 - 24:30 than pitch and roll as a result and this means that we don't typically need a derivative term on the your axis for multicopters we're only going to be working with proportional and integral terms p and I terms this means that we only need to consider the pi balance and overall gains when we're tuning the your axis and the way to do this is again to increase the p and I gains together stepping up in steps of 10% keeping the ratio the same until you see oscillations and then
            • 24:30 - 25:00 backing the gains down 10 20% until you don't see oscillations anymore but the gains are as high as they can be and then once you've done that with both the P Andi gain together you can then if you want to attempt to increase the it term individually up a little bit more again looking for any oscillations in the logs you may find that you also want to reduce the your error filtering on the on the axes in order to improve the
            • 25:00 - 25:30 responsiveness of the your AIS now tuning the PID filters so the error derivative and Target filters is a more in-depth topic um I'm going to cover that in more detail in the AR pilot tuning course I'm going to link down in the video description um but in general for small quads you won't need to adjust those PID filters at this stage you should have a really excellent rate pit tune on your RG pilot drone and that tune is going to set you up with a really great foundation for tuning all
            • 25:30 - 26:00 of the higher level pit controllers hopefully you are already seeing a big Improvement in flight performance not just in Acro mode but also in stabilize loiter those higher level modes because they really do benefit from a really tight rate pit chune now we're going to look at the attitude controller so that we can get the Drone completely tuned in the stabilized mode increasing the absolute value of the pi and D gains will help make the quad more responsive and for smaller quads that's probably
            • 26:00 - 26:30 going to be all you need for much larger quads they are less responsive and they can really benefit from something called derivative feed forward which is another term in the pit controller that helps reduce delay now I'm not going to cover tuning derivative feed forward in this guide because as I said it's not really suitable for smaller hobby grade drones and it's a more sophisticated tuning topic that needs its own video because we also need to cover tuning the P ID filters in RG pilot as well at the same
            • 26:30 - 27:00 time and that's another big topic again it's not really necessary for hobby drones with prop sizes up to 8 in if you're interested in learning more about tuning derivative feed forward in ARG pilot and tuning the PID filters then check out the links down in the video description to learn more about my RG pilot tuning course where I am going to be going into that in much much more detail now let's talk about tuning the attitude controllers and the attitude controllers are simple proportional controllers that control the angle of
            • 27:00 - 27:30 the Drone relative to the ground for the pitch and roll axis and relative to North for the y axis the difference between desired and actual angle is multiplied by a factor to give a Target rate of rotation and that Target rate of rotation is passed through into the rate pit controller so to show that in a schematic we have the desired angle and the actual angle those are subtracted to give an angle error that's multiplied by the proportional term and that's the target rate of rotation that is passed
            • 27:30 - 28:00 into the RG pilot rate controller for pitch role and your respectively you can tune the P terms for these controllers in the config tab in Mission planner under extended tuning and you can see here stabilize roll stabilize pitch and stabilize your you'll have a p term if you increase the P term a larger value will give a more aggressive response to angle errors but if you make the value too large it will cause oscillation on
            • 28:00 - 28:30 the angle axis so again you're just want going to want to increase these P terms um just as high as you can until you start seeing a hint of oscillation and then back down 10 or 20% or so to ensure that you have a stable response of the Quad it's really useful to be able to look at logs while you're tuning the attitude controller pains and you can review the desired versus actual angles they are logged in the attitude section at and if you go into reviewer log
            • 28:30 - 29:00 emission planner it'll bring up this window if you search for the ATT section on the right hand side then then you can find the desired roll desired pitch desired your and the actual roll actual pitch actual your and that will allow you to look for any oscillations or overshoots that you might be able to see um in the logs that might indicate that your attitude P gain is too high again you're going to want to tune each axis separately unless you have a perfectly symmetric quad in which case the pitch and roll axes are likely to be the same
            • 29:00 - 29:30 you'll also see in the extended tuning tab that underneath the P terms you have Excel Maxes for roll pitch and Y in the stabilize mode and RG pilot provides these limits for the maximum rate of angular acceleration demanded by the attitude controller so if you have a very large difference between the desired angle and the actual angle um such that the P gain would produce a value larger than this Excel max value then ARG pilot limits to excel Max these
            • 29:30 - 30:00 Excel Max values should be set according to the capability of the Drone and calculating these values for larger drones is critical and it's covered in detail in my RG pilot tuning course so if you're looking to tune a a large drone then it's worth making sure that you cover that small drones like hobby drones up to like an 8 in prop size can safely disable these limits because um small drones can respond quickly enough that you're never going to see the uh P gain produce a desired acceleration that
            • 30:00 - 30:30 is larger than the Drone can deliver in normal flight to disable these values for small hobby drones only um you can set this uh value to zero so you just set Excel Max to zero that disables the limit don't do that for larger drones for larger drones um make sure you look through the the RG pilot tuning course and calculate the correct maximum value the final thing to look at with the stabilized controller is the maximum lean angle this is the maximum angle the RG pilot will allow the Drone to tilt
            • 30:30 - 31:00 over in stabilized mode and the maximum lean angle should usually be set to ensure that the Drone has plenty of thrust to maintain altitude and control even when it's at the maximum lean angle a good way to calculate this is to take the maximum lean angle as inverse cause of the weight of the Drone divided by 80% of the maximum thrust this means that the Drone can maintain altitude at the maximum lean angle using only a 80% of the maximum motor thrust and that's
            • 31:00 - 31:30 uh gives you 20% leftover for control you may find for drones with a high power to8 ratio High thrust to8 ratio that this equation may give very large angles of 45° or even more for most applications I would recommend a maximum angle of 30° is more than sufficient and larger values like 45 or more can be concerning for Pilots because it it is a bit shocking to see the Drone lean really right over in the sky um even if
            • 31:30 - 32:00 it is actually capable of maintaining altitude under those conditions once you've calculated or decided upon the maximum lean angle you just need to set it up in RG pilot and to do that you're going to go into the full parameter list in the config tab emission planner and look for the angle uncore Max setting um this angle underscore Max is the maximum angle allowed in almost and it's in Cent degrees so um 30° is 3,000 Cent deg you're also going to want to set pscore
            • 32:00 - 32:30 angle uncore Max that's the max angle allowed in position hold mode I would set that to zero and that's going to use the same value as you set in angle uncore Max for lore angle uncore Max that's the maximum pilot requested angle that's allowed in the loer mode now if you set it to zero that's going to use 2/3 of angle uncore Max and that will mean that the Drone will feel more sluggish in loer mode compared to stabilize and I don't recommend that I don't think that's a good flight
            • 32:30 - 33:00 experience for the pilot so I would generally recommend setting angle uncore Max to 3,000 Cent de that's 30° PSC angle Max to zero so the same as angle Max and L angle Max to 3,000 c° the same as angle Max and that will give a consistent flight feel in all the modes at this stage you should have a really excellent Acro or rate pit tune on your drone and the Drone should be well tuned in stabilized mode as well in the next part of this video series we're going to
            • 33:00 - 33:30 be looking at the throttle pit controller so that we can get a really responsive and precise tune in altitude hold mode and that the Drone can change altitude really quickly and accurately until that next part of the video please check out the links down in the video description to see the full RG pilot tuning guide in PDF format so not just the content in this video but all of the content in previous and future videos is currently available in PDF format and also check out the links to learn more about the ARG pilot tuning course which
            • 33:30 - 34:00 covers some of the more sophisticated topics that we haven't looked at in this video that are more appropriate for larger drones like feed forward tuning pit filter tuning and calculating maximum angular accelerations that's all I have for you in this video so until next time I wish you all very very happy flying [Music]
            • 34:00 - 34:30 [Music]