Setting up gyro gain can make or break a model. Understanding how to set it up can be slightly confusing at first because comprehending the proportional integral derivative (PID) loop that controls your gyro can be overwhelming for new pilots.
Elaborating on my August 2014 column in which I interviewed Gary Wright about flybarless gyros, avid Model Aviation reader, David Buxton, shared with me an excellent report on his own findings. David decided to get to the bottom of how to set PIDs and this is what he found.
I wrote this article from an RC helicopter pilot’s perspective, but I included information and insights that can be used by airplane pilots, multirotor pilots, and anyone else who might be interested in electronic stabilization. My mechanical illustrations make the PID formulas more intuitive and easier to visualize.
Our model helicopters formerly used a mechanically stabilizing flybar system, along with a tail gyro that offered a choice of rate mode or heading hold. Modelers turned up the gain until the tail wagged then turned it down. That was pretty much all we could do. PID was something most of us had never heard about.
Today’s flybarless gyro systems eliminate the mechanical flybar system. They also offer more control parameters to enjoy, which helps considerably if we understand what each adjustment can accomplish.
PID for Helicopters
The following diagram illustrates where the PID calculations are located in the stability loop for tail control.
The receiver electronics identify where the tail should be. This is compared with where the gyro sensors calculate the actual position to be. The difference is the error input to the PID formulas. The PID output determines how far to rotate the servo arm and the pitch of the tail rotor changes accordingly.
Before computers and electronics were invented, there were PID systems that used mechanical components. PID stabilization showed up in hundreds of industrial applications. Perhaps the first of these was developed to accurately autopilot ships across the ocean.
PID becomes easier to visualize and understand when illustrated with old-style mechanical components. It’s time to replace the proportional integral derivative definitions of mathematical calculus with simple mechanical illustrations. Imagine strapping your helicopter’s skids to a Lazy Susan turntable so it can freely spin. Power it up and watch it spin. The pirouette can be stopped using mechanically illustrated PID components.
Start by attaching a spring to the helicopter’s tail. Spring tension and length will perform as a proportional element. The harder we pull a spring, the longer it gets and it pulls back with equally increasing intensity.
Derivative (D) acts as a dampener that resists change. Slowly pull the piston and it offers little resistance. Give it a jerk and it vigorously fights back. The resistance to change is proportional to how fast you try to make the change. In our mechanical example, increasing D gain is accomplished by thickening the fluid or reducing the size of the hole in the piston.
Combining P and D
Proportional (P) and D use a spring with a piston dampener. A rate-mode gyro uses PD stabilization. Increasing D gain reduces P oscillation. Stability is increased at the expense of agility. A truck suspension uses much more P and D for a stiffer ride.
Some stabilization systems do not provide a D-gain adjustment. The electronic stabilization does not need any D because there is sufficient dampening from the load and there may be a fixed amount of D gain. Load behavior is often resistive, similar to a sanding block on wood. Air-resistance dampening is velocity squared.
A motor-driven worm drive is illustrative of the Integral (I) process, which is a dynamically adjusted trim that zeros the error. Motor speed is proportional to the error. The change in offset slows to zero when the error is reduced to zero. I gain introduces accuracy to a control system, which P and D cannot accomplish (e.g., ships crossing the ocean under autopilot control can maintain heading accuracy to a fraction of a degree).
Governors, such as those for helicopters, use the I process to maintain head speed as the battery is discharged during flight. The I process slowly increases the throttle so the average head speed does not decline.
The following waveforms are based on a simple simulation using PID formulas and a “perfect” load. The first waveform only turns on some P gain. The blue trace represents a step in target value. Turn on the P gain, with no damping, and the oscillation continues forever. D gain has a dampening effect and I gain slowly trims the waveform average so that the red waveform closes on the blue step waveform. I gain can make a P-gain problem look worse.
The PID values at the left of each waveform are relative and otherwise mean nothing.
The integral process is constantly trying to reduce the error to zero. Think worm drive, with the illustrated motor slowly dithering back and forth in response to small amounts of error. For your model helicopter, factor in some linkage slop, servo resolution, control rod flexing, and plenty of opportunities for tiny amounts of binding along the control path. The integral process is constantly trying to resolve that mess, which can alternately bind and slip. Tail wag becomes noticeable with too much I gain.
Some helicopter pilots obsess (for good reason) about getting the tail mechanics as silky smooth as possible so they can benefit from a higher I-gain setting.
The manufacturers of heli stabilization systems typically provide wizards that use PID settings in proportions that work best for a selection of helicopter sizes. Mechanical linkage ratios are part of the overall gyro gain formula.
Increase the mechanical gain, for example, and you need to turn down the electronic gain. Start by turning up a master gain until tail oscillation, and then back off. That may be all you need to do. Often, you can follow up by fine-tuning the PID and other adjustments. Tweak and test each adjustment one at a time.
My wife told me that a batch of sugar cookies could be made by using only sugar, flour, and butter. PID for helicopters is similar, but the best cookies and the best flybarless systems put more ingredients into the recipe, such as pitch pump and precompensation. It is fun figuring how this stuff works.
You will probably agree that the mechanical illustrations for P, I, and D have provided a useful and intuitive feel for how PID systems work. When you notice an opportunity for helicopter performance improvement, you should now know which adjustment to try first. Many of you use flybarless systems that don’t utilize PID terminology. Your improved understanding of PID will help you translate.
It’s time to go have some more heli fun!
Thanks, David, for sharing this information with our readers.