REU Bi-Weekly Report - University of Cincinnati · Web view(PID/ Fuzzy logic control systems,...
Transcript of REU Bi-Weekly Report - University of Cincinnati · Web view(PID/ Fuzzy logic control systems,...
Abstract
The main goal of this research project is to enhance decision making of a controller using fuzzy
logic to adapt to various dynamic changes in an environment. More specifically, it will allow the
controller system to emulate human reasoning. This topic is related to the NAE Grand Challenge of
Reverse Engineering the Brain. To accomplish this goal, an inverted pendulum model will be
developed as a benchmark control platform. The model will be used to test and compare a Fuzzy
Logic based PID controller with a conventional PID controller. The Fuzzy PID controller for the
pendulum model will then be adapted to stabilize a multi-rotor aircraft. The particular advantage of
using a Fuzzy system is that it streamlines the design process by simplifying if-then rules for action-
reaction scenarios to a more general field. This would allow for a high level of controllability with
minimal effort on the part of the human pilot, due to the inherit autonomy gained through enhanced
performance in the dynamic environmental changes.
2
Table of Contents
Abstract…………………………………………………………………………………………………..2
1. Introduction…………………………………………………………………………………………...4
1.1 Introduction to Multi-Rotor Control………………………………………………………..4
1.2 Introduction to Fuzzy Logic………………………………………………………………...4
1.3 Objective Goals……………………………………………………………………………..
62. Inverted Pendulum Problem…………………………………………………………………………..
62.1 Inverted Pendulum Model (IPM) Development…………………………………………….
62.2 Creating a PID Controller…………………………………………………………………...
72.3 Creating a Fuzzy PID Controller……………………………………………………………
9 2.3.1 Pendulum Angle Fuzzy PID Inference System………………………………………
11 2.3.2 Cart Position Fuzzy PID Inference System………………………………………….
132.4 Performance Envelope Testing Constraints……………………………………………….
142.5 Dual PID Performance Envelope…………………………………………………………..
152.6 Dual Fuzzy PID Performance Envelope…………………………………………………...
172.7 PID vs. Fuzzy PID ………………………………………………………………………….
193. Dynamic Quad-Rotor Model…………………………………………………………………………
203.1 Dynamic Quad-Rotor Model Overview……………………………………………………
20
3
3.2 Dual Fuzzy PID Structure…………………………………………………………………..
213.3 Single Fuzzy PID Structure…………………………………………………………………
233.4 PID vs. Single Fuzzy PID Step Response………………………………………………….
263.5 PID vs. Single Fuzzy PID Flight Data……………………………………………………..
28
4. Discussion…………………………………………………………………………………………….
295. Conclusions…………………………………………………………………………………………...
326. Acknowledgements…………………………………………………………………………………...
337. References…………………………………………………………………………………………….
33 8. Nomenclature…………………………………………………………………………………………
349. Appendicies...........................................................................................................................................
34
4
1. Introduction
1.1 Introduction to Multi-Rotor Control
The multi-rotor copter is a versatile flight platform growing ever more popular in many fields due
to its low cost and utility. However, the multi-rotor aircraft is inherently unstable and extremely
hard to control without an onboard stabilization process. Using a previously developed quad-
rotor simulation, a Fuzzy PID controller was designed and tested. The flight mechanics of a
quad-rotor are straightforward and relate directly to the principle rotational axes of pitch, role,
and yaw of which can be considered independently. This will allow for a simple yet robust
controller that can be easily adapted to more complex platforms, such as a hex-copter or octo-
copter.
1.2 Introduction to Fuzzy Logic
Conventional computer based intelligence systems typically entail very specific boolean logic
principles in order to intelligently control a system. This boolean logic operates under the
principle of highs or lows, through logic gates to create a reaction, thus they contain rigid if-then
rule bases. Fuzzy logic is a different take on this type of control or intelligence system, which is
based on a more human description of the world. Fuzzy logic uses if-then statements that use
what are known as linguistic variables to describe system states. (Mendel 1995) These linguistic
variables a are human descriptors of a situation such as, the room is very hot, or somewhat cold,
versus the room is 75 or 10 degrees. This interpretation allows for a more generalized
development of logical systems, utilizing a ramped mapping of inputs to outputs according to
different functions, weights, and interpolation. The entire process of mapping the inputs to
outputs occurs in what is known as a Fuzzy Inference System (FIS), which works by utilizing
four basic components: fuzzification, the fuzzy rule base, fuzzy inference, and defuzzification, as
depicted below. (Bih 2006)
5
Figure 1. Fuzzy Process Diagram.
i. Fuzzification
This is the process of collecting crisp input data and evaluating it in relation to
membership functions, where the amount of truth (or degree of membership) to each
membership is analyzed (i.e. 1.77m might be 75% tall, and 25% not tall) – this is known
as a fuzzy set. (Bih 2006)
ii. Fuzzy Rule Base
This process takes the newly developed fuzzy set and analyzes it across if-then rules
where logical operators (AND, OR, NOT, etc.) can be used. All rules that have any
membership (regardless of amount) that is greater than zero will be evaluated. (Bih 2006)
iii. Fuzzy Inference
Once the rules are evaluated, the resulting output is then mapped to the appropriate
defuzzification membership functions, where it will be converted into crisp data (i.e. if
temperature is hot, then cooling is activated). (Bih 2006)
6
iv. Defuzzification
Defuzzification takes the fuzzy output data from the inference portion, and weights the
defuzzification membership functions according to the initial degree of membership for
that type of response. There, the output can be chosen as a crisp value by evaluating the
new weighted data in a variety of ways. Typically the centroid of the resulting, weighted
defuzzification membership functions is used. (Bih 2006)
2.
1.3 Objective Goals
In order to accomplish the autonomous flight and stabilization of a multi-rotor aircraft, the
following goals have been laid out:
1. Perform a Literature review. (PID/ Fuzzy logic control systems, MATLAB Fuzzy Logic
Toolbox)
2. Model an inverted pendulum.
3. Obtain or Create a PID controller to be used for the benchmark pendulum model.
4. Create a Fuzzy PID controller for the pendulum model.
5. Use the Fuzzy PID pendulum controller to develop a Fuzzy PID controller for a multi-
rotor aircraft.
6. Learn how to effectively compile a technical paper, poster and presentation.
7. Develop team collaboration.
8. Learn the basics behind technical research.
2. Inverted Pendulum Problem
2.1 Inverted Pendulum Model (IPM) Development
The first step in modeling most dynamic systems is to begin with the equations of motion that
govern their behavior. From these equations, a model is developed using the Simulink toolbox in
7
MATLAB. Equations (1) and (2) below describe the nonlinear system for an IPM with θ being
the pendulum angle and x being the horizontal displacement of the cart. The equations describe a
single input multiple outputs (SIMO) system that is normally unstable about a reference angle, θ
= π radians counterclockwise from the negative y-axis. A force input will create an angle
movement and a cart displacement as the reaction outputs.
Figure 2. Inverted Pendulum Diagram
( I+ml2 ) θ+mglsin (θ )=−ml xcos (θ) (1)
(M +m ) x+b x+ml θ cos (θ )−ml θ2sin (θ )=F (2)
2.2 Creating a PID Controller
A PID controller works by evaluating the error present in the feedback from a system. More
specifically, the controller evaluates three specific error terms; proportional, integral, and
derivative. The proportional term is the current system error, the integral is the summation of the
errors up to that point, and the derivative term refers to the rate of change of error. These three
terms are then weighted based on the system constraints in order to provide the optimal control
8
input. (Araki 2006) Multiplying each of the three terms by a gain results in the desired weights.
This type of controller can be powerful in providing accurate and quick action responses when
well-tuned. For this reason, the PID controller is the accepted convention for many feedback
control systems and is the chosen benchmark for comparison with the Fuzzy PID controller.
The two primary structures for a PID controller are the parallel PID and the ideal PID. The
parallel PID configuration splits the error signal into its proportional, integral, and derivative
terms then simultaneously applies the gains to the three terms before summing them into a single
output signal. On the other hand, the ideal PID applies the integral and derivative gains and sums
them with the original error term. Once these three terms are summed together, the entire signal
is multiplied by a proportional gain before feeding back into the system.
The graph in Figure 3 demonstrates the system’s response to a single step input using a single
custom built ideal PID controller. The controller is accounting for the error in θ and tracking the
cart velocity to match the needed force magnitude. However, the cart never returns to the
reference position once the system reaches a steady state. Two reasons for this type of response
are, the PID controller is only correcting the error between θ and its reference, and there is no
consideration taken for the cart’s reference position. The cart will simply move to any position
that makes θ steady. The addition of a second PID controller, that takes into account the error
between current position and cart origin, remedied the condition.
9
Figure 3. Single PID Impulse Response
The introduction of a cart position PID controller in series after the pendulum PID controller
improved the cart position response without significantly diminishing θ response. While this
setup was a tremendous improvement over the single PID, it did not solve the problem of the cart
settling position. Analysis of signal data throughout the dual PID system revealed that once θ
settled to steady state the signal entering the cart position PID diminished to zero. With a near
zero error signal entering the position PID, the controller could not output an error correction
because there was no signal to amplify. It was being tricked into thinking the position was steady
because the error input was close to zero. By relocating the position PID before the angle PID, the
system would work to keep the pendulum stable while returning the cart to the reference position.
This setup did not allow for the signal to diminish until both the cart and angle were stable. This
became the final configuration for the PID control of the inverted pendulum model.
10
Figure 4. Dual PID Impulse Response
2.3 Creating a Fuzzy PID Controller
Upon completing the PID controller, a Fuzzy Inference System (FIS) was developed to allow for
the dynamic modification of the gains in a PID controller. The conventional PID is a set in stone
method that is limited to constant gains that may or may not be ideal for each system condition.
Dynamically modifying the PID gains allows for a greater performance envelope and additional
resilience to noise and/or small system modifications. To create a Fuzzy PID controller, the
generalized effects of each gain was researched, and thus fuzzy logic rules were developed to
tailor these gains to their best value for a particular error range (or rate of change of error range).
The table used for the generalized fuzzy rule base is listed below:
Table 1. Effects of the Independent Tuning of Each Gain Coefficient. (Ang,Chong,&Li,2005)
Closed Loop Response Rise Time Overshoot Settling
TimeSteady-State
Error Stability
Increasing P Decrease Increase Small Increase Decrease Degrade
Increasing I Small Decrease Increase Increase Large
Decrease Degrade
Increasing D Small Decrease Decrease Decrease Minor
Change Improve
Implementing fuzzy logic into the IPM controller system required two separate FISs. Each FIS
was developed with different rule bases and membership functions that represented the
appropriate reaction needed for the cart position and the pendulum angle. The goal was to allow
for the necessary generality in the systems to modify gains (Proportional, Integral, and
Derivative) based on current system conditions. This was done by taking the values of the tuned
PID controller and allowing them to vary by ±10% according to the fuzzy rule base. The fuzzy
rule base was optimized to obtain the best result given the current system state based on gain
11
reactions in Table 1. Once the fuzzy rule base was completed the FIS was placed into the ideal
PID controller prior to the gains. The architecture of the Fuzzy PID controller can be seen below
in Figure 5.
Figure 5. Fuzzy PID (Ideal) Controller Architecture
2.3.1 Pendulum Angle Fuzzy PID Inference System
The pendulum angle (θ) was the sole input for this particular FIS, and allowed for a
total range of input (universe of discourse) of -1.57 to 1.57 radians. This range was
split between the five possible membership functions seen in Figure 6 which included
overlap. The overlap between the memberships allowed a maximum of two function
weights to be applied at any given point based on which rules were firing at the time
of the calculation.
12
Figure 6. Pendulum Angle Input Fuzzy Logic Membership Function
Upon evaluation of the signal input through the FIS, the deffuzzification process
entailed three output fuzzy sets to be converted to crisp values (the gains). Figure 7
depicts the deffuzzification membership functions used in this process.
Figure 7. Pendulum Angle Output Proportional, Integral and Derivative Gain Membership Functions
13
The actual mapping of the input and output of any FIS is based on the fuzzy rule base.
Large numbers of trials were run in conjunction with the general trends and rules from
Table 1 to yield the final rule base. These results are shown in Tables 2 & 3. It should
also be noted that when creating the rule base in the inference process, all rules carried
the exact same weight.
Table 2. Pendulum Angle Fuzzy Rule Base
Pendulum Angle Fuzzy Rule Base
Pendulum Angle DeviationLarge
PositiveSmall
Positive Stable Small Negative
Large Negative
Proportional Gain Large Moderate Moderate Moderate Large
Integral Gain Small Small Moderate Small Small
Derivative Gain Small Small Moderate Small Small
Table 3. Cart Position Fuzzy Rule Base
Cart Position Fuzzy Rule Base
Cart Position DeviationSmall Positive Stable Small Negative
Proportional Gain Moderate Moderate Moderate
14
Integral Gain Small Large Small
Derivative Gain Small Large Small
2.3.2 Cart Position Fuzzy PID Inference System
Similar to the Fuzzy PID controller used for θ, the cart position FIS was configured in
the exact same manner; taking a single input for cart position x, and setting the
proportional, integral, and derivative gains according to a fuzzy rule base. The cart
position input membership functions that were used can be seen below in Figure 8.
Figure 8. Cart Position Input Fuzzy Logic Membership Function
15
Figure 9. Cart Position Output Proportional, Integral and Derivative Gain Membership Functions
2.4 Performance Envelope Testing Constraints
The performance envelope tests contained very specific constraints for which a MATLAB script
was written to analyze the results of each simulation run. The simulations were set to run for a
maximum of 50 seconds. A “stabilization” was defined as the time it takes the system to get
within the determined “bounds” and stay within those “bounds” for the remainder of the
simulation such that the time staying within the “bounds” was at least 20% of the simulation time.
The “bounds” for the test were a half degree deviation and a half meter deviation (from the
centered values). Additionally, the controller systems used were bounded for a maximum output
correction to the IPM of ±5 units. It should be noted that, the constraints place on the position
deviation were deliberately enlarged to allow for an emphasis on the pendulum angle
stabilization.
16
2.5 Dual PID Performance Envelope
Once completed, extensive testing was conducted on the performance of the PID controller with
the pendulum model. To form a performance envelope, it was decided to vary the initial
conditions for both pendulum angle (θ) and cart position. Upon changing the initial conditions,
the pendulum/cart system was evaluated for its performance in terms of settling time and whether
or not the system settled within a desired threshold. To extensively test small increments to form
a high resolution image of the envelope, a script was created to automatically run 50 data trials
varying the initial position from -10 meters to 10 meters and 50 trials varying the pendulum’s
initial angle deviation from –pi/2 radians to pi/2 radians, yielding a total of 2,500 trials. The
results of the performance envelopes from this script are displayed below as a series of color
maps denoting the actual stabilization time of each degree of freedom within the system.
Figure 10. PID Performance Envelope (No Noise)
After the initial envelope test of the PID control (Figure 10), an additional test was conducted to
simulate harsh sensor noise in a real world system (Figure 11). The chosen value for the sensor
noise was a ±10% deviation from the input signal for both the position and the angle
measurements coming out of the pendulum model itself and going into the respective PID
17
controllers. This is a drastic case of noise, but it describes how the system behaves (and breaks
down) given large amounts of noise.
Figure 11. PID Performance Envelope (Sensor Noise)
Finally, another test was conducted with no sensor noise but instead included an eternal force
noise (Figure 12). That is, the system simulated a ±10% deviation from the output of the PID
controller and then fed this noisy data into the force input of the system. These deviations were
held constant for two seconds, giving the behavior of external force inputs, such as wind.
Figure 12. PID Performance Envelope (Force Noise)
2.6 Dual Fuzzy PID Performance Envelope
18
Similar to the PID controller, a comprehensive test was also conducted on the Fuzzy PID
controller varying the same initial conditions of the angle from –pi/2 radians to pi/2 radians and
the position from -10 meters to 10 meters, all in increments of 50 trials, yielding the 2,500 tests.
The resulting performance envelope is shown below.
Figure 13. Fuzzy PID Performance Envelope (No Noise)
The Fuzzy PID controller was also subjected to the ±10% deviation of the input signal to simulate
harsh sensor noise in the system from the cart position and pendulum angle. It should be noted
that these random signals were actually pseudo-random and used the same seed and generator as
in the PID test case, and thus resulted in the same noisy data changes. The results are depicted
below in Figure 14.
Figure 14. Fuzzy PID Performance Envelope (Sensor Noise)
19
Lastly, the Fuzzy PID was also subjected to a ±10% force noise input between the Fuzzy PID and
the actual pendulum model itself to simulate external force influences. This system also utilized
the same seed and pseudo-random number generation methods as in the PID version of the test,
causing the deviation signal to be multiplied by the actual PID output to be the same. The
resulting contour plots can be seen below in Figure 15.
Figure 15. Fuzzy PID Performance Envelope (Force Noise)
2.7 PID vs Fuzzy PID
With the above performance envelopes established, data was collected to observe the overall
difference in their performance from a numerical standpoint. Below is a table that depicts the
average stabilization times from each of the envelope tests. In the far right column, the difference
between each noisy case and the no noise case was taken. They were then averaged to obtain the
resulting average change in stabilization time from the no noise test. The final row in the table
depicts the percent change when going from the PID to the Fuzzy PID in average stabilization
time. It should also be noted that even though some responses from the envelope tests are quite
long, all situations where the system “stabilized” within the established constraints were kept.
Table 4: Settling Time Comparison
Settling Time
20
No Noise Sensor Noise Force NoiseAverage change in settling time
with Noise
PID 2.91 s 8.07 s 3.08 s 2.66 s
Fuzzy PID 4.79 s 4.82 s 4.81 s 0.03 s
Fuzzy PID compared to PID +64% -40% +56%
In addition to evaluating stabilization times, the actual sizes of the performance envelopes were
also compared in the following table. The value used to represent the size of an envelope was a
summation of the number of trials where the system stabilized within the established constraints
out of the 2,500 possible trials. The final row then depicts the percent change in the data point
representative area when going from the PID system to the Fuzzy PID system.
Table 5: Performance Envelope Comparison
Performance Envelope
No Noise Sensor Noise Force Noise
PID 204 pts 172 pts 232 pts
Fuzzy PID 312 pts 274 pts 334 pts
Fuzzy PID compared to
PID+53% +59% +44%
3. Dynamic Quad-Rotor Model (QRM)
3.1 Dynamic Quad-Rotor Model Overview
The Quad-Rotor Model (QRM) used in this project was a result of previous REU research teams
who developed and validated it using flight data recording, Cipher, and Conduit. This model
utilizes a dual PID control system similar to the inverted pendulum model. However, unlike the
21
IPM, the Quad-Rotor Model (QRM) responds to the error in the angular velocity (P) and the
angular displacement or attitude (φ). Initial ventures into implementing a Fuzzy PID into the
QRM consisted of simply using the pendulum anglefuzzy PID to control φ for the QRM. The
resulting response was less than desirable. Further inspection of the original PID controllers
implemented in the QRM revealed a difference in architecture between the two controllers. The
IPM controller is an ideal PID, while the original QRM utilizes a parallel PID. The difference in
these two structures is the magnitude of influence that the proportional gain has on the response
signal. In the ideal PID, the integral and derivative signals are processed and summed prior to the
proportional gain. This provides the proportional gain an overwhelming influence over the
control signal. In the parallel PID controller, the signals are all processed and summed in parallel
resulting in smaller influence of the proportional gain. The FIS for the pendulum angle controller
provided a response that bore a slight resemblance of the desired signal pattern once restructured
into a parallel architecture.
3.2 Dual Fuzzy PID Structure
As a starting point for design of a new FIS, the input membership functions were built to increase
precision of the response as φ of the system approaches the region deemed as stable, while
providing broad ranges around the edges of the input range. It can be shown below in Figure 16
that the input membership function for φ, has a specific set of ranges from large, to small, to
stable. This allows for a smaller increment of change in response creating a smoother reaction as
the φ of the model approaches a stable state. On the other hand, the controller accounting for the
error in P has a very specific response around its stable region with large broad regions outside of
stable. These broad ranges around the edge of the input allow prolonged steady responses at
extreme φ to return the system to a stable state.
22
Figure 16. Input Membership Functions for the Dual Fuzzy PID in QRM
The output range of the membership functions were initially centered on the tuned PID gain
values for both the P and 𝛗 control. The membership functions of each output variable were
designed to match the input membership functions with five functions for the 𝛗 controller and
three sets for the P controller. The rule base required for this system was found to be very
cumbersome to build and not overly effective at controlling the model. This FIS was quickly
replaced with one of a far less complex nature. The resulting output membership functions are
relatively simplistic involving only three fuzzy sets for each variable for the 𝛗 and P controllers
Figure 17 and 18. It was found that by maintaining simple output membership functions, a
simplistic rule base could be used without degradation in response.
23
Figure 17. Output Membership Functions for the Attitude (φ) Controller in QRM
Figure 18. Output Membership Functions for Angular Velocity (P) Controller in QRM
3.3 Single Fuzzy PID Structure
The second Fuzzy PID structure implemented into the QRM was simplified into a single FIS
which was a multiple input multiple output (MIMO) system. This was employed to cut out the
calculations that go along with having two different fuzzy controllers. Additionally,
consolidating both inputs into a single FIS allows for better system awareness because the rules
24
can be tailored to react to both the attitude and the angular velocity at the same time. Figure 19
depicts the input membership functions used for this FIS.
Figure 19. Input Membership Functions for the Single Fuzzy PID
The FIS structure that was created also added a 4 th output to the system which determined if there
was a need for extra proportional gain for quick responses. The FIS took in information about φ
and the magnitude of P. Say for example φ is negative and P is making the angle more negative,
the proportional gain will be high and the 4th output will scale up the φ error to create a stronger
response. Shown below in Figure 20 is the output membership function in which this FIS used,
including the 4th output mentioned.
25
Figure 20 Output Membership Functions for the Single Fuzzy PID Controller
This setup is incredibly effective for rapid responses to larger error signals and gives the
controller more adaptability to any situation that falls in between extreme and stable conditions.
Figure 21 shows the diagram for the entire controller.
Figure 21. Single Fuzzy PID Controller Diagram
Since this new controller has such a different architecture to that of the previous Fuzzy PID
outlined in this document, the fuzzy rule base had to be adapted to take full advantage of both
26
inputs as well as the additional output in order to maximize the performance. Thus the following
rule base was created and tested for a good response which will be outlined in the following
section.
Table 6. Single Fuzzy PID Rule Base (MIMO)
Single Fuzzy PID Rule BaseInput Output
Angle Angular Velocity P I D Angular P
- Negative Large Off Small Moderate- Stable Moderate Off Large Moderate- Positive Large Off Small Moderate
Negative - - On - ModeratePositive - - On - ModerateNegative Negative - - - HighNegative Positive - - - LowPositive Positive - - - HighPositive Negative - - - LowStable - - Off - Low
3.4 PID vs. Single Fuzzy PID Step Response
Step response data is the most common way to test controllers and their respective response
parameters. Parameters such as rise time, settling time, overshoot, peak and steady state final
value are important system characteristics that determine the effectiveness of the controller. In
order to confirm the performance of the QRM Single Fuzzy PID vs. the PID, it had to be run
through an array of response comparisons. Originally the model was being run strictly with
recorded flight data, which represented the percent stick deviation input by the pilot (this data
will be analyzed in section 3.5). In order to first quantify the performance difference of the
Single Fuzzy PID vs. the PID before worrying about the QRM response, the step data was
analyzed. Figure 22 and Figure 23 show that the Single Fuzzy PID has the ability to diminish
oscillations and produce smoother response curves compared to the PID for a simulated 20% user
step input. The settling time of the Single Fuzzy φ response was slightly reduced from 8.13
27
seconds to 8.04 seconds while oscillations were damped around steady state. A very similar
reaction was also seen in P (Figure 23). As seen in Table 7, the rise time was tightened up by
0.08% compared to the PID which is a marginal amount, but still an improvement. The
overshoot and peak values were also increased which is indicative of a more responsive
controller. The last parameter to observe is the steady state final value. The fuzzy controller’s
final attitude value was 8.38% larger than the PID which is expected around the stable range
since the rule base optimizes the gain behaviors in this region.
The results seen below using the Single Fuzzy PID setup are very promising for its real world
implementation. The controller has an overall smoother response curve to the 20% step input
while still achieving similar if not better settling times which was the ultimate goal of the Fuzzy
PID setup. These key characteristics are all products of the active gain updating feature included
in the FIS.
Figure 22. Attitude Response to 20% User Inputted Step Function
(left: Dual PID Right: Single Fuzzy PID)
28
Figure 23. Angular Velocity Response to 20% User Inputted Step Function
(left: Dual PID Right: Single Fuzzy PID)
Table 7. Step Response Comparison Data for the Attitude Step Response
Quad Model Roll (Phi) Step Response ComparisonRise Time Settling Time Settling Min Overshoot Peak Peak Time
Dual PID 0.084286 s 8.130 s 6.570 deg 170.469% 18.898 deg 1.440 sSingle Fuzzy PID 0.084216 s 8.036 s 7.121 deg 184.355% 20.248 deg 1.480 s
Change from PID to Fuzzy PID -0.08% -1.15% 8.38% 8.15% 7.14% 2.78%
3.5 PID vs. Single Fuzzy PID Flight Data
The Single Fuzzy PID proved itself when subjected to the common step response test, but how
does it perform when subjected to real time flight data? This is the real test that will prove or
disprove the smooth response claims made in previous sections. The data used was a 10 second
excerpt that was provided by past REU participants during the development the QRM simulation.
The section of data was validated in both the frequency and time domain to ensure that it was
“good” data. It consisted of three different user inputted peaks that represent a roll right, left, and
right again. These peaks range from 60% to -60% stick deviations. Figure 24 shows the
comparison of the Single Fuzzy PID vs. the Dual PID controller’s φ response to the flight data.
Three magnified pictures provide a better visual of the differences between the Fuzzy PID and
29
PID responses. The trends are very consistent with the results from the step response in section
3.4. Parameters to note are, decreased settling time, fewer oscillations, and quicker overall
response time. These results confirm that the Single Fuzzy PID is able to handle noise anomalies
as well as large user inputs in a manner that would be suitable for implementation on an actual
quad-rotor system.
Figure 24. Step Response Comparison Data for the Attitude Step Response
30
4. Discussion
In order to evaluate the impact of the addition of a Fuzzy Inference System to a PID controller,
both models outlined in this document must be looked at. First, the results and findings of the
Dual Fuzzy PID vs. PID implemented into the pendulum model will be discussed. This data will
then be compared to the Single Fuzzy PID vs. PID in the Quad model. This should provide a
more complete understanding of the capabilities of the Fuzzy PID in comparison to the PID.
When considering the results of the IPM envelope tests conducted on the PID and the Fuzzy PID,
a few different aspects must be observed. One prominent aspect in a control system is the settling
time in any given situation. In the previously listed performance envelopes, it can be observed
that in what would be considered ideal conditions, the PID proved to have a faster overall settling
time than the Fuzzy PID. This held true for force noise testing as well, however, didn’t hold up
when subject to sensor noise; the Fuzzy PID had a substantially shorter average settling time than
the PID in this test. The other facet of these tests though, is the actual range that the averages
span over. For instance, the PID lacked the overall consistency in settling time when subjected to
the different external factors, such as the sensor noise and the force inputs, resulting in the 2.66
second average settling time change across the tests, whereas the Fuzzy PID was extremely
consistent across all the tests, having only a 0.03 second average settling time change. Another
key aspect to consider is the actual size of the performance envelopes, which were conducted on
the basis of the number of counted trials that were considered settled. In the envelope tests, the
Fuzzy PID yielded a consistently larger (at least 44%) performance envelope over the PID. This
is a direct result of the Fuzzy PID controller’s ability to actively change the Proportional, Integral,
and Derivative gains depending on the current state of the system. In these tests, it is interesting
to also note that the Fuzzy PID was varying these gains by up to 10% from that of the original
tuned PID, yet it yielded an average of a 52% larger performance envelope from the three
31
envelope tests conducted. Together, these results suggest that while the Fuzzy PID can have a
slower overall response in ideal conditions, it’s much more resilient and consistent in different
circumstances while allowing for a larger performance envelope. This would be expected, as the
tuned PID is optimized for a small solution space for ideal conditions while the Fuzzy PID strives
on small amounts of generalization around this solution space.
After obtaining good results with the Inverted Pendulum Model (IPM) tests, similar ideologies
were used in the development of the QRM Fuzzy PID controller. However, as noted in section 3
of this document, the finalized Fuzzy PID for comparison with the original PID consisted of a
unique structure containing a single Fuzzy Inference System (FIS) and an additional proportional
gain, differing drastically in overall architecture (see Figure 21). The results show that this new
Single Fuzzy PID controller (in a step response) was indeed able to settle 1.15% quicker, with
less overall oscillations than that of the tuned Dual PID system. This is again highly attributed to
ability of the FIS to adapt the gains with regards to the current system state. However, why was
the settling time quicker than the Dual PID, which is different than that of the IPM version? This
is likely attributed to the increase in contextual awareness that this new FIS has, as it takes in both
the roll attitude (𝛗) and roll rate (P). This is also why it can be shown that the Single Fuzzy PID
actually has a 0.08% faster rise time, and that the overall peak of the response is smoother, as
indicated by the 2.78% longer peak time. Lastly, it must be noted that the Single Fuzzy PID was
able to achieve an 8.38% higher settling minimum value, indicating a larger range of operating
motion when placed in an actual Quad-Rotor. The most significant fall back of the Single Fuzzy
PID lies in the overall increased overshoot (8.15% more frequent/present). These results also
carry over into the QRM with flight data, as shown in Figure 24, where the results are actually a
bit more noticeable than in the step responses. This behavior is highly consistent with that of the
IPM results, which concluded that a PID breaks down in performance once heavy, high frequency
32
noise is introduced, whereas the Fuzzy PID was extremely resilient to this type of situation. This
is why the QRM with real flight data reflects the exaggerated difference in performance. Thus if
this Single Fuzzy PID were to be placed on an actual Quad-Rotor, the performance difference
between it and the PID would be expected to increase, with the Single Fuzzy PID staying
consistent, and the PID degrading. This will likely result in a much more stable aircraft in harsher
conditions, and an overall more consistent performance. It is also speculated that the Single
Fuzzy PID may be able to handle small system changes, such as in an increase in mass, due to the
active gain updating, however, this is not yet confirmed.
With all the aforementioned results in mind, a series of follow-up tests would be highly beneficial
in verifying/understanding the full extent of the Fuzzy PID’s capabilities and performance. The
first test would be in modifying the capabilities of the system to be more or less rigorous such as
more powerful motors, efficient propellers or quicker controller processing. These various
attributes would be able to verify a consistent performance of similar system types, but with
different mechanics or capabilities. The next test would be to modify the system’s state, such as
the mass or the moments of inertia, in order to investigate whether or not the Fuzzy PID is able to
handle these changes better than the PID could handle without modification. If this were the
case, the Fuzzy PID has an extremely bright future in an adaptive/autonomous system, which is
the end-goal of such a controller. This is also a speculated result that would be expected to be
observed, but again, would need verification.
5. Conclusions
When it comes to stabilizing a multi-rotor aircraft, the PID controller has remained a very popular
and proven solution. However, the tests outlined in this document show that the PID controller
33
can be greatly improved upon by implementing a Fuzzy Inference System (FIS) to adaptively
update/modify the Proportional, Integral, and Derivative gains. The results indicate that a system
can become more stable overall with a consistent, faster response and a larger performance
envelope over a similar, PID controller. This is extremely beneficial in virtually any application
of such a multi-rotor aircraft, particularly when it comes to autonomous control, as it implements
some human reasoning into the stabilization controller to further abstract any autonomous
controller from the physics or changing environment at hand, as well as noise or other external
forces, while providing the best performance.
6. Acknowledgements
This material is based upon work supported by the National Science Foundation under Grant No.
DUE 0756921. Any opinions, findings, and conclusions or recommendations expressed in this
material are those of the author(s) and do not necessarily reflect the views of the National Science
Foundation.
7. References
Ang, K. H., Chong, G. C., & Li, Y. (2005). PID control system. IEEETransactionsonControl
Systems, 559-576.
Araki, M. (2006). PID Control in Control Systems, Robotics and Automation, vol II. In Encyclopedia
ofLifeSupportSystems(EOLSS).
Bih, J. (2006). Paradigm shift - An introduction of fuzzy logic. Potentials,IEEE,25(1), 6-21.
Mendel, J. (1995, Mar). Fuzzy logic systems for engineering: a tutorial. ProceedingsoftheIEEE,
83(3), 345-377.
34
Michigan, R. o. (Ed.). (96, 8 30). ModelingofanInvertedPendulum. Retrieved 6 19, 2014, from
Control Tutorials for Matlab:
http://www.ee.usyd.edu.au/tutorials_online/matlab/examples/pend/invpen.html
Razzaghi, K. (2011, 11 01). A New Approach on Stabilization Control of an Inverted Pendulum,
Using PID Controller. Advancedmaterialsresearch, pp. 403-408.
8. Nomenclature
b = Friction forceF = Input force
g = Gravity constantI = Moment of InertiaL = Pendulum rod lengthm = Pendulum mass
M = Cart massx = Cart displacementθ = Pendulum angleφ = Quad-rotor Attitude anglep = Quad-rotor Angular velocity
9. Appendices
Attached are appendices A-F, where the time schedule, benchmarking PID controllers for the
Inverted Pendulum Model and Dynamic Quad Model, and personal pages by each team member are
all outlined.
35
Appendix A: Time Schedule
During the first couple of days of the research program, the following timeline was adapted
in order to effectively meet the goals outlined in this document. Specifically, this was
planned as an eight week, tentative schedule.
Appendix B: Inverted Pendulum Model Ideal PID Controllers
Ideal PID Controller architecture used for both the position and the angle.
Tuned PID Gain Values
Angle PID Position PID
Proportional (P) 46.9986307007982 0.00985559843681718
Integral (I) 0.234602953123809 0.00983601972259795
Derivative (D) 0.125301282844126 11.2944188731606
Filter Coefficient (N) 100.839854415248 2.73635948094535
Appendix C: Dynamic Quad Model Parallel PID Controllers
Attitude (Phi) Parallel PID architecture used for the Dynamic Quad Model
Angular Velocity (P) Parallel PID architecture used for the Dynamic Quad Model
It should be noted that this system worked by feeding the angle (phi) minus the desired value (controller
input) into the “phi parallel PID” controller, then the corrected value would be fed into the “P parallel
PID” controller as the “phi PID out” where the angular velocity is also fed into. The result of this “P
parallel PID” controller is then used as the correction.
Appendix D: Adam Katterheinrich – Personal Page
Throughout the course of the 8 week REU program I have been exposed to a variety of
new experiences. First of all, the program has provided a professional research platform that has
given me the opportunity to take a mostly foreign topic and formulate a project outline to
complete before a strict deadline. Each Biweekly presentation has been a joy and a struggle to
buckle down and compile relevant information to show consistent progress. The process of
conducting a fuzzy logic and PID control literature review, collaborating with mentors to obtain
goals and objectives, compiling research data and spending time with hands-on work has opened
my eyes to the world of scientific research.
Working with Dr. Cohen and Wei has provided me with an experience that is unmatched
by any other program. My team was been able to pull together ideas from across the board to
develop a Fuzzy Logic PID Controller for both an inverted pendulum model as well as a quad-
rotor model. Using Simulink and MATLAB as the main programming platform provided ample
experience with modeling, simulation and dynamic feedback control. All of these skills are
marketable attributes that will stick with me into further engineering work.
Along with the computer simulations, we were able to spend time assembling a
hexacopter and conducting real flight tests. The hands-on portion of the research project gave the
program a solid edge on the competition because it allowed for implementation of theoretical
topics such as fuzzy logic into a real world platform. Working with the technology first hand has
motivated me to further pursue UAV technology or control systems in the future as career
possibilities. The University of Cincinnati has been pushing to increase its presence in the world
of “smart” drone technology and it is incredibly exciting to be a part of that movement. Our
research will be used in further development of an autonomous controller for rotorcraft and I plan
to continue pursuing the opportunities available in this field.
Finally, I would like to thank the NSF for funding this project and allowing me to
participate in such a well-organized research environment. Learning from experienced educators
and researchers has been a privilege and I plan to use all of the skills acquired in future
engineering work.
Appendix E: Nicholas Nielsen – Personal Page
First off, I would like to thank the NSF for supplying the funding for this wonderful
learning experience. Next, I would like to thank everyone involved in making this program a
reality. I have learned so much in the past 8 weeks that will be beneficial to me as I move on in
my career. Here I would like to make a short accounting of all the things that I have learned this
semester.
We started by conduction literature research that provided us with a solid background on
fuzzy logic. The readings assigned by Dr. Cohen prior to and during the first couple of weeks of
the program allowed us to understand the concepts of fuzzy logic enough to work with the fuzzy
logic toolbox in Matlab Simulink. While this only gave me a rudimentary understanding of
everything that is, involved with fuzzy logic it has given me just enough of a taste of this
wonderful way of thinking to make me want more. My ambitions lie in the field of drones and
drone research. I am very excited about the implications of our research and the potentials for
future research along these lines. I see fuzzy logic as a very solid stepping-stone toward more
intelligent systems. While we did not use it in this research, I learned a little bit about the science
of fuzzy neural networks. I am truly interested in the possibilities of creating a fuzzy neural
network to allow a control system such as the one in our research to “learn” as time goes on to
improve its abilities of adaptation. A system such as this could quite possibly learn to tune a
flight controller itself without any outside influence.
Next, we were face with understanding what a PID controller was and how they operate.
Considering that the PID controller was the benchmark with which we were going to be testing
the fuzzy logic controller, we had to understand what a PID controller was before we could build
or use one. This was difficult at first, not because the concept was that hard to understand but
because the methods of tuning were very complex with complicated calculation that must be done
to find the proper responses. After some exploring, we found a PID block with an auto tuning
function built in to it. This was much less intensive than learning how to calculate the proper
gains by hand and was much more efficient considering our time constraints
During this experience, we were also exposed to the hardware side of this project,
through the opportunity to assemble a hex-rotor aircraft for the lab. This allowed us hands on
experience with all of the components of a multi-rotor aircraft from the motors to the speed
controllers and power distribution boards to the flight controller and radio system. Once
assembled, we flashed the system software onto the flight controller and ran through the
calibration of the flight controller sensors. Finally, we accompanied Wei Wei to conduct the
maiden flight. Wei also showed us how to go about flight data acquisition using telemetry data
and a flight-data recording program built in Matlab. Wei then demonstrated how he uses Cipher
along with Conduit for controller verification and validating.
Throughout this process, I learned many other research and presentation skills to
accompany all the technical skills and knowledge I have gathered. The workshops were very
helpful and have given me a much greater appreciation for the research process and how to
effectively portray my research so that others can quickly and concisely learn about what I did
and how I did it. I learned more about many things from how to document my research
photographically, how to compose a proper technical paper, and how to present the material.
While all of the above listed lessons are going to be useful as I continue my career here at UC and
beyond, I have discovered something far more important to me. I have learned that the field of drones
and control systems particularly those of a fuzzy logic design are what I want to study. Again, I would
like to thank the NSF, Dr. Kukerti, Dr. Aure, Dr. Cohen, Dr. Kastner, and Wei Wei for all of their
guidance and input on this project.
Appendix F: Tyler Parcell – Personal Page
I have always been deeply fascinated with science and technology, as well as its impact
on the world around us. It has always intrigued me to see the true impacts the application of
technology can have in the advancement of society as a whole, and I desire to be a part of it.
More specifically, I desire to be a part of research and development of robotics and/or the
artificial intelligence behind controlling them. As a result, I decided to apply for this research
experience, and was selected for this project. My goal was to gain a better understanding behind
the fundamentals of research and development, as well as to advance both my knowledge and the
scientific field in which the project lies through the research conducted.
I entered the project with essentially no real controls experience at all. Additionally, I
had a minimal working knowledge of more advanced artificial intelligence systems, working only
with fundamental topics on the most basic of scale. This research project was an opportunity to
explore those two areas more in depth through the designing of an intelligent controller system.
The intelligent controller system that our team designed familiarized me with the concept of
feedback control systems, fuzzy logic, and PID controllers. Since my ultimate desire is in the
research and development of robotics and the artificial intelligence behind them, this acquired
skill set will prove to be extremely valuable.
In this project, I was introduced to the idea of non-linear systems, and the unique
challenges that such a system presents in a controls problem. I assisted in developing a simple
non-linear inverted pendulum model and controller, putting some of the aforementioned skills to
use with MATLAB’s Simulink. Lastly, I was also given the opportunity to understand more
regarding the movements/dynamics of controlling a multi-rotor aircraft on a more fundamental
scale, as well as create, along with our team, a controller for this more complex system.
I would like to thank the National Science Foundation for funding this project as well as
the University of Cincinnati for giving me the opportunity to be a part of it.