Page 48 - Build Your Own Quadcopter_ Power Up Your Designs with the Parallax Elev-8
P. 48

Chapter 2: Quadcopter Flight Dynamics            27


                             P Block
                             The P or proportional block depends only upon the difference between the set point and the
                             process variable. The P block math equation is

                                                                 K e (t)
                                                                  p
                             where K is the block gain and e(t) is the error signal as a function of time. This is a simple
                                    p
                             linear system response. For example:
                                 Given that the error signal at time t  is 5 and K  is 10, then the output from this block is
                                                                      p
                                                             0
                                    50. You must be careful in setting the value for K . Too high a value will make the
                                                                           p
                                    system unstable and fall into an oscillation state that would be very bad for system
                                    operations. A procedure for setting  K along with the other block constants will
                                                                   p
                                    follow this section.
                             I Block
                             The I or integral block depends upon a summation of the error signal over time. The I block
                             math equation is
                                                                  t
                                                               K ∫ e (τ) dτ
                                                                i
                             where K  is the block gain and ∫ e (τ) dτ is an integral equation of the error signal as a function
                                                      t
                                    i
                             of time.
                                The integral equation is additive, which allows the output to steadily increase over time
                             unless the error signal is zero or there are compensating negative error values. The net effect
                             of the integral block is to drive the steady-state value to zero overall during a time period.
                             The nominal value for the I block gain is usually very small, which you might expect since
                             the term acts over a long time period.
                                There is one issue that arises with this block: the integral term could temporarily increase
                             to a level that saturates the plant block without driving the steady-state value toward zero.
                             This is called integral windup. Windup, while a potential issue, is not expected to happen in
                             the typical quadcopter control system that is discussed in this book.

                             D Block
                             The D or derivative block depends upon rapid increases in the process variable to drive the
                             error signal to zero. The D block math equation is

                                                               K de (t)/dt
                                                                d
                             where K is the block gain and de (t)/dt is a derivative equation of the error signal as a function
                                    d
                             of time.
                                This block gain must be chosen carefully to allow the system to respond to rapid process
                             changes, yet not to over respond to noise added to the feedback loop. The practical tradeoff
                             is to set a low value for the K  gain and a small derivative time Δt that approximates de(t)/dt.
                                                    d
                             Tuning
                             Tuning is the process of determining useful gain values to use with the PID algorithm. Two
                             methods will be discussed:

                                1.  Trial and Error Method
                                2.  Ziegler-Nichols Method
   43   44   45   46   47   48   49   50   51   52   53