SENIOR DESIGN FORMAL REPORT
PAPARAZZI
Observational Tilt-Rotor UAS
Parry Draper, Brian Kovarik, Fabiola Mazon Madrid, Adria Serra Moral
5/9/2014
1
American Institute of Aeronautics and Astronautics
Paparazzi Tilt-Rotor UAS
Parry J. Draper1
, Brian C. Kovarik1
, Fabiola Mazón Madrid1
, and Adrià Serra Moral1
Saint Louis University, Saint Louis, MO, 63103
The Paparazzi tilt-rotor unmanned aerial system (UAS) is an undergraduate aerospace
engineering senior design project developed at Parks College of Engineering, Aviation and
Technology at Saint Louis University. The UAS design merges the popular technology of
backpack UAVs and tricopters in order to produce a highly-versatile UAS capable of
climbing and cruising efficiently like a UAV as well as taking off and landing vertically,
hovering, and maneuvering like a tricopter. With a wingspan of 40 inches and a total weight
of 5.5 pounds, the Paparazzi UAS possesses the ability to cruise in a forward-thrust
configuration at 40 knots for 4 nautical miles while maintaining the required power for over
15 minutes of hovering and maneuvering surveillance in a vertical-thrust configuration.
Additionally, the UAS is designed to fit within a portable military-grade Pelican case and
can be fully assembled and operational in less than 10 minutes. With a low cost and highly
versatile design, this platform may be used for military reconnaissance, search and rescue
missions, and numerous commercial applications where a multi-use platform is desired.
With a focus on meeting mission requirements and optimizing the system’s capability, the
design process has advanced from the conceptual, preliminary, and detailed design stages
through varying degrees of system performance analysis. Additionally, a pragmatic and
iterative design methodology is demonstrated as the UAS configuration matures during
construction in order to ease the product’s manufacturability without significantly
compromising capabilities. The conclusion of the project will include flight testing of the
prototype aircraft to verify theoretical calculations and demonstrate that the Paparazzi UAS
fulfills all mission requirements.
Nomenclature
AR = Wing Aspect Ratio
c = Mean Aerodynamic Chord
CD = Drag Coefficient
Cf = Coefficient of Skin Friction
CG = Center of Gravity
Cl = 2-D Lift Coefficient
CL = 3-D Lift Coefficient
CLmax = Maximum Lift Coefficient
D = Drag
DL = Disc Loading
f = Thrust Adjustment Coefficient due to Downwash
FM = Figure of Merit
K = Induced Drag Correction Factor
L = Lift
NP = Aircraft Neutral Point
Pav = Power Available
PClimb = Power to Climb
Ph = Power at Hover
Preq = Power Required
ROC = Rate of Climb
SD = Disk Reference Area
Sref = Reference Area
SW = Wing Surface Area
1
Undergraduate Student, Aerospace and Mechanical Engineering Dept., Saint Louis University, Saint Louis, MO
2
American Institute of Aeronautics and Astronautics
Swet = Wetted Surface Area
t = Airfoil Thickness
T = Thrust
Treq = Thrust Required
V = Velocity
Vc = Velocity to Climb
Vh = Velocity at Hover
W = Weight
W/P = Power Loading
W/S = Wing Loading
W/SD = Disk Loading
W/SW = Wing Loading
ΔPE = Change in Potential Energy
ηmechanical = Mechanical Efficiency
ηP = Propeller Efficiency
ρ = Density
σ = Density Ratio
σC = Ceiling Density Ratio
e = Oswald Efficiency Factor
q = Dynamic Pressure
∞ = Freestream Condition
t/c = Airfoil to Thickness Chord Ratio
Re = Reynold’s Number
I. Introduction
HE Paparazzi unmanned aerial system (UAS) is a light-weight, portable aerial surveillance system capable
of vertical and forward thrust. The air vehicle design combines the benefits of increased speed, range, and
endurance that are characteristic of a fixed-wing aircraft during cruise conditions with the benefits of increased low-
speed maneuverability of a rotorcraft system during hovering and surveillance modes. With these inherently
versatile design configurations, the UAS is not intended to optimize either the forward or vertical thrust
configuration, but rather open up a wider variety of possibilities in terms of a mission profile. For example, the UAS
could act entirely as a vertical takeoff and landing (VTOL) unmanned aerial vehicle (UAV) or solely as a tricopter if
desired. However, the hybrid UAV-tricopter design earns its value by combining the strengths of both platforms to
achieve a range of capabilities unobtainable by either system independently.
Figure 1. Paparazzi Tilt-Rotor Aircraft in Forward and Vertical Thrust Configurations
In a military application, the Paparazzi UAS is ideal for urban reconnaissance. With an assembly time of less
than ten minutes, the UAS can be readily deployed as soon as the need arises. As the UAS cruises to the target
destination in its forward thrust configuration, it will conserve battery power that would have been drained by the
deployment of a tricopter. Also, because the forward thrust configuration saves on power while flying faster, the
vehicle gains an increased range and endurance over that of a tricopter alone. Once the UAS has acquired its target,
the platform can descend to near-ground level and transition into its more maneuverable vertical thrust
configuration, at which point the UAS will be able to fly between buildings or other obstacles and capture detailed,
T
3
American Institute of Aeronautics and Astronautics
ground-level surveillance from a perspective unavailable from the sky. In this scenario, the Paparazzi UAS
showcases its name by capturing detailed images with great persistence of a hidden target in only a moment’s notice.
Much like the Paparazzi in Hollywood, this UAS can take pictures of people in places you would never expect.
Additionally, the Paparazzi UAS can be used for search and rescue missions to quickly scan an area for a missing
person in a variety of locations. In a wooded location, the UAS could descend beneath the trees and maneuver
around obstacles to quickly cover areas that would difficult for a human to search on foot. This platform could be
used to safely search for mountain climbers or backpackers who get lost or injured in treacherous terrain. If
equipped with a thermal camera, this UAS can also scan for heat signatures to quickly locate a lost person and send
the life-saving information back to a rescue crew.
In the future, this design can be adapted for mail delivery in both urban and rural settings. Companies such as
Amazon have expressed an interest in using unmanned aerial vehicles to quickly deliver mail packages to customers.
A tilt-rotor UAS in a forward-thrust configuration would be able to quickly cruise to the target at greater distances
than a rotorcraft and then transition to a vertical thrust configuration to carefully lower a package to the doorstep of
a customer. Since a fixed-wing UAV has a minimum velocity, or stall speed, the tilt-rotor UAV provides a much
safer and more stable delivery method that would also better protect the contents of the packages and reduce the
company’s risk.
II. Mission Profile
While the mission profile of the Paparazzi UAS will change with each user’s operation, the following mission
profile was developed as a baseline for the UAS design. Figure 2 displays a visual representation of the flight
profile, and table 1 details the various mission requirements at each stage in the flight profile. With a total flight time
of 33 minutes, the UAS can capture 18 minutes of surveillance, 3 minutes in a forward thrust mode and 15 minutes
in a vertical thrust mode, of a target 2 Nm away from base.
Figure 2. Paparazzi Verification Mission Profile
4
American Institute of Aeronautics and Astronautics
Table 1. Paparazzi Verification Mission Breakdown Key Requirements
Mission Stage Description Key Requirements
0 Unpack/Setup
Fit within a Pelican Case (Max. Dimensions: 47.57" x 24.07" x 17.68")
Air vehicle and ground station setup in less than 10 minutes
1 Vertical Takeoff
Vertical takeoff from ground
Transition to forward thrust at minimum of 20 feet
2 Climb to Cruise Climb to 400 feet in 5 minutes
3 Cruise to Target Cruise for 2 Nautical Miles at 400 feet at 40 knots
4 Surveillance at Altitude
Loiter for 3 minutes at altitude for target acquisition
Descend to 30 feet to conduct detailed surveillance
5
Ground-Level
Surveillance
Transition to vertical thrust mode
Maintain maneuvering flight for 15 minutes
6 Climb to Cruise
Climb to 50 feet vertically and transition to forward thrust
Climb to 400 feet in 5 minutes
7 Cruise to Base Cruise at 40 knots for 2 Nautical Miles to base
8 Descent Descend to 25 feet in forward thrust mode
9 Vertical Landing
Transition to vertical thrust mode
Vertical landing within a 3 foot radius
III. Design and Analysis
A. Conceptual Design
In order to meet the requirements established in the request for proposals (RFP), various design configurations
were analyzed. The most heavily considered concepts are pictured below. These concepts were developed as a result
of consultations with experienced quadcopter and fixed-wing UAV users, as well as background research on tilt-
rotor UAVs.
Figure 3. Initial Conceptual Design Configurations
5
American Institute of Aeronautics and Astronautics
Concept A, seen in the figure above, featured a fairly conventional UAV configuration, except with four motors
that would rotate to accommodate the vertical and forward thrust requirements. Concept B eliminated one of the
motors in an attempt to reduce weight as well as increase agility in the vertical thrust configuration. Concept C went
a step further to eliminate the tail entirely, using the rear motor as a control device for yaw and pitch stability in
forward flight through thrust vectoring controls. The final design consideration, concept D, placed two motors inside
the wing, where the propellers would rotate within the wing to transition between vertical and forward thrust modes.
In order to select a final conceptual design, various design considerations were weighted and assessed for each of
the proposed concepts. Among those weighted the highest were stability and manufacturability. Stability was ranked
high due to the inherent stability issues with designing a tilt-rotor UAS, especially in the transitional stage.
Manufacturability received a higher ranking, as a more easily constructed system would be more likely to be built
and flown by a small team of undergraduates. Other considerations were weight, maneuverability, forward thrust
performance, takeoff performance, and design complexity. Each design consideration was given a utility rating
based on a scale of 1-5, with 5 being the most favorable. Each utility rating was multiplied by the design
considerations’ weighting factor to determine sub-scores. These scores were summed to yield the final score, with
the highest score representing the best conceptual design.
Table 2. Initial Conceptual Down-Select
Design
Considerations
Weighing
Factor
Design A
Utility
Design A
(Util*Wt)
Design B
Utility
Design B
(Util*Wt)
Design C
Utility
Design C
(Util*Wt)
Design D
Utility
Design D
(Util*Wt)
Manufacturability 0.25 4 1.00 3 0.75 4 1.00 2 0.50
Stability 0.25 4 1.00 4 1.00 4 1.00 1 0.25
Weight 0.20 2 0.40 2 0.40 3 0.60 4 0.80
Maneuverability 0.20 2 0.40 3 0.60 4 0.80 1 0.20
Forward Thrust
Performance
0.20 4 0.80 3 0.60 2 0.40 4 0.80
Takeoff
Performance
0.10 4 0.40 4 0.40 4 0.40 3 0.30
Complexity 0.10 3 0.30 3 0.30 2 0.20 1 0.10
Score 4.30 4.05 4.40 2.95
Recommendation 2 3 1
Initial
Selection
4
Based on the results of the conceptual down-select trade study, concept D placed last since there were perceived
issues with stability in the vertical thrust configuration, fitting a large enough propeller needed for VTOL within the
wing, and the ability of the design to maneuver effectively in a vertical thrust configuration.
Concepts A and C ranked very close, and due to the sensitivity of this crude down-select process, both concepts
were considered equally. However, in the end, design concept C was selected, as this concept reduced weight and
surface area that, in turn, would provide better maneuverability and efficiency in a vertical thrust configuration.
Since the actual surveillance mission occurs primarily in the vertical thrust configuration, increasing the
performance of this mode was considered to be paramount. While concept C would not perform as well as concept
A during climb and cruise due to power loss related to thrust vectoring controls, it would compensate with more
agility and efficiency in the vertical thrust mode.
6
American Institute of Aeronautics and Astronautics
The addition of a tail to the three-engine design, as included in concept B, did not seem to be overly beneficial in
this rough analysis. Although the tail would increase stability in the forward thrust mode and decrease control
complexity, the tail would decrease stability and maneuverability in the vertical thrust mode, as well as add
additional weight to the air vehicle. Thus, for our initial conceptual design, it was decided that the tail concept would
only be used in the event that stability in a forward thrust configuration was not achievable without a tail in the more
detailed stages of the air vehicle’s design. Therefore, some of the forward flight stability risk associated with the
selection of concept C could be mitigated with the option of easily adding a tail to the design if necessary.
In reality, this safeguard proved to be critical, as detailed stability analysis demonstrated that the initial concept
would be highly unstable and very difficult to control,
especially in transition. Therefore, the final concept most
closely resembles concept B, with a three-rotor design, a
tail, and a rectangular wing planform, however, aspects of
concept C are still apparent in the final design. For example,
the wing motors were shifted inboard to reduce structural
requirements and increase roll stability, and the tail motor
was placed on the tail to reduce structural weight and
provide a level platform in the vertical configuration for
landing. In addition, the rear motor also tilts for a thrust-
vectoring control, similar to concept C. By doing this, the
best of both concepts were merged into a final concept that
better met the mission requirements.
B. Weight Breakdown
A weight breakdown was compiled for every piece of hardware that is
expected to make up the vehicle or be within the vehicle. The individual
item weights were found empirically or, in cases were the component was
not available, from the manufacturers’ published data sheets. Initially,
certain components of the design were not finalized therefore a
conservative estimate was made based on comparable components on the
market, however, as estimated weights became more concretely defined,
the percent composition for the total system matured.
From this, the total weight was estimated to be approximately 4.83
lbs, and a complete component by component weight breakdown has
been included in the appendix. In addition to the built-in electronics
necessary to fly, it was decided to allow for a 0.65 lb. modular payload,
which could be used to carry any desired payload that would fit within
the volume of the fuselage. This could include an upgraded battery, a heat
sensor, a high-definition camera, or any other desired payload. For
example, a camera with visual and thermal capabilities used on similar-
sized UAVs weighs 0.60 lbs., which is below the maximum allowable payload weight.
Including the customer payload, the estimated UAS gross weight came to be 5.48 lbs. A final gross weight of
5.50 lbs. was selected for design purposes, which builds in an additional slight margin for manufacturing
uncertainties. It should also be noted that all weight estimates, where actual weight was unknown, were developed in
a very conservative fashion so as to ensure that the UAS would not exceed the design weight if actual components
weighed more than predicted.
C. Aerodynamic Analysis
The aerodynamic analysis focused on the airfoil selection and optimization of the finite wing design. Due to the
vertical thrust capability, the aircraft was not constrained by traditional takeoff and CLmax constraints like
conventional aircraft. Because of that, the wing’s design was defined in order to provide sufficient lift during cruise
at a suitable speed and be easily manufactured. With power being a primary concern, since vertical thrust rotorcrafts
tend to consume more power than conventional aircraft, the airfoil shape should attempt to minimize the amount of
power required during forward flight. Therefore, the wing has been designed to minimize the drag produced. As the
surveillance portion of the mission occurs primarily in the vertical thrust configuration, the ideal wing would reduce
the power necessary to cruise and climb and thereby increase the time available for the surveillance mission.
Figure 5. Weight Composition
Figure 4. Final Conceptual Design Configuration
7
American Institute of Aeronautics and Astronautics
Knowing this, the aerodynamic design process began by comparing wing loading vs. airspeed for increasing lift
coefficients.
Figure 6. Aircraft Airspeed vs. Wing Loading for Increasing Lift Coefficients
The diagram assisted in determining how much the required lift coefficient for trim flight would vary as the wing
loading changed. Note that the variation in the required lift coefficients for level flight was found to vary more
significantly as the wing loading increased. As the Paparazzi UAS was designed to be highly maneuverable with a
minimal wetted area for drag reduction, the preliminary wing loading was selected to be around 2.0 to 2.5 lbs/ft2
.
Using the minimum cruise speed of 40 knots requirement it was calculated that at the desired wing loading the
minimum required lift coefficient for level flight would be in the range of 0.40 to 0.45. The range of airfoil lift
coefficients required for level flight was determined with the following equation:
√
(1)
When determining the lift coefficients it was noted that aspect ratios for maneuverable aircraft were found to fall
within the range of 4 to 5. Based on this analysis a target airfoil Cl needed to range from 0.6 to 0.7. Note that the
target airfoil lift coefficients were computed to be significantly high, which was the trade-off for minimizing the
wing area.
By doing preliminary airfoil research, three suitable airfoils were selected for further analysis, the MH-112 and
the MH-114, both of which have been successfully used in previous ultralight propeller aircrafts, and the S-1210, a
high lift and low Reynolds number cambered airfoil. Note that all the airfoils are cambered. Cambered and slightly
thick airfoils contradict the low drag criteria, however, some camber is required in order to supply enough lift at a
low angle of incidence which is an important factor for manufacturability. For a better understanding of the airfoils
individual performance, the computer software XFRL5 was utilized to predict and compare the airfoils aerodynamic
performances at a wide range of specified Reynolds numbers. It is important to emphasize that the XFRL5 computer
software uses the potential flow theory and interpolation to estimate the results. This approach has been proven to
provide lift coefficient results suitable for design; however, the drag and moment coefficient results are still
significantly inaccurate due to the limitations of the theory. The results could still be accurately utilized to predict
and compare which airfoil section would have a higher L/D when compared to one other. The data points obtained
by XFRL5 at different Reynolds numbers were averaged and plotted in the figures included below.
8
American Institute of Aeronautics and Astronautics
Figure 7. Airfoil Lift Coefficient vs. Angle of Attack Comparison at 300,000 Reynolds Number
Each airfoil’s 2D lift coefficient was plotted versus increasing angle of attack. It was observed that at an average
Reynolds number of 300,000; all airfoils would satisfy the 0.6 to 0.7 minimum lift coefficient at a 0 degrees angle of
incidence. Again, since Paparazzi is not restricted by takeoff, the value of the Clmax is not very significant; in fact, it
might only be considered for low speed conditions and near stall, such as the transition from forward thrust to
vertical thrust. This may also be considered in emergency situations such as high winds provoking high angle of
attack deflection or engine out conditions.
Figure 8. Qualitative Comparison of 2D Airfoil Lift/Drag vs. Angle of Attack
The lift to drag ratio of each airfoil was plotted versus increasing angle of attack. It is important to emphasize
that the values of the L/D axis were intentionally removed because these numbers reflect a 2D analysis and this is
used simply as a qualitative analysis not a quantitative one. However, it is still apparent that the S-1210 had greater
drag penalty than the MH airfoils, which was already expected due to its higher camber. As shown, there were
significant gaps in L/D between the three airfoils. Thus, it was determined that the smaller Cl or Clmax benefits
obtained by either the S-1210 or the MH-112 were not worth the drag penalty. As a result, the airfoil was chosen to
be the MH-114. Further modifications were done to the airfoil to remove some camber in order to decrease drag and
increase the moment produced for stability.
9
American Institute of Aeronautics and Astronautics
Figure 9. Modified MH-144: Airfoil Selected for Paparazzi UAS
Once the airfoil was determined, the aerodynamics study shifted to the finite wing design. At this point it is
important to emphasize that the dimensions of the wing were rounded to the nearest half integer in order to facilitate
an ease of manufacturing. First the wing area was approximated by using the weight and the wing loadings obtained
above. To be conservative the design wing loading was set to 2 lbs/ft2
. For a 5.5 lbs. vehicle the area required was
obtained to be 400 in2
. Therefore, the wing planform was designed to be rectangular, with 40 inches of span and a
10 inch chord.
Figure 10. Rectangular Wing Planform
While there is no doubt that the preliminary wing would satisfy the manufacturability requirement, this
rectangular design would add greater weight and drag contributions than other wing planforms. Following various
references, the preliminary finite wing was redesigned in various ways which could result in significant
improvements. First, the study focused on tapering the wing, which would significantly decrease the weight of the
wing while keeping a more elliptical lift distribution across the span of the wing, resulting in a considerable
reduction in induced drag. However due to the complexity of manufacturing a swept and tapered wing, the wing was
designed as rectangular. The spars that would connect the tail rotor to the aircraft are currently to be attached to the
vehicle through the wing; so a rectangular inboard section would facilitate the assembly of the tail rotor. Originally a
tail-less design was considered and designed, but after difficulties in maintaining stability arose a empennage tail
design was added. The tail surfaces were sized with input from the stability analysis. At the same time, the two front
rotors would ideally be a distance apart from the tilting area in order to reduce possible downwash effects during
vertical thrust configuration and allow the propeller not to impinge upon the wing. As a result, the amount of
rectangular inboard area was difficult to optimize. The wing loading was obtained to be 2.3 lbs/ft3
with an aspect
ratio of 4.71, so both values were indeed obtained to fall within the maneuverability criteria determined in the
beginning of the design.
40 in
10 in
10
American Institute of Aeronautics and Astronautics
Figure 11. Wing and Tail Design
Using XFRL5 and the lift coefficient equation specified above, the CL versus angle of attack graph was plotted
and included in Figure 12. This wing was inherently unstable particularly due to the effects of the camber. At this
point, it was important to keep in mind that the overall CG of the vehicle would have to be carefully controlled in
order to ensure longitudinal static stability. Weight could be added to the nose area of the plane in order to do so.
The aerodynamics analysis proved that a rectangular wing with a 40 inch span and a 10 inch chord provides
sufficient lift for the aircraft. Also a tail with a horizontal span of 22 inches and a 6.5 inch chord provides a statically
stable aircraft design.
Figure 12. 2D and 3D Finite Wing Lift Coefficient vs. Angle of Attack Comparison
D. Drag Estimation
With the wing and tail of the aircraft sized, the fuselage was sized with considerations of the internal volume
needed to house the flight electronics and payload. The dimensions were used to develop a detailed drag prediction
of the aircraft.
11
American Institute of Aeronautics and Astronautics
Figure 13. Paparazzi Aircraft Dimensions
A tool was developed in Excel to estimate the drag of the UAS based on a buildup of the system’s various
components using Shevell’s method. This calculates the entire system drag by summing the drag of each of the
system’s structures, according to the equation:
∑ (2)
Where K is defined as,
[ ( ) ( ) ]
( ) ⁄
√ ⁄
(3)
The skin friction coefficient was calculated using a simplified assumption of entirely turbulent flow. It was
assumed that the flow was tripped to turbulent flow at .01 inches on each component. The summed components of
the plane include the rectangular portion of the wing, the engine nacelles, the fuselage, and the tail. With the given
dimensions specified in Table 3, a Reynolds number was calculated for each surface of the aircraft.
Table 3. Freestream Parameters
Pressure (psf) 2051
Density (lbs./ft2
) 2.32E-03
Velocity (ft/s) 67.5
Viscosity (lb ft-1
s-1
) 3.73E-07
Mach Number (M) 0.06
Speed of Sound (ft/s) 1113
Dynamic Pressure (psf) 5.28
12
American Institute of Aeronautics and Astronautics
With this data, the Cd for each component was determined. Then all the Cd values are summed up. This is the
total parasitic drag and was found to be 0.02385 for the entire plane. Then, the induced drag was calculated as
(4)
The Oswald efficiency factor e was calculated from
(5)
With this e, came to a value of .89. Once the parasitic drag and the induced drag were added together, the total
coefficient of drag was found to be .05228. It is from this that the total drag of the plane is calculated according to
the equation,
(6)
The total drag was found to be .65 lbs. for the CL value used during cruise. A drag polar was developed for
increasing values of Cl and the corresponding value of Cd. The tangent of this curve with the origin provided our
glide ratio which is around 12. This value is used to optimize our flight in order to fly at the best range condition.
Figure 14. Paparazzi UAS Drag Polar
E. Propulsion
The amount of thrust that is needed to overcome the weight of the aircraft and climb at the specified climb rate in
vertical thrust of 9.2 ft/s was calculated. Based on consultations with experienced rotorcraft UAV pilots and
engineers, it was determined best to use a motor with which the aircraft would be capable of hovering at 50%-60%
throttle in order to allow for sufficient maneuvering power. With this information, various motors were researched,
specifically Tiger motors since the motor specifications are readily
available. The published data on various Tiger motors was analyzed
for different throttle settings with various propeller configurations to
pinpoint the correct motor. The propulsion system selected uses
three Electric Brushless Motors – MT2814 KV770 Tiger Motors
which offer 8.9 lbs. combined of static thrust compared the 5.5 lbs.
weight of the vehicle. This excess thrust allows the vehicle to climb
at the required speeds during take-off and maneuvering. The system
runs off of 14.8 volt batteries and draws .5 amps when idling. An
efficient propeller must be sized to balance the efficiency in both
vertical and horizontal thrust configurations. The propeller must Figure 15. Tiger Brushless Motors Selected
13
American Institute of Aeronautics and Astronautics
provide enough thrust in horizontal flight to reach the cruise speed. For efficiency in vertical thrust mode a propeller
with large diameter and low pitch is desired as opposed to horizontal thrust where low diameter and higher pitch is
ideal. By analyzing different propeller combinations with our motor in MotoCalc, software commonly used to
predict RC aircraft performance, a propeller that is 12”x8” was selected. This offers the minimum thrust with this
motor needed to reach the cruise speed of 40 knots while having the largest diameter and lowest pitch possible for
the highest efficiency during vertical thrust.
F. Constraint Analysis
An initial constraint analysis tool was developed in Excel with estimated data and then adjusted iteratively as
various design assumptions became more strongly defined. As aircraft and helicopter designs are constrained by
separate parameters, the analysis had to consider the vertical thrust configuration and the forward configuration
constraints separately. Primarily, the limiting values for helicopter takeoff and hovering is power loading and disk
loading. For an aircraft, these values would be power loading and wing loading. While the power loading constraint
is inherently related, each configuration will use a separate throttle setting which will consequently affect the power
required.
The following equation was used to determine the power required for vertical climb at various disk loadings out
of ground effect:
[( √ ) ] [ ] (7)
It should be noted that this equation also applies for hovering flight by setting the climb velocity to zero.
Intuitively, it also becomes apparent that the air vehicle will have enough power to hover if the vehicle has the
power required for climb. Therefore, a climb rate of 120 fpm was assumed to allow the air vehicle to reach an
altitude of 20 feet in 10 seconds. The adjustment for the force of downwash blowing on the vehicle was assumed to
be 3% of the disk loading. Additionally, the figure of merit was assumed to be 0.7 to compensate power losses due
to factors such as airfoil profile drag, nonuniform flow, tip losses, and slipstream effects. The mechanical efficiency
was approximated to be 0.97. Although this analysis considers the power required out of ground effect, the actual
power required during takeoff in ground effect is decreased. However, in an effort to design with conservative
assumptions and allow excess power for maneuvering, ground effect was neglected for power calculations.
Using an assumed weight of 5.50 lbs, the power loading was plotted versus the disk loading. In the figure below,
the area above the curve represents an inoperable region, where there is not sufficient power to takeoff at 120 fpm.
The area below the curve is the design space which meets VTOL power requirements. The design point for climb
was selected to be a power loading of 5.7 lbs/hp at a disk loading of 7.0 lbs/ft2
. With the current engine and propeller
combination, this occurs at an 80% throttle setting, which is the upper limit for our desired maneuvering mission.
With the design point falling beneath the curve, there is a surplus of power available as a margin of safety which
could also be used to accelerate the vehicle upwards at a greater rate if required during takeoff or maneuvering
flight.
Figure 16. Power Loading vs. Disk Loading for the Vertical Thrust Configuration
14
American Institute of Aeronautics and Astronautics
Similarly, an analysis was conducted for the forward flight configuration to determine the required power
loading at various wing loadings. The first limitation considered for forward flight was the maximum wing loading
sustainable before stall. This was computed at a stall speed estimated from preliminary aerodynamic data:
( ) (8)
Next, the maximum speed of the aircraft was considered as a constraint. As an approximation, this speed was
estimated to be 125% of the cruise velocity of 40 knots. Assuming a propeller efficiency of 0.7 and a parabolic drag
profile as established earlier, the following equation was used to determine power loading as a function of wing
loading:
( )
( )
( )
(9)
Based on the RFP requirement to climb at a rate of 76 fpm, the same assumptions were made for the following
equation, except it was assumed that the propeller efficiency would be 0.6 for climbing conditions.
( )
√
√
( )( )
(10)
The final constraint considered for forward flight was the air vehicle’s ceiling. As defined by the RFP, the ceiling
was a specified 400 feet. From this, the density ratio was calculated and input with the previous assumptions into the
following equation:
( )
√
√
( )( )
(11)
The following graph combines each of the constraints for forward flight with the shaded regions being the
regions where the design constraints are not met. The design point was constrained by the same engine and propeller
combination performance used in the vertical thrust analysis at the cruise condition of 40 knots. At 70% throttle,
which is the throttle setting required to achieve a cruise speed of 40 kts, the power loading was 26 lb/hp with a wing
loading of 2.3 lb/ft2
.
Figure 17. Power Loading vs. Wing Loading for the Forward Flight Configuration
15
American Institute of Aeronautics and Astronautics
F. Performance Characteristics
In the forward thrust configuration, the vehicle becomes a traditional propeller driven aircraft. Hence, its forward
flight performance was analyzed using the same approach as a conventional aircraft. First, the aircraft was studied in
steady level flight where the required lift coefficient to trim the aircraft at a given airspeed was calculated using:
⁄
(12)
Since the aircraft is operated by electric motors, the weight remains constant during the entire mission, making
the lift coefficient entirely dependent on the airspeed. Next, the drag coefficient at this particular CL was
approximated using the drag polar in Fig. 10. From this, the thrust required at a given airspeed was obtained as:
(13)
Because the aircraft is propelled by three propeller driven motors, it was more meaningful to analyze the vehicle
performance in terms of power required. Under this flight condition, the power required was calculated by,
(14)
The flight performance was analyzed in a range of
18 to 47 knots, with 40 knots being the design cruise
airspeed and 22 knots being the calculated stall speed.
For a simpler understanding of the variance in
performance at different speeds, the results are
graphically represented in Fig. 11.
Thus, the speed for maximum endurance, located at
the point of minimum power, was approximately 30
knots. Also, the speed for maximum range, located at
the point of maximum L/D (obtained by the tangent
line), was around 39 knots. For completeness, the
aircraft stall line was included, to facilitate the
appreciation between the flight and the no-flight
regimes. Notice that the defined speed for cruise falls
close to the maximum range speed.
Once steady level flight was analyzed, the climb to
altitude performance was analyzed. This is specified as
the portion of the mission in which the aircraft climbs in the forward thrust configuration. The rate of climb of a
propeller aircraft is defined as:
(15)
The RFP states that the first climb towards the destination is required to be at a minimum rate of 96 fpm while
the second climb back to the base was required to be at a minimum rate of 90 fpm. With Eqn. 15, the selected
propulsion system was analyzed to verify that it would indeed be capable of producing enough power to perform the
required climb. In order to minimize this quantity, the aircraft was chosen to climb at the minimum power velocity
of 30 knots, resulting in a power required of 0.056 hp.
With the forward flight performance estimated, the vertical thrust tricopter configuration was studied. In vertical
thrust mode, the minimum condition of equilibrium for hovering flight required the thrust produced by the three
motors to be equal to the total weight of the vehicle.
Knowing the characteristics of the motor and the geometry of the propeller, it was possible to calculate the disc
loading, which plays a crucial role in the hover performance and maneuverability of the aircraft. First, it was
necessary to assume a reasonable figure of merit, which is the ratio between the power output of the motors and the
actual power consumed. The optimum figure of merit for rotorcraft vehicles is located within 0.7 and 0.8. Figure 12
depicts the relationship between power loading and disc loading for various figures of merit.
Figure 17. Power Required vs. Airspeed
16
American Institute of Aeronautics and Astronautics
The optimum figure of merit of the Paparazzi
UAS was assumed to be the minimum optimal value
of 0.7 in order to be conservative and allow extra
room in possible losses or future changes in the
design which might have an effect on the overall
performance of the vehicle. Once the figure of merit
was defined, the power requirements to takeoff and
hover were calculated. The disk loading required to
hover was estimated to be 2.33 psf, and it was
determined that each motor had to produce 0.106 hp
to hover, resulting in a total power required of 0.351
hp. Note that an extra 10% was added to the total
power result in order to account for potential drag
and transmission losses.
Since the power required to hover is a
representation of the minimum amount of power
required to maintain the UAS in a fixed equilibrium
position with the environment, the power required to
climb was estimated by using the conservation of energy relationship.
(16)
[ √( ) ] (17)
Then, to find the total power required to climb to the minimum transition height of 20 feet, it was necessary to
assume a suitable Vc of 180 fpm, and the total power required to takeoff was computed to be 0.42 hp.
H. Stability
The first approach towards determining the stability conditions of the aircraft was followed by making a more
precise estimation of the center of gravity’s location. In order to find the location of the CG, every component
included in the vehicle was considered as a point mass with a defined weight and location; then, the CG equation
yielded,
∑ ∑
(18)
In order to use the equation above, the point mass locations of the wings, fuselage, tail, and spars were found by
calculating the moment of area of the surfaces and dividing by its mass:
(19)
From the equations above, the CG location was calculated to be 4.0 inches from the leading edge. This was set
constant to be at the location of rotation for transition. From the aerodynamic analysis the wing’s aerodynamic
center was found to be located 4.36 inches aft the rectangular section leading edge as computed. A 2D
representation of the location of each point mass, the CG location, and the NP location was developed as a visual
representation.
Figure 18. Power and Disc Loading for Figures of Merit
17
American Institute of Aeronautics and Astronautics
Figure 18. Free-Body Diagram of Paparazzi Aircraft
As a result of the CG being forward of the NP, the aircraft will be longitudinally stable, giving a 5% static
margin. Note that the CG was designed to be on the same axis line as the rotating spar in order to prevent extra
moments on the aircraft produced by the change in inertia forces.
Figure 19. Various CG Locations within the Aircraft
From this graphical representation it was possible to write the preliminary equations of equilibrium of for steady
level flight.
∑ (20)
∑ (21)
∑ (22)
Since LW, W, LT, and D are known from the aerodynamics section and the drag polar, and since Kn, IT, ITV, and
ITH can be easily obtained by the geometry of the vehicle, the system yielded 3 equations and 3 unknowns (TT, T,
δRT), which can be solved to obtained the precise conditions for trim at level flight. It is required to study the
response of the vehicle after a longitudinal disturbance. A longitudinal disturbance would provoke an increment on
18
American Institute of Aeronautics and Astronautics
the vehicle AoA. This increment would add an incremental lift contribution, which would unbalance the condition
of equilibrium, creating a vertical acceleration as well as pitching the aircraft. In order to counteract this force and
moment, the back rotor might have to increase its power as well change its δRV angle and the horizontal tail surface
will need to be deflected.
Along the same lines, the lateral-directional stability of the UAS was analyzed. This case of study is more
intuitive. During trim level flight, it might be easily observed that the δRH would be zero, as both thrust forces would
cancel their respective moments due to the vehicle symmetry about the Xb axis. Similarly, if a disturbance were
encountered the tail rotor would need to adjust in order to counteract the force and moment raised from the sideslip
disturbance. Also the vertical stabilizers ensure additional stability during gusts and level flight.
For completeness, the study of the stability in the vertical thrust tricopter mode was also considered. All rotors
have the same contribution to counteract the weight, and if a disturbance in any direction were encountered, the
rotors adjust their output power in order to balance the forces and moments originated by the disturbance. This is
controlled by an autopilot system and both accelerometers and gyroscopic sensors. It is of crucial importance to
understand in great depth both the static response and transient behavior of the aircraft after a disturbance, so the
optimum controller can be designed.
The stability analysis focused on the design of the vertical and horizontal stabilizers to assure a trim condition
and static stability during the cruise phase. A static stability margin of 5% was selected as an appropriate value from
industry. The Cmα of the aircraft was computed using Eqn. 18:
̅
( ) ̅
(23)
With the tail horizontal stabilizer deflected and different incident angles, the Cm vs. Cl was developed to ensure
static stability is provided.
Figure 20. Moment Coefficient vs. Lift Coefficient
The negative slope demonstrates the longitudinal static stability of the aircraft over its range of flight conditions.
Based on the aircraft geometry, the minimum horizontal stabilizer chord was selected to be 6.5 inches so that the tail
would keep the aircraft level while on the ground in VTOL configuration. With an assumed ηH of 1 due to the
propeller influence, and the desired 5% static margin, the horizontal stabilizer was determined to have a span of 22
inches. Using a similar approach and Eqn. 19, the vertical stabilizer was calculated to have a span of 6.5 inches,
which produced a Cnβ value of 0.054 rad-1
, assuming a Kf of 0.8, vertical tail side-wash gradient of 0.5, ηV of 0.9,
and a design vertical tail volume coefficient of 0.1.
( ) (24)
19
American Institute of Aeronautics and Astronautics
Figure 21. Cn vs. β Plot
In order to facilitate the analysis the longitudinal and the lateral-directional stabilities were decoupled and
analyzed independently. Hence, the dynamic stability analysis was separated into three sections: Longitudinal
stability, lateral-directional stability, and hover stability.
The longitudinal stability of Paparazzi was linearized at the trim condition of steady level flight at 40 knots by
using the small perturbation assumption. The five responses of interest corresponding to our longitudinal model
consisted of the surge velocity u, the angle of attack α, the pitch angle θ, the pitch rate q, and the altitude h.
(25)
Also, the two longitudinal control inputs included in Paparazzi’s design were the tail wing incidence angle δih
and the motor change in thrust δT.
(26)
The eigenvalues, damping ratios, and natural frequencies that characterize this flight condition were calculated
and show that the negative real part of the eigenvalues verified the stable condition mentioned in the static stability
section.
Table 4. Longitudinal Stability Parameters
λ ζ ωn (rad/sec)
-3.42 + 0.7i 0.98 3.5
-3.42 – 0.7i 0.98 3.5
-0.007 + 0.37i 0.002 0.37
-0.007 – 0.37i 0.002 0.37
The phugoid and short period response to a unit tail incidence impulse input over time was analyzed. Figure 22
shows the response of the aircraft phugoid and short period response respectively. The average oscillatory period
and time to half amplitude of each mode is shown in Table 5.
Table 5. Oscillatory Period and Time to Half Amplitude
Mode Average Oscillation Period (sec.) Average Time to Half (sec.)
Phugoid 17 105
Short Period 1.8 0.2
20
American Institute of Aeronautics and Astronautics
Figure 22. Short Period and Phugoid Response to Tail Incidence Unit Impulse
In order to ensure the full control of the aircraft during autonomous cruise flight, an altitude and pitch attitude
controller was designed. The controller was designed to ensure a percent overshoot of less than 5% and a settling
time of less than 2.5 seconds.
Figure 23. Comparison of Controlled and Uncontrolled Response to Initial Disturbance
The controller effectively returns the aircraft to
its original trim condition within the designed 2.5
settling time. The 7 degree tail incidence input
required to control the aircraft is within the tail
incidence limits of ±90 degrees. Also, Figure 24
shows the altitude of the aircraft with the controller
when tested after a ±1 degree tail incidence input,
which demonstrates that the controller assures a
precise change in pitch attitude as the change in
altitude is attained without the oscillations
observed in the uncontrolled case. Finally, the
effect of the altitude controller in the aircraft
response for a given altitude mission was calculated. Figure 24. Tail Incidence Input for Control
21
American Institute of Aeronautics and Astronautics
The altitude controller will allow the aircraft to both change and maintain a specified altitude with a small offset
error.
Figure 25. Altitude Response at Given Tail Incidence Input
Figure 26. Altitude Response for a Specified Altitude Path
The lateral-directional stability of Paparazzi was also linearized at the trim condition of steady level flight at 40
knots by using the small perturbation assumption. The five responses of interest corresponding to our lateral-
directional model consisted of the sideslip angle β, the bank angle φ, the roll rate p, the yaw rate r, and the heading
angle ψ.
(27)
Also, the two lateral-directional control inputs included in Paparazzi’s design were the wing incidence angle δw
and the rear motor deflection δR.
(28)
22
American Institute of Aeronautics and Astronautics
The eigenvalues, damping ratios, and natural frequencies that characterize this flight condition were calculated
and the negative real part of the eigenvalues verified the stable condition mentioned in the static stability section.
Table 6. Longitudinal Stability Parameters
λ ζ ωn (rad/sec)
-3.42 + 0.7i 0.98 3.5
-3.42 – 0.7i 0.98 3.5
-0.007 + 0.37i 0.002 0.37
-0.007 – 0.37i 0.002 0.37
Following the same approach as the longitudinal control, a controller was designed to control the bank angle and
the heading angle with a percent overshoot of less than 5% and a settling time of less than 1.5 seconds. The open-
loop and closed-loop response for a +1 degree bank angle disturbance is displayed in Figure 27. The open-loop and
closed-loop response for a +1 sideslip angle disturbance is shown in Figure 28.
Figure 27. Comparison of Controlled and Uncontrolled Response to Bank Angle Disturbance
Figure 28. Comparison of Controlled and Uncontrolled Response to Sideslip Angle Disturbance
23
American Institute of Aeronautics and Astronautics
In both figures, it is shown that that the controller effectively brings the vehicle back to the initial trim condition
within the specified percent overshoot and settling time. Also, how the will aircraft respond to different unit impulse
inputs are displayed in Figure 29 and Figure 30 respectively.
Figure 29. Comparison of Controlled and Uncontrolled Response to Wing Incidence Impulse
Figure 30. Comparison of Controlled and Uncontrolled Response to Rear Rotor Impulse
I. Transition
Transition encompasses the change from vertical thrust to horizontal thrust in aircraft and is very difficult flight
regime to predict. This analysis is the “holy grail” of the aerospace industry because of the level of complexity in the
analysis and control systems. It is difficult to maintain a stable transition because as the vehicle transitions, its
forward velocity is not above the stall speed of the wing. Therefore the thrust level must change with each angle
increment such that the vehicle does not lose altitude but also increases horizontal velocity until transition is
complete and the velocity is greater than the stall speed. The Paparazzi aircraft pitches the forward wings and a
portion of the horizontal tail from angles of 90 degrees to 0 degrees thus altering the thrust direction.
24
American Institute of Aeronautics and Astronautics
The transition analysis was done in an ideal condition, meaning the altitude is held constant. Due to factors such
as motor efficiencies the vehicle will lose altitude in an actual transition. The analysis focused on maintaining a
positive horizontal acceleration and a zero rotational acceleration at multiple rotor angles in order to prevent the
UAS from losing altitude and speed as well as preventing rotation during the transitional process. Using the aircraft
geometry and Eqns. 20-22, it was possible to solve for the minimum thrust settings that would satisfy the
acceleration conditions.
Figure 31. Transitional Analysis Schematic
̈ (29)
̈ (30)
̈ (31)
Figure 32 shows the changing angles of the motors and the surfaces during the transition. The horizontal speed
and the power required to maintain altitude and a forward acceleration during transition were computed and
compared against the power available at each of the stages analyzed to demonstrate that the power requirements
were within the aircraft’s capabilities. The power required for this transition compared to the airspeed of the aircraft
was developed, with the key angles shown in Figure 32. The red line signifies an ideal transition with no altitude
loss. If the aircraft were to exert the exact power along this line during the angle change the vehicle maintains its
altitude while increasing the horizontal velocity beyond the stall speed. This is the same for transition to forward
thrust as it is to vertical thrust.
Figure 32. Power Required vs. Airspeed during Transition
The transition was also tested in the wind tunnel. The wing angles were changed to different angles and data was
collected. The graphs show stability during transition. The raw data can be found in the appendix. The drag for each
angle of the wing was collected and compared that with the other angles to create a power required to overcome the
25
American Institute of Aeronautics and Astronautics
vehicle drag vs. airspeed for each wing angle of transition. The Cm vs. Cl was also generated for each transition
angle in the wind tunnel. This data shows that the vehicle is actually decently statically stable during the transition,
with a negative slope in the graphs.
Figure 33. Transitional Wind Tunnel Testing
Figure 34. Power Required to Overcome Drag During Transition, Wind Tunnel Results
26
American Institute of Aeronautics and Astronautics
Figure 35. Cm vs. Cl Wind Tunnel Results
With this analysis it is believed that with a good flight controller a near ideal transition may be met with a small
vehicle such as Paparazzi. The transition will be stable and quick, allowing for minimal loses during the transition.
J. Battery Analysis
Once the required power for takeoff, hover, climb, and cruise were known, the battery analysis was done to study
the battery size required to complete the mission. Note that the preliminary analysis is a simplified process used and
was in fact a simple use of the power, voltage and current definitions. The equations for battery capacity and power
are shown below.
(32)
(33)
It is possible to combine both equations and write a unique expression relating the capacity of the battery and the
required power output to the motors to complete at each stage of the flight,
(34)
After consulting professors and experts in the field, it was safe to assume that for a battery less than 1 year, the
voltage output would be near a constant value at all times. As a result, the team decided to consider a 14.8 volt
Lithium polymer battery, since these batteries are commonly used in RC aircraft due to their high power available
versus weight characteristics. The capacity breakdown at each flight section was included in Table 7. Also, for a
better appreciation of the battery capacity needed for each flight condition, a graphical representation of the battery
consumption can be seen in Figure 36.
Table 7. Battery Consumption and Time of Flight
Mission Stage Time (min)
1st Climb 5
Cruise 2.25
Loiter 3
Surveillance 15
Takeoff/Landing 0.5
2nd Climb 5
Cruise 2.25
Total 33
y = -0.0862x - 0.2059
y = -0.313x + 0.0165
y = -1.2754x + 0.2223
-0.4
-0.3
-0.2
-0.1
0
0.1
0.2
0 0.5 1 1.5
Cm
CL
30 Deg.
60 Deg.
90 Deg.
Figure 36. Battery Consumption at Mission Stages
In Figure 36, it can be seen that the most significant power consumption occurs during the 15 minutes of detailed
surveillance in the vertical thrust mode, as expected since vertical thrust is known to draw a significant amount of
power. Since approximately 5700 mAh of power would be consumed throughout the mission, a 6400 mAh battery
was selected, as this size of battery provided an additional 700 mAh, or 11%, suplus power. Comparing batteries
available on the market, a 6600 mAh battery could be purchased off-the-shelf from Thunder Power which is a
company that specializes in light-weight batteries for RC aircraft. This battery actually weighed less and filled a
smaller volume than similar batteries that provided 6400 mAh of power, so an additional 200 mAh is available as an
extended reserve, bringing the total surplus to 900 mAh, or 14% of the total power available. In total, the selected
battery and its associated components weigh 1.37 lbs.
K. Structural Analysis
In order to analyze that the system’s structures would meet the design requirements, the anticipated loading over
the entire flight envelope had to be obtained. With a conservative approach and assuming standard load factors for
an acrobatic aircraft, the maximum structural load factors were designed for +6g and -3g loads. Additionally, the
loading analysis included gusts of 5 and 15 feet per second, which is a common assumption for low-altitude, light-
weight unmanned surveillance. The V-n diagram pictured below defines the entire aerodynamic and structural flight
envelope by illustrating the variation in load factor
with airspeed.
With the loading defined, the structural
components of the UAS could be analyzed. For this,
a half-span model of the wing’s main 3/8” carbon
fiber spar was created in Abaqus, a finite element
analysis software, using a symmetry-plane approach.
The inboard end of the spar was fixed, and the
outboard end of the spar was left unsupported. The
carbon fiber composite material was modeled as an
orthotropic material, with directional material
properties obtained from the manufacturer’s technical
data sheet for the selected spar. A fine mesh was
applied to the model, and for an approximate
approach, an elliptical pressure load distribution was
0
400
800
1200
1600
2000
2400
2800
3200
3600
4000
4400
4800
5200
5600
6000
6400
PowerConsumption(mAh)
Power Consumption
Surplus
Cruise
2nd Climb
Surveillance
Loiter
Cruise
1st Climb
Takeoff
Figure 37. Aerodynamic and Structural Flight
Envelope with 5 and 15 fps gust lines
28
American Institute of Aeronautics and Astronautics
applied across the upper surface of the half-spar. Results from the simulation for both stresses and deflections are
displayed visually below, with the red area being the location of maximum stresses and the blue area signifying the
maximum deflections.
Figure 38. Stress Distribution for Carbon Fiber Spar
The image above shows the Von Mises stresses for the carbon fiber spar. The analysis reported maximum
stresses of 19.2 ksi, which is well below the ultimate stresses published on the manufactuer’s website of 640 ksi.
These stresses occur inboard on the top and bottom of the inboard section of the rod. As the reported stresses fall
well below the maxim tensile stresses, there exists an opportunity to optimize the spar in the future to potentially
reduce the vehicle weight or cost.
Figure 39. Exaggerated Spar Deflections for 9g Loading
This image depecicts the exaggerated deflections of the rod for easy viewing purposes. As expected, the
maximum deflections occur at the tip. For this model, a factor of saftey of 1.5 was applied to the loading in order to
obtain a maximum tip deflection of 1.78 inches, which was deemed to be acceptable.
Limitations to this finite element analysis modeling should be noted. When dealing with composite materials, the
published material properties represent averages, but the actual properties may vary. Therefore, the directional
moduli used in this analysis could vary from those used in the material modeling, and the strength of the material
can depend on how well the composite material is manufactured. For these reasons, full-scale physical testing
should also be conducted once a prototype vehicle is developed.
Additionally, it should be noted that the design of the Paparazzi UAS was not driven by structures, so the
structural analysis primarily focused on verifying that the structures would meet the requirements rather than
seeking to optimize the structural system to reduce weight. However, as the spar seemed to handle the structural
loading even with a factor of saftey of 1.5, there may be an oportunity for weight savings by analyzing other spar
diameters, sizes, and materials.
29
American Institute of Aeronautics and Astronautics
L. Cost Analysis
Figure 40. Cost Breakdown vs. Vehicle Component
A preliminary cost breakdown has been generated using simply the materials needed to build the aircraft at retail
costs from the manufacturers. These costs represent the actual dollar amounts planned to be spent in order to build
and fly a prototype vehicle. The cost break down was separated in terms of the main aircraft components and is
included in the appendix. The majority of the cost is attributed to the electronics needed to fly and maintain stability,
as well as the cost of the propulsion system. The electronics portion of the vehicle amounts to $539, while the
propulsion system costs $279. The total cost of materials to build the UAS comes to $1,272. This value is
competitive in terms of pricing when considering the cost of similarly sized aircraft, with sufficient room for a profit
margin if sold at a marked-up price.
M. Risk Mitigation
In order to design an aircraft efficiently and to withstand various obstacles the flight profile may present, a risk
analysis is performed in order to mitigate such risks during the design. Below is a list of perceived risks along with
the actions that will be taken to mitigate these risks throughout the design of the Paparazzi UAS.
 Likelihood is order 1-5, with 1 being the least likely and 5 being the most likely.
 Severity or the consequence of the risk happening is ordered 1-5 with 1 being least severe and 5 being most
severe.
Table 8. Vehicle Risks and Risk Mitigations
UAV Failure Modes
Risks
Level of
Likelihood
Level of
Effect Consequence Mitigation
One Engine Out 2 5
Depending on which
motor fails, system
loses thrust and is
forced into
horizontal flight
mode to remain a
flight
All subsystems will undergo
strenuous testing to ensure
it can withstand flight
$125.00
$279.00
$146.00
$539.00
$183.00
$-
$100.00
$200.00
$300.00
$400.00
$500.00
$600.00
Wing Propulsion Fuselage Electronics Battery
30
American Institute of Aeronautics and Astronautics
Two Engines Out 2 5
System fails which
causes loss of
stability and control
of aircraft
All subsystems will undergo
strenuous testing to ensure
it can withstand flight
Three Engines Out 1 5
System fails which
causes loss of
stability and control
of aircraft
All subsystems will undergo
strenuous testing to ensure
it can withstand flight
Propeller Damage 2 5
System fails which
causes loss of
stability and control
of aircraft
All subsystems will undergo
strenuous testing to ensure
it can withstand flight
Unstable Vehicle 2 4
System becomes
unstable and
potential loss of
payload
Pilot will be trained to
handle such events
UAV Stalls 3 3
System becomes
unstable and
potential loss of
payload
Pilot will be trained to
handle such events
Excessive Wind During
Flight
2 3
System becomes
unstable and
potential loss of
payload
Pilot will be trained to
handle such events
Damages to UAV Due
to Excessive Forces on
Vehicle
3 3
System becomes
unstable and
potential loss of
payload
Pilot will be instructed to
land vehicle or detonate
vehicle depending on
situation
Risks
Level of
Likelihood
Level of
Effect Consequence Mitigation
Wing Transition Servos
Fail
2 4
Vehicle is forced to
remain in vertical
thrust mode
All subsystems will undergo
strenuous testing to ensure
it can withstand flight
Motor Speed Controller
Failure
2 4
Motors may
possibly rev at limits
greater than the
recommended
values, or randomly
All subsystems will undergo
strenuous testing to ensure
it can withstand flight, also
pilot will be trained for such
scenarios
31
American Institute of Aeronautics and Astronautics
Autopilot System
Failure
3 5
System fails which
causes loss of
stability and control
of aircraft
UAV will contain a
standard R/C manual
override for emergency
situations
Battery Failure 2 5
System fails which
causes loss of
stability and control
of aircraft
All electronics will be
tested prior to flight and on
full scale test; Back up
system being considered
Batteries Become
Depleted of Charge
2 5
System fails which
causes loss of
stability and control
of aircraft
All electronics will be
tested prior to flight and on
full scale test; Before each
flight, the batteries must be
fully charged; Backup
system being considered
Faulty Wiring 2 5
Insufficient wiring
will cause lack on
control of aircraft
All wiring will be checked
prior to each flight
Loss of Signal 2 2 No Data Collected
All electronics will be
tested prior to flight and on
full scale test
GPS Unit Fails 2 2
No data collected;
Lose track of
payload
All electronics will be
tested prior to flight and on
full scale test
Wiring Fails to
Transmit Data
2 2 No data collected
All electronics will be
tested prior to flight and on
full scale test
Table 9. External Risks and Risk Mitigations
Risks
Level of
Likelihood
Level of
Effect Consequence Mitigation
Miscellaneous
Insufficient Progress
Due to Missing
Members (illness,
accident, etc.)
2 2
Progress on project
becomes slower
Keep communication
between team open and
honest; Work ahead to
prevent these interferences
from interrupting progress
32
American Institute of Aeronautics and Astronautics
School Work Interferes
with Project
Completion
2 2
Progress on project
becomes slower
Keep communication
between team open and
honest; Work ahead to
prevent these interferences
from interrupting progress
Parts Do Not Arrive On
time
4 4
Progress on project
becomes slower
Work ahead to prevent
these interferences from
interrupting progress;
Always have a second plan
to work on so project is
continuously progressing
Lack of Funds to
Purchase Parts
3 5
Progress on project
becomes slower
Work ahead in the budget to
prevent these interferences
from interrupting progress;
Keeping the communication
open with necessary
personnel to get the team
proper funding
Vehicle Damage in
Transportation
3 3
May cause problems
on launch day with
damaged parts
Have spare parts on hand
Vehicle Components do
not easily assemble
2 3 Inability to fly Follow design specs closely
Risks
Level of
Likelihood
Level of
Effect Consequence Mitigation
Manufacturing
Hazardous Materials
such as Foams, Paints,
Epoxies, etc.
2 3
Irritation to eyes,
injury to skin, etc.
Follow safety codes and
have safety overview before
each work session
Risks with Electronics 2 3 Small minor burns
Follow safety codes and
have safety overview before
each work session
33
American Institute of Aeronautics and Astronautics
Hazard with Motors 2 4 Serious bodily harm
Follow safety codes and
have safety overview before
each work session
IV. Conclusion
Through a highly iterative process, the Paparazzi vehicle was designed to maximize payload and flight time. The
airfoil and wing shape were selected to obtain the desired maneuverability performance while reducing the power
consumption during forward flight. In addition, a constraint analysis considering each of limiting mission
requirements was used throughout this process to select appropriate values for power loading, wing loading, and
disk loading. Based on the vehicle performance analysis, the Paparazzi can cruise at the desired 40 knots, which is
the best range value. All climb conditions are also performed at the minimum power condition of 30 knots. The
vehicle has been design to be statically and dynamically stable, including during the transition stage. Based on the
analysis presented in this document, the Paparazzi UAS meets all the requirements established in the RFP. The
Paparazzi vehicle fills a gap in today’s current UAS market. The vehicle is a low cost highly versatile design that
offers the long distance and high speeds of a UAV and the high maneuverability of a tricopter. The vehicle is small
and compact weighing 5.5 lbs. and carrying .62 lbs. of modular payload. With an anticipated 18 minutes of
surveillance 1.5 miles away, the vehicle can stay aloft 33 minutes. A battery was chosen to meet this time
requirement and offers a surplus of power for a variety of different flight regimes. The vehicle has an estimated total
build price of $1,227. The vehicle was verified via wind tunnel testing, and full scale testing was planned. The full
scale testing has run out of time however many vital components have been assembled. A group of students next
year plan on building the aircraft and flight testing the design.
Appendix
Appendix I—Weight Breakdown
Table 10 - Component by Component Weight Breakdown
Weight Breakdown
Electronics
Weight (lbs) Quantity Total Weight (lbs)
Motors 0.27 3 0.80
Propellers 0.04 3 0.12
KK board 0.22 1 0.22
Ardupilot 0.01 1 0.01
GPS 0.04 1 0.04
Battery 0.76 1 0.76
Speed Controller 0.06 3 0.17
Receiver 0.02 1 0.02
Servo Motors 5 0.24
Total: 2.37
Wing and Tail Components
Weight (lbs) Quantity Total Weight (lbs)
Section 1 Wing Foam 0.02 2 0.05
Section 2 Wing Foam 0.04 2 0.08
Spar within Section 1 Carbon Fiber 0.14 2 0.27
Spar within Section 2 Carbon Fiber 0.07 2 0.14
34
American Institute of Aeronautics and Astronautics
Spar Swept Section Carbon Fiber 0.08 2 0.15
Tail Spar 1 Carbon Fiber 0.05 2 0.10
Tail Spar 2 Carbon Fiber 0.20 2 0.40
Tail Upper Spar Carbon Fiber 0.03 2 0.05
Tail Horizontal Spar Carbon Fiber 0.19 1 0.19
Total: 1.44
Fuselage Materials
Weight (lbs) Quantity Total Weight (lbs)
Top Foam 0.02 1 0.02
Box Foam 0.02 1 0.02
Box Balsa 0.19 1 0.19
Top Balsa 0.19 1 0.19
Total 0.41
Total Aircraft Weight (lbs) 4.22
Max Payload for customer (lbs) 1.25
Total Flight Weight (lbs) 5.47
Appendix II—Thrust and Power Required Data
Table 11 - Data for Thrust and Power Required for Level Flight at Different Airspeed
KTAS CL CD Treq (lb) Preq (hp)
18 2.172 0.376 0.952 0.052
21 1.596 0.210 0.724 0.046
24 1.222 0.130 0.583 0.042
27 0.965 0.087 0.494 0.040
30 0.782 0.062 0.438 0.040
33 0.646 0.048 0.404 0.040
36 0.543 0.038 0.386 0.042
40 0.436 0.030 0.380 0.046
41 0.399 0.028 0.383 0.049
44 0.348 0.025 0.393 0.054
47 0.305 0.023 0.410 0.060
Appendix III—Matlab Code for Battery Analysis
%% Paparazzi
%Battery Capacity Preliminary Analysis
clear, clc
%% Conversion Factors
kts2fps = 1.6878;
hp2lbs = 550;
deg2rad = pi/180;
ft2in = 12;
hp2watt = 746;
%% Aircraft Characteristics
W = 5.5; %lbs
b = 40; %inches
cr = 8.5; %inches
ct = 8.5; %inches
S = 340; %inches^2
AR = (b^2)/S;
Ab = 0.785; %Area blades
35
American Institute of Aeronautics and Astronautics
sweep = 0; %degrees
e = (4.61*(1-0.045*(AR^0.68))*(cosd(sweep)^.15))-
3.1;
%% Drag Polar
K = 1/(pi*AR*e);
cd0 = 0.02;
%% Power Calculations
Vol = 14.8; %Volts
%% Takeoff
tto = 6; %sec
Vtko = 3; %ft/s
%% Climb
Vclimb = 30; %knots since it is close to V for min
Power.
RC1 = 96; %fpm
Preqcli = 0.04; %hp = minimum power
tclimb = 5*60; %seconds
%using the equation RC = (Pav - Preq)/W
%Power needed by engine to climb
Power1 = (((RC1/60)*W)+(Preqcli*hp2lbs))/hp2lbs;
%hp
Iclimb1 = ((Power1*hp2watt)/Vol)*1000; %mAmp
%% Cruise x2
rhoc = 0.002318; %slugs/ft3
%rhoc = 0.002377;
Vcruise = 40; %kts
CLcruise =
W/(0.5*rhoc*((Vcruise*kts2fps)^2)*(S/(ft2in^2)));
CDcruise = cd0 + K*((CLcruise*kts2fps)^2);
range = 2; %nm
tcruise = (range/Vcruise)*3600; %seconds
Treqcruise =
CDcruise*0.5*rhoc*((Vcruise*kts2fps)^2); %lbs
Preqcruise = (Vcruise*kts2fps)*Treqcruise/hp2lbs;
%hp
Icruise = ((Preqcruise * hp2watt)/Vol)*1000;
%mAmp
%% Transition
ttrans = 3; %sec
%% Loiter
FM = 0.6; %From
tlot = 3*60; %sec
tsurv = 15*60; %sec
Trot = W/3;
Vrot = sqrt((Trot/Ab)/(2*rhoc));
Prot = (Trot*Vrot)/(FM*550);
P_hv_tot = 3*Prot*1.03;
f = 1.03;
nmech = 0.97;
Pclimb_rot
=(((f*W)/FM)*sqrt(((f*W)/Ab)/(2*rhoc)))+((W*Vtk
o)/2);
Ptko = Pclimb_rot/550;
Vlot = 30*kts2fps; %fps
Cllot = (W/(S/(ft2in^2)))/(0.5*rhoc*(Vlot)^2);
Cdlot = cd0 + K*(Cllot^2);
Plot=
(Vlot*(Cdlot*0.5*rhoc*(Vlot^2)*(S/(ft2in^2)))/550);
Ito = ((Ptko*(hp2watt)/Vol)*1000);
Ilot = (Plot*(hp2watt)/Vol)*1000;
Isurv = ((P_hv_tot*(hp2watt)/Vol)*1000);
%% Climb
RC2 = 90; %fpm
Power2 = (((RC2/60)*W)+(Preqcli*hp2lbs))/hp2lbs;
%hp
tclimb2 = tclimb;
Iclimb2 = ((Power2*hp2watt)/Vol)*1000; %mAmp
%% Descend
tdesc = 0; %sec
%% Landing
tland = 10; %sec
%time of mission
%ttotal = tclimb + tcruise + tclimb2 + tcruise;
ttotal = tclimb + tcruise + tlot + ...
tclimb2 + tcruise+tsurv+tto;
%Iavg = ((Iclimb1*tclimb)+(Icruise*tcruise)...
% +(Iclimb2*tclimb2)+(Icruise*tcruise))/ttotal;
Iavg =((Iclimb1*tclimb)+(Icruise*tcruise)+
(Isurv*tsurv)+ (Ito*tto)...
+(Ilot*tlot)+...
(Iclimb2*tclimb2)+(Icruise*tcruise))/ttotal;
%mAmp
Pclimb1 = Iclimb1*tclimb/3600
Pcruise1 = Icruise*tcruise/3600
Psurv = Isurv*tsurv/3600
Pto = Ito*tto/3600
Plot = Ilot*tlot/3600
Pclimb2 = Iclimb2*tclimb2/3600
Pcruise2 = Icruise*tcruise/3600
CAP = ((Iavg*ttotal)/3600) %mAh
36
American Institute of Aeronautics and Astronautics
Appendix IV—Cost Breakdown
Table 12. Cost Breakdown
Wing Materials
Foam $ 75.00
Carbon Fiber Rectangular tube $ 50.00
Propulsion System
Motors (3) $ 186.00
Servos $ 75.00
Props $ 16.00
Locknuts $ 2.00
Fuselage/Payload
3-D Printed Fuselage $ 20.00
Carbon Fiber Exterior $ 60.00
Cameras $ 16.00
Carbon Fiber Rods $ 50.00
Electronics
Control Boards (2) $ 371.00
GPS $ 40.00
Batteries $ 180.00
3 Brushless Speed Controllers (ESCs) $ 39.00
Transmitter and Receiver $ 40.00
Servo Connectors $ 5.00
Bullet Connectors $ 3.00
Battery Charger and Accessories $ 23.00
ESC Programming Card $ 7.00
AVR Programmer $ 11.00
Battery Connector $ 3.00
Total
$ 1,272.00
Appendix V—Drag Buildup Data
Table 13- Drag Build Up for Swept Wing Section
t/c 0.13
Span 1.67
Sweep (Degrees) 18
C_r,e 0.83
Taper Ratio 0.4
C_t 0.33
c_bar (m.a.c.) 0.62
Re 260028
C_f (turb for whole wing) 0.006113
37
American Institute of Aeronautics and Astronautics
C_f (turb for up to x_cr) 0.005760
C_f (laminar up to x_cr) 0.002245
x_cr 0.01
C_f, weighted (and corrected by 10% for surface roughness) 0.006783
Z 1.90
Correction Factor (K) 1.28
S_wet 0.45
C,d_wing 0.001638
f_P,wing 0.003869
Table 14 - Drag Build Up Rectangular Wing Section
t/c 0.13
Span 1.67
Sweep (Degrees) 0
C_r,e 0.83
Taper Ratio 1
C_t 0.83
c_bar (m.a.c.) 0.83
Re 350037
C_f (turb for whole wing) 0.005760
C_f (turb for up to x_cr) 0.005760
C_f (laminar up to x_cr) 0.002245
x_cr 0.01
C_f, weighted (and corrected by 10% for surface roughness) 0.006404
Z 2.00
Correction Factor (K) 1.29
S_wet 2.78
C,d_wing 0.009708
f_P,wing 0.02292
Table 15 - Drag Build Up Fuselage
Fuse Length 1
Cross-Sectional Area 0.0625
Perimeter 2.5
Fuse Diameter 0.25
Re 420045
C_f (turb for whole fuselage) 0.005554
C_f (turb for up to x_cr) 0.005760
C_f (laminar up to x_cr) 0.002245
x_cr 0.01
C_f, weighted (and corrected by 10% for surface roughness) 0.006181
Correction Coeff (K) 1.40
38
American Institute of Aeronautics and Astronautics
S_wet 0.95
C,d_fuse 0.003490
f_P,fuse 0.008240
Table 16 - Drag Build Up Engineer Nacelles Section
Length 0.35
Cross-Sectional Area 0.03125
Perimeter 0.36
Diameter 0.12
Re 148834
C_f (turb for whole fuselage) 0.006834
C_f (turb for up to x_cr) 0.005760
C_f (laminar up to x_cr) 0.002245
x_cr 0.01
C_f, weighted (and corrected by 10% for surface roughness) 0.007543
Correction Coeff (K) 1.64
S_wet 0.15
C,d_fuse 0.0007860
f_P,fuse 0.001856
Table 17 - Drag Build Up Totals
C,d_total(Cdo) 0.01562
f total 0.03689
D,p total 0.1948
C_L (steady level flight) 0.44
Induced Drag Coeff 0.01449
Total C_D 0.03
Total Drag 0.38
Drag of JUST Wing, HT, and VT 0.061
Total L/D 14.46
Table 18 - Drag Build Up Structural Conditions
Weight (W) 5.5
Reference Area (S_ref) 2.36
Re,cr 3.50E+05
Fuselage Diameter 0.46
Thickness (Wing) 0.108
Thickness (Tails) 0
Roughness 1.12
Span 3.33
Efficiency Factor 0.8852
39
American Institute of Aeronautics and Astronautics
Appendix VI—Constraint Analysis Data
Table 19 - Constraint Analysis Conditions
Gross Weight
Wg (lbs) 5.5
Max Cruise Height
h (ft) 400
Cruise Velocity
V (kts) 40
V (fps) 67.5
Mdesign 0.061
Temperature at Max Cruise Height
T (Kelvin) 286.4
T (Rankine) 515.6
T/To 0.917
Density
ρSL (slug/ft3
) 0.002377
ρTO (slug/ft3
) 0.002345
ρcruise (slug/ft3
) 0.00231758
ρhover (slug/ft3
) 0.00234259
σcruise 0.975
Rate of Climb
ROC (fps) 1.267
Table 20 - Constraint Analysis Parameters
Design Assumptions
Vmax (fps) 84.39
Mmax 0.076
Vstall (fps) 37.35
Clmax 1.42
ɳp, cruise 0.70
CD0 0.016
ɳp, ROC 0.60
(L/D)max 14.5
AR 4.7
e 0.89
K 0.076
40
American Institute of Aeronautics and Astronautics
hceiling (ft) 400
ρcieling (slug/ft3
) 0.0023176
σceiling 0.9750
Design Assumptions for Helicopter
FM 0.70
ɳp, mechanical 0.97
f 1.03
ROC (fps) 2
Table 21 - Forward Flight Design Point
Forward Thrust Design Point
Throttle Setting 70%
W/SW (lbs/ft2
) 2.3
W/P (lbs/hp) 25.6
Table 22 - Vertical Thrust Design Point
Vertical Thrust Efficient Design
Throttle Setting 80%
W/SD (lbs/ft2
) 7.0
W/P (lbs/hp) 5.7
Appendix VII—Airfoil Data Points
Table 23. Modified MH 114
Wing Airfoil –
Modified MH114
Tail Airfoil –
NACA 0009
X Y X Y
1 0 1 0
0.99665 0.00106 0.99572 0.00057
0.98722 0.0043 0.98296 0.00218
0.97276 0.00943 0.96194 0.00463
0.95372 0.01577 0.93301 0.0077
0.93005 0.02295 0.89668 0.01127
0.90199 0.03097 0.85355 0.01522
0.87001 0.03972 0.80438 0.01945
0.83463 0.04896 0.75 0.02384
0.79632 0.05841 0.69134 0.02823
0.75558 0.06774 0.62941 0.03247
0.71288 0.07668 0.56526 0.03638
0.66868 0.08496 0.5 0.03978
0.6234 0.09231 0.43474 0.04248
0.57735 0.09857 0.37059 0.04431
41
American Institute of Aeronautics and Astronautics
0.53089 0.10359 0.33928 0.04484
0.48438 0.10728 0.30866 0.04509
0.4382 0.10956 0.27886 0.04504
0.39274 0.11039 0.25 0.04466
0.3484 0.10975 0.22221 0.04397
0.30554 0.10767 0.19562 0.04295
0.26453 0.10418 0.17033 0.04161
0.22566 0.09936 0.14645 0.03994
0.18921 0.0933 0.12408 0.03795
0.15539 0.08611 0.10332 0.03564
0.12443 0.07791 0.08427 0.03305
0.09655 0.06887 0.06699 0.03023
0.07192 0.05915 0.05156 0.0272
0.0507 0.04893 0.03806 0.02395
0.033 0.03841 0.02653 0.02039
0.01891 0.02782 0.01704 0.01646
0.00857 0.01742 0.00961 0.01214
0.00198 0.00754 0.00428 0.00767
0.00032 0.00285 0.00107 0.00349
0 0.00025 0 0
0.00022 -0.00214 0.00107 -0.00349
0.00062 -0.00355 0.00428 -0.00767
0.0012 -0.00476 0.00961 -0.01214
0.002 -0.00586 0.01704 -0.01646
0.0031 -0.00697 0.02653 -0.02039
0.00525 -0.00862 0.03806 -0.02395
0.00795 -0.01024 0.05156 -0.0272
0.01348 -0.01288 0.06699 -0.03023
0.02894 -0.01783 0.08427 -0.03305
0.05011 -0.02186 0.10332 -0.03564
0.07665 -0.02485 0.12408 -0.03795
0.10836 -0.02673 0.14645 -0.03994
0.14492 -0.02753 0.17033 -0.04161
0.18598 -0.0273 0.19562 -0.04295
0.23112 -0.02613 0.22221 -0.04397
0.27985 -0.02415 0.25 -0.04466
0.33164 -0.02145 0.27886 -0.04504
0.38589 -0.01817 0.30866 -0.04509
0.44199 -0.01444 0.33928 -0.04484
0.49927 -0.01046 0.37059 -0.04431
0.55703 -0.00645 0.43474 -0.04248
42
American Institute of Aeronautics and Astronautics
0.61454 -0.00262 0.5 -0.03978
0.671 0.00085 0.56526 -0.03638
0.72557 0.00378 0.62941 -0.03247
0.77737 0.00601 0.69134 -0.02823
0.82556 0.00742 0.75 -0.02384
0.86933 0.00793 0.80438 -0.01945
0.90792 0.00757 0.85355 -0.01522
0.94063 0.00634 0.89668 -0.01127
0.96666 0.00442 0.93301 -0.0077
0.9853 0.0023 0.96194 -0.00463
0.99635 0.00063 0.98296 -0.00218
1 0 0.99572 -0.00057
1 0
Appendix VIII—Wind Tunnel Data Reduction
%% Wind Tunnel Analysis
%Team Paparazzi
clear
clc
%% Conversion Factors
% < < Distance > >
nm_2_miles = 1.15078; %multiply to convert from nm to miles
miles_2_ft = 5280; %multiply to convert from miles to feet
in_2_ft = 1/12; %multiply to convert from in to ft
% < < Speed > >
kts_2_mph = 1.1508; %multiply to convert from kts to mph
kts_2_fps = 1.6878; %multiply to convert from kts to fps
mph_2_fps = 1.46667; %multiply to convert from mph to fps
% < < Mass > >
oz_2_lbs = 1/16; %multiply to convert from oz to lbs
% < < Temperature > >
fah_2_rank = 460.67; %add to convert from Fahrenheit to Rankine
% < < Pressure > >
inHg_2_psf = 70.7262; %multiply to convert from inches Mercury
to Psf
% < < Time > >
hour_2_sec = 3600; %multiply to convert from hours to seconds
min_2_sec = 60; %multiply to convert from min to seconds
% < < Angles > >
deg_2_rad = pi/180; %multiply to convert from degrees to radians
%% Atmospheric Conditions
Tatm = 76; %Fahrenheit
Tatm = Tatm + fah_2_rank; %Convert to working units
Patm = 29.5; %inches of Mercury
Patm = Patm*inHg_2_psf; %Convert to working units
Rair = 1716; %Air Constant in engineering units
Density = Patm/(Rair*Tatm); %Air Density at Given Conditions
mu = (3.62*10^-
7)*((Tatm/518.7)^1.5)*((518.7+198.72)/(Tatm+198.72));
%air viscocity in engineering units at Patm and Tatm
%-> Got equation from Introduction to Flight 7th ed.
nu = mu/Density;
a_SL = 1116; %Speed of Sound at SL in fps
%% Chosen Testing Variables
Vvec = [0 15 20 25 30 35 40 45 60 92]; %Wind Tunnel Speeds in
mph
Vvec = Vvec*mph_2_fps; %Convert to working units
q_s = 0.5*Density*Vvec.^2; %Uncorrected Dynamic Pressure
Vector
%% Wind Tunnel Test Section Geometry
H = 28; %Test Section Height in inches
H = H*in_2_ft; %Convert to working units
B = 40; %Test Section Width in inches
B = B*in_2_ft; %Convert to working units
Lts = 54; %Test Section Length in inches
Lts = Lts*in_2_ft; %Convert to working units
Acs = H*B; %Test Section Cross-sectional (Frontal) Area
Ats = H*Lts; %Test Section Area
Strut_D = 1.5; %Strut Diameter in inches <<NOT UPDATED>>
Strut_D = Strut_D*in_2_ft; %Convert to working units
Strut_L = 15; %Strut Length in inches <<NOT UPDATED>>
43
American Institute of Aeronautics and Astronautics
Strut_L = Strut_L*in_2_ft; %Convert to working units
Astrut = Strut_D*Strut_L; %THis is the Area in contact with free
stream
%% Paparazzi Aircraft Wind Tunnel Model Geometry
% < < Wing > >
bw = 20; %Wing Span in inches
bw = bw*in_2_ft; %Convert to working units
cbar_w = 4.25; %Wing MAC in inches
cbar_w = cbar_w*in_2_ft; %Convert to working units
Sw = bw*cbar_w; %Wing Area
ARw = (bw^2)/Sw; %Wing Aspect Ratio
Vol_w = 31.29; %Wing Volume in inches cube
Vol_w = Vol_w*(in_2_ft^3); %Convert to working units
X_CG = 2; %CG location from wing LE in inches
X_CG = X_CG*in_2_ft; %Convert to working units
tw = 0.1305*cbar_w; %Wing Thickness
Rew = (Vvec*cbar_w)/nu; %Wing Reynolds Number Vector
% < < Tail > >
bt = 10.63; %Tail Span in inches
bt = bt*in_2_ft; %Convert to working units
cbar_t = 3.25; %Tail MAC in inches
cbar_t = cbar_t*in_2_ft; %Convert to working units
St = bt*cbar_t; %Tail Area
ARt = (bt^2)/St; %Tail Aspect Ratio
lt = 7.5; %Distance from CG to Tail Aerodynamic Center (@ c/4)
in inches
lt = lt*in_2_ft; %Convert to working units
V_H = (lt*St)/(cbar_w*Sw); %Tail Volume Coefficient
Ret = (Vvec*cbar_t)/nu; %Tail Reynolds Number Vector
% < < Fuselage > >
Vol_f = 7.4668; %Fuselage Volume in inches cube
Vol_f = Vol_f*(in_2_ft^3); %Convert to working units
X_balance_CG = 0.94; %X-Distance between Balance and
Aircraft CG in inches
X_balance_CG = X_balance_CG*in_2_ft; %Convert to working
units
Z_balance_CG = 0.50; %Z-Distance between Balance and Aircraft
CG in inches
Z_balance_CG = Z_balance_CG*in_2_ft; %Convert to working
units
D_f = 1.5; %Fuselage Diameter in inches
D_f = D_f*in_2_ft; %Convert to working units
L_f = 6.875; %Fuselage Length in inches
L_f = L_f*in_2_ft; %Convert to working units
%% Figure Parameters
% < < Figure 6.23 > >
% Read from ARw and Taper Ratio = 1
bv_b = 0.86; %Get
% < < Figure 6.29 > >
bv = bv_b*bw;
be = (bw + bv)*0.5;
K = be/B;
be_B = be/B; %Read and Taper Ratio = 1
Delta = 0.146; %Get
% < < Figure 6.52 > >
lt_B = lt/B; %Read and Taper Ratio = 1
Tau2 = 0.35; %Get
% < < Figure 6.13 > >
tw_cbarw = tw/cbar_w; %Read (Airfoil not in the chart,
approximated)
Df_Lf = D_f/L_f; %Read
K1 = 0.997; %Get
K3 = 0.95; %Get
% < < Figure 6.14 > >
b2_B = 2*bw/B; %Read
B_H = B/H; %Read
Tau1 = 0.9125; %Get
%% Constant Correction Coefficients
Esbw = (K1*Tau1*Vol_w)/(Acs^(3/2));
EsbB = (K3*Tau1*Vol_f)/(Acs^(3/2));
Esbt = Esbw+EsbB;
Estrut_windshield = 0.25*(Acs/Ats);
DCmcg_Ddelta = -0.0626*V_H; %Assuming
%% Wind Tunnel Test
%% No Wind with Model Data
%import .dat file to matlab
[Data,SizeData] = importfile('no_wind.dat', 2);
%Substract First Row which to substract Zero offset error
44
American Institute of Aeronautics and Astronautics
for i = 2:1:SizeData(1)
Data(i,:) = Data(i,:) - Data(1,:);
end
alpha_no_wind = Data(2:end,1); %AoA vector in Deg.
Lift_no_wind = Data(2:end,2); %Lift Vector in lbs.
Drag_no_wind = Data(2:end,3); %Drag Vector in lbs.
Pitch_no_wind = Data(2:end,4)*in_2_ft; %Pitching Moment
Vector in lbs*ft
Side_no_wind = Data(2:end,5); %Sideforce Vector in lbs
Roll_no_wind = Data(2:end,6)*in_2_ft; %Rolling Moment Vector
in lbs*ft
Yaw_no_wind = Data(2:end,7)*in_2_ft; %Yawing Moment
Vector in lbs*ft
%% No Model with Wind at 92 mph Data
%import .dat file to matlab
[Data]= importfile('no_model_92mph.dat', 2);
alpha_no_model_92mph = Data(1:end,1); %AoA vector in Deg.
Lift_no_model_92mph = Data(1:end,2); %Lift Vector in lbs.
Drag_no_model_92mph = Data(1:end,3); %Drag Vector in lbs.
Pitch_no_model_92mph = Data(1:end,4)*in_2_ft; %Pitching
Moment Vector in lbs*ft
Side_no_model_92mph = Data(1:end,5); %Sideforce Vector in lbs
Roll_no_model_92mph = Data(1:end,6)*in_2_ft; %Rolling
Moment Vector in lbs*ft
Yaw_no_model_92mph = Data(1:end,7)*in_2_ft; %Yawing
Moment Vector in lbs*ft
%To correct Cruise conditions besides 92 mph, we need to
nondimensionalize the Data
%Divide Loads by 0.5*Density*V^2*Sstruts
%Divide Moments by 0.5*Density*V^2*Sstruts*Dstrut
CLs_no_model =
Lift_no_model_92mph/(0.5*Density*(Vvec(end)^2)*Astrut);
CDs_no_model =
Drag_no_model_92mph/(0.5*Density*(Vvec(end)^2)*Astrut);
CSFs_no_model =
Side_no_model_92mph/(0.5*Density*(Vvec(end)^2)*Astrut);
CMs_no_model =
Pitch_no_model_92mph/(0.5*Density*(Vvec(end)^2)*Astrut*Stru
t_D);
CLRs_no_model =
Roll_no_model_92mph/(0.5*Density*(Vvec(end)^2)*Astrut*Strut
_D);
CNs_no_model =
Yaw_no_model_92mph/(0.5*Density*(Vvec(end)^2)*Astrut*Strut
_D);
%% Cruise Analysis:
%% < < Speed = 30 mph > >
%import .dat file to matlab
[Data,SizeData] = importfile('cruise_30mph.dat', 2);
%Substract First Row which to substract Zero offset error
for i = 2:1:SizeData(1)
Data(i,:) = Data(i,:) - Data(1,:);
end
alpha_cruise_30mph = Data(2:end,1); %AoA vector in Deg.
Lift_cruise_30mph = Data(2:end,2); %Lift Vector in lbs.
Drag_cruise_30mph = Data(2:end,3); %Drag Vector in lbs.
Pitch_cruise_30mph = Data(2:end,4)*in_2_ft; %Pitching Moment
Vector in lbs*ft
Side_cruise_30mph = Data(2:end,5); %Sideforce Vector in lbs
Roll_cruise_30mph = Data(2:end,6)*in_2_ft; %Rolling Moment
Vector in lbs*ft
Yaw_cruise_30mph = Data(2:end,7)*in_2_ft; %Yawing Moment
Vector in lbs*ft
%First, we correct for no wind effect
Lift_cruise_30mph_corr = Lift_cruise_30mph - Lift_no_wind;
Drag_cruise_30mph_corr = Drag_cruise_30mph - Drag_no_wind;
Pitch_cruise_30mph_corr = Pitch_cruise_30mph - Pitch_no_wind;
Side_cruise_30mph_corr = Side_cruise_30mph - Side_no_wind;
Roll_cruise_30mph_corr = Roll_cruise_30mph - Roll_no_wind;
Yaw_cruise_30mph_corr = Yaw_cruise_30mph - Yaw_no_wind;
%Now, Since V is not 92 mph, we nondimensionalize Lift and
Drag
%To correct for no model in Lift and Drag to find other correction
factors
CLs_cruise_30mph_corr =
Lift_cruise_30mph_corr/(0.5*Density*(Vvec(5)^2)*Sw);
CDs_cruise_30mph_corr =
Drag_cruise_30mph_corr/(0.5*Density*(Vvec(5)^2)*Sw);
%Now we correct for no model error
CLs_cruise_30mph_corr = CLs_cruise_30mph_corr -
CLs_no_model;
CDs_cruise_30mph_corr = CDs_cruise_30mph_corr -
CDs_no_model;
%Now we compute CL squared to find K and CD0
CLs_cruise_30mph_CG_sq = CLs_cruise_30mph_corr.^2;
%{
%We plot to have a sense of the results (Should be a straigth line)
figure
plot(CLs_cruise_30mph_CG_sq,CDs_cruise_30mph_corr)
%}
%We do a linear fit to compute the slope and the CD intercept
(CD0)
CL_sq_CD_30mph_Eq =
polyfit(CLs_cruise_30mph_CG_sq,CDs_cruise_30mph_corr,1);
%Compute K
K_cruise_30mph = CL_sq_CD_30mph_Eq(1);
%Compute e
e_osw_cruise_30mph = 1/(K_cruise_30mph*ARw*pi);
%Compute CD0
CD0_cruise_30mph = CL_sq_CD_30mph_Eq(2);
%Find Missing correction factors
Ewbt_cruise_30mph = (Sw/(4*Acs))*CD0_cruise_30mph;
Etot_cruise_30mph = Esbt + Ewbt_cruise_30mph +
Estrut_windshield;
%Compute Corrected dynamic pressure
q_corr_cruise_30mph = q_s(5)*(1+Etot_cruise_30mph)^2;
%Use Corrected dynamic pressure to compute all coefficients
CLs_cruise_30mph_corr =
Lift_cruise_30mph_corr/(q_corr_cruise_30mph*Sw);
CDs_cruise_30mph_corr =
Drag_cruise_30mph_corr/(q_corr_cruise_30mph*Sw);
45
American Institute of Aeronautics and Astronautics
CSFs_cruise_30mph_corr =
Side_cruise_30mph_corr/(q_corr_cruise_30mph*Sw);
CMs_cruise_30mph_corr =
Pitch_cruise_30mph_corr/(q_corr_cruise_30mph*Sw*cbar_w);
CLRs_cruise_30mph_corr =
Roll_cruise_30mph_corr/(q_corr_cruise_30mph*Sw*cbar_w);
CNs_cruise_30mph_corr =
Yaw_cruise_30mph_corr/(q_corr_cruise_30mph*Sw*cbar_w);
%Now we correct all coefficients for no model error
CLs_cruise_30mph_corr = CLs_cruise_30mph_corr -
CLs_no_model;
CDs_cruise_30mph_corr = CDs_cruise_30mph_corr -
CDs_no_model;
CSFs_cruise_30mph_corr = CSFs_cruise_30mph_corr -
CSFs_no_model;
CMs_cruise_30mph_corr = CMs_cruise_30mph_corr -
CMs_no_model;
CLRs_cruise_30mph_corr = CLRs_cruise_30mph_corr -
CLRs_no_model;
CNs_cruise_30mph_corr = CNs_cruise_30mph_corr -
CNs_no_model;
%Compute AoA correction Vector
Delta_alpha_cruise_30mph =
Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_cruise_30mph_corr;
%Corrected AoA
alpha_cruise_30mph_corr = alpha_cruise_30mph +
Delta_alpha_cruise_30mph;
%Drag Wall Correction
Delta_Cd_cruise_30mph =
Delta*(Sw/Acs)*(CLs_cruise_30mph_corr.^2);
%Tail Moment Coefficient Correction Vector
Delta_Cm_CG_cruise_30mph =
DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*...
CLs_cruise_30mph_corr;
%Now we translate the Loads and moments from Balance Center
to CG
%Loads_CG = Loads_Balance
%Moments_CG = Moment_Balance +- Loads*distance
CLs_cruise_30mph_corr_CG = CLs_cruise_30mph_corr;
CDs_cruise_30mph_corr_CG = CDs_cruise_30mph_corr +
Delta_Cd_cruise_30mph;
CSFs_cruise_30mph_corr_CG = CSFs_cruise_30mph_corr;
CMs_cruise_30mph_corr_CG = (CMs_cruise_30mph_corr +...
CLs_cruise_30mph_corr*(X_balance_CG/cbar_w)-...
CDs_cruise_30mph_corr*(Z_balance_CG/cbar_w)) -
Delta_Cm_CG_cruise_30mph;
CLRs_cruise_30mph_corr_CG = CLRs_cruise_30mph_corr -...
CSFs_cruise_30mph_corr*(Z_balance_CG/cbar_w);
CNs_cruise_30mph_corr_CG = CNs_cruise_30mph_corr +...
CSFs_cruise_30mph_corr*(X_balance_CG/cbar_w);
%{
%Plot Results for further Study
figure
plot(alpha_cruise_30mph_corr,CLs_cruise_30mph_corr_CG)
title('Lift Coefficient vs. Angle of Attack at 30mph')
xlabel('Angle of Attack (Degrees)')
ylabel('C_L')
figure
plot(CLs_cruise_30mph_corr_CG,CDs_cruise_30mph_corr_CG)
title('Drag Polar at 30mph')
xlabel('C_L')
ylabel('C_D')
figure
plot(CLs_cruise_30mph_corr_CG,CMs_cruise_30mph_corr_CG)
title('Moment Coefficient vs. Lift Coefficient at 30mph')
xlabel('C_L')
ylabel('C_m about CG')
figure
plot(alpha_cruise_30mph_corr,CLRs_cruise_30mph_corr_CG)
title('Rolling Moment Coefficient vs. Angle of Attack at 30mph')
xlabel('Angle of Attack (Degrees)')
ylabel('C_Lroll')
figure
plot(alpha_cruise_30mph_corr,CNs_cruise_30mph_corr_CG)
title('Yawing Moment Coefficient vs. Angle of Attack at 30mph')
xlabel('Angle of Attack (Degrees)')
ylabel('C_N')
%}
%% < < Speed = 60 mph > >
%import .dat file to matlab
[Data,SizeData] = importfile('cruise_60mph.dat', 2);
%Substract First Row which to substract Zero offset error
for i = 2:1:SizeData(1)
Data(i,:) = Data(i,:) - Data(1,:);
end
alpha_cruise_60mph = Data(2:end,1); %AoA vector in Deg.
Lift_cruise_60mph = Data(2:end,2); %Lift Vector in lbs.
Drag_cruise_60mph = Data(2:end,3); %Drag Vector in lbs.
Pitch_cruise_60mph = Data(2:end,4)*in_2_ft; %Pitching Moment
Vector in lbs*ft
Side_cruise_60mph = Data(2:end,5); %Sideforce Vector in lbs
Roll_cruise_60mph = Data(2:end,6)*in_2_ft; %Rolling Moment
Vector in lbs*ft
Yaw_cruise_60mph = Data(2:end,7)*in_2_ft; %Yawing Moment
Vector in lbs*ft
%First, we correct for no wind effect
Lift_cruise_60mph_corr = Lift_cruise_60mph - Lift_no_wind;
Drag_cruise_60mph_corr = Drag_cruise_60mph - Drag_no_wind;
Pitch_cruise_60mph_corr = Pitch_cruise_60mph - Pitch_no_wind;
Side_cruise_60mph_corr = Side_cruise_60mph - Side_no_wind;
Roll_cruise_60mph_corr = Roll_cruise_60mph - Roll_no_wind;
Yaw_cruise_60mph_corr = Yaw_cruise_60mph - Yaw_no_wind;
%Now, Since V is not 92 mph, we nondimensionalize Lift and
Drag
%To correct for no model in Lift and Drag to find other correction
factors
CLs_cruise_60mph_corr =
Lift_cruise_60mph_corr/(0.5*Density*(Vvec(end-1)^2)*Sw);
CDs_cruise_60mph_corr =
Drag_cruise_60mph_corr/(0.5*Density*(Vvec(end-1)^2)*Sw);
%Now we correct for no model error
CLs_cruise_60mph_corr = CLs_cruise_60mph_corr -
CLs_no_model;
CDs_cruise_60mph_corr = CDs_cruise_60mph_corr -
CDs_no_model;
%Now we compute CL squared to find K and CD0
CLs_cruise_60mph_CG_sq = CLs_cruise_60mph_corr.^2;
46
American Institute of Aeronautics and Astronautics
%{
%We plot to have a sense of the results (Should be a straigth line)
figure
plot(CLs_cruise_60mph_CG_sq,CDs_cruise_60mph_corr)
%}
%We do a linear fit to compute the slope and the CD intercept
(CD0)
CL_sq_CD_60mph_Eq =
polyfit(CLs_cruise_60mph_CG_sq,CDs_cruise_60mph_corr,1);
%Compute K
K_cruise_60mph = CL_sq_CD_60mph_Eq(1);
%Compute e
e_osw_cruise_60mph = 1/(K_cruise_60mph*ARw*pi);
%Compute CD0
CD0_cruise_60mph = CL_sq_CD_60mph_Eq(2);
%Find Missing correction factors
Ewbt_cruise_60mph = (Sw/(4*Acs))*CD0_cruise_60mph;
Etot_cruise_60mph = Esbt + Ewbt_cruise_60mph +
Estrut_windshield;
%Compute Corrected dynamic pressure
q_corr_cruise_60mph = q_s(end-1)*(1+Etot_cruise_60mph)^2;
%Use Corrected dynamic pressure to compute all coefficients
CLs_cruise_60mph_corr =
Lift_cruise_60mph_corr/(q_corr_cruise_60mph*Sw);
CDs_cruise_60mph_corr =
Drag_cruise_60mph_corr/(q_corr_cruise_60mph*Sw);
CSFs_cruise_60mph_corr =
Side_cruise_60mph_corr/(q_corr_cruise_60mph*Sw);
CMs_cruise_60mph_corr =
Pitch_cruise_60mph_corr/(q_corr_cruise_60mph*Sw*cbar_w);
CLRs_cruise_60mph_corr =
Roll_cruise_60mph_corr/(q_corr_cruise_60mph*Sw*cbar_w);
CNs_cruise_60mph_corr =
Yaw_cruise_60mph_corr/(q_corr_cruise_60mph*Sw*cbar_w);
%Now we correct all coefficients for no model error
CLs_cruise_60mph_corr = CLs_cruise_60mph_corr -
CLs_no_model;
CDs_cruise_60mph_corr = CDs_cruise_60mph_corr -
CDs_no_model;
CSFs_cruise_60mph_corr = CSFs_cruise_60mph_corr -
CSFs_no_model;
CMs_cruise_60mph_corr = CMs_cruise_60mph_corr -
CMs_no_model;
CLRs_cruise_60mph_corr = CLRs_cruise_60mph_corr -
CLRs_no_model;
CNs_cruise_60mph_corr = CNs_cruise_60mph_corr -
CNs_no_model;
%Compute AoA correction Vector
Delta_alpha_cruise_60mph =
Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_cruise_60mph_corr;
%Corrected AoA
alpha_cruise_60mph_corr = alpha_cruise_60mph +
Delta_alpha_cruise_60mph;
%Drag Wall Correction
Delta_Cd_cruise_60mph =
Delta*(Sw/Acs)*(CLs_cruise_60mph_corr.^2);
%Tail Moment Coefficient Correction Vector
Delta_Cm_CG_cruise_60mph =
DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*...
CLs_cruise_60mph_corr;
%Now we translate the Loads and moments from Balance Center
to CG
%Loads_CG = Loads_Balance
%Moments_CG = Moment_Balance
CLs_cruise_60mph_corr_CG = CLs_cruise_60mph_corr;
CDs_cruise_60mph_corr_CG = CDs_cruise_60mph_corr +
Delta_Cd_cruise_60mph;
CSFs_cruise_60mph_corr_CG = CSFs_cruise_60mph_corr;
CMs_cruise_60mph_corr_CG = (CMs_cruise_60mph_corr +...
CLs_cruise_60mph_corr*(X_balance_CG/cbar_w)-...
CDs_cruise_60mph_corr*(Z_balance_CG/cbar_w)) -
Delta_Cm_CG_cruise_60mph;
CLRs_cruise_60mph_corr_CG = CLRs_cruise_60mph_corr -...
CSFs_cruise_60mph_corr*(Z_balance_CG/cbar_w);
CNs_cruise_60mph_corr_CG = CNs_cruise_60mph_corr +...
CSFs_cruise_60mph_corr*(X_balance_CG/cbar_w);
%{
%Plot Results for further Study
figure
plot(alpha_cruise_60mph_corr,CLs_cruise_60mph_corr_CG)
title('Lift Coefficient vs. Angle of Attack at 60mph')
xlabel('Angle of Attack (Degrees)')
ylabel('C_L')
figure
plot(CLs_cruise_60mph_corr_CG,CDs_cruise_60mph_corr_CG)
title('Drag Polar at 60mph')
xlabel('C_L')
ylabel('C_D')
figure
plot(CLs_cruise_60mph_corr_CG,CMs_cruise_60mph_corr_CG)
title('Moment Coefficient vs. Lift Coefficient at 60mph')
xlabel('C_L')
ylabel('C_m')
figure
plot(alpha_cruise_60mph_corr,CLRs_cruise_60mph_corr_CG)
title('Rolling Moment Coefficient vs. Angle of Attack at 60mph')
xlabel('Angle of Attack (Degrees)')
ylabel('C_Lroll')
figure
plot(alpha_cruise_60mph_corr,CNs_cruise_60mph_corr_CG)
title('Yawing Moment Coefficient vs. Angle of Attack at 60mph')
xlabel('Angle of Attack (Degrees)')
ylabel('C_N')
%}
%% < < Speed = 92 mph (Design Speed) > >
%import .dat file to matlab
[Data,SizeData] = importfile('cruise_92mph.dat', 2);
%Substract First Row which to substract Zero offset error
for i = 2:1:SizeData(1)
Data(i,:) = Data(i,:) - Data(1,:);
end
alpha_cruise_92mph = Data(2:end,1); %AoA vector in Deg.
Lift_cruise_92mph = Data(2:end,2); %Lift Vector in lbs.
Drag_cruise_92mph = Data(2:end,3); %Drag Vector in lbs.
Pitch_cruise_92mph = Data(2:end,4)*in_2_ft; %Pitching Moment
Vector in lbs*ft
47
American Institute of Aeronautics and Astronautics
Side_cruise_92mph = Data(2:end,5); %Sideforce Vector in lbs
Roll_cruise_92mph = Data(2:end,6)*in_2_ft; %Rolling Moment
Vector in lbs*ft
Yaw_cruise_92mph = Data(2:end,7)*in_2_ft; %Yawing Moment
Vector in lbs*ft
%First, we correct for no wind and no model effects
Lift_cruise_92mph_corr = Lift_cruise_92mph -
Lift_no_wind(1:end-1) - Lift_no_model_92mph;
Drag_cruise_92mph_corr = Drag_cruise_92mph -
Drag_no_wind(1:end-1) - Drag_no_model_92mph;
Pitch_cruise_92mph_corr = Pitch_cruise_92mph -
Pitch_no_wind(1:end-1) - Pitch_no_model_92mph;
Side_cruise_92mph_corr = Side_cruise_92mph -
Side_no_wind(1:end-1) - Side_no_model_92mph;
Roll_cruise_92mph_corr = Roll_cruise_92mph -
Roll_no_wind(1:end-1) - Roll_no_model_92mph;
Yaw_cruise_92mph_corr = Yaw_cruise_92mph -
Yaw_no_wind(1:end-1) - Yaw_no_model_92mph;
%Compute CG Lift and Drag Coefficients with uncorrected
dynamic pressure
CLs_cruise_92mph_corr =
Lift_cruise_92mph_corr/(0.5*Density*(Vvec(end)^2)*Sw);
CDs_cruise_92mph_corr =
Drag_cruise_92mph_corr/(0.5*Density*(Vvec(end)^2)*Sw);
%Now we compute CL squared to find K and CD0
CLs_cruise_92mph_CG_sq = CLs_cruise_92mph_corr.^2;
%{
%We plot to have a sense of the results (Should be a straigth line)
figure
plot(CLs_cruise_92mph_CG_sq,CDs_cruise_92mph_corr)
%}
%We do a linear fit to compute the slope and the CD intercept
(CD0)
CL_sq_CD_92mph_Eq =
polyfit(CLs_cruise_92mph_CG_sq,CDs_cruise_92mph_corr,1);
%Compute K
K_cruise_92mph = CL_sq_CD_92mph_Eq(1);
%Compute e
e_osw_cruise_92mph = 1/(K_cruise_92mph*ARw*pi);
%Compute CD0
CD0_cruise_92mph = CL_sq_CD_92mph_Eq(2);
%Find Missing correction factors
Ewbt_cruise_92mph = (Sw/(4*Acs))*CD0_cruise_92mph;
Etot_cruise_92mph = Esbt + Ewbt_cruise_92mph +
Estrut_windshield;
%Compute Corrected dynamic pressure
q_corr_cruise_92mph = q_s(end)*(1+Etot_cruise_92mph)^2;
%Use Corrected dynamic pressure to compute all coefficients
CLs_cruise_92mph_corr =
Lift_cruise_92mph_corr/(q_corr_cruise_92mph*Sw);
CDs_cruise_92mph_corr =
Drag_cruise_92mph_corr/(q_corr_cruise_92mph*Sw);
CSFs_cruise_92mph_corr =
Side_cruise_92mph_corr/(q_corr_cruise_92mph*Sw);
CMs_cruise_92mph_corr =
Pitch_cruise_92mph_corr/(q_corr_cruise_92mph*Sw*cbar_w);
CLRs_cruise_92mph_corr =
Roll_cruise_92mph_corr/(q_corr_cruise_92mph*Sw*cbar_w);
CNs_cruise_92mph_corr =
Yaw_cruise_92mph_corr/(q_corr_cruise_92mph*Sw*cbar_w);
%Compute AoA correction Vector
Delta_alpha_cruise_92mph =
Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_cruise_92mph_corr;
%Corrected AoA
alpha_cruise_92mph_corr = alpha_cruise_92mph +
Delta_alpha_cruise_92mph;
%Drag Wall Correction
Delta_Cd_cruise_92mph =
Delta*(Sw/Acs)*(CLs_cruise_92mph_corr.^2);
%Tail Moment Coefficient Correction Vector
Delta_Cm_CG_cruise_92mph =
DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*...
CLs_cruise_92mph_corr;
%Now we translate the Loads and moments from Balance Center
to CG
%Loads_CG = Loads_Balance
%Moments_CG = Moment_Balance
CLs_cruise_92mph_corr_CG = CLs_cruise_92mph_corr;
CDs_cruise_92mph_corr_CG = CDs_cruise_92mph_corr +
Delta_Cd_cruise_92mph;
CSFs_cruise_92mph_corr_CG = CSFs_cruise_92mph_corr;
CMs_cruise_92mph_corr_CG = (CMs_cruise_92mph_corr +...
CLs_cruise_92mph_corr*(X_balance_CG/cbar_w)-...
CDs_cruise_92mph_corr*(Z_balance_CG/cbar_w)) -
Delta_Cm_CG_cruise_92mph;
CLRs_cruise_92mph_corr_CG = CLRs_cruise_92mph_corr -...
CSFs_cruise_92mph_corr*(Z_balance_CG/cbar_w);
CNs_cruise_92mph_corr_CG = CNs_cruise_92mph_corr +...
CSFs_cruise_92mph_corr*(X_balance_CG/cbar_w);
%Linear Fits
CM_cruise_92mph_alpha_fit =
polyfit(alpha_cruise_92mph_corr,CMs_cruise_92mph_corr_CG,1)
;
CM_cruise_92mph_CL_fit =
polyfit(CLs_cruise_92mph_corr_CG,CMs_cruise_92mph_corr_C
G,1);
CL_alpha_cruise_92mph_fit =
polyfit(alpha_cruise_92mph_corr(2:9),CLs_cruise_92mph_corr_C
G(2:9),1);
%Plot linear fits
CM_cruise_92mph_alpha_Eq =
polyval(CM_cruise_92mph_alpha_fit,alpha_cruise_92mph_corr);
CM_cruise_92mph_CL_Eq =
polyval(CM_cruise_92mph_CL_fit,CLs_cruise_92mph_corr_CG);
CL_alpha_cruise_92mph_Eq =
polyval(CL_alpha_cruise_92mph_fit,alpha_cruise_92mph_corr);
%CL_alpha
CL_alpha_cruise_92mph = CL_alpha_cruise_92mph_fit(1);
%1/deg
%Cm_alpha
CM_alpha_cruise_92mph = CM_cruise_92mph_alpha_fit(1);
%1/deg
%Cm_CL
CM_CL_cruise_92mph = CM_cruise_92mph_CL_fit(1);
%Static Margin
Kn = (-1/CM_CL_cruise_92mph); %percentage
48
American Institute of Aeronautics and Astronautics
%{%}
%Plot Results for further Study
figure
plot(alpha_cruise_92mph_corr,CLs_cruise_92mph_corr_CG,'Line
Width',2)
hold on
plot(alpha_cruise_92mph_corr,CL_alpha_cruise_92mph_Eq,'--
k','Linewidth',2)
title('Lift Coefficient vs. Angle of Attack at 92mph')
xlabel('Angle of Attack (Degrees)')
ylabel('C_L')
legend('Wind Tunnel Result','Linear Fit','location','SouthEast')
figure
plot(CLs_cruise_92mph_corr_CG,CDs_cruise_92mph_corr_CG,'L
ineWidth',2)
title('Drag Polar at 92mph')
xlabel('C_L')
ylabel('C_D')
figure
plot(alpha_cruise_92mph_corr,CMs_cruise_92mph_corr_CG,'b','L
ineWidth',2)
hold on
plot(alpha_cruise_92mph_corr,CM_cruise_92mph_alpha_Eq,'--
k','LineWidth',2)
title('Moment Coefficient vs. Angle of Attack')
xlabel('Angle of Attack (Deg.)')
ylabel('C_m')
legend('Wind Tunnel Result','Linear Fit','Location','SouthEast')
figure
plot(CLs_cruise_92mph_corr_CG,CMs_cruise_92mph_corr_CG,'
b','LineWidth',2)
hold on
plot(CLs_cruise_92mph_corr_CG,CM_cruise_92mph_CL_Eq,'--
k','LineWidth',2)
title('Moment Coefficient vs. Lift Coefficient at 92mph')
xlabel('C_L')
ylabel('C_m')
legend('Wind Tunnel Result','LinearFit','location','SouthEast')
figure
plot(alpha_cruise_92mph_corr,CLRs_cruise_92mph_corr_CG,'Lin
eWidth',2)
title('Rolling Moment Coefficient vs. Angle of Attack at 92mph')
xlabel('Angle of Attack (Degrees)')
ylabel('C_Lroll')
figure
plot(alpha_cruise_92mph_corr,CNs_cruise_92mph_corr_CG,'Line
Width',2)
title('Yawing Moment Coefficient vs. Angle of Attack at 92mph')
xlabel('Angle of Attack (Degrees)')
ylabel('C_N')
%% Zero Reference for Stability Analysis
%import .dat file to matlab
[Data,SizeData] = importfile('zero_reference_control.dat', 2);
%Substract First Row which to substract Zero offset error
for i = 2:1:SizeData(1)
Data(i,:) = Data(i,:) - Data(1,:);
end
alpha_zero_reference_control = Data(2:end,1); %AoA vector in
Deg.
Lift_zero_reference_control = Data(2:end,2); %Lift Vector in lbs.
Drag_zero_reference_control = Data(2:end,3); %Drag Vector in
lbs.
Pitch_zero_reference_control = Data(2:end,4)*in_2_ft; %Pitching
Moment Vector in lbs*ft
Side_zero_reference_control = Data(2:end,5); %Sideforce Vector
in lbs
Roll_zero_reference_control = Data(2:end,6)*in_2_ft; %Rolling
Moment Vector in lbs*ft
Yaw_zero_reference_control = Data(2:end,7)*in_2_ft; %Yawing
Moment Vector in lbs*ft
%First, we correct for no wind effect
Lift_zero_reference_control_corr = Lift_zero_reference_control -
Lift_no_wind(4);
Drag_zero_reference_control_corr = Drag_zero_reference_control
- Drag_no_wind(4);
Pitch_zero_reference_control_corr = Pitch_zero_reference_control
- Pitch_no_wind(4);
Side_zero_reference_control_corr = Side_zero_reference_control -
Side_no_wind(4);
Roll_zero_reference_control_corr = Roll_zero_reference_control -
Roll_no_wind(4);
Yaw_zero_reference_control_corr = Yaw_zero_reference_control
- Yaw_no_wind(4);
%Use Corrected dynamic pressure to compute all coefficients
CLs_zero_reference_control_corr =
Lift_zero_reference_control_corr/(q_corr_cruise_30mph*Sw);
CDs_zero_reference_control_corr =
Drag_zero_reference_control_corr/(q_corr_cruise_30mph*Sw);
CSFs_zero_reference_control_corr =
Side_zero_reference_control_corr/(q_corr_cruise_30mph*Sw);
CMs_zero_reference_control_corr =
Pitch_zero_reference_control_corr/(q_corr_cruise_30mph*Sw*cba
r_w);
CLRs_zero_reference_control_corr =
Roll_zero_reference_control_corr/(q_corr_cruise_30mph*Sw*cbar
_w);
CNs_zero_reference_control_corr =
Yaw_zero_reference_control_corr/(q_corr_cruise_30mph*Sw*cba
r_w);
%Now we correct all coefficients for no model error
CLs_zero_reference_control_corr =
CLs_zero_reference_control_corr - CLs_no_model;
CDs_zero_reference_control_corr =
CDs_zero_reference_control_corr - CDs_no_model;
CSFs_zero_reference_control_corr =
CSFs_zero_reference_control_corr - CSFs_no_model;
CMs_zero_reference_control_corr =
CMs_zero_reference_control_corr - CMs_no_model;
CLRs_zero_reference_control_corr =
CLRs_zero_reference_control_corr - CLRs_no_model;
CNs_zero_reference_control_corr =
CNs_zero_reference_control_corr - CNs_no_model;
%Compute AoA correction Vector
Delta_alpha_zero_reference_control =
Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_zero_reference_control_
corr;
%Corrected AoA
alpha_zero_reference_control_corr =
alpha_zero_reference_control +
Delta_alpha_zero_reference_control;
%Drag Wall Correction
Delta_Cd_zero_reference_control =
Delta*(Sw/Acs)*(CLs_zero_reference_control_corr.^2);
49
American Institute of Aeronautics and Astronautics
%Tail Moment Coefficient Correction Vector
Delta_Cm_CG_zero_reference_control =
DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*...
CLs_zero_reference_control_corr;
%Now we translate the Loads and moments from Balance Center
to CG
%Loads_CG = Loads_Balance
%Moments_CG = Moment_Balance
CLs_zero_reference_control_corr_CG =
CLs_zero_reference_control_corr;
CDs_zero_reference_control_corr_CG =
CDs_zero_reference_control_corr +
Delta_Cd_zero_reference_control;
CSFs_zero_reference_control_corr_CG =
CSFs_zero_reference_control_corr;
CMs_zero_reference_control_corr_CG =
(CMs_zero_reference_control_corr +...
CLs_zero_reference_control_corr*(X_balance_CG/cbar_w)-...
CDs_zero_reference_control_corr*(Z_balance_CG/cbar_w)) -
Delta_Cm_CG_zero_reference_control;
CLRs_zero_reference_control_corr_CG =
CLRs_zero_reference_control_corr -...
CSFs_zero_reference_control_corr*(Z_balance_CG/cbar_w);
CNs_zero_reference_control_corr_CG =
CNs_zero_reference_control_corr +...
CSFs_zero_reference_control_corr*(X_balance_CG/cbar_w);
%% Roll Body Stability Analysis
%% < < Left Wing 11 Degrees Down > >
%Import .dat File into Matlab
[Data,SizeData] = importfile('roll_left_wing_11deg_down.dat', 2);
%Substract First Row which to substract Zero offset error
for i = 2:1:SizeData(1)
Data(i,:) = Data(i,:) - Data(1,:);
end
alpha_roll_11deg_down = Data(2:end,1); %AoA vector in Deg.
Lift_roll_11deg_down = Data(2:end,2); %Lift Vector in lbs.
Drag_roll_11deg_down = Data(2:end,3); %Drag Vector in lbs.
Pitch_roll_11deg_down = Data(2:end,4)*in_2_ft; %Pitching
Moment Vector in lbs*ft
Side_roll_11deg_down = Data(2:end,5); %Sideforce Vector in lbs
Roll_roll_11deg_down = Data(2:end,6)*in_2_ft; %Rolling
Moment Vector in lbs*ft
Yaw_roll_11deg_down = Data(2:end,7)*in_2_ft; %Yawing
Moment Vector in lbs*ft
%First, we correct for no wind effect
Lift_roll_11deg_down_corr = Lift_roll_11deg_down -
Lift_no_wind(4);
Drag_roll_11deg_down_corr = Drag_roll_11deg_down -
Drag_no_wind(4);
Pitch_roll_11deg_down_corr = Pitch_roll_11deg_down -
Pitch_no_wind(4);
Side_roll_11deg_down_corr = Side_roll_11deg_down -
Side_no_wind(4);
Roll_roll_11deg_down_corr = Roll_roll_11deg_down -
Roll_no_wind(4);
Yaw_roll_11deg_down_corr = Yaw_roll_11deg_down -
Yaw_no_wind(4);
%Use Corrected dynamic pressure to compute all coefficients
CLs_roll_11deg_down_corr =
Lift_roll_11deg_down_corr/(q_corr_cruise_30mph*Sw);
CDs_roll_11deg_down_corr =
Drag_roll_11deg_down_corr/(q_corr_cruise_30mph*Sw);
CSFs_roll_11deg_down_corr =
Side_roll_11deg_down_corr/(q_corr_cruise_30mph*Sw);
CMs_roll_11deg_down_corr =
Pitch_roll_11deg_down_corr/(q_corr_cruise_30mph*Sw*cbar_w);
CLRs_roll_11deg_down_corr =
Roll_roll_11deg_down_corr/(q_corr_cruise_30mph*Sw*cbar_w);
CNs_roll_11deg_down_corr =
Yaw_roll_11deg_down_corr/(q_corr_cruise_30mph*Sw*cbar_w);
%Now we correct all coefficients for no model error
CLs_roll_11deg_down_corr = CLs_roll_11deg_down_corr -
CLs_no_model;
CDs_roll_11deg_down_corr = CDs_roll_11deg_down_corr -
CDs_no_model;
CSFs_roll_11deg_down_corr = CSFs_roll_11deg_down_corr -
CSFs_no_model;
CMs_roll_11deg_down_corr = CMs_roll_11deg_down_corr -
CMs_no_model;
CLRs_roll_11deg_down_corr = CLRs_roll_11deg_down_corr -
CLRs_no_model;
CNs_roll_11deg_down_corr = CNs_roll_11deg_down_corr -
CNs_no_model;
%Compute AoA correction Vector
Delta_alpha_roll_11deg_down =
Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_roll_11deg_down_corr;
%Corrected AoA
alpha_roll_11deg_down_corr = alpha_roll_11deg_down +
Delta_alpha_roll_11deg_down;
%Drag Wall Correction
Delta_Cd_roll_11deg_down =
Delta*(Sw/Acs)*(CLs_roll_11deg_down_corr.^2);
%Tail Moment Coefficient Correction Vector
Delta_Cm_CG_roll_11deg_down =
DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*...
CLs_roll_11deg_down_corr;
%Now we translate the Loads and moments from Balance Center
to CG
%Loads_CG = Loads_Balance
%Moments_CG = Moment_Balance
CLs_roll_11deg_down_corr_CG = CLs_roll_11deg_down_corr;
CDs_roll_11deg_down_corr_CG = CDs_roll_11deg_down_corr +
Delta_Cd_roll_11deg_down;
CSFs_roll_11deg_down_corr_CG = CSFs_roll_11deg_down_corr;
CMs_roll_11deg_down_corr_CG = (CMs_roll_11deg_down_corr
+...
CLs_roll_11deg_down_corr*(X_balance_CG/cbar_w)-...
CDs_roll_11deg_down_corr*(Z_balance_CG/cbar_w)) -
Delta_Cm_CG_roll_11deg_down;
CLRs_roll_11deg_down_corr_CG = CLRs_roll_11deg_down_corr
-...
CSFs_roll_11deg_down_corr*(Z_balance_CG/cbar_w);
CNs_roll_11deg_down_corr_CG = CNs_roll_11deg_down_corr
+...
CSFs_roll_11deg_down_corr*(X_balance_CG/cbar_w);
%% < < Left Wing 8 Degrees Up > >
%Import .dat File into Matlab
[Data,SizeData] = importfile('roll_left_wing_8deg_up.dat', 2);
50
American Institute of Aeronautics and Astronautics
%Substract First Row which to substract Zero offset error
for i = 2:1:SizeData(1)
Data(i,:) = Data(i,:) - Data(1,:);
end
alpha_roll_8deg_up = Data(2:end,1); %AoA vector in Deg.
Lift_roll_8deg_up = Data(2:end,2); %Lift Vector in lbs.
Drag_roll_8deg_up = Data(2:end,3); %Drag Vector in lbs.
Pitch_roll_8deg_up = Data(2:end,4)*in_2_ft; %Pitching Moment
Vector in lbs*ft
Side_roll_8deg_up = Data(2:end,5); %Sideforce Vector in lbs
Roll_roll_8deg_up = Data(2:end,6)*in_2_ft; %Rolling Moment
Vector in lbs*ft
Yaw_roll_8deg_up = Data(2:end,7)*in_2_ft; %Yawing Moment
Vector in lbs*ft
%First, we correct for no wind effect
Lift_roll_8deg_up_corr = Lift_roll_8deg_up - Lift_no_wind(4);
Drag_roll_8deg_up_corr = Drag_roll_8deg_up -
Drag_no_wind(4);
Pitch_roll_8deg_up_corr = Pitch_roll_8deg_up -
Pitch_no_wind(4);
Side_roll_8deg_up_corr = Side_roll_8deg_up - Side_no_wind(4);
Roll_roll_8deg_up_corr = Roll_roll_8deg_up - Roll_no_wind(4);
Yaw_roll_8deg_up_corr = Yaw_roll_8deg_up - Yaw_no_wind(4);
%Use Corrected dynamic pressure to compute all coefficients
CLs_roll_8deg_up_corr =
Lift_roll_8deg_up_corr/(q_corr_cruise_30mph*Sw);
CDs_roll_8deg_up_corr =
Drag_roll_8deg_up_corr/(q_corr_cruise_30mph*Sw);
CSFs_roll_8deg_up_corr =
Side_roll_8deg_up_corr/(q_corr_cruise_30mph*Sw);
CMs_roll_8deg_up_corr =
Pitch_roll_8deg_up_corr/(q_corr_cruise_30mph*Sw*cbar_w);
CLRs_roll_8deg_up_corr =
Roll_roll_8deg_up_corr/(q_corr_cruise_30mph*Sw*cbar_w);
CNs_roll_8deg_up_corr =
Yaw_roll_8deg_up_corr/(q_corr_cruise_30mph*Sw*cbar_w);
%Now we correct all coefficients for no model error
CLs_roll_8deg_up_corr = CLs_roll_8deg_up_corr -
CLs_no_model;
CDs_roll_8deg_up_corr = CDs_roll_8deg_up_corr -
CDs_no_model;
CSFs_roll_8deg_up_corr = CSFs_roll_8deg_up_corr -
CSFs_no_model;
CMs_roll_8deg_up_corr = CMs_roll_8deg_up_corr -
CMs_no_model;
CLRs_roll_8deg_up_corr = CLRs_roll_8deg_up_corr -
CLRs_no_model;
CNs_roll_8deg_up_corr = CNs_roll_8deg_up_corr -
CNs_no_model;
%Compute AoA correction Vector
Delta_alpha_roll_8deg_up =
Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_roll_8deg_up_corr;
%Corrected AoA
alpha_roll_8deg_up_corr = alpha_roll_8deg_up +
Delta_alpha_roll_8deg_up;
%Drag Wall Correction
Delta_Cd_roll_8deg_up =
Delta*(Sw/Acs)*(CLs_roll_8deg_up_corr.^2);
%Tail Moment Coefficient Correction Vector
Delta_Cm_CG_roll_8deg_up =
DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*...
CLs_roll_8deg_up_corr;
%Now we translate the Loads and moments from Balance Center
to CG
%Loads_CG = Loads_Balance
%Moments_CG = Moment_Balance
CLs_roll_8deg_up_corr_CG = CLs_roll_8deg_up_corr;
CDs_roll_8deg_up_corr_CG = CDs_roll_8deg_up_corr +
Delta_Cd_roll_8deg_up;
CSFs_roll_8deg_up_corr_CG = CSFs_roll_8deg_up_corr;
CMs_roll_8deg_up_corr_CG = (CMs_roll_8deg_up_corr +...
CLs_roll_8deg_up_corr*(X_balance_CG/cbar_w)-...
CDs_roll_8deg_up_corr*(Z_balance_CG/cbar_w)) -
Delta_Cm_CG_roll_8deg_up;
CLRs_roll_8deg_up_corr_CG = CLRs_roll_8deg_up_corr -...
CSFs_roll_8deg_up_corr*(Z_balance_CG/cbar_w);
CNs_roll_8deg_up_corr_CG = CNs_roll_8deg_up_corr +...
CSFs_roll_8deg_up_corr*(X_balance_CG/cbar_w);
%% < < Left Wing 16 Degrees Up > >
%Import .dat File into Matlab
[Data,SizeData] = importfile('roll_left_wing_16deg_up.dat', 2);
%Substract First Row which to substract Zero offset error
for i = 2:1:SizeData(1)
Data(i,:) = Data(i,:) - Data(1,:);
end
alpha_roll_16deg_up = Data(2:end,1); %AoA vector in Deg.
Lift_roll_16deg_up = Data(2:end,2); %Lift Vector in lbs.
Drag_roll_16deg_up = Data(2:end,3); %Drag Vector in lbs.
Pitch_roll_16deg_up = Data(2:end,4)*in_2_ft; %Pitching Moment
Vector in lbs*ft
Side_roll_16deg_up = Data(2:end,5); %Sideforce Vector in lbs
Roll_roll_16deg_up = Data(2:end,6)*in_2_ft; %Rolling Moment
Vector in lbs*ft
Yaw_roll_16deg_up = Data(2:end,7)*in_2_ft; %Yawing Moment
Vector in lbs*ft
%First, we correct for no wind effect
Lift_roll_16deg_up_corr = Lift_roll_16deg_up - Lift_no_wind(4);
Drag_roll_16deg_up_corr = Drag_roll_16deg_up -
Drag_no_wind(4);
Pitch_roll_16deg_up_corr = Pitch_roll_16deg_up -
Pitch_no_wind(4);
Side_roll_16deg_up_corr = Side_roll_16deg_up -
Side_no_wind(4);
Roll_roll_16deg_up_corr = Roll_roll_16deg_up -
Roll_no_wind(4);
Yaw_roll_16deg_up_corr = Yaw_roll_16deg_up -
Yaw_no_wind(4);
%Use Corrected dynamic pressure to compute all coefficients
CLs_roll_16deg_up_corr =
Lift_roll_16deg_up_corr/(q_corr_cruise_30mph*Sw);
CDs_roll_16deg_up_corr =
Drag_roll_16deg_up_corr/(q_corr_cruise_30mph*Sw);
CSFs_roll_16deg_up_corr =
Side_roll_16deg_up_corr/(q_corr_cruise_30mph*Sw);
CMs_roll_16deg_up_corr =
Pitch_roll_16deg_up_corr/(q_corr_cruise_30mph*Sw*cbar_w);
CLRs_roll_16deg_up_corr =
Roll_roll_16deg_up_corr/(q_corr_cruise_30mph*Sw*cbar_w);
CNs_roll_16deg_up_corr =
Yaw_roll_16deg_up_corr/(q_corr_cruise_30mph*Sw*cbar_w);
%Now we correct all coefficients for no model error
51
American Institute of Aeronautics and Astronautics
CLs_roll_16deg_up_corr = CLs_roll_16deg_up_corr -
CLs_no_model;
CDs_roll_16deg_up_corr = CDs_roll_16deg_up_corr -
CDs_no_model;
CSFs_roll_16deg_up_corr = CSFs_roll_16deg_up_corr -
CSFs_no_model;
CMs_roll_16deg_up_corr = CMs_roll_16deg_up_corr -
CMs_no_model;
CLRs_roll_16deg_up_corr = CLRs_roll_16deg_up_corr -
CLRs_no_model;
CNs_roll_16deg_up_corr = CNs_roll_16deg_up_corr -
CNs_no_model;
%Compute AoA correction Vector
Delta_alpha_roll_16deg_up =
Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_roll_16deg_up_corr;
%Corrected AoA
alpha_roll_16deg_up_corr = alpha_roll_16deg_up +
Delta_alpha_roll_16deg_up;
%Drag Wall Correction
Delta_Cd_roll_16deg_up =
Delta*(Sw/Acs)*(CLs_roll_16deg_up_corr.^2);
%Tail Moment Coefficient Correction Vector
Delta_Cm_CG_roll_16deg_up =
DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*...
CLs_roll_16deg_up_corr;
%Now we translate the Loads and moments from Balance Center
to CG
%Loads_CG = Loads_Balance
%Moments_CG = Moment_Balance
CLs_roll_16deg_up_corr_CG = CLs_roll_16deg_up_corr;
CDs_roll_16deg_up_corr_CG = CDs_roll_16deg_up_corr +
Delta_Cd_roll_16deg_up;
CSFs_roll_16deg_up_corr_CG = CSFs_roll_16deg_up_corr;
CMs_roll_16deg_up_corr_CG = (CMs_roll_16deg_up_corr +...
CLs_roll_16deg_up_corr*(X_balance_CG/cbar_w)-...
CDs_roll_16deg_up_corr*(Z_balance_CG/cbar_w)) -
Delta_Cm_CG_roll_16deg_up;
CLRs_roll_16deg_up_corr_CG = CLRs_roll_16deg_up_corr -...
CSFs_roll_16deg_up_corr*(Z_balance_CG/cbar_w);
CNs_roll_16deg_up_corr_CG = CNs_roll_16deg_up_corr +...
CSFs_roll_16deg_up_corr*(X_balance_CG/cbar_w);
CLRs_wing_incidence = [CLRs_roll_11deg_down_corr_CG...
CLRs_zero_reference_control_corr_CG...
CLRs_roll_8deg_up_corr_CG...
CLRs_roll_16deg_up_corr_CG];
CNs_wing_incidence = [CNs_roll_11deg_down_corr_CG...
CNs_zero_reference_control_corr_CG...
CNs_roll_8deg_up_corr_CG...
CNs_roll_16deg_up_corr_CG];
Wing_incidence_angles = [-11 0 8 16];
CLR_Wing_incidence_fit =
polyfit(Wing_incidence_angles,CLRs_wing_incidence,1);
CN_Wing_incidecne_fit =
polyfit(Wing_incidence_angles,CNs_wing_incidence,1);
CLRs_Equation_incidence =
polyval(CLR_Wing_incidence_fit,Wing_incidence_angles);
CNs_Equation_incidence =
polyval(CN_Wing_incidecne_fit,Wing_incidence_angles);
%Compute Stability Derivative
DCLroll_Di = CLR_Wing_incidence_fit(1); %1/deg
DCN_Di = CN_Wing_incidecne_fit(1); %SHould be negative, it is
positive probably due to decrease in Drag as AoA increases!!
%{%}
figure
plot(Wing_incidence_angles,CLRs_wing_incidence,'b','LineWidth'
,2)
hold on
plot(Wing_incidence_angles,CLRs_Equation_incidence,'--
k','LineWidth',2)
title('Rolling Moment Coefficient vs. Wing Incidence Angle')
xlabel('Wing Incidence Angle (Deg.)')
ylabel('C_Lroll')
legend('Wind Tunel Result','Linear Fit','Location','SouthEast')
figure
plot(Wing_incidence_angles,CNs_wing_incidence,'b','LineWidth',
2)
hold on
plot(Wing_incidence_angles,CNs_Equation_incidence,'--
k','LineWidth',2)
title('Yawing Moment Coefficient vs. Wing Incidence Angle')
xlabel('Wing Incidence Angle (Deg.)')
ylabel('C_N')
legend('Wind Tunel Result','Linear Fit','Location','SouthEast')
%% Yaw Body Stability Analysis
% < < Sideslip = 8 Deg. Counterclockwise > >
%Import .dat File into Matlab
[Data,SizeData] = importfile('yaw_8deg_counterclockwise.dat', 2);
%Substract First Row which to substract Zero offset error
for i = 2:1:SizeData(1)
Data(i,:) = Data(i,:) - Data(1,:);
end
alpha_yaw_8deg_counter = Data(2:end,1); %AoA vector in Deg.
Lift_yaw_8deg_counter = Data(2:end,2); %Lift Vector in lbs.
Drag_yaw_8deg_counter = Data(2:end,3); %Drag Vector in lbs.
Pitch_yaw_8deg_counter = Data(2:end,4)*in_2_ft; %Pitching
Moment Vector in lbs*ft
Side_yaw_8deg_counter = Data(2:end,5); %Sideforce Vector in
lbs
Roll_yaw_8deg_counter = Data(2:end,6)*in_2_ft; %Rolling
Moment Vector in lbs*ft
Yaw_yaw_8deg_counter = Data(2:end,7)*in_2_ft; %Yawing
Moment Vector in lbs*ft
%First, we correct for no wind effect
Lift_yaw_8deg_counter_corr = Lift_yaw_8deg_counter -
Lift_no_wind(4);
Drag_yaw_8deg_counter_corr = Drag_yaw_8deg_counter -
Drag_no_wind(4);
Pitch_yaw_8deg_counter_corr = Pitch_yaw_8deg_counter -
Pitch_no_wind(4);
Side_yaw_8deg_counter_corr = Side_yaw_8deg_counter -
Side_no_wind(4);
Roll_yaw_8deg_counter_corr = Roll_yaw_8deg_counter -
Roll_no_wind(4);
Yaw_yaw_8deg_counter_corr = Yaw_yaw_8deg_counter -
Yaw_no_wind(4);
%Use Corrected dynamic pressure to compute all coefficients
CLs_yaw_8deg_counter_corr =
Lift_yaw_8deg_counter_corr/(q_corr_cruise_30mph*Sw);
52
American Institute of Aeronautics and Astronautics
CDs_yaw_8deg_counter_corr =
Drag_yaw_8deg_counter_corr/(q_corr_cruise_30mph*Sw);
CSFs_yaw_8deg_counter_corr =
Side_yaw_8deg_counter_corr/(q_corr_cruise_30mph*Sw);
CMs_yaw_8deg_counter_corr =
Pitch_yaw_8deg_counter_corr/(q_corr_cruise_30mph*Sw*cbar_w
);
CLRs_yaw_8deg_counter_corr =
Roll_yaw_8deg_counter_corr/(q_corr_cruise_30mph*Sw*cbar_w)
;
CNs_yaw_8deg_counter_corr =
Yaw_yaw_8deg_counter_corr/(q_corr_cruise_30mph*Sw*cbar_w
);
%Now we correct all coefficients for no model error
CLs_yaw_8deg_counter_corr = CLs_yaw_8deg_counter_corr -
CLs_no_model;
CDs_yaw_8deg_counter_corr = CDs_yaw_8deg_counter_corr -
CDs_no_model;
CSFs_yaw_8deg_counter_corr = CSFs_yaw_8deg_counter_corr -
CSFs_no_model;
CMs_yaw_8deg_counter_corr = CMs_yaw_8deg_counter_corr -
CMs_no_model;
CLRs_yaw_8deg_counter_corr = CLRs_yaw_8deg_counter_corr -
CLRs_no_model;
CNs_yaw_8deg_counter_corr = CNs_yaw_8deg_counter_corr -
CNs_no_model;
%Compute AoA correction Vector
Delta_alpha_yaw_8deg_counter =
Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_yaw_8deg_counter_corr
;
%Corrected AoA
alpha_yaw_8deg_counter_corr = alpha_yaw_8deg_counter +
Delta_alpha_yaw_8deg_counter;
%Drag Wall Correction
Delta_Cd_yaw_8deg_counter =
Delta*(Sw/Acs)*(CLs_yaw_8deg_counter_corr.^2);
%Tail Moment Coefficient Correction Vector
Delta_Cm_CG_yaw_8deg_counter =
DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*...
CLs_yaw_8deg_counter_corr;
%Now we translate the Loads and moments from Balance Center
to CG
%Loads_CG = Loads_Balance
%Moments_CG = Moment_Balance
CLs_yaw_8deg_counter_corr_CG =
CLs_yaw_8deg_counter_corr;
CDs_yaw_8deg_counter_corr_CG = CDs_yaw_8deg_counter_corr
+ Delta_Cd_yaw_8deg_counter;
CSFs_yaw_8deg_counter_corr_CG =
CSFs_yaw_8deg_counter_corr;
CMs_yaw_8deg_counter_corr_CG =
(CMs_yaw_8deg_counter_corr +...
CLs_yaw_8deg_counter_corr*(X_balance_CG/cbar_w)-...
CDs_yaw_8deg_counter_corr*(Z_balance_CG/cbar_w)) -
Delta_Cm_CG_yaw_8deg_counter;
CLRs_yaw_8deg_counter_corr_CG =
CLRs_yaw_8deg_counter_corr -...
CSFs_yaw_8deg_counter_corr*(Z_balance_CG/cbar_w);
CNs_yaw_8deg_counter_corr_CG = CNs_yaw_8deg_counter_corr
+...
CSFs_yaw_8deg_counter_corr*(X_balance_CG/cbar_w);
% < < Sideslip = 9 Deg. clockwise > >
%Import .dat File into Matlab
[Data,SizeData] = importfile('yaw_9deg_clockwise.dat', 2);
%Substract First Row which to substract Zero offset error
for i = 2:1:SizeData(1)
Data(i,:) = Data(i,:) - Data(1,:);
end
alpha_yaw_9deg_colockw = Data(2:end,1); %AoA vector in Deg.
Lift_yaw_9deg_colockw = Data(2:end,2); %Lift Vector in lbs.
Drag_yaw_9deg_colockw = Data(2:end,3); %Drag Vector in lbs.
Pitch_yaw_9deg_colockw = Data(2:end,4)*in_2_ft; %Pitching
Moment Vector in lbs*ft
Side_yaw_9deg_colockw = Data(2:end,5); %Sideforce Vector in
lbs
Roll_yaw_9deg_colockw = Data(2:end,6)*in_2_ft; %Rolling
Moment Vector in lbs*ft
Yaw_yaw_9deg_colockw = Data(2:end,7)*in_2_ft; %Yawing
Moment Vector in lbs*ft
%First, we correct for no wind effect
Lift_yaw_9deg_colockw_corr = Lift_yaw_9deg_colockw -
Lift_no_wind(4);
Drag_yaw_9deg_colockw_corr = Drag_yaw_9deg_colockw -
Drag_no_wind(4);
Pitch_yaw_9deg_colockw_corr = Pitch_yaw_9deg_colockw -
Pitch_no_wind(4);
Side_yaw_9deg_colockw_corr = Side_yaw_9deg_colockw -
Side_no_wind(4);
Roll_yaw_9deg_colockw_corr = Roll_yaw_9deg_colockw -
Roll_no_wind(4);
Yaw_yaw_9deg_colockw_corr = Yaw_yaw_9deg_colockw -
Yaw_no_wind(4);
%Use Corrected dynamic pressure to compute all coefficients
CLs_yaw_9deg_colockw_corr =
Lift_yaw_9deg_colockw_corr/(q_corr_cruise_30mph*Sw);
CDs_yaw_9deg_colockw_corr =
Drag_yaw_9deg_colockw_corr/(q_corr_cruise_30mph*Sw);
CSFs_yaw_9deg_colockw_corr =
Side_yaw_9deg_colockw_corr/(q_corr_cruise_30mph*Sw);
CMs_yaw_9deg_colockw_corr =
Pitch_yaw_9deg_colockw_corr/(q_corr_cruise_30mph*Sw*cbar_
w);
CLRs_yaw_9deg_colockw_corr =
Roll_yaw_9deg_colockw_corr/(q_corr_cruise_30mph*Sw*cbar_w
);
CNs_yaw_9deg_colockw_corr =
Yaw_yaw_9deg_colockw_corr/(q_corr_cruise_30mph*Sw*cbar_
w);
%Now we correct all coefficients for no model error
CLs_yaw_9deg_colockw_corr = CLs_yaw_9deg_colockw_corr -
CLs_no_model;
CDs_yaw_9deg_colockw_corr = CDs_yaw_9deg_colockw_corr -
CDs_no_model;
CSFs_yaw_9deg_colockw_corr = CSFs_yaw_9deg_colockw_corr
- CSFs_no_model;
CMs_yaw_9deg_colockw_corr = CMs_yaw_9deg_colockw_corr -
CMs_no_model;
CLRs_yaw_9deg_colockw_corr = CLRs_yaw_9deg_colockw_corr
- CLRs_no_model;
CNs_yaw_9deg_colockw_corr = CNs_yaw_9deg_colockw_corr -
CNs_no_model;
%Compute AoA correction Vector
53
American Institute of Aeronautics and Astronautics
Delta_alpha_yaw_9deg_colockw =
Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_yaw_9deg_colockw_cor
r;
%Corrected AoA
alpha_yaw_9deg_colockw_corr = alpha_yaw_9deg_colockw +
Delta_alpha_yaw_9deg_colockw;
%Drag Wall Correction
Delta_Cd_yaw_9deg_colockw =
Delta*(Sw/Acs)*(CLs_yaw_9deg_colockw_corr.^2);
%Tail Moment Coefficient Correction Vector
Delta_Cm_CG_yaw_9deg_colockw =
DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*...
CLs_yaw_9deg_colockw_corr;
%Now we translate the Loads and moments from Balance Center
to CG
%Loads_CG = Loads_Balance
%Moments_CG = Moment_Balance
CLs_yaw_9deg_colockw_corr_CG =
CLs_yaw_9deg_colockw_corr;
CDs_yaw_9deg_colockw_corr_CG =
CDs_yaw_9deg_colockw_corr + Delta_Cd_yaw_9deg_colockw;
CSFs_yaw_9deg_colockw_corr_CG =
CSFs_yaw_9deg_colockw_corr;
CMs_yaw_9deg_colockw_corr_CG =
(CMs_yaw_9deg_colockw_corr +...
CLs_yaw_9deg_colockw_corr*(X_balance_CG/cbar_w)-...
CDs_yaw_9deg_colockw_corr*(Z_balance_CG/cbar_w)) -
Delta_Cm_CG_yaw_9deg_colockw;
CLRs_yaw_9deg_colockw_corr_CG =
CLRs_yaw_9deg_colockw_corr -...
CSFs_yaw_9deg_colockw_corr*(Z_balance_CG/cbar_w);
CNs_yaw_9deg_colockw_corr_CG =
CNs_yaw_9deg_colockw_corr +...
CSFs_yaw_9deg_colockw_corr*(X_balance_CG/cbar_w);
CNs_beta_sweep = [CNs_yaw_8deg_counter_corr_CG...
CNs_zero_reference_control_corr_CG...
CNs_yaw_9deg_colockw_corr_CG];
CLRs_beta_sweep = [CLRs_yaw_8deg_counter_corr_CG...
CLRs_zero_reference_control_corr_CG...
CLRs_yaw_9deg_colockw_corr_CG];
beta_angles = [-8 0 9];
CN_beta_fit = polyfit(beta_angles,CNs_beta_sweep,1);
CLR_beta_fit = polyfit(beta_angles,CLRs_beta_sweep,1);
CLRs_Equation_beta = polyval(CLR_beta_fit,beta_angles);
CNs_Equation_beta = polyval(CN_beta_fit,beta_angles);
%Compute Stability Derivative
DCLroll_DBeta = CLR_beta_fit(1); %1/deg
DCN_DBeta = CN_beta_fit(1);
%{%}
figure
plot(beta_angles,CLRs_beta_sweep,'b','LineWidth',2)
hold on
plot(beta_angles,CLRs_Equation_beta,'--k','LineWidth',2)
title('Rolling Moment Coefficient vs. Sideslip Angle')
xlabel('Sideslip Angle (Deg.)')
ylabel('C_Lroll')
legend('Wind Tunel Result','Linear Fit','Location','SouthEast')
figure
plot(beta_angles,CNs_beta_sweep,'b','LineWidth',2)
hold on
plot(beta_angles,CNs_Equation_beta,'--k','LineWidth',2)
title('Yawing Moment Coefficient vs. Sideslip Angle')
xlabel('Sideslip Angle (Deg.)')
ylabel('C_N')
legend('Wind Tunel Result','Linear Fit','Location','SouthEast')
%% Pitch Body Stability Analysis
%% < < Tail 5 Degrees Down > >
%Import .dat File into Matlab
[Data,SizeData] = importfile('pitch_5deg_down.dat', 2);
%Substract First Row which to substract Zero offset error
for i = 2:1:SizeData(1)
Data(i,:) = Data(i,:) - Data(1,:);
end
alpha_pitch_5deg_down = Data(2:end,1); %AoA vector in Deg.
Lift_pitch_5deg_down = Data(2:end,2); %Lift Vector in lbs.
Drag_pitch_5deg_down = Data(2:end,3); %Drag Vector in lbs.
Pitch_pitch_5deg_down = Data(2:end,4)*in_2_ft; %Pitching
Moment Vector in lbs*ft
Side_pitch_5deg_down = Data(2:end,5); %Sideforce Vector in lbs
Roll_pitch_5deg_down = Data(2:end,6)*in_2_ft; %Rolling
Moment Vector in lbs*ft
Yaw_pitch_5deg_down = Data(2:end,7)*in_2_ft; %Yawing
Moment Vector in lbs*ft
%First, we correct for no wind effect
Lift_pitch_5deg_down_corr = Lift_pitch_5deg_down -
Lift_no_wind(4);
Drag_pitch_5deg_down_corr = Drag_pitch_5deg_down -
Drag_no_wind(4);
Pitch_pitch_5deg_down_corr = Pitch_pitch_5deg_down -
Pitch_no_wind(4);
Side_pitch_5deg_down_corr = Side_pitch_5deg_down -
Side_no_wind(4);
Roll_pitch_5deg_down_corr = Roll_pitch_5deg_down -
Roll_no_wind(4);
Yaw_pitch_5deg_down_corr = Yaw_pitch_5deg_down -
Yaw_no_wind(4);
%Use Corrected dynamic pressure to compute all coefficients
CLs_pitch_5deg_down_corr =
Lift_pitch_5deg_down_corr/(q_corr_cruise_30mph*Sw);
CDs_pitch_5deg_down_corr =
Drag_pitch_5deg_down_corr/(q_corr_cruise_30mph*Sw);
CSFs_pitch_5deg_down_corr =
Side_pitch_5deg_down_corr/(q_corr_cruise_30mph*Sw);
CMs_pitch_5deg_down_corr =
Pitch_pitch_5deg_down_corr/(q_corr_cruise_30mph*Sw*cbar_w)
;
CLRs_pitch_5deg_down_corr =
Roll_pitch_5deg_down_corr/(q_corr_cruise_30mph*Sw*cbar_w);
CNs_pitch_5deg_down_corr =
Yaw_pitch_5deg_down_corr/(q_corr_cruise_30mph*Sw*cbar_w);
%Now we correct all coefficients for no model error
CLs_pitch_5deg_down_corr = CLs_pitch_5deg_down_corr -
CLs_no_model;
CDs_pitch_5deg_down_corr = CDs_pitch_5deg_down_corr -
CDs_no_model;
CSFs_pitch_5deg_down_corr = CSFs_pitch_5deg_down_corr -
CSFs_no_model;
54
American Institute of Aeronautics and Astronautics
CMs_pitch_5deg_down_corr = CMs_pitch_5deg_down_corr -
CMs_no_model;
CLRs_pitch_5deg_down_corr = CLRs_pitch_5deg_down_corr -
CLRs_no_model;
CNs_pitch_5deg_down_corr = CNs_pitch_5deg_down_corr -
CNs_no_model;
%Compute AoA correction Vector
Delta_alpha_pitch_5deg_down =
Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_pitch_5deg_down_corr;
%Corrected AoA
alpha_pitch_5deg_down_corr = alpha_pitch_5deg_down +
Delta_alpha_pitch_5deg_down;
%Drag Wall Correction
Delta_Cd_pitch_5deg_down =
Delta*(Sw/Acs)*(CLs_pitch_5deg_down_corr.^2);
%Tail Moment Coefficient Correction Vector
Delta_Cm_CG_pitch_5deg_down =
DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*...
CLs_pitch_5deg_down_corr;
%Now we translate the Loads and moments from Balance Center
to CG
%Loads_CG = Loads_Balance
%Moments_CG = Moment_Balance
CLs_pitch_5deg_down_corr_CG = CLs_pitch_5deg_down_corr;
CDs_pitch_5deg_down_corr_CG = CDs_pitch_5deg_down_corr +
Delta_Cd_pitch_5deg_down;
CSFs_pitch_5deg_down_corr_CG =
CSFs_pitch_5deg_down_corr;
CMs_pitch_5deg_down_corr_CG = (CMs_pitch_5deg_down_corr
+...
CLs_pitch_5deg_down_corr*(X_balance_CG/cbar_w)-...
CDs_pitch_5deg_down_corr*(Z_balance_CG/cbar_w)) -
Delta_Cm_CG_pitch_5deg_down;
CLRs_pitch_5deg_down_corr_CG =
CLRs_pitch_5deg_down_corr -...
CSFs_pitch_5deg_down_corr*(Z_balance_CG/cbar_w);
CNs_pitch_5deg_down_corr_CG = CNs_pitch_5deg_down_corr
+...
CSFs_pitch_5deg_down_corr*(X_balance_CG/cbar_w);
%% < < Tail 10 Degrees Up > >
%Import .dat File into Matlab
[Data,SizeData] = importfile('pitch_10deg_up.dat', 2);
%Substract First Row which to substract Zero offset error
for i = 2:1:SizeData(1)
Data(i,:) = Data(i,:) - Data(1,:);
end
alpha_pitch_10deg_up = Data(2:end,1); %AoA vector in Deg.
Lift_pitch_10deg_up = Data(2:end,2); %Lift Vector in lbs.
Drag_pitch_10deg_up = Data(2:end,3); %Drag Vector in lbs.
Pitch_pitch_10deg_up = Data(2:end,4)*in_2_ft; %Pitching
Moment Vector in lbs*ft
Side_pitch_10deg_up = Data(2:end,5); %Sideforce Vector in lbs
Roll_pitch_10deg_up = Data(2:end,6)*in_2_ft; %Rolling Moment
Vector in lbs*ft
Yaw_pitch_10deg_up = Data(2:end,7)*in_2_ft; %Yawing Moment
Vector in lbs*ft
%First, we correct for no wind effect
Lift_pitch_10deg_up_corr = Lift_pitch_10deg_up -
Lift_no_wind(4);
Drag_pitch_10deg_up_corr = Drag_pitch_10deg_up -
Drag_no_wind(4);
Pitch_pitch_10deg_up_corr = Pitch_pitch_10deg_up -
Pitch_no_wind(4);
Side_pitch_10deg_up_corr = Side_pitch_10deg_up -
Side_no_wind(4);
Roll_pitch_10deg_up_corr = Roll_pitch_10deg_up -
Roll_no_wind(4);
Yaw_pitch_10deg_up_corr = Yaw_pitch_10deg_up -
Yaw_no_wind(4);
%Use Corrected dynamic pressure to compute all coefficients
CLs_pitch_10deg_up_corr =
Lift_pitch_10deg_up_corr/(q_corr_cruise_30mph*Sw);
CDs_pitch_10deg_up_corr =
Drag_pitch_10deg_up_corr/(q_corr_cruise_30mph*Sw);
CSFs_pitch_10deg_up_corr =
Side_pitch_10deg_up_corr/(q_corr_cruise_30mph*Sw);
CMs_pitch_10deg_up_corr =
Pitch_pitch_10deg_up_corr/(q_corr_cruise_30mph*Sw*cbar_w);
CLRs_pitch_10deg_up_corr =
Roll_pitch_10deg_up_corr/(q_corr_cruise_30mph*Sw*cbar_w);
CNs_pitch_10deg_up_corr =
Yaw_pitch_10deg_up_corr/(q_corr_cruise_30mph*Sw*cbar_w);
%Now we correct all coefficients for no model error
CLs_pitch_10deg_up_corr = CLs_pitch_10deg_up_corr -
CLs_no_model;
CDs_pitch_10deg_up_corr = CDs_pitch_10deg_up_corr -
CDs_no_model;
CSFs_pitch_10deg_up_corr = CSFs_pitch_10deg_up_corr -
CSFs_no_model;
CMs_pitch_10deg_up_corr = CMs_pitch_10deg_up_corr -
CMs_no_model;
CLRs_pitch_10deg_up_corr = CLRs_pitch_10deg_up_corr -
CLRs_no_model;
CNs_pitch_10deg_up_corr = CNs_pitch_10deg_up_corr -
CNs_no_model;
%Compute AoA correction Vector
Delta_alpha_pitch_10deg_up =
Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_pitch_10deg_up_corr;
%Corrected AoA
alpha_pitch_10deg_up_corr = alpha_pitch_10deg_up +
Delta_alpha_pitch_10deg_up;
%Drag Wall Correction
Delta_Cd_pitch_10deg_up =
Delta*(Sw/Acs)*(CLs_pitch_10deg_up_corr.^2);
%Tail Moment Coefficient Correction Vector
Delta_Cm_CG_pitch_10deg_up =
DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*...
CLs_pitch_10deg_up_corr;
%Now we translate the Loads and moments from Balance Center
to CG
%Loads_CG = Loads_Balance
%Moments_CG = Moment_Balance
CLs_pitch_10deg_up_corr_CG = CLs_pitch_10deg_up_corr;
CDs_pitch_10deg_up_corr_CG = CDs_pitch_10deg_up_corr +
Delta_Cd_pitch_10deg_up;
CSFs_pitch_10deg_up_corr_CG = CSFs_pitch_10deg_up_corr;
CMs_pitch_10deg_up_corr_CG = (CMs_pitch_10deg_up_corr -...
CLs_pitch_10deg_up_corr*(X_balance_CG/cbar_w)+...
CDs_pitch_10deg_up_corr*(Z_balance_CG/cbar_w)) -
Delta_Cm_CG_pitch_10deg_up;
55
American Institute of Aeronautics and Astronautics
CLRs_pitch_10deg_up_corr_CG = CLRs_pitch_10deg_up_corr -
...
CSFs_pitch_10deg_up_corr*(Z_balance_CG/cbar_w);
CNs_pitch_10deg_up_corr_CG = CNs_pitch_10deg_up_corr +...
CSFs_pitch_10deg_up_corr*(X_balance_CG/cbar_w);
CLs_Tail_incidence_sweep = [CLs_pitch_5deg_down_corr_CG...
CLs_zero_reference_control_corr_CG...
CLs_pitch_10deg_up_corr_CG];
CMs_Tail_incidence_sweep =
[CMs_pitch_5deg_down_corr_CG...
CMs_zero_reference_control_corr_CG...
CMs_pitch_10deg_up_corr_CG];
Tail_incidence_angles = [-5 0 10];
CM_tail_incidence_fit =
polyfit(Tail_incidence_angles,CMs_Tail_incidence_sweep,1);
CL_tail_incidence_fit =
polyfit(Tail_incidence_angles,CLs_Tail_incidence_sweep,1);
CLs_Equation_tail_incidence =
polyval(CL_tail_incidence_fit,Tail_incidence_angles);
CMs_Equation_tail_incidence =
polyval(CM_tail_incidence_fit,Tail_incidence_angles);
%Compute Stability Derivative
DCL_DTi = CL_tail_incidence_fit(1); %1/deg
DCM_DTi = CM_tail_incidence_fit(1); %1/deg
%{%}
figure
plot(Tail_incidence_angles,CLs_Tail_incidence_sweep,'b','LineWi
dth',2)
hold on
plot(Tail_incidence_angles,CLs_Equation_tail_incidence,'--
k','LineWidth',2)
title('Lift Coefficient vs. Tail Incidence Angle')
xlabel('Tail Incidence Angle (Deg.)')
ylabel('C_L')
legend('Wind Tunel Result','Linear Fit','Location','SouthEast')
figure
plot(Tail_incidence_angles,CMs_Tail_incidence_sweep,'b','LineW
idth',2)
hold on
plot(Tail_incidence_angles,CMs_Equation_tail_incidence,'--
k','LineWidth',2)
title('Pitching Moment Coefficient vs. Sideslip Angle')
xlabel('Tail Incidence Angle (Deg.)')
ylabel('C_m')
legend('Wind Tunel Result','Linear Fit','Location','SouthEast')
%% Transition Analysis Data
% < < Wings 30 Degrees Up > >
%import .dat file to matlab
[Data,SizeData] =
importfile('transition_wing_30deg_up_0_20_30_35_40_45mph.dat
', 2);
%Substract First Row which to substract Zero offset error
for i = 2:1:SizeData(1)
Data(i,:) = Data(i,:) - Data(1,:);
end
alpha_transition_30deg = Data(2:end,1); %AoA vector in Deg.
Lift_transition_30deg = Data(2:end,2); %Lift Vector in lbs.
Drag_transition_30deg = Data(2:end,3); %Drag Vector in lbs.
Pitch_transition_30deg = Data(2:end,4)*in_2_ft; %Pitching
Moment Vector in lbs*ft
Side_transition_30deg = Data(2:end,5); %Sideforce Vector in lbs
Roll_transition_30deg = Data(2:end,6)*in_2_ft; %Rolling Moment
Vector in lbs*ft
Yaw_transition_30deg = Data(2:end,7)*in_2_ft; %Yawing
Moment Vector in lbs*ft
% < < Wings 60 Degrees Up > >
%import .dat file to matlab
[Data,SizeData] =
importfile('transition_wing_60deg_up_0_20_25_30_35.dat', 2);
%Substract First Row which to substract Zero offset error
for i = 2:1:SizeData(1)
Data(i,:) = Data(i,:) - Data(1,:);
end
alpha_transition_60deg = Data(2:end,1); %AoA vector in Deg.
Lift_transition_60deg = Data(2:end,2); %Lift Vector in lbs.
Drag_transition_60deg = Data(2:end,3); %Drag Vector in lbs.
Pitch_transition_60deg = Data(2:end,4)*in_2_ft; %Pitching
Moment Vector in lbs*ft
Side_transition_60deg = Data(2:end,5); %Sideforce Vector in lbs
Roll_transition_60deg = Data(2:end,6)*in_2_ft; %Rolling Moment
Vector in lbs*ft
Yaw_transition_60deg = Data(2:end,7)*in_2_ft; %Yawing
Moment Vector in lbs*ft
% < < Wings 90 Degrees Up > >
%import .dat file to matlab
[Data,SizeData] =
importfile('transition_wing_90deg_up_0_15_20_25_30.dat', 2);
%Substract First Row which to substract Zero offset error
for i = 2:1:SizeData(1)
Data(i,:) = Data(i,:) - Data(1,:);
end
alpha_transition_90deg = Data(2:end,1); %AoA vector in Deg.
Lift_transition_90deg = Data(2:end,2); %Lift Vector in lbs.
Drag_transition_90deg = Data(2:end,3); %Drag Vector in lbs.
Pitch_transition_90deg = Data(2:end,4)*in_2_ft; %Pitching
Moment Vector in lbs*ft
Side_transition_90deg = Data(2:end,5); %Sideforce Vector in lbs
Roll_transition_90deg = Data(2:end,6)*in_2_ft; %Rolling Moment
Vector in lbs*ft
Yaw_transition_90deg = Data(2:end,7)*in_2_ft; %Yawing
Moment Vector in lbs*ft
56
American Institute of Aeronautics and Astronautics
Appendix IX—Wind Tunnel Data
Wind Tunnel Results:
-10 -5 0 5 10 15
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Lift Coefficient vs. Angle of Attack at 92mph
Angle of Attack (Degrees)
C
L
Wind Tunnel Result
Linear Fit
0 0.2 0.4 0.6 0.8 1 1.2 1.4
0.06
0.08
0.1
0.12
0.14
0.16
0.18
0.2
0.22
Drag Polar at 92mph
CL
C
D
57
American Institute of Aeronautics and Astronautics
-10 -5 0 5 10 15
-0.5
-0.45
-0.4
-0.35
-0.3
-0.25
-0.2
-0.15
Moment Coefficient vs. Angle of Attack
Angle of Attack (Deg.)
C
m
Wind Tunnel Result
Linear Fit
0 0.2 0.4 0.6 0.8 1 1.2 1.4
-0.5
-0.45
-0.4
-0.35
-0.3
-0.25
-0.2
-0.15
Moment Coefficient vs. Lift Coefficient at 92mph
CL
C
m
Wind Tunnel Result
LinearFit
-10 -5 0 5 10 15
-0.08
-0.07
-0.06
-0.05
-0.04
-0.03
-0.02
-0.01
Rolling Moment Coefficient vs. Angle of Attack at 92mph
Angle of Attack (Degrees)
C
L
roll
58
American Institute of Aeronautics and Astronautics
-10 -5 0 5 10 15
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
Yawing Moment Coefficient vs. Angle of Attack at 92mph
Angle of Attack (Degrees)
C
N
-15 -10 -5 0 5 10 15 20
-0.3
-0.25
-0.2
-0.15
-0.1
-0.05
0
0.05
0.1
0.15
0.2
Rolling Moment Coefficient vs. Wing Incidence Angle
Wing Incidence Angle (Deg.)
C
L
roll
Wind Tunel Result
Linear Fit
-15 -10 -5 0 5 10 15 20
-0.35
-0.3
-0.25
-0.2
-0.15
-0.1
-0.05
0
0.05
Yawing Moment Coefficient vs. Wing Incidence Angle
Wing Incidence Angle (Deg.)
C
N
Wind Tunel Result
Linear Fit
59
American Institute of Aeronautics and Astronautics
-8 -6 -4 -2 0 2 4 6 8 10
-0.15
-0.145
-0.14
-0.135
-0.13
-0.125
-0.12
-0.115
-0.11
-0.105
Rolling Moment Coefficient vs. Sideslip Angle
Sideslip Angle (Deg.)
C
L
roll
Wind Tunel Result
Linear Fit
-8 -6 -4 -2 0 2 4 6 8 10
-1.2
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
Yawing Moment Coefficient vs. Sideslip Angle
Sideslip Angle (Deg.)
C
N
Wind Tunel Result
Linear Fit
-5 0 5 10
0.4
0.5
0.6
0.7
0.8
0.9
1
Lift Coefficient vs. Tail Incidence Angle
Tail Incidence Angle (Deg.)
C
L
Wind Tunel Result
Linear Fit
60
American Institute of Aeronautics and Astronautics
Transition Wind Tunnel Data:
-5 0 5 10
0.2
0.25
0.3
0.35
0.4
0.45
0.5
Pitching Moment Coefficient vs. Sideslip Angle
Sideslip Angle (Deg.)
C
m
Wind Tunel Result
Linear Fit
61
American Institute of Aeronautics and Astronautics
Appendix IX—Control Design
Longitundal
%Senior Design - Paparazzi
%Dynamic Stability and Feedback Control
clear
close all
%% Longitudinal State Space
%X(1) = udot
%X(2) = alphadot
%X(3) = thetadot (pitch)
%X(4) = qdot
%X(5) = hdot
% A = [ Xu/m Xw/m 0 -g...
% Zu/(m-Zwdot) Zw/(m-Zwdot) (Zq+m*U0)/(m-
Zwdot) 0...
% (Mu+Zu*Gamma)/Iyy (Mw+Zw*Gamma)/Iyy
((Mq+(Zq+m*U0))*Gamma)/Iyy 0...
% 0 0 1 0]
%B = [
%% Conversion Factors
y = 0.0107x - 0.4115
y = 0.0281x - 0.4924
y = 0.0457x - 0.4233
-0.4
-0.3
-0.2
-0.1
0
0.1
0.2
0 5 10 15 20 25
Cm
Speed (kts)
30 Deg.
60 Deg.
90 Deg.
62
American Institute of Aeronautics and Astronautics
% < < Distance > >
nm_2_miles = 1.15078; %multiply to convert from nm to miles
miles_2_ft = 5280; %multiply to convert from miles to feet
in_2_ft = 1/12; %multiply to convert from in to ft
% < < Speed > >
kts_2_mph = 1.1508; %multiply to convert from kts to mph
kts_2_fps = 1.6878; %multiply to convert from kts to fps
mph_2_fps = 1.46667; %multiply to convert from mph to fps
% < < Mass > >
oz_2_lbs = 1/16; %multiply to convert from oz to lbs
% < < Temperature > >
fah_2_rank = 460.67; %add to convert from Fahrenheit to Rankine
% < < Pressure > >
inHg_2_psf = 70.7262; %multiply to convert from inches Mercury
to Psf
% < < Time > >
hour_2_sec = 3600; %multiply to convert from hours to seconds
min_2_sec = 60; %multiply to convert from min to seconds
% < < Angles > >
deg_2_rad = pi/180; %multiply to convert from degrees to radians
%% Given Constant Atmospheric Data
P_SL = 2116.2; %psf
T_SL = 518.69; %Deg. Rankine
Rho_SL = 0.002377; %slugs/ft3
Gamma_Air = 1.4; %Constant
R_Air = 1716; %Air Constant
mu_Air = 3.7424*10^-7; %Air Constant
delta_STL = 0.9822;
theta_STL_STD = 0.997;
theta_STL_Cold = 0.784;
theta_STL_Hot = 1.0812;
delta_500_STL = 0.9692;
theta_500_STL_STD = 0.994;
theta_500_STL_Cold = 0.7972;
theta_500_STL_Hot = 1.0774;
sigma_500_STL = 0.975;
mu_500_STL = 3.72497*10^-7;
Tatm = T_SL*theta_STL_STD; %Rank
Rair = 1716;
g = 32.2; %gravity constant in ft/sec2
rho = 0.002377*sigma_500_STL; %Density at trim level
mu = (3.62*10^-
7)*((Tatm/518.7)^1.5)*((518.7+198.72)/(Tatm+198.72));
%air viscocity in engineering units at Patm and Tatm
%-> Got equation from Introduction to Flight 7th ed.
nu = mu/rho;
a_SL = 1116; %Speed of Sound at SL in fps
%% Vehicle Geometry
lH = 16.45; %inches
lH = lH*in_2_ft; %ft
cbar_w = 8.5; %in
cbar_w = cbar_w*in_2_ft;
cbar_H = 6.5;
cbar_H = cbar_H*in_2_ft;
alpha0H = 0;
bw = 40;
bw = bw*in_2_ft;
bH = 22;
bH = bH*in_2_ft;
Sw = bw*cbar_w; %Wing Planform Area
SH = bH*cbar_H;
ARw = (bw^2)/Sw;
ARH = (bH^2)/SH;
ht = lH/cbar_w;
hcg = (4*in_2_ft)/cbar_w;
VH = (SH*lH)/(Sw*cbar_w);
etaH = .9; %assumed due to propeller
influence
dTh = 0;
XdTh = 13.5;
XdTh = XdTh*in_2_ft;
M = 5.5/g; %mass of the vehicle
Imat = [4.214*10^6 1.4502*10^3 -2.5678*10^4;... %in
lbs*in^2
1.4502*10^3 4.215*10^6 3.563*10^4;...
-2.5678*10^4 3.563*10^4 2.5144*10^5];
Imat = Imat*(in_2_ft^2)/g; %in slugs*ft^2
Iyy = Imat(2,2); %slugs*ft^2
CD0 = 0.02385; %From Drag build-up Excel File
%% Trim Conditions
U0 = 40; %Trim Speed in fps
U0 = U0*kts_2_fps;
qinf = 0.5*rho*U0^2; %dynamic pressure at trim
qSM = qinf*Sw/M; %Constant in control derivatives
qSCIyy = qinf*Sw*cbar_w/Iyy;
CL0 = g/qSM; %Lift Coefficient at trim
ew = 4.61*(1-0.045*ARw^0.68)-3.1;
ewH = 4.61*(1-0.045*ARH^0.68)-3.1;
CDt = CD0 + (1/(pi*ARw*ew))*CL0^2;
TH_tot = CDt*qinf*Sw;
TH_mot = TH_tot/3;
alpha0 = 0;
Theta_T = 0;
Cm0 = 0.025;
iH = 1.94*deg_2_rad;
%% Stability Derivatives
CTh = TH_mot/(qinf*Sw);
63
American Institute of Aeronautics and Astronautics
CD_alpha_fun = [0.04584 0.23491]; %1/rad
CD_alpha = polyval(CD_alpha_fun,alpha0);
CD_alphadot = 0.04584;
CLw_alpha = 4.58;
CLH_alpha = 4.12;
CLih = CLH_alpha*(etaH)*(SH/Sw);% + CTh; %Since we
are including (d/dih)(CTh*sin(ih)) which was approx as slope ih.
Cmih = -CLH_alpha*ht*etaH*(SH/Sw);
Cm_alphadot = -32.97; %From wind tunnel
analysis matlab
dE_dalpha = (2*CLw_alpha)/(pi*ARw);
CLH0 = CLH_alpha*(((1-dE_dalpha)*alpha0)+iH-alpha0H);
CDih = (2*CLH_alpha*CLH0*etaH*(SH/Sw))/(pi*ARH*ewH);
Cm_alpha = -0.2406; %1/rad
%Cm_alpha = -0.59;
%% Control Derivatives
Xu_Xpu = qSM*(-1*(((2/U0)*CD0)));
%Xalphadot = -qSM*CD_alphadot;
Xalphadot = 0;
Xalpha = qSM*(CL0-CD_alpha);
Xq = 0;
Xdih = -qSM*CDih;
XdT = qSCIyy*cos(Theta_T)/M;
Zu_Zpu = qSM*(-1*((2/U0)*CL0));
Zalpha = qSM*(CD0-CLw_alpha);
Zq = -VH*CLw_alpha;
Zalphadot = Zq*dE_dalpha;
Zih = -qSM*CLih;
ZdT = -sin(Theta_T)/M;
Mu_Mpu = qSCIyy*((2/U0)*Cm0);
Mq = Zq*hcg;
Malphadot = qSCIyy*Cm_alphadot;
Malpha_Mpalpha = -3.8657; %From Wind Tunnel
analysis 1/rad
Mih = .5*qinf*Sw*Cmih;
MdT = (dTh*cos(Theta_T) - XdTh*sin(Theta_T))/Iyy;
%% State Space
a11 = Xu_Xpu+((Xalphadot*(Zu_Zpu))/(U0-Zalphadot));
a12 = Xalpha+((Xalphadot*Zalpha)/(U0-Zalphadot));
a13 = -g;
a14 = Xq+(Xalphadot*((U0+Zq)/(U0-Zalphadot)));
a15 = 0;
a21 = ((Zu_Zpu)/(U0-Zalphadot));
a22 = Zalpha/(U0-Zalphadot);
a23 = 0;
a24 = ((U0+Zq)/(U0-Zalphadot));
a25 = 0;
a31 = 0;
a32 = 0;
a33 = 0;
a34 = 1;
a35 = 0;
a41 = Mu_Mpu + ((Malphadot*Zu_Zpu)/(U0-Zalphadot));
a42 = Malpha_Mpalpha + ((Malphadot*Zalpha)/(U0-Zalphadot));
a43 = 0;
a44 = Mq + Malphadot*(((U0+Zq)/(U0-Zalphadot)));
a45 = 0;
a51 = 0;
a52 = -U0;
a53 = U0;
a54 = 0;
a55 = 0;
%b11 = Xdih+((Xalphadot*Zih)/(U0-Zalphadot));
b11 = 0;
b12 = XdT+((Xalphadot*ZdT)/(U0-Zalphadot));
b21 = Zih/(U0-Zalphadot);
b22 = ZdT/(U0-Zalphadot);
b31 = 0;
b32 = 0;
b41 = Mih + ((Malphadot*Zih)/(U0-Zalphadot));
b42 = MdT + ((Malphadot*ZdT)/(U0-Zalphadot));
b51 = 0;
b52 = 0;
A = [a11 a12 a13 a14 a15;...
a21 a22 a23 a24 a25;...
a31 a32 a33 a34 a35;...
a41 a42 a43 a44 a45;...
a51 a52 a53 a54 a55];
B = [b11 b21 b31 b41 b51;...
b12 b22 b32 b42 b52]';
% Get the number of states, n, number of controls, m, and the
number of
% outputs, p.
[n,m] = size(B);
C = eye(n,n);
p = size(C,1);
D = zeros(p,m);
% Define the state space model.
sys_ss = ss(A,B,C,D);
% Convert to transfer function.
sys_tf = tf(sys_ss);
% Convert to zero-pole description.
sys_zpk = zpk(sys_ss);
% Convert back to state space
sys_ssa = ss(sys_tf);
%{
%% Simulation of State Space System
% Find the characteristic polynomial.
CharPoly = poly(A);
% Find the system poles.
Poles = roots(CharPoly);
dt = 0.01;
tfinal = 50;
time_s = 0:dt:tfinal;
% Compute the left eigenvectors of A. These are used in tests for
% controllability.
[W,Dc] = eig(A.');
W = conj(W);
% Compute the right eigenvectors of A. These are used in tests for
% observability.
[V,Do] = eig(A);
%% Initial Simulation
t0 = 0:.05:20;
u0(2,1:401) = 0;
u0(1,1:60) = 3.5/57.3;
64
American Institute of Aeronautics and Astronautics
u0(1,61:120) = 1/57.3;
u0(1,121:180) = 3.5/57.3;
u0(1,181:401) = 0/57.3;
%u0(1,101:401) = 0/57.3;
%{
u0(1,41:80) = 0;
u0(1,81:120) = 1/57.3;
u0(1,121:401) = 0;
%}
x0 = [67.51;0;0;0;400]; %trim
[y1,t1,x1] = lsim(sys_ss,u0,t0,x0);
figure
subplot(5,1,1)
plot(t1,y1(:,1))
xlabel('time (s)')
ylabel('speed (fps)')
title('Surge Velocity vs. time')
subplot(5,1,2)
plot(t1,y1(:,2)*57.3)
xlabel('time (s)')
ylabel('alpha (deg)')
subplot(5,1,3)
plot(t1,y1(:,3)*57.3)
xlabel('time (s)')
ylabel('theta (deg)')
title('Pitch Attitude vs. time')
subplot(5,1,4)
plot(t1,y1(:,4)*57.3)
xlabel('time (s)')
ylabel('Pitch Rate (deg/s)')
subplot(5,1,5)
plot(t1,y1(:,5))
xlabel('time (s)')
ylabel('Altitude (ft)')
figure
plot(t1,u0(1,:)*57.3)
xlabel('time (sec)')
ylabel('Tail Incidence Angle (deg.)')
%}
%% System for Control
Acc = A(1:4,1:4);
Bcc = B(1:4,1:2);
%Bcc = B(1:4,1);
[nc,mc] = size(Bcc);
Ccc = eye(nc,nc);
pcc = size(Ccc,1);
Dcc = zeros(pcc,mc);
% Define the state space model.
sys_cc = ss(Acc,Bcc,Ccc,Dcc);
% Convert to transfer function.
sys_tf = tf(sys_cc);
% Convert to zero-pole description.
sys_zpk = zpk(sys_cc);
% Convert back to state space
sys_ssa = ss(sys_tf);
% Find the characteristic polynomial.
CharPoly = poly(Acc);
% Find the system poles.
Poles = roots(CharPoly);
% Compute the left eigenvectors of A. These are used in tests for
% controllability.
[W,Dc] = eig(Acc.');
W = conj(W);
% Compute the right eigenvectors of A. These are used in tests for
% observability.
[V,Do] = eig(Acc);
% Damping characteristics
damp(Acc)
% Compute the controllability matrix, P, using the MATLAB
function.
P = ctrb(sys_cc);
% Determine if the system is controllable by checking the rank of
P.
% The rank of P should match the number of rows (or columns) of
the square
% matrix A.
if rank(P) == nc
disp('The system is controllable.');
else
disp('The system is NOT controllable.');
end
disp(' ');
% Compute the condition number for impending singularity.
Cn = cond(Acc);
% Degree of Controllability between Mode i and Control j.
DoC = zeros(nc,mc);
for i = 1:nc
for j = 1:mc
DoC(i,j) = abs(dot(Bcc(:,j),
W(i,:))/norm(Bcc(:,j))/norm(W(i,:)));
end
end
% Compute the inverse matrix Pccfi.
Pccfi = zeros(nc,nc);
base = CharPoly(nc:-1:2);
for i = nc:-1:1
if i == nc
% Last row. Set the first element to 1.
Pccfi(i,1) = 1;
else
% Populate the ith row
Pccfi(i,1:nc-i+1) = [base(i:end) 1];
end
end
%{
% Compute the Transformation matrix, Tccf.
Tccf = P*Pccfi;
% Compute the CCF matrices.
Accf = TccfAcc*Tccf;
Bccf = TccfBcc;
Cccf = Ccc*Tccf;
Dccf = Dcc;
65
American Institute of Aeronautics and Astronautics
%}
% Compute the observability matrix, Q, using the MATLAB
function.
Q = obsv(sys_cc);
% Determine if the system is observable by checking the rank of
Q.
% The rank of Q should match the number of rows (or columns) of
the square
% matrix A.
if rank(Q) == nc
disp('The system is observable.');
else
disp('The system is NOT observable.');
end
disp(' ');
% Degree of Observability between Mode i and Measurement j.
DoO = zeros(pcc,nc);
for j = 1:pcc
for i = 1:nc
DoO(j,i) = abs(dot(Ccc(j,:),
V(:,i))/norm(Ccc(j,:))/norm(V(:,i)));
end
end
% Perform a stability analysis using Lyapunov stability.
disp('Lyapunov Stability Analysis.');
% Find the poles with zero real part.
i_zero_real = find(real(Poles) == 0);
if ~isempty(i_zero_real)
% Lyapunov stabilty analysis will not work if there is at least
one
% pole with zero real part. At this point, we can only check for
% marginally stable or unstable systems.
else
% Lyapunov stability analysis will work.
% Form a positive definite matrix, Q.
Qc = eye(nc);
% Solve the Lyapunov equation for P.
Pc = lyap(Acc',Qc);
% Perform Sylvester's Method to determine if P is positive
definite.
pm = zeros(1,nc);
for i = 1:nc
pm(i) = det(Pc(1:i,1:i));
end
if all(pm > 0)
disp('P is positive definite. System is asymptotically stable.');
elseif any(pm < 0)
disp('P is not positive definite. System is unstable.');
else
disp('P is positive semi-definite. Try another Q.');
end
end
% Determine a desired response for the system. Two approaches
are
% investigated: (1.) second order dominant; (2.) 6th order ITAE.
% Specify the overshoot percentage and settling time.
PO = 5;
ts = 1.5;
% Determine damping ratio from PO and natural frequency from
settling time
% and zeta.
term = pi^2 + log(PO/100)^2;
zeta = abs(log(PO/100))/sqrt(term);
wn = 4/(zeta*ts);
% Desired 2nd order system.
num2 = wn^2;
den2 = [1 2*zeta*wn wn^2];
Des2 = tf(num2,den2);
% Dominant 2nd order eigenvalues.
DesEig2 = roots(den2);
% Get the stepinfo
stepinfo(Des2)
% Augment with 2 additional poles.
Aug4 = zeros(2,1);
Aug4(1) = 10*real(DesEig2(1));
Aug4(2) = Aug4(1)-1;
% 4th order transfer function with augmented poles,
den_Aug4 = conv(den2,conv([1 -Aug4(1)],([1 -Aug4(2)])));
Aug2 = tf(num2, den_Aug4);
% Plot the dominant 2nd order response.
figure
step(Des2, 'b-', Aug2*den_Aug4(end)/num2, 'g--');grid on
legend('Desired 2nd', 'Augmented 2nd order');
% Compute the state feedback regulator based upon the augmented
2nd order
% system.
K = place(Acc,Bcc,[DesEig2;Aug4]);
% Form plant system. Set output matrix for state feedback control.
sys_p.Ap = Acc;
sys_p.Bp = Bcc;
sys_p.Cp = eye(nc);
sys_p.Dp = zeros(nc,mc);
% Form controller system.
sys_c.Ac = 0;
sys_c.Bc1= 0;
sys_c.Bc2= 0;
sys_c.Cc = 0;
sys_c.Dc1= -K;
sys_c.Dc2= zeros(mc,mc);
% Form closed loop system.
[Acl,Bcl,Ccl,Dcl] = closed_loop_system(sys_p, sys_c);
sys_cl = ss(Acl,Bcl,Ccl,Dcl);
%% Simulation
t = 0:.05:200;
x0 = [0;0;1.5/57.3;0]; %trim
% Closed-loop response (zero input, ICs).
[Yo,t,Xo] = lsim(sys_cc,zeros(numel(t),mc),t,x0);
[Yc,t,Xc] = lsim(sys_cl,zeros(numel(t),mc),t,x0);
66
American Institute of Aeronautics and Astronautics
figure
plot(Xo(:,3)*57.3,Xo(:,4)*57.3)
grid on
xlabel('theta, deg.')
ylabel('dtheta / dt, deg./s')
title('Phase Diagram for Pitch Attitude')
% Control signals.
u = zeros(numel(t),mc);
for i = 1:mc
for j = 1:numel(t)
u(j,i) = -K(i,:)*Xc(j,:)';
end
end
% Plot the control signals.
figure
%subplot(2,1,1);
plot(t, u(:,1)*57.3);grid on
xlabel('Time, s');
ylabel('di_t (deg.)');
title('Regulating controls vs. Time');
%{
subplot(2,1,2);
plot(t, u(:,2));grid on
xlabel('Time, s');
ylabel('dThrust, N');
%}
% Open-loop and closed loop plots of the model states.
figure
subplot(4,1,1);
plot(t,Xo(:,1),'--b',t,Xc(:,1),'-r');grid on
xlabel('Time, s');
ylabel('speed, fps');
title('Model States vs. Time with 0 input and I.C.s')
subplot(4,1,2);
plot(t,Xo(:,2)*57.3,'--b',t,Xc(:,2)*57.3,'-r');grid on
xlabel('Time, s');
ylabel('alpha , rad');
subplot(4,1,3);
plot(t,Xo(:,3)*57.3,'--b',t,Xc(:,3)*57.3,'-r');grid on
xlabel('Time, s');
ylabel('theta , rad');
subplot(4,1,4);
plot(t,Xo(:,4)*57.3,'--b',t,Xc(:,4)*57.3,'-r');grid on
xlabel('Time, s');
ylabel('pitch rate, rad/s');
legend('Uncontrolled Response','Controlled
Response','Location','NorthEast')
Acl2 = zeros(n,n);
Acl2(1:4,1:4) = Acl;
Acl2(5,:) = A(5,:);
sys_cl2 = ss(Acl2,B,C,D);
t0 = 0:.05:10;
%{%}
u0(2,1:401) = 0;
u0(1,1:60) = 0/57.3;
u0(1,61:100) = 1.5/57.3;
u0(1,101:180) = 0/57.3;
u0(1,181:220) = -1.5/57.3;
u0(1,221:401) = 0/57.3;
u01 = 1/57.3*ones(numel(t0),1);
u02 = 0*ones(numel(t0),1);
u03 = 1*ones(numel(t0),1);
xx0 = [0;0;0;0;400]; %trim
[y1,t1,x1] = lsim(sys_cl2,[u01 u02],t0,xx0);
[y2,t2,x2] = lsim(sys_ss,[u01 u02],t0,xx0);
[y3,t3,x3] = lsim(sys_cl2,[u02 u03],t0,xx0);
[y4,t4,x4] = lsim(sys_ss,[u02 u03],t0,xx0);
figure
subplot(5,1,1)
plot(t1,y1(:,1),'-r')
hold on
plot(t1,y2(:,1),'--b')
xlabel('time (s)')
ylabel('speed (fps)')
title('Surge Velocity vs. time')
subplot(5,1,2)
plot(t1,y1(:,2)*57.3,'-r')
hold on
plot(t1,y2(:,2)*57.3,'--b')
xlabel('time (s)')
ylabel('alpha (deg)')
subplot(5,1,3)
plot(t1,y1(:,3)*57.3,'-r')
hold on
plot(t1,y2(:,3)*57.3,'--b')
xlabel('time (s)')
ylabel('theta (deg)')
title('Pitch Attitude vs. time')
subplot(5,1,4)
plot(t1,y1(:,4)*57.3,'-r')
hold on
plot(t1,y2(:,4)*57.3,'--b')
xlabel('time (s)')
ylabel('Pitch Rate (deg/s)')
title('Pitch Rate vs. time')
subplot(5,1,5)
plot(t1,y1(:,5),'-r')
hold on
plot(t1,y2(:,5),'--b')
xlabel('time (s)')
ylabel('Altitude (ft)')
title('Model State vs. Time with 0 I.C.s and Tail Incidence step
input')
legend('Controlled Response','Uncontrolled Response')
figure
subplot(5,1,1)
plot(t1,y3(:,1),'-r')
hold on
plot(t1,y4(:,1),'--b')
xlabel('time (s)')
ylabel('speed (fps)')
title('Surge Velocity vs. time')
subplot(5,1,2)
plot(t1,y3(:,2)*57.3,'-r')
hold on
plot(t1,y4(:,2)*57.3,'--b')
xlabel('time (s)')
ylabel('alpha (deg)')
subplot(5,1,3)
plot(t1,y3(:,3)*57.3,'-r')
hold on
plot(t1,y4(:,3)*57.3,'--b')
xlabel('time (s)')
ylabel('theta (deg)')
title('Pitch Attitude vs. time')
subplot(5,1,4)
67
American Institute of Aeronautics and Astronautics
plot(t1,y3(:,4)*57.3,'-r')
hold on
plot(t1,y4(:,4)*57.3,'--b')
xlabel('time (s)')
ylabel('Pitch Rate (deg/s)')
title('Pitch Rate vs. time')
subplot(5,1,5)
plot(t1,y3(:,5),'-r')
hold on
plot(t1,y4(:,5),'--b')
xlabel('time (s)')
ylabel('Altitude (ft)')
title('Model State vs. Time with 0 I.C.s and Thrust step input')
legend('Controlled Response','Uncontrolled Response')
t6 = 0:length(u0)-1;
%{%}
figure
plot(t6,u0(1,:)*57.3)
xlabel('time (sec)')
ylabel('Tail Incidence Angle (deg.)')
[y5,t6,x5] = lsim(sys_cl2,u0,t6,xx0);
[y6,t6,x6] = lsim(sys_ss,u0,t6,xx0);
figure
subplot(1,2,1)
plot(t6,y5(:,5),'-r')
hold on
plot(t6,y6(:,5),'--b')
xlabel('time (s)')
ylabel('Altitude (ft)')
subplot(1,2,2)
plot(t6,u0(1,:)*57.3)
xlabel('time (sec)')
ylabel('Tail Incidence Angle (deg.)')
title('Altitude vs. Time with Tail Incidence Control')
%%%%% SERVO MECHANISM TRACKING %%%%%
% Track outputs y1, y2 and y3.
CC = zeros(2,5);
CC(1,:) = C(1,:);
%CC(2,:) = C(3,:);
CC(2,:) = C(5,:);
Csv = CC;
p = 3;
% Matrices
Asv = zeros(n+m, n+m);
Asv(1:n,1:n) = A;
Asv(n+1:end,1:n) = -Csv;
Bsv = zeros(n+m, m);
Bsv(1:n,:) = B;
% Gain design. Add 3 additional eigenvalues for each reference.
Ksv = place(Asv,Bsv,[DesEig2;Aug4;-6;-12;-7]);
Kv = Ksv(:,1:n);
kI = -Ksv(:,n+1:end);
% Closed loop system
% Aclsv = [A-B*Kv, B*kI;-Csv, zeros(p,m)];
% Bclsv = [zeros(n,m);eye(m)];
% Cclsv = [Csv, zeros(m,m)];
% Dclsv = 0;
% sys_clsv = ss(Aclsv,Bclsv,Cclsv,Dclsv);
% Form plant system. Set output matrix for state feedback control.
sys_p.Ap = A;
sys_p.Bp = B;
sys_p.Cp = eye(n);
sys_p.Dp = zeros(n,m);
% Form controller system. Tracking on each of the three position
states.
sys_c.Ac = zeros(m,m);
sys_c.Bc1= -CC;
sys_c.Bc2= eye(m);
sys_c.Cc = kI;
sys_c.Dc1= -Kv;
sys_p.Dc2= zeros(n,m);
% Form closed loop system.
[Aclsv, Bclsv, Cclsv, Dclsv] = closed_loop_system(sys_p, sys_c);
sys_clsv = ss(Aclsv,Bclsv,Cclsv,Dclsv);
% Simulation
dt = 0.01;
tfinal = 10;
t = 0:dt:tfinal;
% Simulation #1: r1 = 1, r2 = 1 and r3 = 1. Zero I.C.
r1 = ones(numel(t),1);
r2 = ones(numel(t),1);
%r3 = ones(numel(t),1);
[y_clsv,time_clsv,x_clsv] = lsim(sys_clsv,[r1, r2],t);
% Control signals.
u = zeros(numel(t),m);
for i = 1:m
for j = 1:numel(t)
u(j,i) = -Kv(i,:)*x_clsv(j,1:n)'+kI(i,:)*x_clsv(j,n+1:end)';
end
end
% Plot the control signals.
figure
subplot(2,1,1);
plot(t, u(:,1)*57.3);grid on
xlabel('Time, s');
ylabel('delta_{tail}, deg.');
title('Tracking controls vs. Time');
subplot(2,1,2);
plot(t, u(:,2)/38);grid on
xlabel('Time, s');
ylabel('delta_{thrust}, lbf');
% Plot output responses.
figure
subplot(3,1,1);
plot(time_clsv, y_clsv(:,1),'b-');grid on
xlabel('Time, s');
ylabel('y_1, m');
title('Unit step responses for each output vs. Time');
subplot(3,1,2);
plot(time_clsv, y_clsv(:,2),'b-');grid on
xlabel('Time, s');
ylabel('y_2, m');
subplot(3,1,3);
plot(time_clsv, y_clsv(:,3),'b-');grid on
xlabel('Time, s');
ylabel('y_3, m');
figure
subplot(3,1,1);
plot(time_clsv, x_clsv(:,1),'b-');grid on
68
American Institute of Aeronautics and Astronautics
xlabel('Time, s');
ylabel('speed, fps');
title('Unit step responses for each output vs. Time');
subplot(3,1,2);
plot(time_clsv, x_clsv(:,3)*57.3,'b-');grid on
xlabel('Time, s');
ylabel('theta, deg.');
subplot(3,1,3);
plot(time_clsv, x_clsv(:,5),'b-');grid on
xlabel('Time, s');
ylabel('altitude, ft');
%%%%% FREQUENCY ANALYSIS %%%%%
% Perform frequency analysis of servo tracker.
w = logspace(0,4,400);
freq_resp1 = freq_analysis(sys_p, sys_c, w, 1, 3);
freq_resp2 = freq_analysis(sys_p, sys_c, w, 2, 3);
% Plot frequency data.
%plot_freq_resp(freq_resp1, w);
%plot_freq_resp(freq_resp2, w);
%% Altitude Autopilot Control
%% Comparison of Elevator input Controlled/Uncontrolled
%{%}
Hmax = 500;
Hc = zeros(312,1);
Hc(:,1)=[zeros(10,1);Hmax/100*[0:1:100]';Hmax*ones(50,1);Hma
x/100*[100:-1:0]';zeros(50,1)];
t4 = 0:length(Hc)-1;
%{
[Yh,t4]=lsim(sys_cl2(:,2),Hc,t4);
[Yh2,t4]=lsim(sys_ss(:,2),Hc,t4);
%}
%{%}
[Yh,t4]=lsim(sys_cl2(:,2),Hc,t4);
[Yh2,t4]=lsim(sys_ss(:,2),Hc,t4);
figure
subplot(5,1,1)
plot(t4,Yh(:,1),'-r')
hold on
plot(t4,Yh2(:,1),'--b')
xlabel('time, sec')
ylabel('Velocity, fps')
subplot(5,1,2)
plot(t4,Yh(:,2),'-r')
hold on
plot(t4,Yh2(:,2),'--b')
xlabel('time, sec')
ylabel('alpha, deg.')
subplot(5,1,3)
plot(t4,Yh(:,3),'-r')
hold on
plot(t4,Yh2(:,3),'--b')
xlabel('time, sec')
ylabel('theta, deg.')
subplot(5,1,4)
plot(t4,Yh(:,4),'-r')
hold on
plot(t4,Yh2(:,4),'--b')
xlabel('time, sec')
ylabel('dtheta/dt, deg./sec')
subplot(5,1,5)
plot(t4,Yh(:,5),'-r')
hold on
plot(t4,Yh2(:,5),'--b')
xlabel('time, sec')
ylabel('Altitude, ft.')
%% simplified model
Ashort = A(2:4,2:4);
Bshort = B(2:4,1:2);
Ashort = [Ashort(1,1) Ashort(1,3);Ashort(3,1) Ashort(3,3)];
Bshort = [Bshort(1,1) Bshort(3,1)]';
Cshort = eye(2);
Dshort = zeros(2,1);
sys_short = ss(Ashort, Bshort, Cshort, Dshort);
CPshort = poly(Ashort);
% Calculate the open-loop system eigenvalues, zeta and wn from
ABCD
[wn0_short,zeta0_short,Eigs0_short] = damp(Ashort);
% Convert to transfer function.
sys_tf_short = tf(sys_short);
time_short = 0:0.001:3.0;
x0sh = [0; 0];
u = zeros(size(time_short));
u(1:500) = -1/57.3;
[Y0sh,t_short,X0sh] = lsim(sys_short,u,time_short,x0sh);
Tp_short = (2*pi)/(wn0_short(1)); %Seconds
T_Half_short = -log(2)/(real(Eigs0_short(1))); %Seconds
figure
plot(t_short,X0sh(:,1)*57.3,'-b','LineWidth',2)
xlabel('time (sec)')
ylabel('alpha (deg.)')
title('Short Period Response to alpha = 0.5 deg. Disturbance')
%% SImulation
[Vsh2, Gamsh2] = eig(A);
xshort = real(Vsh2(:,2));
xphug = real(Vsh2(:,4));
xshort = xshort/norm(xshort);
xphug = xphug/norm(xphug);
Nsamp = 100;
yshort = zeros(5,Nsamp);
timesh = linspace(0,3,Nsamp);
for i = 1:Nsamp
yshort(:,i) = C*expm(timesh(i)*A)*xshort;
end
figure
subplot(3,2,1)
plot(timesh,yshort(1,:))
ylabel('speed (fps)')
xlabel('time (sec)')
title('Short Period Responses')
69
American Institute of Aeronautics and Astronautics
subplot(3,2,2)
plot(timesh,yshort(2,:)/deg_2_rad)
ylabel('alpha (deg)')
xlabel('time (sec)')
subplot(3,2,3)
plot(timesh,yshort(3,:)/deg_2_rad)
ylabel('q (deg./sec)')
xlabel('time (sec)')
subplot(3,2,4)
plot(timesh,yshort(4,:)/deg_2_rad)
ylabel('theta (deg)')
xlabel('time (sec)')
subplot(3,2,5)
plot(timesh,yshort(5,:))
ylabel('altitude (ft)')
xlabel('time (sec)')
h1=zeros(5,Nsamp); h2=zeros(5,Nsamp);
for i=1:Nsamp,
h1(:,i)=C*expm(timesh(i)*A)*B(:,1); % impulse response from
u_w
h2(:,i)=C*expm(timesh(i)*A)*B(:,2); % imp resp from v_w
end
figure
subplot(3,2,1)
plot(timesh,h1(1,:))
ylabel('speed (fps)')
xlabel('time (sec)')
title('Impulse Responses to Wing Incidence')
subplot(3,2,2)
plot(timesh,h1(2,:)/deg_2_rad)
ylabel('alpha (deg)')
xlabel('time (sec)')
subplot(3,2,3)
plot(timesh,h1(3,:)/deg_2_rad)
ylabel('theta (deg)')
xlabel('time (sec)')
subplot(3,2,4)
plot(timesh,h1(4,:)/deg_2_rad)
ylabel('q (deg./sec)')
xlabel('time (sec)')
subplot(3,2,5)
plot(timesh,h1(5,:))
ylabel('altitude (ft)')
xlabel('time (sec)')
figure
subplot(3,2,1)
plot(timesh,h2(1,:))
ylabel('speed (fps)')
xlabel('time (sec)')
title('Impulse Responses to Change in Thrust')
subplot(3,2,2)
plot(timesh,h2(2,:)/deg_2_rad)
ylabel('alpha (deg)')
xlabel('time (sec)')
subplot(3,2,3)
plot(timesh,h2(3,:)/deg_2_rad)
ylabel('theta (deg)')
xlabel('time (sec)')
subplot(3,2,4)
plot(timesh,h2(4,:)/deg_2_rad)
ylabel('q (deg./sec)')
xlabel('time (sec)')
subplot(3,2,5)
plot(timesh,h2(5,:))
ylabel('altitude (ft)')
xlabel('time (sec)')
%% Phugoid
Nsamp = 1000; %number of time samples
yphug=zeros(5,Nsamp);
tphug=linspace(0,1000,Nsamp);
for i=1:Nsamp
yphug(:,i)=C*expm(tphug(i)*A)*xphug;
end
figure
subplot(3,2,1)
plot(tphug,yphug(1,:))
ylabel('speed (fps)')
xlabel('time (sec)')
title('Phugoid Motion')
subplot(3,2,2)
plot(tphug,yphug(2,:)/deg_2_rad)
ylabel('alpha (deg)')
xlabel('time (sec)')
subplot(3,2,3)
plot(tphug,yphug(3,:))
ylabel('q_{inf} (psf)')
xlabel('time (sec)')
subplot(3,2,4)
plot(tphug,yphug(4,:)/deg_2_rad)
ylabel('theta (deg)')
xlabel('time (sec)')
subplot(3,2,5)
plot(tphug,yphug(5,:))
ylabel('altitude (ft)')
xlabel('time (sec)')
figure
plot(tphug,yphug(1,:),'-r','LineWidth',2)
hold on
plot(tphug,yphug(5,:),'--b','LineWidth',2)
xlabel('time (sec)')
ylabel('Amplitude')
title('Phugoid Mode')
legend('Speed','Altitude','Location','NorthEast')
axis([0 100 -1 1])
% Calculate the open-loop system eigenvalues, zeta and wn from
ABCD
[wn0,zeta0,Eigs0] = damp(A);
Eigs_phug = Eigs0(4:5);
Damp_phug = zeta0(4:5);
wn_phug = wn0(4:5);
Tp_phug = (2*pi)/(wn_phug(1)); %Seconds
T_Half_phug = -log(2)/(real(Eigs_phug(1))); %Seconds
Lateral
%Senior Design - Paparazzi
%Dynamic Stability and Feedback Control
clear
close all
70
American Institute of Aeronautics and Astronautics
%% Longitudinal State Space
%X(1) = Beta (Sideslip Angle)
%X(2) = Phi (Bank Angle)
%X(3) = p (roll rate)
%X(4) = r (yaw rate)
%X(5) = psy (Heading Angle)
% A = [ Xbet/U0 g/U0 Yp/U0 (Yr/U0 -1) 0...
% 0 0 1 0 0...
% Lbet 0 Lp Lr 0...
% Nbet 0 Np Nr 0...
% 0 0 0 1 0]
%B = [
%% Conversion Factors
% < < Distance > >
nm_2_miles = 1.15078; %multiply to convert from nm to miles
miles_2_ft = 5280; %multiply to convert from miles to feet
in_2_ft = 1/12; %multiply to convert from in to ft
% < < Speed > >
kts_2_mph = 1.1508; %multiply to convert from kts to mph
kts_2_fps = 1.6878; %multiply to convert from kts to fps
mph_2_fps = 1.46667; %multiply to convert from mph to fps
% < < Mass > >
oz_2_lbs = 1/16; %multiply to convert from oz to lbs
% < < Temperature > >
fah_2_rank = 460.67; %add to convert from Fahrenheit to Rankine
% < < Pressure > >
inHg_2_psf = 70.7262; %multiply to convert from inches Mercury
to Psf
% < < Time > >
hour_2_sec = 3600; %multiply to convert from hours to seconds
min_2_sec = 60; %multiply to convert from min to seconds
% < < Angles > >
deg_2_rad = pi/180; %multiply to convert from degrees to radians
%% Given Constant Atmospheric Data
P_SL = 2116.2; %psf
T_SL = 518.69; %Deg. Rankine
Rho_SL = 0.002377; %slugs/ft3
Gamma_Air = 1.4; %Constant
R_Air = 1716; %Air Constant
mu_Air = 3.7424*10^-7; %Air Constant
delta_STL = 0.9822;
theta_STL_STD = 0.997;
theta_STL_Cold = 0.784;
theta_STL_Hot = 1.0812;
delta_500_STL = 0.9692;
theta_500_STL_STD = 0.994;
theta_500_STL_Cold = 0.7972;
theta_500_STL_Hot = 1.0774;
sigma_500_STL = 0.975;
mu_500_STL = 3.72497*10^-7;
Tatm = T_SL*theta_STL_STD; %Rank
Rair = 1716;
g = 32.2; %gravity constant in ft/sec2
rho = 0.002377*sigma_500_STL; %Density at trim level
mu = (3.62*10^-
7)*((Tatm/518.7)^1.5)*((518.7+198.72)/(Tatm+198.72));
%air viscocity in engineering units at Patm and Tatm
%-> Got equation from Introduction to Flight 7th ed.
nu = mu/rho;
a_SL = 1116; %Speed of Sound at SL in fps
%% Vehicle Geometry
lH = 16.45; %inches
lH = lH*in_2_ft; %ft
cbar_w = 8.5; %in
cbar_w = cbar_w*in_2_ft;
cbar_H = 6.5;
cbar_H = cbar_H*in_2_ft;
alpha0H = 0;
bw = 40;
bw = bw*in_2_ft;
bH = 22;
bH = bH*in_2_ft;
Sw = bw*cbar_w; %Wing Planform Area
SH = bH*cbar_H;
ARw = (bw^2)/Sw;
ARH = (bH^2)/SH;
ht = lH/cbar_w;
hcg = (4*in_2_ft)/cbar_w;
VH = (SH*lH)/(Sw*cbar_w);
etaH = .9; %assumed due to propeller
influence
dTh = 0;
XdTh = 13.5;
XdTh = XdTh*in_2_ft;
M = 5.5/g; %mass of the vehicle
Imat = [4.214*10^6 1.4502*10^3 -2.5678*10^4;... %in
lbs*in^2
1.4502*10^3 4.215*10^6 3.563*10^4;...
-2.5678*10^4 3.563*10^4 2.5144*10^5];
Imat = Imat*(in_2_ft^2)/g; %in slugs*ft^2
Iyy = Imat(2,2); %slugs*ft^2
CD0 = 0.02385; %From Drag build-up Excel File
%% Trim Conditions
U0 = 40; %Trim Speed in fps
U0 = U0*kts_2_fps;
qinf = 0.5*rho*U0^2; %dynamic pressure at trim
71
American Institute of Aeronautics and Astronautics
qSM = qinf*Sw/M; %Constant in control derivatives
qSCIyy = qinf*Sw*cbar_w/Iyy;
CL0 = g/qSM; %Lift Coefficient at trim
ew = 4.61*(1-0.045*ARw^0.68)-3.1;
ewH = 4.61*(1-0.045*ARH^0.68)-3.1;
CDt = CD0 + (1/(pi*ARw*ew))*CL0^2;
TH_tot = CDt*qinf*Sw;
TH_mot = TH_tot/3;
alpha0 = 0;
Theta_T = 0;
%% Stability Derivatives
Cn_bet = 0.0019*180/pi; %1/rad
CL_bet = 0;
CL_p = -0.245;
CL_r = -0.0012;
CL_dw = 0.0032*180/pi;
%Cn_p = -0.0016;
Cn_p = -0.00;
Cn_r = -0.3234;
%Cn_r = -0.3234;
Cn_dw = 0.0027*180/pi;
CTh = TH_mot/(qinf*Sw);
%% Control Derivatives
Y_bet = qSM*Cn_bet;
Y_p = 0;
Y_r = 0;
L_bet = (qinf*Sw*bw/Imat(1,1))*CL_bet;
L_p = (qinf*Sw*bw/Imat(1,1))*CL_p;
L_r = (qinf*Sw*bw/Imat(1,1))*CL_r;
L_dr = 0;
L_dw =(qinf*Sw*bw/Imat(1,1))*(CL_dw + (2*CTh/pi));
N_bet = (qinf*Sw*bw/Imat(3,3))*Cn_bet;
N_p = (qinf*Sw*bw/Imat(3,3))*Cn_p;
N_r = (qinf*Sw*bw/Imat(3,3))*Cn_r;
N_dr = (qinf*Sw*bw/Imat(3,3))*(2*CTh/pi)*ht;
N_dw = (qinf*Sw*bw/Imat(3,3))*(Cn_dw+ (2*CTh/pi));
Ydr = qSM*(2*CTh/pi);
%% State Space
a11 = Y_bet/U0;
a12 = g/U0;
a13 = 0;
a14 = -1;
a15 = 0;
a21 = 0;
a22 = 0;
a23 = 1;
a24 = 0;
a25 = 0;
a31 = (L_bet+(N_bet*Imat(1,3)/Imat(1,1)))/(1-
((Imat(1,3)^2)/(Imat(1,1)*Imat(3,3))));
a32 = 0;
a33 = (L_p+(N_p*Imat(1,3)/Imat(1,1)))/(1-
((Imat(1,3)^2)/(Imat(1,1)*Imat(3,3))));
a34 = (L_r+(N_r*Imat(1,3)/Imat(1,1)))/(1-
((Imat(1,3)^2)/(Imat(1,1)*Imat(3,3))));
a35 = 0;
a41 = (N_bet+(L_bet*Imat(1,3)/Imat(3,3)))/(1-
((Imat(1,3)^2)/(Imat(1,1)*Imat(3,3))));
a42 = 0;
a43 = (N_p+(L_p*Imat(1,3)/Imat(3,3)))/(1-
((Imat(1,3)^2)/(Imat(1,1)*Imat(3,3))));
a44 = (N_r+(L_r*Imat(1,3)/Imat(3,3)))/(1-
((Imat(1,3)^2)/(Imat(1,1)*Imat(3,3))));
a45 = 0;
a51 = 0;
a52 = 0;
a53 = 0;
a54 = 1;
a55 = 0;
b11 = 0;
b12 = Ydr/U0;
b21 = 0;
b22 = 0;
b31 = (L_dw+(N_dw*Imat(1,3)/Imat(1,1)))/(1-
((Imat(1,3)^2)/(Imat(1,1)*Imat(3,3))));
b32 = (L_dr+(N_dr*Imat(1,3)/Imat(1,1)))/(1-
((Imat(1,3)^2)/(Imat(1,1)*Imat(3,3))));
b41 = (N_dw+(L_dw*Imat(1,3)/Imat(3,3)))/(1-
((Imat(1,3)^2)/(Imat(1,1)*Imat(3,3))));
b42 = (N_dr+(L_dr*Imat(1,3)/Imat(3,3)))/(1-
((Imat(1,3)^2)/(Imat(1,1)*Imat(3,3))));
b51 = 0;
b52 = 0;
A = [a11 a12 a13 a14 a15;...
a21 a22 a23 a24 a25;...
a31 a32 a33 a34 a35;...
a41 a42 a43 a44 a45;...
a51 a52 a53 a54 a55];
damp(A)
B = [b11 b21 b31 b41 b51;...
b12 b22 b32 b42 b52]';
% Get the number of states, n, number of controls, m, and the
number of
% outputs, p.
[n,m] = size(B);
C = eye(n,n);
p = size(C,1);
D = zeros(p,m);
% Define the state space model.
sys_ss = ss(A,B,C,D);
% Convert to transfer function.
sys_tf = tf(sys_ss);
% Convert to zero-pole description.
sys_zpk = zpk(sys_ss);
% Convert back to state space
sys_ssa = ss(sys_tf);
72
American Institute of Aeronautics and Astronautics
%{
%% Simulation of State Space System
% Find the characteristic polynomial.
CharPoly = poly(A);
% Find the system poles.
Poles = roots(CharPoly);
dt = 0.01;
tfinal = 50;
time_s = 0:dt:tfinal;
% Compute the left eigenvectors of A. These are used in tests for
% controllability.
[W,Dc] = eig(A.');
W = conj(W);
% Compute the right eigenvectors of A. These are used in tests for
% observability.
[V,Do] = eig(A);
%% Initial Simulation
t0 = 0:.05:20;
u0(2,1:401) = 0;
u0(1,1:60) = 3.5/57.3;
u0(1,61:120) = 1/57.3;
u0(1,121:180) = 3.5/57.3;
u0(1,181:401) = 0/57.3;
%u0(1,101:401) = 0/57.3;
%{
u0(1,41:80) = 0;
u0(1,81:120) = 1/57.3;
u0(1,121:401) = 0;
%}
x0 = [67.51;0;0;0;400]; %trim
[y1,t1,x1] = lsim(sys_ss,u0,t0,x0);
figure
subplot(5,1,1)
plot(t1,y1(:,1))
xlabel('time (s)')
ylabel('speed (fps)')
title('Surge Velocity vs. time')
subplot(5,1,2)
plot(t1,y1(:,2)*57.3)
xlabel('time (s)')
ylabel('alpha (deg)')
subplot(5,1,3)
plot(t1,y1(:,3)*57.3)
xlabel('time (s)')
ylabel('theta (deg)')
title('Pitch Attitude vs. time')
subplot(5,1,4)
plot(t1,y1(:,4)*57.3)
xlabel('time (s)')
ylabel('Pitch Rate (deg/s)')
subplot(5,1,5)
plot(t1,y1(:,5))
xlabel('time (s)')
ylabel('Altitude (ft)')
figure
plot(t1,u0(1,:)*57.3)
xlabel('time (sec)')
ylabel('Tail Incidence Angle (deg.)')
%}
%% System for Control
Acc = A(1:4,1:4);
Bcc = B(1:4,1:2);
%Bcc = B(1:4,1);
[nc,mc] = size(Bcc);
Ccc = eye(nc,nc);
pcc = size(Ccc,1);
Dcc = zeros(pcc,mc);
% Define the state space model.
sys_cc = ss(Acc,Bcc,Ccc,Dcc);
% Convert to transfer function.
sys_tf = tf(sys_cc);
% Convert to zero-pole description.
sys_zpk = zpk(sys_cc);
% Convert back to state space
sys_ssa = ss(sys_tf);
% Find the characteristic polynomial.
CharPoly = poly(Acc);
% Find the system poles.
Poles = roots(CharPoly);
% Compute the left eigenvectors of A. These are used in tests for
% controllability.
[W,Dc] = eig(Acc.');
W = conj(W);
% Compute the right eigenvectors of A. These are used in tests for
% observability.
[V,Do] = eig(Acc);
% Damping characteristics
damp(Acc)
% Compute the controllability matrix, P, using the MATLAB
function.
P = ctrb(sys_cc);
% Determine if the system is controllable by checking the rank of
P.
% The rank of P should match the number of rows (or columns) of
the square
% matrix A.
if rank(P) == nc
disp('The system is controllable.');
else
disp('The system is NOT controllable.');
end
disp(' ');
% Compute the condition number for impending singularity.
Cn = cond(Acc);
% Degree of Controllability between Mode i and Control j.
DoC = zeros(nc,mc);
73
American Institute of Aeronautics and Astronautics
for i = 1:nc
for j = 1:mc
DoC(i,j) = abs(dot(Bcc(:,j),
W(i,:))/norm(Bcc(:,j))/norm(W(i,:)));
end
end
% Compute the inverse matrix Pccfi.
Pccfi = zeros(nc,nc);
base = CharPoly(nc:-1:2);
for i = nc:-1:1
if i == nc
% Last row. Set the first element to 1.
Pccfi(i,1) = 1;
else
% Populate the ith row
Pccfi(i,1:nc-i+1) = [base(i:end) 1];
end
end
%{
% Compute the Transformation matrix, Tccf.
Tccf = P*Pccfi;
% Compute the CCF matrices.
Accf = TccfAcc*Tccf;
Bccf = TccfBcc;
Cccf = Ccc*Tccf;
Dccf = Dcc;
%}
% Compute the observability matrix, Q, using the MATLAB
function.
Q = obsv(sys_cc);
% Determine if the system is observable by checking the rank of
Q.
% The rank of Q should match the number of rows (or columns) of
the square
% matrix A.
if rank(Q) == nc
disp('The system is observable.');
else
disp('The system is NOT observable.');
end
disp(' ');
% Degree of Observability between Mode i and Measurement j.
DoO = zeros(pcc,nc);
for j = 1:pcc
for i = 1:nc
DoO(j,i) = abs(dot(Ccc(j,:),
V(:,i))/norm(Ccc(j,:))/norm(V(:,i)));
end
end
% Perform a stability analysis using Lyapunov stability.
disp('Lyapunov Stability Analysis.');
% Find the poles with zero real part.
i_zero_real = find(real(Poles) == 0);
if ~isempty(i_zero_real)
% Lyapunov stabilty analysis will not work if there is at least
one
% pole with zero real part. At this point, we can only check for
% marginally stable or unstable systems.
else
% Lyapunov stability analysis will work.
% Form a positive definite matrix, Q.
Qc = eye(nc);
% Solve the Lyapunov equation for P.
Pc = lyap(Acc',Qc);
% Perform Sylvester's Method to determine if P is positive
definite.
pm = zeros(1,nc);
for i = 1:nc
pm(i) = det(Pc(1:i,1:i));
end
if all(pm > 0)
disp('P is positive definite. System is asymptotically stable.');
elseif any(pm < 0)
disp('P is not positive definite. System is unstable.');
else
disp('P is positive semi-definite. Try another Q.');
end
end
% Determine a desired response for the system. Two approaches
are
% investigated: (1.) second order dominant; (2.) 6th order ITAE.
% Specify the overshoot percentage and settling time.
PO = 5;
ts = 1.5;
% Determine damping ratio from PO and natural frequency from
settling time
% and zeta.
term = pi^2 + log(PO/100)^2;
zeta = abs(log(PO/100))/sqrt(term);
wn = 4/(zeta*ts);
% Desired 2nd order system.
num2 = wn^2;
den2 = [1 2*zeta*wn wn^2];
Des2 = tf(num2,den2);
% Dominant 2nd order eigenvalues.
DesEig2 = roots(den2);
% Get the stepinfo
stepinfo(Des2)
% Augment with 2 additional poles.
Aug4 = zeros(2,1);
Aug4(1) = 10*real(DesEig2(1));
Aug4(2) = Aug4(1)-1;
% 4th order transfer function with augmented poles,
den_Aug4 = conv(den2,conv([1 -Aug4(1)],([1 -Aug4(2)])));
Aug2 = tf(num2, den_Aug4);
% Plot the dominant 2nd order response.
figure
step(Des2, 'b-', Aug2*den_Aug4(end)/num2, 'g--');grid on
legend('Desired 2nd', 'Augmented 2nd order');
% Compute the state feedback regulator based upon the augmented
2nd order
% system.
K = place(Acc,Bcc,[DesEig2;Aug4]);
% Form plant system. Set output matrix for state feedback control.
sys_p.Ap = Acc;
sys_p.Bp = Bcc;
74
American Institute of Aeronautics and Astronautics
sys_p.Cp = eye(nc);
sys_p.Dp = zeros(nc,mc);
% Form controller system.
sys_c.Ac = 0;
sys_c.Bc1= 0;
sys_c.Bc2= 0;
sys_c.Cc = 0;
sys_c.Dc1= -K;
sys_c.Dc2= zeros(mc,mc);
% Form closed loop system.
[Acl,Bcl,Ccl,Dcl] = closed_loop_system(sys_p, sys_c);
sys_cl = ss(Acl,Bcl,Ccl,Dcl);
%% Simulation
t = 0:.05:200;
x0 = [0;1/57.3;0;0]; %trim
Accs = zeros(5,5);
Accs(1:4,1:4) = Acl;
Accs(5,:) = A(5,:);
sys_cl2 = ss(Accs,B,C,D);
% Closed-loop response (zero input, ICs).
[Yo,t,Xo] = lsim(sys_cc,zeros(numel(t),mc),t,x0);
[Yc,t,Xc] = lsim(sys_cl,zeros(numel(t),mc),t,x0);
[Ys,t,Xs] = lsim(sys_ss,zeros(numel(t),mc),t,[x0; 0]);
[Ycs,t,Xcs] = lsim(sys_cl2,zeros(numel(t),mc),t,[x0; 0]);
figure
plot(Xo(:,2)*57.3,Xo(:,3)*57.3)
grid on
xlabel('theta, deg.')
ylabel('dtheta / dt, deg./s')
title('Phase Diagram for Pitch Attitude')
% Control signals.
u = zeros(numel(t),mc);
for i = 1:mc
for j = 1:numel(t)
u(j,i) = -K(i,:)*Xc(j,:)';
end
end
% Plot the control signals.
figure
subplot(2,1,1);
plot(t, u(:,1));grid on
xlabel('Time, s');
ylabel('Wing Incidence (deg.)');
title('Regulating controls vs. Time');
subplot(2,1,2);
plot(t, u(:,2));grid on
xlabel('Time, s');
ylabel('Back Rotor Incidence, deg.');
% Open-loop and closed loop plots of the model states.
figure
subplot(5,1,1);
plot(t,Xo(:,1)*57.3,'--b',t,Xc(:,1)*57.3,'-r');grid on
xlabel('Time, s');
ylabel('beta, deg.');
title('Model States vs. Time with 0 input and I.C.s')
subplot(5,1,2);
plot(t,Xo(:,2)*57.3,'--b',t,Xc(:,2)*57.3,'-r');grid on
xlabel('Time, s');
ylabel('phi , deg.');
subplot(5,1,3);
plot(t,Xo(:,3)*57.3,'--b',t,Xc(:,3)*57.3,'-r');grid on
xlabel('Time, s');
ylabel('Roll Rate, deg./s');
subplot(5,1,4);
plot(t,Xo(:,4)*57.3,'--b',t,Xc(:,4)*57.3,'-r');grid on
xlabel('Time, s');
ylabel('Yaw rate, deg./s');
subplot(5,1,5);
plot(t,Xs(:,5)*57.3,'--b',t,Xcs(:,5)*57.3,'-r');grid on
xlabel('Time, s');
ylabel('psy, deg.');
legend('Uncontrolled Response','Controlled
Response','Location','NorthEast')
%{%}
u0(2,1:401) = 0;
u0(1,1:3) = 1/57.3;
u0(1,4:100) = 0/57.3;
u0(1,101:180) = 0/57.3;
u0(1,181:220) = 0/57.3;
u0(1,221:401) = 0/57.3;
u01(1,1:401) = 0;
u01(2,1:3) = 1/57.3;
u01(2,4:180) = 0/57.3;
u01(2,181:220) = 0/57.3;
u01(2,221:401) = 0/57.3;
t0 = linspace(0,300,length(u0));
xx0 = [0;0;0;0;0]; %trim
[y1,t1,x1] = lsim(sys_cl2,u0,t0,xx0);
[y2,t2,x2] = lsim(sys_ss,u0,t0,xx0);
[y3,t3,x3] = lsim(sys_cl2,u01,t0,xx0);
[y4,t4,x4] = lsim(sys_ss,u01,t0,xx0);
figure
subplot(5,1,1)
plot(t1,y1(:,1)*57.3,'-r')
hold on
plot(t1,y2(:,1)*57.3,'--b')
xlabel('time (s)')
ylabel('speed (fps)')
title('Surge Velocity vs. time')
subplot(5,1,2)
plot(t1,y1(:,2)*57.3,'-r')
hold on
plot(t1,y2(:,2)*57.3,'--b')
xlabel('time (s)')
ylabel('alpha (deg)')
subplot(5,1,3)
plot(t1,y1(:,3)*57.3,'-r')
hold on
plot(t1,y2(:,3)*57.3,'--b')
xlabel('time (s)')
ylabel('theta (deg)')
title('Pitch Attitude vs. time')
subplot(5,1,4)
plot(t1,y1(:,4)*57.3,'-r')
hold on
plot(t1,y2(:,4)*57.3,'--b')
75
American Institute of Aeronautics and Astronautics
xlabel('time (s)')
ylabel('Pitch Rate (deg/s)')
title('Pitch Rate vs. time')
subplot(5,1,5)
plot(t1,y1(:,5)*57.3,'-r')
hold on
plot(t1,y2(:,5)*57.3,'--b')
xlabel('time (s)')
ylabel('Altitude (ft)')
title('Model State vs. Time with 0 I.C.s and Tail Incidence step
input')
legend('Controlled Response','Uncontrolled Response')
figure
subplot(5,1,1)
plot(t1,y3(:,1)*57.3,'-r')
hold on
plot(t1,y4(:,1)*57.3,'--b')
xlabel('time (s)')
ylabel('speed (fps)')
title('Surge Velocity vs. time')
subplot(5,1,2)
plot(t1,y3(:,2)*57.3,'-r')
hold on
plot(t1,y4(:,2)*57.3,'--b')
xlabel('time (s)')
ylabel('alpha (deg)')
subplot(5,1,3)
plot(t1,y3(:,3)*57.3,'-r')
hold on
plot(t1,y4(:,3)*57.3,'--b')
xlabel('time (s)')
ylabel('theta (deg)')
title('Pitch Attitude vs. time')
subplot(5,1,4)
plot(t1,y3(:,4)*57.3,'-r')
hold on
plot(t1,y4(:,4)*57.3,'--b')
xlabel('time (s)')
ylabel('Pitch Rate (deg/s)')
title('Pitch Rate vs. time')
subplot(5,1,5)
plot(t1,y3(:,5)*57.3,'-r')
hold on
plot(t1,y4(:,5)*57.3,'--b')
xlabel('time (s)')
ylabel('Altitude (ft)')
title('Model State vs. Time with 0 I.C.s and Thrust step input')
legend('Controlled Response','Uncontrolled Response')
t6 = 0:length(u0)-1;
%{%}
figure
plot(t6,u0(1,:)*57.3)
xlabel('time (sec)')
ylabel('Tail Incidence Angle (deg.)')
[y5,t6,x5] = lsim(sys_cl2,u0,t6,xx0);
[y6,t6,x6] = lsim(sys_ss,u0,t6,xx0);
figure
subplot(1,2,1)
plot(t6,y5(:,5),'-r')
hold on
plot(t6,y6(:,5),'--b')
xlabel('time (s)')
ylabel('Altitude (ft)')
subplot(1,2,2)
plot(t6,u0(1,:)*57.3)
xlabel('time (sec)')
ylabel('Tail Incidence Angle (deg.)')
title('Altitude vs. Time with Tail Incidence Control')
%%%%% SERVO MECHANISM TRACKING %%%%%
% Track outputs y1, y2 and y3.
CC = zeros(2,5);
CC(1,:) = C(1,:);
%CC(2,:) = C(3,:);
CC(2,:) = C(5,:);
Csv = CC;
p = 3;
% Matrices
Asv = zeros(n+m, n+m);
Asv(1:n,1:n) = A;
Asv(n+1:end,1:n) = -Csv;
Bsv = zeros(n+m, m);
Bsv(1:n,:) = B;
% Gain design. Add 3 additional eigenvalues for each reference.
Ksv = place(Asv,Bsv,[DesEig2;Aug4;-6;-12;-7]);
Kv = Ksv(:,1:n);
kI = -Ksv(:,n+1:end);
% Closed loop system
% Aclsv = [A-B*Kv, B*kI;-Csv, zeros(p,m)];
% Bclsv = [zeros(n,m);eye(m)];
% Cclsv = [Csv, zeros(m,m)];
% Dclsv = 0;
% sys_clsv = ss(Aclsv,Bclsv,Cclsv,Dclsv);
% Form plant system. Set output matrix for state feedback control.
sys_p.Ap = A;
sys_p.Bp = B;
sys_p.Cp = eye(n);
sys_p.Dp = zeros(n,m);
% Form controller system. Tracking on each of the three position
states.
sys_c.Ac = zeros(m,m);
sys_c.Bc1= -CC;
sys_c.Bc2= eye(m);
sys_c.Cc = kI;
sys_c.Dc1= -Kv;
sys_p.Dc2= zeros(n,m);
% Form closed loop system.
[Aclsv, Bclsv, Cclsv, Dclsv] = closed_loop_system(sys_p, sys_c);
sys_clsv = ss(Aclsv,Bclsv,Cclsv,Dclsv);
% Simulation
dt = 0.01;
tfinal = 10;
t = 0:dt:tfinal;
% Simulation #1: r1 = 1, r2 = 1 and r3 = 1. Zero I.C.
r1 = ones(numel(t),1);
r2 = ones(numel(t),1);
%r3 = ones(numel(t),1);
[y_clsv,time_clsv,x_clsv] = lsim(sys_clsv,[r1, r2],t);
% Control signals.
u = zeros(numel(t),m);
for i = 1:m
for j = 1:numel(t)
u(j,i) = -Kv(i,:)*x_clsv(j,1:n)'+kI(i,:)*x_clsv(j,n+1:end)';
76
American Institute of Aeronautics and Astronautics
end
end
% Plot the control signals.
figure
subplot(2,1,1);
plot(t, u(:,1)*57.3);grid on
xlabel('Time, s');
ylabel('delta_{tail}, deg.');
title('Tracking controls vs. Time');
subplot(2,1,2);
plot(t, u(:,2)/38);grid on
xlabel('Time, s');
ylabel('delta_{thrust}, lbf');
% Plot output responses.
figure
subplot(3,1,1);
plot(time_clsv, y_clsv(:,1),'b-');grid on
xlabel('Time, s');
ylabel('y_1, m');
title('Unit step responses for each output vs. Time');
subplot(3,1,2);
plot(time_clsv, y_clsv(:,2),'b-');grid on
xlabel('Time, s');
ylabel('y_2, m');
subplot(3,1,3);
plot(time_clsv, y_clsv(:,3),'b-');grid on
xlabel('Time, s');
ylabel('y_3, m');
figure
subplot(3,1,1);
plot(time_clsv, x_clsv(:,1),'b-');grid on
xlabel('Time, s');
ylabel('speed, fps');
title('Unit step responses for each output vs. Time');
subplot(3,1,2);
plot(time_clsv, x_clsv(:,3)*57.3,'b-');grid on
xlabel('Time, s');
ylabel('theta, deg.');
subplot(3,1,3);
plot(time_clsv, x_clsv(:,5),'b-');grid on
xlabel('Time, s');
ylabel('altitude, ft');
%%%%% FREQUENCY ANALYSIS %%%%%
% Perform frequency analysis of servo tracker.
w = logspace(0,4,400);
freq_resp1 = freq_analysis(sys_p, sys_c, w, 1, 3);
freq_resp2 = freq_analysis(sys_p, sys_c, w, 2, 3);
% Plot frequency data.
plot_freq_resp(freq_resp1, w);
plot_freq_resp(freq_resp2, w);
%% Altitude Autopilot Control
%% Comparison of Elevator input Controlled/Uncontrolled
%{%}
Hmax = 500;
Hc = zeros(312,1);
Hc(:,1)=[zeros(10,1);Hmax/100*[0:1:100]';Hmax*ones(50,1);Hma
x/100*[100:-1:0]';zeros(50,1)];
t4 = 0:length(Hc)-1;
%{
[Yh,t4]=lsim(sys_cl2(:,2),Hc,t4);
[Yh2,t4]=lsim(sys_ss(:,2),Hc,t4);
%}
%{%}
[Yh,t4]=lsim(sys_cl2(:,1),Hc,t4);
[Yh2,t4]=lsim(sys_ss(:,1),Hc,t4);
figure
subplot(5,1,1)
plot(t4,Yh(:,1),'-r')
hold on
plot(t4,Yh2(:,1),'--b')
xlabel('time, sec')
ylabel('Velocity, fps')
subplot(5,1,2)
plot(t4,Yh(:,2),'-r')
hold on
plot(t4,Yh2(:,2),'--b')
xlabel('time, sec')
ylabel('alpha, deg.')
subplot(5,1,3)
plot(t4,Yh(:,3),'-r')
hold on
plot(t4,Yh2(:,3),'--b')
xlabel('time, sec')
ylabel('theta, deg.')
subplot(5,1,4)
plot(t4,Yh(:,4),'-r')
hold on
plot(t4,Yh2(:,4),'--b')
xlabel('time, sec')
ylabel('dtheta/dt, deg./sec')
subplot(5,1,5)
plot(t4,Yh(:,5),'-r')
hold on
plot(t4,Yh2(:,5),'--b')
xlabel('time, sec')
ylabel('Altitude, ft.')
%% simplified model
Ashort = A(2:4,2:4);
Bshort = B(2:4,1:2);
Ashort = [Ashort(1,1) Ashort(1,3);Ashort(3,1) Ashort(3,3)];
Bshort = [Bshort(1,1) Bshort(3,1)]';
Cshort = eye(2);
Dshort = zeros(2,1);
sys_short = ss(Ashort, Bshort, Cshort, Dshort);
CPshort = poly(Ashort);
% Calculate the open-loop system eigenvalues, zeta and wn from
ABCD
[wn0_short,zeta0_short,Eigs0_short] = damp(Ashort);
% Convert to transfer function.
sys_tf_short = tf(sys_short);
time_short = 0:0.1:2.5;
x0sh = [(.5*pi/180); qinf];
u = zeros(size(time_short));
77
American Institute of Aeronautics and Astronautics
[Y0sh,t_short,X0sh] = lsim(sys_short,u,time_short,x0sh);
Tp_short = (2*pi)/(wn0_short(1)); %Seconds
T_Half_short = -log(2)/(real(Eigs0_short(1))); %Seconds
figure
plot(t_short,X0sh(:,1),'-b','LineWidth',2)
xlabel('time (sec)')
ylabel('alpha (deg.)')
title('Short Period Response to alpha = 0.5 deg. Disturbance')
%% SImulation
[Vsh2, Gamsh2] = eig(A);
xshort = real(Vsh2(:,2));
xphug = real(Vsh2(:,4));
xshort = xshort/norm(xshort);
xphug = xphug/norm(xphug);
Nsamp = 100;
yshort = zeros(5,Nsamp);
timesh = linspace(0,3,Nsamp);
for i = 1:Nsamp
yshort(:,i) = C*expm(timesh(i)*A)*xshort;
end
figure
subplot(3,2,1)
plot(timesh,yshort(1,:))
ylabel('speed (fps)')
xlabel('time (sec)')
title('Short Period Responses')
subplot(3,2,2)
plot(timesh,yshort(2,:)/deg_2_rad)
ylabel('alpha (deg)')
xlabel('time (sec)')
subplot(3,2,3)
plot(timesh,yshort(3,:))
ylabel('q_{inf} (psf)')
xlabel('time (sec)')
subplot(3,2,4)
plot(timesh,yshort(4,:)/deg_2_rad)
ylabel('theta (deg)')
xlabel('time (sec)')
subplot(3,2,5)
plot(timesh,yshort(5,:))
ylabel('altitude (ft)')
xlabel('time (sec)')
h1=zeros(5,Nsamp); h2=zeros(5,Nsamp);
for i=1:Nsamp,
h1(:,i)=C*expm(timesh(i)*A)*B(:,1); % impulse response from
u_w
h2(:,i)=C*expm(timesh(i)*A)*B(:,2); % imp resp from v_w
end
figure
subplot(3,2,1)
plot(timesh,h1(1,:))
ylabel('speed (fps)')
xlabel('time (sec)')
title('Impulse Responses to Wing Incidence')
subplot(3,2,2)
plot(timesh,h1(2,:)/deg_2_rad)
ylabel('alpha (deg)')
xlabel('time (sec)')
subplot(3,2,3)
plot(timesh,h1(3,:)/deg_2_rad)
ylabel('theta (deg)')
xlabel('time (sec)')
subplot(3,2,4)
plot(timesh,h1(4,:))
ylabel('q_{inf} (psf)')
xlabel('time (sec)')
subplot(3,2,5)
plot(timesh,h1(5,:))
ylabel('altitude (ft)')
xlabel('time (sec)')
figure
subplot(3,2,1)
plot(timesh,h2(1,:))
ylabel('speed (fps)')
xlabel('time (sec)')
title('Impulse Responses to Change in Thrust')
subplot(3,2,2)
plot(timesh,h2(2,:)/deg_2_rad)
ylabel('alpha (deg)')
xlabel('time (sec)')
subplot(3,2,3)
plot(timesh,h2(3,:)/deg_2_rad)
ylabel('theta (deg)')
xlabel('time (sec)')
subplot(3,2,4)
plot(timesh,h2(4,:))
ylabel('q_{inf} (psf)')
xlabel('time (sec)')
subplot(3,2,5)
plot(timesh,h2(5,:))
ylabel('altitude (ft)')
xlabel('time (sec)')
%% Phugoid
Nsamp = 1000; %number of time samples
yphug=zeros(5,Nsamp);
tphug=linspace(0,1000,Nsamp);
for i=1:Nsamp
yphug(:,i)=C*expm(tphug(i)*A)*xphug;
end
figure
subplot(3,2,1)
plot(tphug,yphug(1,:))
ylabel('speed (fps)')
xlabel('time (sec)')
title('Phugoid Motion')
subplot(3,2,2)
plot(tphug,yphug(2,:)/deg_2_rad)
ylabel('alpha (deg)')
xlabel('time (sec)')
subplot(3,2,3)
plot(tphug,yphug(3,:))
ylabel('q_{inf} (psf)')
xlabel('time (sec)')
subplot(3,2,4)
plot(tphug,yphug(4,:)/deg_2_rad)
ylabel('theta (deg)')
xlabel('time (sec)')
subplot(3,2,5)
plot(tphug,yphug(5,:))
ylabel('altitude (ft)')
xlabel('time (sec)')
78
American Institute of Aeronautics and Astronautics
figure
plot(tphug,yphug(1,:),'-r','LineWidth',2)
hold on
plot(tphug,yphug(5,:),'--b','LineWidth',2)
xlabel('time (sec)')
ylabel('Amplitude')
title('Phugoid Mode')
legend('Speed','Altitude','Location','NorthEast')
axis([0 100 -1 1])
% Calculate the open-loop system eigenvalues, zeta and wn from
ABCD
[wn0,zeta0,Eigs0] = damp(A);
Eigs_phug = Eigs0(4:5);
Damp_phug = zeta0(4:5);
wn_phug = wn0(4:5);
Tp_phug = (2*pi)/(wn_phug(1)); %Seconds
T_Half_phug = -log(2)/(real(Eigs_phug(1))); %Seconds
%{
% Zero input for all time
u = zeros(2,length(time_s));
%u(1,1:200) = -1.5*pi/180;
%u(1,201:400) = 1.5*pi/180;
% Initial conditions on states.
x0 = [U0;1*pi/180;0;0;400];
% Calculate the open-loop system eigenvalues, zeta and wn from
ABCD
[wn0,zeta0,Eigs0] = damp(A);
% Open-loop response. This is an impulse response, as the input,
u, is
% zero and there are non-zero ICs, x0.
[Yo,t,Xo] = lsim(sys_ss,u,time_s,x0);
%{%}
% Open-loop plots of the system states.
figure
subplot(3,2,1);
plot(t,Xo(:,1),'b');grid on
xlabel('Time, s');
ylabel('u fps');
subplot(3,2,2);
plot(t,Xo(:,2),'b');grid on
xlabel('Time, s');
ylabel('alpha, rad');
subplot(3,2,3);
plot(t,Xo(:,3),'b');grid on
xlabel('Time, s');
ylabel('theta, rad');
subplot(3,2,4);
plot(t,Xo(:,4),'b');grid on
xlabel('Time, s');
ylabel('q, psf');
subplot(3,2,5);
plot(t,Xo(:,5),'b');grid on
xlabel('Time, s');
ylabel('h, ft');
%}
%{
%% Controllability
% Compute the controllability matrix, P, using the MATLAB
function.
P = ctrb(sys_ss);
% Determine if the system is controllable by checking the rank of
P.
% The rank of P should match the number of rows (or columns) of
the square
% matrix A.
disp(' ')
if rank(P) == n
disp('The system is controllable.');
else
disp('The system is NOT controllable.');
end
disp(' ');
% Compute the condition number for impending singularity.
Condition = cond(A);
% Degree of Controllability between Mode i and Control j.
DoC = zeros(n,m);
for i = 1:n
for j = 1:m
DoC(i,j) = abs(dot(B(:,j), W(i,:))/norm(B(:,j))/norm(W(i,:)));
end
end
% Compute the inverse matrix Pccfi.
Pccfi = zeros(n,n);
base = CharPoly(n:-1:2);
for i = n:-1:1
if i == n
% Last row. Set the first element to 1.
Pccfi(i,1) = 1;
else
% Populate the ith row
Pccfi(i,1:n-i+1) = [base(i:end) 1];
end
end
%{
% Compute the Transformation matrix, Tccf.
Tccf = P*Pccfi;
% Compute the CCF matrices.
Accf = TccfA*Tccf;
Bccf = TccfB;
Cccf = C*Tccf;
Dccf = D;
%% Observability
% Compute the observability matrix, Q, using the MATLAB
function.
Q = obsv(sys_ss);
% Determine if the system is observable by checking the rank of
Q.
% The rank of Q should match the number of rows (or columns) of
the square
% matrix A.
if rank(Q) == n
disp('The system is observable.');
else
disp('The system is NOT observable.');
end
disp(' ');
79
American Institute of Aeronautics and Astronautics
% Degree of Observability between Mode i and Measurement j.
DoO = zeros(p,n);
for j = 1:p
for i = 1:n
DoO(j,i) = abs(dot(C(j,:), V(:,i))/norm(C(j,:))/norm(V(:,i)));
end
end
% Compute the OCF form of the observability matrix.
Qocf = inv(Pccfi);
% Compute the Transformation matrix, Tocf = inv(Q)Qocf.
Tocf = QQocf;
% Compute the CCF matrices.
Aocf = TocfA*Tocf;
Bocf = TocfB;
Cocf = C*Tocf;
Docf = D;
function [A,B,C,D] = closed_loop_system(sys_p, sys_c)
%****************************************************
**********************
%
% Function computes the closed loop matrices for a particular
plant and
% controller.
%
%
% Inputs:
% sys_p structure, plant state space system
% Fields:
% .Ap [nxn] matrix, State matrix
% .Bp [nxm] matrix, Control matrix
% .Cp [pxn] matrix, Output matrix
% .Dp [pxm] matrix, Direct transmission matrix
% sys_c structure, controller state space system
% Fields:
% .Ac [ncxnc] matrix, Controller state matrix
% .Bc1 [ncxmc1] matrix, Plant output matrix
% .Bc2 [ncxnr] matrix, Reference matrix
% .Cc [mxnc] matrix, Controller output matrix
% .Dc1 [mxmc1] matrix, Control-Plant output matrix
% .Dc2 [mxnr] matrix, Control-Reference matrix
%
%
% Outputs:
% A [nxn] matrix, Closed loop state matrix
% B [nxm] matrix, Closed loop control matrix
% C [pxn] matrix, Closed loop output matrix
% D [pxm] matrix, Closed loop direct transmission matrix
%
%
% Version history:
% 2013.12.30 KRB Initial release
%
%****************************************************
**********************
% Extract plant matrices.
Ap = sys_p.Ap;
Bp = sys_p.Bp;
Cp = sys_p.Cp;
Dp = sys_p.Dp;
% Extract controller matrices.
Ac = sys_c.Ac;
Bc1 = sys_c.Bc1;
Bc2 = sys_c.Bc2;
Cc = sys_c.Cc;
Dc1 = sys_c.Dc1;
Dc2 = sys_c.Dc2;
% Intermediate matrices.
Dc1Dp = Dc1*Dp;
Z = eye(size(Dc1Dp,1)) - Dc1Dp;
DpiZDc1 = Dp*inv(Z)*Dc1;
if (all(abs(sys_c.Ac(:)) < 1e-6) && all(abs(sys_c.Bc1(:)) < 1e-6)
&& ...
all(abs(sys_c.Bc2(:)) < 1e-6))
% No controller state defined.
% Closed loop A matrix.
A = Ap + Bp*inv(Z)*Dc1*Cp;
% Closed loop B matrix.
B = Bp;
% Closed loop C matrix.
C = Cp;
% Closed loop D matrix.
D = Dp;
else
% Controller state defined.
% Closed loop A matrix.
A = [Ap + Bp*inv(Z)*Dc1*Cp, Bp*inv(Z)*Cc;
Bc1*(eye(size(DpiZDc1,1))+DpiZDc1)*Cp,
Ac+Bc1*Dp*inv(Z)*Cc];
% Closed loop B matrix.
B = [Bp*inv(Z)*Dc2; Bc2 + Bc1*Dp*inv(Z)*Dc2];
% Closed loop C matrix.
C = [(eye(size(DpiZDc1,1))+DpiZDc1)*Cp, Dp*inv(Z)*Cc];
% Closed loop D matrix.
D = Dp*inv(Z)*Dc2;
end
function [freq_data] = freq_analysis(sys_p, sys_c, w, i_in, i_out)
%****************************************************
**********************
%
% Function performs a frequency analysis for a MIMO system for
a particular
% input / output pair. The analysis is performed at both the plant
input
% and the plant output.
%
%
% Inputs:
% sys_p structure, plant state space system
% Fields:
% .Ap [nxn] matrix, State matrix
% .Bp [nxm] matrix, Control matrix
% .Cp [pxn] matrix, Output matrix
% .Dp [pxm] matrix, Direct transmission matrix
% sys_c structure, controller state space system
% Fields:
% .Ac [ncxnc] matrix, Controller state matrix
% .Bc1 [ncxmc1] matrix, Plant output matrix
% .Bc2 [ncxnr] matrix, Reference matrix
% .Cc [mxnc] matrix, Controller output matrix
80
American Institute of Aeronautics and Astronautics
% .Dc1 [mxmc1] matrix, Control-Plant output matrix
% .Dc2 [mxnr] matrix, Control-Reference matrix
%
%
% Outputs:
% freq_data structure, frequency response data
% Fields:
% .input structure, frequency response broken at plant
% input
% .output structure, frequency response broken at plant
% output
% .system structure, data associated with closed loop
% system of plant and controller
%
%
% Version history:
% 2013.12.30 KRB Initial release
% 2014.03.17 KRB Fixed Cin in computing Lin
%
%****************************************************
**********************
% Get the number of frequencies.
nf = numel(w);
% Extract plant matrices.
Ap = sys_p.Ap;
Bp = sys_p.Bp;
Cp = sys_p.Cp;
Dp = sys_p.Dp;
% Extract controller matrices.
Ac = sys_c.Ac;
Bc1 = sys_c.Bc1;
Bc2 = sys_c.Bc2;
Cc = sys_c.Cc;
Dc1 = sys_c.Dc1;
Dc2 = sys_c.Dc2;
% Initialize input frequency analysis substructure.
freq_data.input.Lin = zeros(nf,1);
freq_data.input.ReturnDiff= zeros(nf,1);
freq_data.input.StabRobust= zeros(nf,1);
freq_data.input.LoopGainXover_rps= 0;
freq_data.input.GMRD = [0,0];
freq_data.input.PMRD = [0,0];
freq_data.input.GMSR = [0,0];
freq_data.input.PMSR = [0,0];
freq_data.input.Gnoise = zeros(nf,1);
% Initialize output frequency analysis substructure.
freq_data.output.S = zeros(nf,1);
freq_data.output.T = zeros(nf,1);
% Initialize system substructure.
freq_data.system.OLEvalues = [];
freq_data.system.CLEvalues = [];
% Close the loop
Z = inv(eye(size(Dc1*Dp))-Dc1*Dp);
Acl = [(Ap+Bp*Z*Dc1*Cp) (Bp*Z*Cc);
(Bc1*Cp+Bc1*Dp*Z*Dc1*Cp) (Ac+Bc1*Dp*Z*Cc)];
Bcl = [(Bp*Z*Dc2);
(Bc2+Bc1*Dp*Z*Dc2)];
Ccl = [(Cp+Dp*Z*Dc1*Cp) (Dp*Z*Cc)];
Dcl =(Dp*Z*Dc2);
%%%%% EIGENVALUE ANALYSIS %%%%%
% Compute the eignevalues of the open loop plant, and closed loop
system.
freq_data.system.OLEvalues = eig(Ap);
freq_data.system.CLEvalues = eig(Acl);
%%%%% LOOP GAIN AT PLANT INPUT ANALYSIS
%%%%%
%Create SS model of loop gain at the plant input.
Ain = [ Ap 0.*Bp*Cc; Bc1*Cp Ac];
Bin = [ Bp; Bc1*Dp];
Cin = -[ Dc1*Cp Cc];
Din = -[ Dc1*Dp];
% Perform frequency analysis for each input.
L_in = zeros(nf,1);
RD_in= zeros(nf,1);
SR_in= zeros(nf,1);
Gnois= zeros(nf,1);
for i = 1:nf
% s = j*omega
s = sqrt(-1)*w(i);
% Controller object.
KK = Cc*inv(s*eye(size(Ac))-Ac)*Bc1+Dc1;
% Loop Gain.
L_in(i) = Cin(i_in,:)*inv(s*eye(size(Ain))-
Ain)*Bin(:,i_in)+Din(i_in,i_in);
% Return difference.
RD_in(i) = 1.+L_in(i);
% Difference at actuator input.
SR_in(i) = 1.+1./L_in(i);
% Noise transfer function.
Gnois(i) = max(svd(KK));
end
% Compute crossover frequency.
magdb = 20.*log10(abs(L_in));
wc = FindCrossover(magdb,w);
% Compute the return difference and stability robustness MIMO
margins.
rtd = 180/pi;
rdm = min(abs(RD_in));
srm = min(abs(SR_in));
rd_gm = [ (1/(1+rdm)) (1/(1-rdm)) ];
sr_gm = [ (1-rdm) (1+rdm) ];
rd_gm = 20*log10(rd_gm);
sr_gm = 20*log10(sr_gm);
rd_pm = rtd*2*asin(rdm/2);
sr_pm = rtd*2*asin(srm/2);
% Store.
freq_data.input.Lin = L_in;
freq_data.input.ReturnDiff= RD_in;
freq_data.input.StabRobust= SR_in;
freq_data.input.LoopGainXover_rps= wc;
freq_data.input.GMRD = rd_gm;
freq_data.input.PMRD = rd_pm;
freq_data.input.GMSR = sr_gm;
freq_data.input.PMSR = sr_pm;
freq_data.input.Gnoise = Gnois;
81
American Institute of Aeronautics and Astronautics
%%%%% LOOP GAIN AT PLANT OUTPUT ANALYSIS
%%%%%
%SS model of loop gain at the plant output
Aout = [ Ap Bp*Cc; 0.*Bc1*Cp Ac];
Bout = [ Bp*Dc1; Bc1];
Cout = [ Cp Dp*Cc];
Dout = [ Dp*Dc1];
sens = zeros(nf,1);
compsens = zeros(nf,1);
for i = 1:nf
% s = j*omega
s = sqrt(-1)*w(i);
% Loop at Plant output (Az).
Lout = Cout(i_out,:)*inv(s*eye(size(Aout))-
Aout)*Bout(:,i_in)+Dout(i_out,i_in);
% Sensitivity
Sout = inv(eye(size(Lout))+Lout);
% Complementary sensitivity
Tout = Sout*Lout;
% Get max SV for each sensitivity.
sens(i) = max(svd(Sout));
compsens(i) = max(svd(Tout));
end
% Store.
freq_data.output.S = sens;
freq_data.output.T = compsens;
function t1 = FindCrossover(a,t)
%find the value of t where a crosses zero
n=numel(a);
j=0;
while j <= n,
if a(n-j) > 0.,
i=n-j;
j=n+1;
end;
j=j+1;
end
pp=inv([t(i) 1.;t(i+1) 1.])*[a(i);a(i+1)];
t1=-pp(2)/pp(1);
function plot_freq_resp(freq_resp, w)
%****************************************************
**********************
%
% Generates various figures for the specified frequency response.
%
%
% Inputs:
% freq_resp Structure, frequency response data. Refer to the file
% "freq_analysis.m" for field definitions
% w n-element vector, frequency vector at which frequency
% response data was collected (rps)
%
%
% Outputs:
% MATLAB figures
%
%
% Version history:
% 2013.12.30 KRB Initial release
%
%****************************************************
**********************
% Constant
rtd = 180/pi;
% Extract data from frequency response structure.
L_in = freq_resp.input.Lin;
wc = freq_resp.input.LoopGainXover_rps;
RD_in = freq_resp.input.ReturnDiff;
rd_min = min(abs(RD_in));
SR_in = freq_resp.input.StabRobust;
sr_min = min(abs(SR_in));
sens = freq_resp.output.S;
S_max = max(abs(sens));
compsens= freq_resp.output.T;
T_max = max(abs(compsens));
Gnois = freq_resp.input.Gnoise;
% Draw circles.
dd=0.:.001:2*pi;
xx1=cos(dd)-1;yy1=sin(dd);
xx2=rd_min*cos(dd)-1;yy2=rd_min*sin(dd);
% Nyquist plot
figure,
plot(xx1,yy1,'k',real(L_in),imag(L_in),'b',xx2,yy2,'r-
','LineWidth',2);grid
axis([-2 2 -2 2]);
text(.5,.5,['radius = ' num2str(rd_min)])
xlabel('Re(L)')
ylabel('Im(L)')
title('Nyquist')
xw_plot = 2*min(w);
% Loop Gain Bode magnitude
figure
semilogx(w,20*log10(abs(L_in)),'LineWidth',2);grid
text(xw_plot,10.,['LGCF = ' num2str(wc)])
xlabel('Frequency (rps)')
ylabel('Magnitude dB')
title('Bode');
% Loop gain Bode phase
figure
semilogx(w,rtd*angle(L_in),'LineWidth',2);grid
xlabel('Frequency (rps)')
ylabel('Phase deg')
title('Bode');
% Plot Return Difference 1+L magnitude.
figure
semilogx(w,20*log10(abs(RD_in)),'LineWidth',2);grid
text(xw_plot,10.,['min = ' num2str(rd_min)])
xlabel('Frequency (rps)')
ylabel('Magnitude dB')
title('|I+L| at input')
% Plot Stability Robustness 1+inv(L) magnitude.
figure
semilogx(w,20*log10(abs(SR_in)),'LineWidth',2);grid
text(xw_plot,10.,['min = ' num2str(sr_min)])
xlabel('Frequency (rps)')
ylabel('Magnitude dB')
82
American Institute of Aeronautics and Astronautics
title(' |I+inv(L)| at Plant Input')
% Plot sensitivity.
figure
semilogx(w,20*log10(sens),'LineWidth',2);grid
text(xw_plot,-10.,['max = ' num2str(S_max)])
xlabel('Frequency (rps)')
ylabel('Magnitude dB')
title(' |S| at Plant Output')
% Plot complementary sensitivity.
figure
semilogx(w,20*log10(compsens),'LineWidth',2);grid
text(xw_plot,-10.,['max = ' num2str(T_max)])
xlabel('Frequency (rps)')
ylabel('Magnitude dB')
title(' |T| at Plant Output')
% Plot noise to control magnitude.
figure
semilogx(w,20*log10(Gnois),'LineWidth',2);grid
xlabel('Frequency (rps)')
ylabel('Magnitude dB')
title('Noise-to-Control Transfer Function Matrix')
Appendix IX — Nyquist Plots
Figure 41. Nyquist Plot for Stability
83
American Institute of Aeronautics and Astronautics
Figure 42. Nyquist Plot for Stability
Appendix IX — Visual Risk Chart
Figure 43. Visual Representation of Risk Analysis
Acknowledgments
The team would like to thank Dr. Raymond Lebeau, Dr. Douglas Schwaab, Cody Alger, Ben Winokur, the
faculty of Parks College of Engineering, Aviation, and Technology at Saint Louis University, and the Department of
Aerospace and Mechanical Engineering for their mentorship, assistance, and financial support throughout this
project.
References
1
Leishman, J. Gordon. Principles of Helicopter Aerodynamics. Cambridge: Cambridge UP, 2006. Print.
2
Lennon, Andy. RC Model Airplane Design. Osceola, Wis., USA: Motor International, 1986. Print.
3
Raymer, Daniel P. Aircraft Design: A Conceptual Approach. Reston, VA: American Institute of Aeronautics and
Astronautics, 2012. Print.
4
Roskam, Jan, and Chuan-Tau Edward Lan. Airplane Aerodynamics and Performance. Lawrence, KS: DARcorporation,
2008. Print.
5
Schmidt, D. K. Modern Flight Dynamics. New York, NY: McGraw-Hill, 2012. Print.

Paparrazzi_Final (1)

  • 1.
    SENIOR DESIGN FORMALREPORT PAPARAZZI Observational Tilt-Rotor UAS Parry Draper, Brian Kovarik, Fabiola Mazon Madrid, Adria Serra Moral 5/9/2014
  • 2.
    1 American Institute ofAeronautics and Astronautics Paparazzi Tilt-Rotor UAS Parry J. Draper1 , Brian C. Kovarik1 , Fabiola Mazón Madrid1 , and Adrià Serra Moral1 Saint Louis University, Saint Louis, MO, 63103 The Paparazzi tilt-rotor unmanned aerial system (UAS) is an undergraduate aerospace engineering senior design project developed at Parks College of Engineering, Aviation and Technology at Saint Louis University. The UAS design merges the popular technology of backpack UAVs and tricopters in order to produce a highly-versatile UAS capable of climbing and cruising efficiently like a UAV as well as taking off and landing vertically, hovering, and maneuvering like a tricopter. With a wingspan of 40 inches and a total weight of 5.5 pounds, the Paparazzi UAS possesses the ability to cruise in a forward-thrust configuration at 40 knots for 4 nautical miles while maintaining the required power for over 15 minutes of hovering and maneuvering surveillance in a vertical-thrust configuration. Additionally, the UAS is designed to fit within a portable military-grade Pelican case and can be fully assembled and operational in less than 10 minutes. With a low cost and highly versatile design, this platform may be used for military reconnaissance, search and rescue missions, and numerous commercial applications where a multi-use platform is desired. With a focus on meeting mission requirements and optimizing the system’s capability, the design process has advanced from the conceptual, preliminary, and detailed design stages through varying degrees of system performance analysis. Additionally, a pragmatic and iterative design methodology is demonstrated as the UAS configuration matures during construction in order to ease the product’s manufacturability without significantly compromising capabilities. The conclusion of the project will include flight testing of the prototype aircraft to verify theoretical calculations and demonstrate that the Paparazzi UAS fulfills all mission requirements. Nomenclature AR = Wing Aspect Ratio c = Mean Aerodynamic Chord CD = Drag Coefficient Cf = Coefficient of Skin Friction CG = Center of Gravity Cl = 2-D Lift Coefficient CL = 3-D Lift Coefficient CLmax = Maximum Lift Coefficient D = Drag DL = Disc Loading f = Thrust Adjustment Coefficient due to Downwash FM = Figure of Merit K = Induced Drag Correction Factor L = Lift NP = Aircraft Neutral Point Pav = Power Available PClimb = Power to Climb Ph = Power at Hover Preq = Power Required ROC = Rate of Climb SD = Disk Reference Area Sref = Reference Area SW = Wing Surface Area 1 Undergraduate Student, Aerospace and Mechanical Engineering Dept., Saint Louis University, Saint Louis, MO
  • 3.
    2 American Institute ofAeronautics and Astronautics Swet = Wetted Surface Area t = Airfoil Thickness T = Thrust Treq = Thrust Required V = Velocity Vc = Velocity to Climb Vh = Velocity at Hover W = Weight W/P = Power Loading W/S = Wing Loading W/SD = Disk Loading W/SW = Wing Loading ΔPE = Change in Potential Energy ηmechanical = Mechanical Efficiency ηP = Propeller Efficiency ρ = Density σ = Density Ratio σC = Ceiling Density Ratio e = Oswald Efficiency Factor q = Dynamic Pressure ∞ = Freestream Condition t/c = Airfoil to Thickness Chord Ratio Re = Reynold’s Number I. Introduction HE Paparazzi unmanned aerial system (UAS) is a light-weight, portable aerial surveillance system capable of vertical and forward thrust. The air vehicle design combines the benefits of increased speed, range, and endurance that are characteristic of a fixed-wing aircraft during cruise conditions with the benefits of increased low- speed maneuverability of a rotorcraft system during hovering and surveillance modes. With these inherently versatile design configurations, the UAS is not intended to optimize either the forward or vertical thrust configuration, but rather open up a wider variety of possibilities in terms of a mission profile. For example, the UAS could act entirely as a vertical takeoff and landing (VTOL) unmanned aerial vehicle (UAV) or solely as a tricopter if desired. However, the hybrid UAV-tricopter design earns its value by combining the strengths of both platforms to achieve a range of capabilities unobtainable by either system independently. Figure 1. Paparazzi Tilt-Rotor Aircraft in Forward and Vertical Thrust Configurations In a military application, the Paparazzi UAS is ideal for urban reconnaissance. With an assembly time of less than ten minutes, the UAS can be readily deployed as soon as the need arises. As the UAS cruises to the target destination in its forward thrust configuration, it will conserve battery power that would have been drained by the deployment of a tricopter. Also, because the forward thrust configuration saves on power while flying faster, the vehicle gains an increased range and endurance over that of a tricopter alone. Once the UAS has acquired its target, the platform can descend to near-ground level and transition into its more maneuverable vertical thrust configuration, at which point the UAS will be able to fly between buildings or other obstacles and capture detailed, T
  • 4.
    3 American Institute ofAeronautics and Astronautics ground-level surveillance from a perspective unavailable from the sky. In this scenario, the Paparazzi UAS showcases its name by capturing detailed images with great persistence of a hidden target in only a moment’s notice. Much like the Paparazzi in Hollywood, this UAS can take pictures of people in places you would never expect. Additionally, the Paparazzi UAS can be used for search and rescue missions to quickly scan an area for a missing person in a variety of locations. In a wooded location, the UAS could descend beneath the trees and maneuver around obstacles to quickly cover areas that would difficult for a human to search on foot. This platform could be used to safely search for mountain climbers or backpackers who get lost or injured in treacherous terrain. If equipped with a thermal camera, this UAS can also scan for heat signatures to quickly locate a lost person and send the life-saving information back to a rescue crew. In the future, this design can be adapted for mail delivery in both urban and rural settings. Companies such as Amazon have expressed an interest in using unmanned aerial vehicles to quickly deliver mail packages to customers. A tilt-rotor UAS in a forward-thrust configuration would be able to quickly cruise to the target at greater distances than a rotorcraft and then transition to a vertical thrust configuration to carefully lower a package to the doorstep of a customer. Since a fixed-wing UAV has a minimum velocity, or stall speed, the tilt-rotor UAV provides a much safer and more stable delivery method that would also better protect the contents of the packages and reduce the company’s risk. II. Mission Profile While the mission profile of the Paparazzi UAS will change with each user’s operation, the following mission profile was developed as a baseline for the UAS design. Figure 2 displays a visual representation of the flight profile, and table 1 details the various mission requirements at each stage in the flight profile. With a total flight time of 33 minutes, the UAS can capture 18 minutes of surveillance, 3 minutes in a forward thrust mode and 15 minutes in a vertical thrust mode, of a target 2 Nm away from base. Figure 2. Paparazzi Verification Mission Profile
  • 5.
    4 American Institute ofAeronautics and Astronautics Table 1. Paparazzi Verification Mission Breakdown Key Requirements Mission Stage Description Key Requirements 0 Unpack/Setup Fit within a Pelican Case (Max. Dimensions: 47.57" x 24.07" x 17.68") Air vehicle and ground station setup in less than 10 minutes 1 Vertical Takeoff Vertical takeoff from ground Transition to forward thrust at minimum of 20 feet 2 Climb to Cruise Climb to 400 feet in 5 minutes 3 Cruise to Target Cruise for 2 Nautical Miles at 400 feet at 40 knots 4 Surveillance at Altitude Loiter for 3 minutes at altitude for target acquisition Descend to 30 feet to conduct detailed surveillance 5 Ground-Level Surveillance Transition to vertical thrust mode Maintain maneuvering flight for 15 minutes 6 Climb to Cruise Climb to 50 feet vertically and transition to forward thrust Climb to 400 feet in 5 minutes 7 Cruise to Base Cruise at 40 knots for 2 Nautical Miles to base 8 Descent Descend to 25 feet in forward thrust mode 9 Vertical Landing Transition to vertical thrust mode Vertical landing within a 3 foot radius III. Design and Analysis A. Conceptual Design In order to meet the requirements established in the request for proposals (RFP), various design configurations were analyzed. The most heavily considered concepts are pictured below. These concepts were developed as a result of consultations with experienced quadcopter and fixed-wing UAV users, as well as background research on tilt- rotor UAVs. Figure 3. Initial Conceptual Design Configurations
  • 6.
    5 American Institute ofAeronautics and Astronautics Concept A, seen in the figure above, featured a fairly conventional UAV configuration, except with four motors that would rotate to accommodate the vertical and forward thrust requirements. Concept B eliminated one of the motors in an attempt to reduce weight as well as increase agility in the vertical thrust configuration. Concept C went a step further to eliminate the tail entirely, using the rear motor as a control device for yaw and pitch stability in forward flight through thrust vectoring controls. The final design consideration, concept D, placed two motors inside the wing, where the propellers would rotate within the wing to transition between vertical and forward thrust modes. In order to select a final conceptual design, various design considerations were weighted and assessed for each of the proposed concepts. Among those weighted the highest were stability and manufacturability. Stability was ranked high due to the inherent stability issues with designing a tilt-rotor UAS, especially in the transitional stage. Manufacturability received a higher ranking, as a more easily constructed system would be more likely to be built and flown by a small team of undergraduates. Other considerations were weight, maneuverability, forward thrust performance, takeoff performance, and design complexity. Each design consideration was given a utility rating based on a scale of 1-5, with 5 being the most favorable. Each utility rating was multiplied by the design considerations’ weighting factor to determine sub-scores. These scores were summed to yield the final score, with the highest score representing the best conceptual design. Table 2. Initial Conceptual Down-Select Design Considerations Weighing Factor Design A Utility Design A (Util*Wt) Design B Utility Design B (Util*Wt) Design C Utility Design C (Util*Wt) Design D Utility Design D (Util*Wt) Manufacturability 0.25 4 1.00 3 0.75 4 1.00 2 0.50 Stability 0.25 4 1.00 4 1.00 4 1.00 1 0.25 Weight 0.20 2 0.40 2 0.40 3 0.60 4 0.80 Maneuverability 0.20 2 0.40 3 0.60 4 0.80 1 0.20 Forward Thrust Performance 0.20 4 0.80 3 0.60 2 0.40 4 0.80 Takeoff Performance 0.10 4 0.40 4 0.40 4 0.40 3 0.30 Complexity 0.10 3 0.30 3 0.30 2 0.20 1 0.10 Score 4.30 4.05 4.40 2.95 Recommendation 2 3 1 Initial Selection 4 Based on the results of the conceptual down-select trade study, concept D placed last since there were perceived issues with stability in the vertical thrust configuration, fitting a large enough propeller needed for VTOL within the wing, and the ability of the design to maneuver effectively in a vertical thrust configuration. Concepts A and C ranked very close, and due to the sensitivity of this crude down-select process, both concepts were considered equally. However, in the end, design concept C was selected, as this concept reduced weight and surface area that, in turn, would provide better maneuverability and efficiency in a vertical thrust configuration. Since the actual surveillance mission occurs primarily in the vertical thrust configuration, increasing the performance of this mode was considered to be paramount. While concept C would not perform as well as concept A during climb and cruise due to power loss related to thrust vectoring controls, it would compensate with more agility and efficiency in the vertical thrust mode.
  • 7.
    6 American Institute ofAeronautics and Astronautics The addition of a tail to the three-engine design, as included in concept B, did not seem to be overly beneficial in this rough analysis. Although the tail would increase stability in the forward thrust mode and decrease control complexity, the tail would decrease stability and maneuverability in the vertical thrust mode, as well as add additional weight to the air vehicle. Thus, for our initial conceptual design, it was decided that the tail concept would only be used in the event that stability in a forward thrust configuration was not achievable without a tail in the more detailed stages of the air vehicle’s design. Therefore, some of the forward flight stability risk associated with the selection of concept C could be mitigated with the option of easily adding a tail to the design if necessary. In reality, this safeguard proved to be critical, as detailed stability analysis demonstrated that the initial concept would be highly unstable and very difficult to control, especially in transition. Therefore, the final concept most closely resembles concept B, with a three-rotor design, a tail, and a rectangular wing planform, however, aspects of concept C are still apparent in the final design. For example, the wing motors were shifted inboard to reduce structural requirements and increase roll stability, and the tail motor was placed on the tail to reduce structural weight and provide a level platform in the vertical configuration for landing. In addition, the rear motor also tilts for a thrust- vectoring control, similar to concept C. By doing this, the best of both concepts were merged into a final concept that better met the mission requirements. B. Weight Breakdown A weight breakdown was compiled for every piece of hardware that is expected to make up the vehicle or be within the vehicle. The individual item weights were found empirically or, in cases were the component was not available, from the manufacturers’ published data sheets. Initially, certain components of the design were not finalized therefore a conservative estimate was made based on comparable components on the market, however, as estimated weights became more concretely defined, the percent composition for the total system matured. From this, the total weight was estimated to be approximately 4.83 lbs, and a complete component by component weight breakdown has been included in the appendix. In addition to the built-in electronics necessary to fly, it was decided to allow for a 0.65 lb. modular payload, which could be used to carry any desired payload that would fit within the volume of the fuselage. This could include an upgraded battery, a heat sensor, a high-definition camera, or any other desired payload. For example, a camera with visual and thermal capabilities used on similar- sized UAVs weighs 0.60 lbs., which is below the maximum allowable payload weight. Including the customer payload, the estimated UAS gross weight came to be 5.48 lbs. A final gross weight of 5.50 lbs. was selected for design purposes, which builds in an additional slight margin for manufacturing uncertainties. It should also be noted that all weight estimates, where actual weight was unknown, were developed in a very conservative fashion so as to ensure that the UAS would not exceed the design weight if actual components weighed more than predicted. C. Aerodynamic Analysis The aerodynamic analysis focused on the airfoil selection and optimization of the finite wing design. Due to the vertical thrust capability, the aircraft was not constrained by traditional takeoff and CLmax constraints like conventional aircraft. Because of that, the wing’s design was defined in order to provide sufficient lift during cruise at a suitable speed and be easily manufactured. With power being a primary concern, since vertical thrust rotorcrafts tend to consume more power than conventional aircraft, the airfoil shape should attempt to minimize the amount of power required during forward flight. Therefore, the wing has been designed to minimize the drag produced. As the surveillance portion of the mission occurs primarily in the vertical thrust configuration, the ideal wing would reduce the power necessary to cruise and climb and thereby increase the time available for the surveillance mission. Figure 5. Weight Composition Figure 4. Final Conceptual Design Configuration
  • 8.
    7 American Institute ofAeronautics and Astronautics Knowing this, the aerodynamic design process began by comparing wing loading vs. airspeed for increasing lift coefficients. Figure 6. Aircraft Airspeed vs. Wing Loading for Increasing Lift Coefficients The diagram assisted in determining how much the required lift coefficient for trim flight would vary as the wing loading changed. Note that the variation in the required lift coefficients for level flight was found to vary more significantly as the wing loading increased. As the Paparazzi UAS was designed to be highly maneuverable with a minimal wetted area for drag reduction, the preliminary wing loading was selected to be around 2.0 to 2.5 lbs/ft2 . Using the minimum cruise speed of 40 knots requirement it was calculated that at the desired wing loading the minimum required lift coefficient for level flight would be in the range of 0.40 to 0.45. The range of airfoil lift coefficients required for level flight was determined with the following equation: √ (1) When determining the lift coefficients it was noted that aspect ratios for maneuverable aircraft were found to fall within the range of 4 to 5. Based on this analysis a target airfoil Cl needed to range from 0.6 to 0.7. Note that the target airfoil lift coefficients were computed to be significantly high, which was the trade-off for minimizing the wing area. By doing preliminary airfoil research, three suitable airfoils were selected for further analysis, the MH-112 and the MH-114, both of which have been successfully used in previous ultralight propeller aircrafts, and the S-1210, a high lift and low Reynolds number cambered airfoil. Note that all the airfoils are cambered. Cambered and slightly thick airfoils contradict the low drag criteria, however, some camber is required in order to supply enough lift at a low angle of incidence which is an important factor for manufacturability. For a better understanding of the airfoils individual performance, the computer software XFRL5 was utilized to predict and compare the airfoils aerodynamic performances at a wide range of specified Reynolds numbers. It is important to emphasize that the XFRL5 computer software uses the potential flow theory and interpolation to estimate the results. This approach has been proven to provide lift coefficient results suitable for design; however, the drag and moment coefficient results are still significantly inaccurate due to the limitations of the theory. The results could still be accurately utilized to predict and compare which airfoil section would have a higher L/D when compared to one other. The data points obtained by XFRL5 at different Reynolds numbers were averaged and plotted in the figures included below.
  • 9.
    8 American Institute ofAeronautics and Astronautics Figure 7. Airfoil Lift Coefficient vs. Angle of Attack Comparison at 300,000 Reynolds Number Each airfoil’s 2D lift coefficient was plotted versus increasing angle of attack. It was observed that at an average Reynolds number of 300,000; all airfoils would satisfy the 0.6 to 0.7 minimum lift coefficient at a 0 degrees angle of incidence. Again, since Paparazzi is not restricted by takeoff, the value of the Clmax is not very significant; in fact, it might only be considered for low speed conditions and near stall, such as the transition from forward thrust to vertical thrust. This may also be considered in emergency situations such as high winds provoking high angle of attack deflection or engine out conditions. Figure 8. Qualitative Comparison of 2D Airfoil Lift/Drag vs. Angle of Attack The lift to drag ratio of each airfoil was plotted versus increasing angle of attack. It is important to emphasize that the values of the L/D axis were intentionally removed because these numbers reflect a 2D analysis and this is used simply as a qualitative analysis not a quantitative one. However, it is still apparent that the S-1210 had greater drag penalty than the MH airfoils, which was already expected due to its higher camber. As shown, there were significant gaps in L/D between the three airfoils. Thus, it was determined that the smaller Cl or Clmax benefits obtained by either the S-1210 or the MH-112 were not worth the drag penalty. As a result, the airfoil was chosen to be the MH-114. Further modifications were done to the airfoil to remove some camber in order to decrease drag and increase the moment produced for stability.
  • 10.
    9 American Institute ofAeronautics and Astronautics Figure 9. Modified MH-144: Airfoil Selected for Paparazzi UAS Once the airfoil was determined, the aerodynamics study shifted to the finite wing design. At this point it is important to emphasize that the dimensions of the wing were rounded to the nearest half integer in order to facilitate an ease of manufacturing. First the wing area was approximated by using the weight and the wing loadings obtained above. To be conservative the design wing loading was set to 2 lbs/ft2 . For a 5.5 lbs. vehicle the area required was obtained to be 400 in2 . Therefore, the wing planform was designed to be rectangular, with 40 inches of span and a 10 inch chord. Figure 10. Rectangular Wing Planform While there is no doubt that the preliminary wing would satisfy the manufacturability requirement, this rectangular design would add greater weight and drag contributions than other wing planforms. Following various references, the preliminary finite wing was redesigned in various ways which could result in significant improvements. First, the study focused on tapering the wing, which would significantly decrease the weight of the wing while keeping a more elliptical lift distribution across the span of the wing, resulting in a considerable reduction in induced drag. However due to the complexity of manufacturing a swept and tapered wing, the wing was designed as rectangular. The spars that would connect the tail rotor to the aircraft are currently to be attached to the vehicle through the wing; so a rectangular inboard section would facilitate the assembly of the tail rotor. Originally a tail-less design was considered and designed, but after difficulties in maintaining stability arose a empennage tail design was added. The tail surfaces were sized with input from the stability analysis. At the same time, the two front rotors would ideally be a distance apart from the tilting area in order to reduce possible downwash effects during vertical thrust configuration and allow the propeller not to impinge upon the wing. As a result, the amount of rectangular inboard area was difficult to optimize. The wing loading was obtained to be 2.3 lbs/ft3 with an aspect ratio of 4.71, so both values were indeed obtained to fall within the maneuverability criteria determined in the beginning of the design. 40 in 10 in
  • 11.
    10 American Institute ofAeronautics and Astronautics Figure 11. Wing and Tail Design Using XFRL5 and the lift coefficient equation specified above, the CL versus angle of attack graph was plotted and included in Figure 12. This wing was inherently unstable particularly due to the effects of the camber. At this point, it was important to keep in mind that the overall CG of the vehicle would have to be carefully controlled in order to ensure longitudinal static stability. Weight could be added to the nose area of the plane in order to do so. The aerodynamics analysis proved that a rectangular wing with a 40 inch span and a 10 inch chord provides sufficient lift for the aircraft. Also a tail with a horizontal span of 22 inches and a 6.5 inch chord provides a statically stable aircraft design. Figure 12. 2D and 3D Finite Wing Lift Coefficient vs. Angle of Attack Comparison D. Drag Estimation With the wing and tail of the aircraft sized, the fuselage was sized with considerations of the internal volume needed to house the flight electronics and payload. The dimensions were used to develop a detailed drag prediction of the aircraft.
  • 12.
    11 American Institute ofAeronautics and Astronautics Figure 13. Paparazzi Aircraft Dimensions A tool was developed in Excel to estimate the drag of the UAS based on a buildup of the system’s various components using Shevell’s method. This calculates the entire system drag by summing the drag of each of the system’s structures, according to the equation: ∑ (2) Where K is defined as, [ ( ) ( ) ] ( ) ⁄ √ ⁄ (3) The skin friction coefficient was calculated using a simplified assumption of entirely turbulent flow. It was assumed that the flow was tripped to turbulent flow at .01 inches on each component. The summed components of the plane include the rectangular portion of the wing, the engine nacelles, the fuselage, and the tail. With the given dimensions specified in Table 3, a Reynolds number was calculated for each surface of the aircraft. Table 3. Freestream Parameters Pressure (psf) 2051 Density (lbs./ft2 ) 2.32E-03 Velocity (ft/s) 67.5 Viscosity (lb ft-1 s-1 ) 3.73E-07 Mach Number (M) 0.06 Speed of Sound (ft/s) 1113 Dynamic Pressure (psf) 5.28
  • 13.
    12 American Institute ofAeronautics and Astronautics With this data, the Cd for each component was determined. Then all the Cd values are summed up. This is the total parasitic drag and was found to be 0.02385 for the entire plane. Then, the induced drag was calculated as (4) The Oswald efficiency factor e was calculated from (5) With this e, came to a value of .89. Once the parasitic drag and the induced drag were added together, the total coefficient of drag was found to be .05228. It is from this that the total drag of the plane is calculated according to the equation, (6) The total drag was found to be .65 lbs. for the CL value used during cruise. A drag polar was developed for increasing values of Cl and the corresponding value of Cd. The tangent of this curve with the origin provided our glide ratio which is around 12. This value is used to optimize our flight in order to fly at the best range condition. Figure 14. Paparazzi UAS Drag Polar E. Propulsion The amount of thrust that is needed to overcome the weight of the aircraft and climb at the specified climb rate in vertical thrust of 9.2 ft/s was calculated. Based on consultations with experienced rotorcraft UAV pilots and engineers, it was determined best to use a motor with which the aircraft would be capable of hovering at 50%-60% throttle in order to allow for sufficient maneuvering power. With this information, various motors were researched, specifically Tiger motors since the motor specifications are readily available. The published data on various Tiger motors was analyzed for different throttle settings with various propeller configurations to pinpoint the correct motor. The propulsion system selected uses three Electric Brushless Motors – MT2814 KV770 Tiger Motors which offer 8.9 lbs. combined of static thrust compared the 5.5 lbs. weight of the vehicle. This excess thrust allows the vehicle to climb at the required speeds during take-off and maneuvering. The system runs off of 14.8 volt batteries and draws .5 amps when idling. An efficient propeller must be sized to balance the efficiency in both vertical and horizontal thrust configurations. The propeller must Figure 15. Tiger Brushless Motors Selected
  • 14.
    13 American Institute ofAeronautics and Astronautics provide enough thrust in horizontal flight to reach the cruise speed. For efficiency in vertical thrust mode a propeller with large diameter and low pitch is desired as opposed to horizontal thrust where low diameter and higher pitch is ideal. By analyzing different propeller combinations with our motor in MotoCalc, software commonly used to predict RC aircraft performance, a propeller that is 12”x8” was selected. This offers the minimum thrust with this motor needed to reach the cruise speed of 40 knots while having the largest diameter and lowest pitch possible for the highest efficiency during vertical thrust. F. Constraint Analysis An initial constraint analysis tool was developed in Excel with estimated data and then adjusted iteratively as various design assumptions became more strongly defined. As aircraft and helicopter designs are constrained by separate parameters, the analysis had to consider the vertical thrust configuration and the forward configuration constraints separately. Primarily, the limiting values for helicopter takeoff and hovering is power loading and disk loading. For an aircraft, these values would be power loading and wing loading. While the power loading constraint is inherently related, each configuration will use a separate throttle setting which will consequently affect the power required. The following equation was used to determine the power required for vertical climb at various disk loadings out of ground effect: [( √ ) ] [ ] (7) It should be noted that this equation also applies for hovering flight by setting the climb velocity to zero. Intuitively, it also becomes apparent that the air vehicle will have enough power to hover if the vehicle has the power required for climb. Therefore, a climb rate of 120 fpm was assumed to allow the air vehicle to reach an altitude of 20 feet in 10 seconds. The adjustment for the force of downwash blowing on the vehicle was assumed to be 3% of the disk loading. Additionally, the figure of merit was assumed to be 0.7 to compensate power losses due to factors such as airfoil profile drag, nonuniform flow, tip losses, and slipstream effects. The mechanical efficiency was approximated to be 0.97. Although this analysis considers the power required out of ground effect, the actual power required during takeoff in ground effect is decreased. However, in an effort to design with conservative assumptions and allow excess power for maneuvering, ground effect was neglected for power calculations. Using an assumed weight of 5.50 lbs, the power loading was plotted versus the disk loading. In the figure below, the area above the curve represents an inoperable region, where there is not sufficient power to takeoff at 120 fpm. The area below the curve is the design space which meets VTOL power requirements. The design point for climb was selected to be a power loading of 5.7 lbs/hp at a disk loading of 7.0 lbs/ft2 . With the current engine and propeller combination, this occurs at an 80% throttle setting, which is the upper limit for our desired maneuvering mission. With the design point falling beneath the curve, there is a surplus of power available as a margin of safety which could also be used to accelerate the vehicle upwards at a greater rate if required during takeoff or maneuvering flight. Figure 16. Power Loading vs. Disk Loading for the Vertical Thrust Configuration
  • 15.
    14 American Institute ofAeronautics and Astronautics Similarly, an analysis was conducted for the forward flight configuration to determine the required power loading at various wing loadings. The first limitation considered for forward flight was the maximum wing loading sustainable before stall. This was computed at a stall speed estimated from preliminary aerodynamic data: ( ) (8) Next, the maximum speed of the aircraft was considered as a constraint. As an approximation, this speed was estimated to be 125% of the cruise velocity of 40 knots. Assuming a propeller efficiency of 0.7 and a parabolic drag profile as established earlier, the following equation was used to determine power loading as a function of wing loading: ( ) ( ) ( ) (9) Based on the RFP requirement to climb at a rate of 76 fpm, the same assumptions were made for the following equation, except it was assumed that the propeller efficiency would be 0.6 for climbing conditions. ( ) √ √ ( )( ) (10) The final constraint considered for forward flight was the air vehicle’s ceiling. As defined by the RFP, the ceiling was a specified 400 feet. From this, the density ratio was calculated and input with the previous assumptions into the following equation: ( ) √ √ ( )( ) (11) The following graph combines each of the constraints for forward flight with the shaded regions being the regions where the design constraints are not met. The design point was constrained by the same engine and propeller combination performance used in the vertical thrust analysis at the cruise condition of 40 knots. At 70% throttle, which is the throttle setting required to achieve a cruise speed of 40 kts, the power loading was 26 lb/hp with a wing loading of 2.3 lb/ft2 . Figure 17. Power Loading vs. Wing Loading for the Forward Flight Configuration
  • 16.
    15 American Institute ofAeronautics and Astronautics F. Performance Characteristics In the forward thrust configuration, the vehicle becomes a traditional propeller driven aircraft. Hence, its forward flight performance was analyzed using the same approach as a conventional aircraft. First, the aircraft was studied in steady level flight where the required lift coefficient to trim the aircraft at a given airspeed was calculated using: ⁄ (12) Since the aircraft is operated by electric motors, the weight remains constant during the entire mission, making the lift coefficient entirely dependent on the airspeed. Next, the drag coefficient at this particular CL was approximated using the drag polar in Fig. 10. From this, the thrust required at a given airspeed was obtained as: (13) Because the aircraft is propelled by three propeller driven motors, it was more meaningful to analyze the vehicle performance in terms of power required. Under this flight condition, the power required was calculated by, (14) The flight performance was analyzed in a range of 18 to 47 knots, with 40 knots being the design cruise airspeed and 22 knots being the calculated stall speed. For a simpler understanding of the variance in performance at different speeds, the results are graphically represented in Fig. 11. Thus, the speed for maximum endurance, located at the point of minimum power, was approximately 30 knots. Also, the speed for maximum range, located at the point of maximum L/D (obtained by the tangent line), was around 39 knots. For completeness, the aircraft stall line was included, to facilitate the appreciation between the flight and the no-flight regimes. Notice that the defined speed for cruise falls close to the maximum range speed. Once steady level flight was analyzed, the climb to altitude performance was analyzed. This is specified as the portion of the mission in which the aircraft climbs in the forward thrust configuration. The rate of climb of a propeller aircraft is defined as: (15) The RFP states that the first climb towards the destination is required to be at a minimum rate of 96 fpm while the second climb back to the base was required to be at a minimum rate of 90 fpm. With Eqn. 15, the selected propulsion system was analyzed to verify that it would indeed be capable of producing enough power to perform the required climb. In order to minimize this quantity, the aircraft was chosen to climb at the minimum power velocity of 30 knots, resulting in a power required of 0.056 hp. With the forward flight performance estimated, the vertical thrust tricopter configuration was studied. In vertical thrust mode, the minimum condition of equilibrium for hovering flight required the thrust produced by the three motors to be equal to the total weight of the vehicle. Knowing the characteristics of the motor and the geometry of the propeller, it was possible to calculate the disc loading, which plays a crucial role in the hover performance and maneuverability of the aircraft. First, it was necessary to assume a reasonable figure of merit, which is the ratio between the power output of the motors and the actual power consumed. The optimum figure of merit for rotorcraft vehicles is located within 0.7 and 0.8. Figure 12 depicts the relationship between power loading and disc loading for various figures of merit. Figure 17. Power Required vs. Airspeed
  • 17.
    16 American Institute ofAeronautics and Astronautics The optimum figure of merit of the Paparazzi UAS was assumed to be the minimum optimal value of 0.7 in order to be conservative and allow extra room in possible losses or future changes in the design which might have an effect on the overall performance of the vehicle. Once the figure of merit was defined, the power requirements to takeoff and hover were calculated. The disk loading required to hover was estimated to be 2.33 psf, and it was determined that each motor had to produce 0.106 hp to hover, resulting in a total power required of 0.351 hp. Note that an extra 10% was added to the total power result in order to account for potential drag and transmission losses. Since the power required to hover is a representation of the minimum amount of power required to maintain the UAS in a fixed equilibrium position with the environment, the power required to climb was estimated by using the conservation of energy relationship. (16) [ √( ) ] (17) Then, to find the total power required to climb to the minimum transition height of 20 feet, it was necessary to assume a suitable Vc of 180 fpm, and the total power required to takeoff was computed to be 0.42 hp. H. Stability The first approach towards determining the stability conditions of the aircraft was followed by making a more precise estimation of the center of gravity’s location. In order to find the location of the CG, every component included in the vehicle was considered as a point mass with a defined weight and location; then, the CG equation yielded, ∑ ∑ (18) In order to use the equation above, the point mass locations of the wings, fuselage, tail, and spars were found by calculating the moment of area of the surfaces and dividing by its mass: (19) From the equations above, the CG location was calculated to be 4.0 inches from the leading edge. This was set constant to be at the location of rotation for transition. From the aerodynamic analysis the wing’s aerodynamic center was found to be located 4.36 inches aft the rectangular section leading edge as computed. A 2D representation of the location of each point mass, the CG location, and the NP location was developed as a visual representation. Figure 18. Power and Disc Loading for Figures of Merit
  • 18.
    17 American Institute ofAeronautics and Astronautics Figure 18. Free-Body Diagram of Paparazzi Aircraft As a result of the CG being forward of the NP, the aircraft will be longitudinally stable, giving a 5% static margin. Note that the CG was designed to be on the same axis line as the rotating spar in order to prevent extra moments on the aircraft produced by the change in inertia forces. Figure 19. Various CG Locations within the Aircraft From this graphical representation it was possible to write the preliminary equations of equilibrium of for steady level flight. ∑ (20) ∑ (21) ∑ (22) Since LW, W, LT, and D are known from the aerodynamics section and the drag polar, and since Kn, IT, ITV, and ITH can be easily obtained by the geometry of the vehicle, the system yielded 3 equations and 3 unknowns (TT, T, δRT), which can be solved to obtained the precise conditions for trim at level flight. It is required to study the response of the vehicle after a longitudinal disturbance. A longitudinal disturbance would provoke an increment on
  • 19.
    18 American Institute ofAeronautics and Astronautics the vehicle AoA. This increment would add an incremental lift contribution, which would unbalance the condition of equilibrium, creating a vertical acceleration as well as pitching the aircraft. In order to counteract this force and moment, the back rotor might have to increase its power as well change its δRV angle and the horizontal tail surface will need to be deflected. Along the same lines, the lateral-directional stability of the UAS was analyzed. This case of study is more intuitive. During trim level flight, it might be easily observed that the δRH would be zero, as both thrust forces would cancel their respective moments due to the vehicle symmetry about the Xb axis. Similarly, if a disturbance were encountered the tail rotor would need to adjust in order to counteract the force and moment raised from the sideslip disturbance. Also the vertical stabilizers ensure additional stability during gusts and level flight. For completeness, the study of the stability in the vertical thrust tricopter mode was also considered. All rotors have the same contribution to counteract the weight, and if a disturbance in any direction were encountered, the rotors adjust their output power in order to balance the forces and moments originated by the disturbance. This is controlled by an autopilot system and both accelerometers and gyroscopic sensors. It is of crucial importance to understand in great depth both the static response and transient behavior of the aircraft after a disturbance, so the optimum controller can be designed. The stability analysis focused on the design of the vertical and horizontal stabilizers to assure a trim condition and static stability during the cruise phase. A static stability margin of 5% was selected as an appropriate value from industry. The Cmα of the aircraft was computed using Eqn. 18: ̅ ( ) ̅ (23) With the tail horizontal stabilizer deflected and different incident angles, the Cm vs. Cl was developed to ensure static stability is provided. Figure 20. Moment Coefficient vs. Lift Coefficient The negative slope demonstrates the longitudinal static stability of the aircraft over its range of flight conditions. Based on the aircraft geometry, the minimum horizontal stabilizer chord was selected to be 6.5 inches so that the tail would keep the aircraft level while on the ground in VTOL configuration. With an assumed ηH of 1 due to the propeller influence, and the desired 5% static margin, the horizontal stabilizer was determined to have a span of 22 inches. Using a similar approach and Eqn. 19, the vertical stabilizer was calculated to have a span of 6.5 inches, which produced a Cnβ value of 0.054 rad-1 , assuming a Kf of 0.8, vertical tail side-wash gradient of 0.5, ηV of 0.9, and a design vertical tail volume coefficient of 0.1. ( ) (24)
  • 20.
    19 American Institute ofAeronautics and Astronautics Figure 21. Cn vs. β Plot In order to facilitate the analysis the longitudinal and the lateral-directional stabilities were decoupled and analyzed independently. Hence, the dynamic stability analysis was separated into three sections: Longitudinal stability, lateral-directional stability, and hover stability. The longitudinal stability of Paparazzi was linearized at the trim condition of steady level flight at 40 knots by using the small perturbation assumption. The five responses of interest corresponding to our longitudinal model consisted of the surge velocity u, the angle of attack α, the pitch angle θ, the pitch rate q, and the altitude h. (25) Also, the two longitudinal control inputs included in Paparazzi’s design were the tail wing incidence angle δih and the motor change in thrust δT. (26) The eigenvalues, damping ratios, and natural frequencies that characterize this flight condition were calculated and show that the negative real part of the eigenvalues verified the stable condition mentioned in the static stability section. Table 4. Longitudinal Stability Parameters λ ζ ωn (rad/sec) -3.42 + 0.7i 0.98 3.5 -3.42 – 0.7i 0.98 3.5 -0.007 + 0.37i 0.002 0.37 -0.007 – 0.37i 0.002 0.37 The phugoid and short period response to a unit tail incidence impulse input over time was analyzed. Figure 22 shows the response of the aircraft phugoid and short period response respectively. The average oscillatory period and time to half amplitude of each mode is shown in Table 5. Table 5. Oscillatory Period and Time to Half Amplitude Mode Average Oscillation Period (sec.) Average Time to Half (sec.) Phugoid 17 105 Short Period 1.8 0.2
  • 21.
    20 American Institute ofAeronautics and Astronautics Figure 22. Short Period and Phugoid Response to Tail Incidence Unit Impulse In order to ensure the full control of the aircraft during autonomous cruise flight, an altitude and pitch attitude controller was designed. The controller was designed to ensure a percent overshoot of less than 5% and a settling time of less than 2.5 seconds. Figure 23. Comparison of Controlled and Uncontrolled Response to Initial Disturbance The controller effectively returns the aircraft to its original trim condition within the designed 2.5 settling time. The 7 degree tail incidence input required to control the aircraft is within the tail incidence limits of ±90 degrees. Also, Figure 24 shows the altitude of the aircraft with the controller when tested after a ±1 degree tail incidence input, which demonstrates that the controller assures a precise change in pitch attitude as the change in altitude is attained without the oscillations observed in the uncontrolled case. Finally, the effect of the altitude controller in the aircraft response for a given altitude mission was calculated. Figure 24. Tail Incidence Input for Control
  • 22.
    21 American Institute ofAeronautics and Astronautics The altitude controller will allow the aircraft to both change and maintain a specified altitude with a small offset error. Figure 25. Altitude Response at Given Tail Incidence Input Figure 26. Altitude Response for a Specified Altitude Path The lateral-directional stability of Paparazzi was also linearized at the trim condition of steady level flight at 40 knots by using the small perturbation assumption. The five responses of interest corresponding to our lateral- directional model consisted of the sideslip angle β, the bank angle φ, the roll rate p, the yaw rate r, and the heading angle ψ. (27) Also, the two lateral-directional control inputs included in Paparazzi’s design were the wing incidence angle δw and the rear motor deflection δR. (28)
  • 23.
    22 American Institute ofAeronautics and Astronautics The eigenvalues, damping ratios, and natural frequencies that characterize this flight condition were calculated and the negative real part of the eigenvalues verified the stable condition mentioned in the static stability section. Table 6. Longitudinal Stability Parameters λ ζ ωn (rad/sec) -3.42 + 0.7i 0.98 3.5 -3.42 – 0.7i 0.98 3.5 -0.007 + 0.37i 0.002 0.37 -0.007 – 0.37i 0.002 0.37 Following the same approach as the longitudinal control, a controller was designed to control the bank angle and the heading angle with a percent overshoot of less than 5% and a settling time of less than 1.5 seconds. The open- loop and closed-loop response for a +1 degree bank angle disturbance is displayed in Figure 27. The open-loop and closed-loop response for a +1 sideslip angle disturbance is shown in Figure 28. Figure 27. Comparison of Controlled and Uncontrolled Response to Bank Angle Disturbance Figure 28. Comparison of Controlled and Uncontrolled Response to Sideslip Angle Disturbance
  • 24.
    23 American Institute ofAeronautics and Astronautics In both figures, it is shown that that the controller effectively brings the vehicle back to the initial trim condition within the specified percent overshoot and settling time. Also, how the will aircraft respond to different unit impulse inputs are displayed in Figure 29 and Figure 30 respectively. Figure 29. Comparison of Controlled and Uncontrolled Response to Wing Incidence Impulse Figure 30. Comparison of Controlled and Uncontrolled Response to Rear Rotor Impulse I. Transition Transition encompasses the change from vertical thrust to horizontal thrust in aircraft and is very difficult flight regime to predict. This analysis is the “holy grail” of the aerospace industry because of the level of complexity in the analysis and control systems. It is difficult to maintain a stable transition because as the vehicle transitions, its forward velocity is not above the stall speed of the wing. Therefore the thrust level must change with each angle increment such that the vehicle does not lose altitude but also increases horizontal velocity until transition is complete and the velocity is greater than the stall speed. The Paparazzi aircraft pitches the forward wings and a portion of the horizontal tail from angles of 90 degrees to 0 degrees thus altering the thrust direction.
  • 25.
    24 American Institute ofAeronautics and Astronautics The transition analysis was done in an ideal condition, meaning the altitude is held constant. Due to factors such as motor efficiencies the vehicle will lose altitude in an actual transition. The analysis focused on maintaining a positive horizontal acceleration and a zero rotational acceleration at multiple rotor angles in order to prevent the UAS from losing altitude and speed as well as preventing rotation during the transitional process. Using the aircraft geometry and Eqns. 20-22, it was possible to solve for the minimum thrust settings that would satisfy the acceleration conditions. Figure 31. Transitional Analysis Schematic ̈ (29) ̈ (30) ̈ (31) Figure 32 shows the changing angles of the motors and the surfaces during the transition. The horizontal speed and the power required to maintain altitude and a forward acceleration during transition were computed and compared against the power available at each of the stages analyzed to demonstrate that the power requirements were within the aircraft’s capabilities. The power required for this transition compared to the airspeed of the aircraft was developed, with the key angles shown in Figure 32. The red line signifies an ideal transition with no altitude loss. If the aircraft were to exert the exact power along this line during the angle change the vehicle maintains its altitude while increasing the horizontal velocity beyond the stall speed. This is the same for transition to forward thrust as it is to vertical thrust. Figure 32. Power Required vs. Airspeed during Transition The transition was also tested in the wind tunnel. The wing angles were changed to different angles and data was collected. The graphs show stability during transition. The raw data can be found in the appendix. The drag for each angle of the wing was collected and compared that with the other angles to create a power required to overcome the
  • 26.
    25 American Institute ofAeronautics and Astronautics vehicle drag vs. airspeed for each wing angle of transition. The Cm vs. Cl was also generated for each transition angle in the wind tunnel. This data shows that the vehicle is actually decently statically stable during the transition, with a negative slope in the graphs. Figure 33. Transitional Wind Tunnel Testing Figure 34. Power Required to Overcome Drag During Transition, Wind Tunnel Results
  • 27.
    26 American Institute ofAeronautics and Astronautics Figure 35. Cm vs. Cl Wind Tunnel Results With this analysis it is believed that with a good flight controller a near ideal transition may be met with a small vehicle such as Paparazzi. The transition will be stable and quick, allowing for minimal loses during the transition. J. Battery Analysis Once the required power for takeoff, hover, climb, and cruise were known, the battery analysis was done to study the battery size required to complete the mission. Note that the preliminary analysis is a simplified process used and was in fact a simple use of the power, voltage and current definitions. The equations for battery capacity and power are shown below. (32) (33) It is possible to combine both equations and write a unique expression relating the capacity of the battery and the required power output to the motors to complete at each stage of the flight, (34) After consulting professors and experts in the field, it was safe to assume that for a battery less than 1 year, the voltage output would be near a constant value at all times. As a result, the team decided to consider a 14.8 volt Lithium polymer battery, since these batteries are commonly used in RC aircraft due to their high power available versus weight characteristics. The capacity breakdown at each flight section was included in Table 7. Also, for a better appreciation of the battery capacity needed for each flight condition, a graphical representation of the battery consumption can be seen in Figure 36. Table 7. Battery Consumption and Time of Flight Mission Stage Time (min) 1st Climb 5 Cruise 2.25 Loiter 3 Surveillance 15 Takeoff/Landing 0.5 2nd Climb 5 Cruise 2.25 Total 33 y = -0.0862x - 0.2059 y = -0.313x + 0.0165 y = -1.2754x + 0.2223 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0 0.5 1 1.5 Cm CL 30 Deg. 60 Deg. 90 Deg.
  • 28.
    Figure 36. BatteryConsumption at Mission Stages In Figure 36, it can be seen that the most significant power consumption occurs during the 15 minutes of detailed surveillance in the vertical thrust mode, as expected since vertical thrust is known to draw a significant amount of power. Since approximately 5700 mAh of power would be consumed throughout the mission, a 6400 mAh battery was selected, as this size of battery provided an additional 700 mAh, or 11%, suplus power. Comparing batteries available on the market, a 6600 mAh battery could be purchased off-the-shelf from Thunder Power which is a company that specializes in light-weight batteries for RC aircraft. This battery actually weighed less and filled a smaller volume than similar batteries that provided 6400 mAh of power, so an additional 200 mAh is available as an extended reserve, bringing the total surplus to 900 mAh, or 14% of the total power available. In total, the selected battery and its associated components weigh 1.37 lbs. K. Structural Analysis In order to analyze that the system’s structures would meet the design requirements, the anticipated loading over the entire flight envelope had to be obtained. With a conservative approach and assuming standard load factors for an acrobatic aircraft, the maximum structural load factors were designed for +6g and -3g loads. Additionally, the loading analysis included gusts of 5 and 15 feet per second, which is a common assumption for low-altitude, light- weight unmanned surveillance. The V-n diagram pictured below defines the entire aerodynamic and structural flight envelope by illustrating the variation in load factor with airspeed. With the loading defined, the structural components of the UAS could be analyzed. For this, a half-span model of the wing’s main 3/8” carbon fiber spar was created in Abaqus, a finite element analysis software, using a symmetry-plane approach. The inboard end of the spar was fixed, and the outboard end of the spar was left unsupported. The carbon fiber composite material was modeled as an orthotropic material, with directional material properties obtained from the manufacturer’s technical data sheet for the selected spar. A fine mesh was applied to the model, and for an approximate approach, an elliptical pressure load distribution was 0 400 800 1200 1600 2000 2400 2800 3200 3600 4000 4400 4800 5200 5600 6000 6400 PowerConsumption(mAh) Power Consumption Surplus Cruise 2nd Climb Surveillance Loiter Cruise 1st Climb Takeoff Figure 37. Aerodynamic and Structural Flight Envelope with 5 and 15 fps gust lines
  • 29.
    28 American Institute ofAeronautics and Astronautics applied across the upper surface of the half-spar. Results from the simulation for both stresses and deflections are displayed visually below, with the red area being the location of maximum stresses and the blue area signifying the maximum deflections. Figure 38. Stress Distribution for Carbon Fiber Spar The image above shows the Von Mises stresses for the carbon fiber spar. The analysis reported maximum stresses of 19.2 ksi, which is well below the ultimate stresses published on the manufactuer’s website of 640 ksi. These stresses occur inboard on the top and bottom of the inboard section of the rod. As the reported stresses fall well below the maxim tensile stresses, there exists an opportunity to optimize the spar in the future to potentially reduce the vehicle weight or cost. Figure 39. Exaggerated Spar Deflections for 9g Loading This image depecicts the exaggerated deflections of the rod for easy viewing purposes. As expected, the maximum deflections occur at the tip. For this model, a factor of saftey of 1.5 was applied to the loading in order to obtain a maximum tip deflection of 1.78 inches, which was deemed to be acceptable. Limitations to this finite element analysis modeling should be noted. When dealing with composite materials, the published material properties represent averages, but the actual properties may vary. Therefore, the directional moduli used in this analysis could vary from those used in the material modeling, and the strength of the material can depend on how well the composite material is manufactured. For these reasons, full-scale physical testing should also be conducted once a prototype vehicle is developed. Additionally, it should be noted that the design of the Paparazzi UAS was not driven by structures, so the structural analysis primarily focused on verifying that the structures would meet the requirements rather than seeking to optimize the structural system to reduce weight. However, as the spar seemed to handle the structural loading even with a factor of saftey of 1.5, there may be an oportunity for weight savings by analyzing other spar diameters, sizes, and materials.
  • 30.
    29 American Institute ofAeronautics and Astronautics L. Cost Analysis Figure 40. Cost Breakdown vs. Vehicle Component A preliminary cost breakdown has been generated using simply the materials needed to build the aircraft at retail costs from the manufacturers. These costs represent the actual dollar amounts planned to be spent in order to build and fly a prototype vehicle. The cost break down was separated in terms of the main aircraft components and is included in the appendix. The majority of the cost is attributed to the electronics needed to fly and maintain stability, as well as the cost of the propulsion system. The electronics portion of the vehicle amounts to $539, while the propulsion system costs $279. The total cost of materials to build the UAS comes to $1,272. This value is competitive in terms of pricing when considering the cost of similarly sized aircraft, with sufficient room for a profit margin if sold at a marked-up price. M. Risk Mitigation In order to design an aircraft efficiently and to withstand various obstacles the flight profile may present, a risk analysis is performed in order to mitigate such risks during the design. Below is a list of perceived risks along with the actions that will be taken to mitigate these risks throughout the design of the Paparazzi UAS.  Likelihood is order 1-5, with 1 being the least likely and 5 being the most likely.  Severity or the consequence of the risk happening is ordered 1-5 with 1 being least severe and 5 being most severe. Table 8. Vehicle Risks and Risk Mitigations UAV Failure Modes Risks Level of Likelihood Level of Effect Consequence Mitigation One Engine Out 2 5 Depending on which motor fails, system loses thrust and is forced into horizontal flight mode to remain a flight All subsystems will undergo strenuous testing to ensure it can withstand flight $125.00 $279.00 $146.00 $539.00 $183.00 $- $100.00 $200.00 $300.00 $400.00 $500.00 $600.00 Wing Propulsion Fuselage Electronics Battery
  • 31.
    30 American Institute ofAeronautics and Astronautics Two Engines Out 2 5 System fails which causes loss of stability and control of aircraft All subsystems will undergo strenuous testing to ensure it can withstand flight Three Engines Out 1 5 System fails which causes loss of stability and control of aircraft All subsystems will undergo strenuous testing to ensure it can withstand flight Propeller Damage 2 5 System fails which causes loss of stability and control of aircraft All subsystems will undergo strenuous testing to ensure it can withstand flight Unstable Vehicle 2 4 System becomes unstable and potential loss of payload Pilot will be trained to handle such events UAV Stalls 3 3 System becomes unstable and potential loss of payload Pilot will be trained to handle such events Excessive Wind During Flight 2 3 System becomes unstable and potential loss of payload Pilot will be trained to handle such events Damages to UAV Due to Excessive Forces on Vehicle 3 3 System becomes unstable and potential loss of payload Pilot will be instructed to land vehicle or detonate vehicle depending on situation Risks Level of Likelihood Level of Effect Consequence Mitigation Wing Transition Servos Fail 2 4 Vehicle is forced to remain in vertical thrust mode All subsystems will undergo strenuous testing to ensure it can withstand flight Motor Speed Controller Failure 2 4 Motors may possibly rev at limits greater than the recommended values, or randomly All subsystems will undergo strenuous testing to ensure it can withstand flight, also pilot will be trained for such scenarios
  • 32.
    31 American Institute ofAeronautics and Astronautics Autopilot System Failure 3 5 System fails which causes loss of stability and control of aircraft UAV will contain a standard R/C manual override for emergency situations Battery Failure 2 5 System fails which causes loss of stability and control of aircraft All electronics will be tested prior to flight and on full scale test; Back up system being considered Batteries Become Depleted of Charge 2 5 System fails which causes loss of stability and control of aircraft All electronics will be tested prior to flight and on full scale test; Before each flight, the batteries must be fully charged; Backup system being considered Faulty Wiring 2 5 Insufficient wiring will cause lack on control of aircraft All wiring will be checked prior to each flight Loss of Signal 2 2 No Data Collected All electronics will be tested prior to flight and on full scale test GPS Unit Fails 2 2 No data collected; Lose track of payload All electronics will be tested prior to flight and on full scale test Wiring Fails to Transmit Data 2 2 No data collected All electronics will be tested prior to flight and on full scale test Table 9. External Risks and Risk Mitigations Risks Level of Likelihood Level of Effect Consequence Mitigation Miscellaneous Insufficient Progress Due to Missing Members (illness, accident, etc.) 2 2 Progress on project becomes slower Keep communication between team open and honest; Work ahead to prevent these interferences from interrupting progress
  • 33.
    32 American Institute ofAeronautics and Astronautics School Work Interferes with Project Completion 2 2 Progress on project becomes slower Keep communication between team open and honest; Work ahead to prevent these interferences from interrupting progress Parts Do Not Arrive On time 4 4 Progress on project becomes slower Work ahead to prevent these interferences from interrupting progress; Always have a second plan to work on so project is continuously progressing Lack of Funds to Purchase Parts 3 5 Progress on project becomes slower Work ahead in the budget to prevent these interferences from interrupting progress; Keeping the communication open with necessary personnel to get the team proper funding Vehicle Damage in Transportation 3 3 May cause problems on launch day with damaged parts Have spare parts on hand Vehicle Components do not easily assemble 2 3 Inability to fly Follow design specs closely Risks Level of Likelihood Level of Effect Consequence Mitigation Manufacturing Hazardous Materials such as Foams, Paints, Epoxies, etc. 2 3 Irritation to eyes, injury to skin, etc. Follow safety codes and have safety overview before each work session Risks with Electronics 2 3 Small minor burns Follow safety codes and have safety overview before each work session
  • 34.
    33 American Institute ofAeronautics and Astronautics Hazard with Motors 2 4 Serious bodily harm Follow safety codes and have safety overview before each work session IV. Conclusion Through a highly iterative process, the Paparazzi vehicle was designed to maximize payload and flight time. The airfoil and wing shape were selected to obtain the desired maneuverability performance while reducing the power consumption during forward flight. In addition, a constraint analysis considering each of limiting mission requirements was used throughout this process to select appropriate values for power loading, wing loading, and disk loading. Based on the vehicle performance analysis, the Paparazzi can cruise at the desired 40 knots, which is the best range value. All climb conditions are also performed at the minimum power condition of 30 knots. The vehicle has been design to be statically and dynamically stable, including during the transition stage. Based on the analysis presented in this document, the Paparazzi UAS meets all the requirements established in the RFP. The Paparazzi vehicle fills a gap in today’s current UAS market. The vehicle is a low cost highly versatile design that offers the long distance and high speeds of a UAV and the high maneuverability of a tricopter. The vehicle is small and compact weighing 5.5 lbs. and carrying .62 lbs. of modular payload. With an anticipated 18 minutes of surveillance 1.5 miles away, the vehicle can stay aloft 33 minutes. A battery was chosen to meet this time requirement and offers a surplus of power for a variety of different flight regimes. The vehicle has an estimated total build price of $1,227. The vehicle was verified via wind tunnel testing, and full scale testing was planned. The full scale testing has run out of time however many vital components have been assembled. A group of students next year plan on building the aircraft and flight testing the design. Appendix Appendix I—Weight Breakdown Table 10 - Component by Component Weight Breakdown Weight Breakdown Electronics Weight (lbs) Quantity Total Weight (lbs) Motors 0.27 3 0.80 Propellers 0.04 3 0.12 KK board 0.22 1 0.22 Ardupilot 0.01 1 0.01 GPS 0.04 1 0.04 Battery 0.76 1 0.76 Speed Controller 0.06 3 0.17 Receiver 0.02 1 0.02 Servo Motors 5 0.24 Total: 2.37 Wing and Tail Components Weight (lbs) Quantity Total Weight (lbs) Section 1 Wing Foam 0.02 2 0.05 Section 2 Wing Foam 0.04 2 0.08 Spar within Section 1 Carbon Fiber 0.14 2 0.27 Spar within Section 2 Carbon Fiber 0.07 2 0.14
  • 35.
    34 American Institute ofAeronautics and Astronautics Spar Swept Section Carbon Fiber 0.08 2 0.15 Tail Spar 1 Carbon Fiber 0.05 2 0.10 Tail Spar 2 Carbon Fiber 0.20 2 0.40 Tail Upper Spar Carbon Fiber 0.03 2 0.05 Tail Horizontal Spar Carbon Fiber 0.19 1 0.19 Total: 1.44 Fuselage Materials Weight (lbs) Quantity Total Weight (lbs) Top Foam 0.02 1 0.02 Box Foam 0.02 1 0.02 Box Balsa 0.19 1 0.19 Top Balsa 0.19 1 0.19 Total 0.41 Total Aircraft Weight (lbs) 4.22 Max Payload for customer (lbs) 1.25 Total Flight Weight (lbs) 5.47 Appendix II—Thrust and Power Required Data Table 11 - Data for Thrust and Power Required for Level Flight at Different Airspeed KTAS CL CD Treq (lb) Preq (hp) 18 2.172 0.376 0.952 0.052 21 1.596 0.210 0.724 0.046 24 1.222 0.130 0.583 0.042 27 0.965 0.087 0.494 0.040 30 0.782 0.062 0.438 0.040 33 0.646 0.048 0.404 0.040 36 0.543 0.038 0.386 0.042 40 0.436 0.030 0.380 0.046 41 0.399 0.028 0.383 0.049 44 0.348 0.025 0.393 0.054 47 0.305 0.023 0.410 0.060 Appendix III—Matlab Code for Battery Analysis %% Paparazzi %Battery Capacity Preliminary Analysis clear, clc %% Conversion Factors kts2fps = 1.6878; hp2lbs = 550; deg2rad = pi/180; ft2in = 12; hp2watt = 746; %% Aircraft Characteristics W = 5.5; %lbs b = 40; %inches cr = 8.5; %inches ct = 8.5; %inches S = 340; %inches^2 AR = (b^2)/S; Ab = 0.785; %Area blades
  • 36.
    35 American Institute ofAeronautics and Astronautics sweep = 0; %degrees e = (4.61*(1-0.045*(AR^0.68))*(cosd(sweep)^.15))- 3.1; %% Drag Polar K = 1/(pi*AR*e); cd0 = 0.02; %% Power Calculations Vol = 14.8; %Volts %% Takeoff tto = 6; %sec Vtko = 3; %ft/s %% Climb Vclimb = 30; %knots since it is close to V for min Power. RC1 = 96; %fpm Preqcli = 0.04; %hp = minimum power tclimb = 5*60; %seconds %using the equation RC = (Pav - Preq)/W %Power needed by engine to climb Power1 = (((RC1/60)*W)+(Preqcli*hp2lbs))/hp2lbs; %hp Iclimb1 = ((Power1*hp2watt)/Vol)*1000; %mAmp %% Cruise x2 rhoc = 0.002318; %slugs/ft3 %rhoc = 0.002377; Vcruise = 40; %kts CLcruise = W/(0.5*rhoc*((Vcruise*kts2fps)^2)*(S/(ft2in^2))); CDcruise = cd0 + K*((CLcruise*kts2fps)^2); range = 2; %nm tcruise = (range/Vcruise)*3600; %seconds Treqcruise = CDcruise*0.5*rhoc*((Vcruise*kts2fps)^2); %lbs Preqcruise = (Vcruise*kts2fps)*Treqcruise/hp2lbs; %hp Icruise = ((Preqcruise * hp2watt)/Vol)*1000; %mAmp %% Transition ttrans = 3; %sec %% Loiter FM = 0.6; %From tlot = 3*60; %sec tsurv = 15*60; %sec Trot = W/3; Vrot = sqrt((Trot/Ab)/(2*rhoc)); Prot = (Trot*Vrot)/(FM*550); P_hv_tot = 3*Prot*1.03; f = 1.03; nmech = 0.97; Pclimb_rot =(((f*W)/FM)*sqrt(((f*W)/Ab)/(2*rhoc)))+((W*Vtk o)/2); Ptko = Pclimb_rot/550; Vlot = 30*kts2fps; %fps Cllot = (W/(S/(ft2in^2)))/(0.5*rhoc*(Vlot)^2); Cdlot = cd0 + K*(Cllot^2); Plot= (Vlot*(Cdlot*0.5*rhoc*(Vlot^2)*(S/(ft2in^2)))/550); Ito = ((Ptko*(hp2watt)/Vol)*1000); Ilot = (Plot*(hp2watt)/Vol)*1000; Isurv = ((P_hv_tot*(hp2watt)/Vol)*1000); %% Climb RC2 = 90; %fpm Power2 = (((RC2/60)*W)+(Preqcli*hp2lbs))/hp2lbs; %hp tclimb2 = tclimb; Iclimb2 = ((Power2*hp2watt)/Vol)*1000; %mAmp %% Descend tdesc = 0; %sec %% Landing tland = 10; %sec %time of mission %ttotal = tclimb + tcruise + tclimb2 + tcruise; ttotal = tclimb + tcruise + tlot + ... tclimb2 + tcruise+tsurv+tto; %Iavg = ((Iclimb1*tclimb)+(Icruise*tcruise)... % +(Iclimb2*tclimb2)+(Icruise*tcruise))/ttotal; Iavg =((Iclimb1*tclimb)+(Icruise*tcruise)+ (Isurv*tsurv)+ (Ito*tto)... +(Ilot*tlot)+... (Iclimb2*tclimb2)+(Icruise*tcruise))/ttotal; %mAmp Pclimb1 = Iclimb1*tclimb/3600 Pcruise1 = Icruise*tcruise/3600 Psurv = Isurv*tsurv/3600 Pto = Ito*tto/3600 Plot = Ilot*tlot/3600 Pclimb2 = Iclimb2*tclimb2/3600 Pcruise2 = Icruise*tcruise/3600 CAP = ((Iavg*ttotal)/3600) %mAh
  • 37.
    36 American Institute ofAeronautics and Astronautics Appendix IV—Cost Breakdown Table 12. Cost Breakdown Wing Materials Foam $ 75.00 Carbon Fiber Rectangular tube $ 50.00 Propulsion System Motors (3) $ 186.00 Servos $ 75.00 Props $ 16.00 Locknuts $ 2.00 Fuselage/Payload 3-D Printed Fuselage $ 20.00 Carbon Fiber Exterior $ 60.00 Cameras $ 16.00 Carbon Fiber Rods $ 50.00 Electronics Control Boards (2) $ 371.00 GPS $ 40.00 Batteries $ 180.00 3 Brushless Speed Controllers (ESCs) $ 39.00 Transmitter and Receiver $ 40.00 Servo Connectors $ 5.00 Bullet Connectors $ 3.00 Battery Charger and Accessories $ 23.00 ESC Programming Card $ 7.00 AVR Programmer $ 11.00 Battery Connector $ 3.00 Total $ 1,272.00 Appendix V—Drag Buildup Data Table 13- Drag Build Up for Swept Wing Section t/c 0.13 Span 1.67 Sweep (Degrees) 18 C_r,e 0.83 Taper Ratio 0.4 C_t 0.33 c_bar (m.a.c.) 0.62 Re 260028 C_f (turb for whole wing) 0.006113
  • 38.
    37 American Institute ofAeronautics and Astronautics C_f (turb for up to x_cr) 0.005760 C_f (laminar up to x_cr) 0.002245 x_cr 0.01 C_f, weighted (and corrected by 10% for surface roughness) 0.006783 Z 1.90 Correction Factor (K) 1.28 S_wet 0.45 C,d_wing 0.001638 f_P,wing 0.003869 Table 14 - Drag Build Up Rectangular Wing Section t/c 0.13 Span 1.67 Sweep (Degrees) 0 C_r,e 0.83 Taper Ratio 1 C_t 0.83 c_bar (m.a.c.) 0.83 Re 350037 C_f (turb for whole wing) 0.005760 C_f (turb for up to x_cr) 0.005760 C_f (laminar up to x_cr) 0.002245 x_cr 0.01 C_f, weighted (and corrected by 10% for surface roughness) 0.006404 Z 2.00 Correction Factor (K) 1.29 S_wet 2.78 C,d_wing 0.009708 f_P,wing 0.02292 Table 15 - Drag Build Up Fuselage Fuse Length 1 Cross-Sectional Area 0.0625 Perimeter 2.5 Fuse Diameter 0.25 Re 420045 C_f (turb for whole fuselage) 0.005554 C_f (turb for up to x_cr) 0.005760 C_f (laminar up to x_cr) 0.002245 x_cr 0.01 C_f, weighted (and corrected by 10% for surface roughness) 0.006181 Correction Coeff (K) 1.40
  • 39.
    38 American Institute ofAeronautics and Astronautics S_wet 0.95 C,d_fuse 0.003490 f_P,fuse 0.008240 Table 16 - Drag Build Up Engineer Nacelles Section Length 0.35 Cross-Sectional Area 0.03125 Perimeter 0.36 Diameter 0.12 Re 148834 C_f (turb for whole fuselage) 0.006834 C_f (turb for up to x_cr) 0.005760 C_f (laminar up to x_cr) 0.002245 x_cr 0.01 C_f, weighted (and corrected by 10% for surface roughness) 0.007543 Correction Coeff (K) 1.64 S_wet 0.15 C,d_fuse 0.0007860 f_P,fuse 0.001856 Table 17 - Drag Build Up Totals C,d_total(Cdo) 0.01562 f total 0.03689 D,p total 0.1948 C_L (steady level flight) 0.44 Induced Drag Coeff 0.01449 Total C_D 0.03 Total Drag 0.38 Drag of JUST Wing, HT, and VT 0.061 Total L/D 14.46 Table 18 - Drag Build Up Structural Conditions Weight (W) 5.5 Reference Area (S_ref) 2.36 Re,cr 3.50E+05 Fuselage Diameter 0.46 Thickness (Wing) 0.108 Thickness (Tails) 0 Roughness 1.12 Span 3.33 Efficiency Factor 0.8852
  • 40.
    39 American Institute ofAeronautics and Astronautics Appendix VI—Constraint Analysis Data Table 19 - Constraint Analysis Conditions Gross Weight Wg (lbs) 5.5 Max Cruise Height h (ft) 400 Cruise Velocity V (kts) 40 V (fps) 67.5 Mdesign 0.061 Temperature at Max Cruise Height T (Kelvin) 286.4 T (Rankine) 515.6 T/To 0.917 Density ρSL (slug/ft3 ) 0.002377 ρTO (slug/ft3 ) 0.002345 ρcruise (slug/ft3 ) 0.00231758 ρhover (slug/ft3 ) 0.00234259 σcruise 0.975 Rate of Climb ROC (fps) 1.267 Table 20 - Constraint Analysis Parameters Design Assumptions Vmax (fps) 84.39 Mmax 0.076 Vstall (fps) 37.35 Clmax 1.42 ɳp, cruise 0.70 CD0 0.016 ɳp, ROC 0.60 (L/D)max 14.5 AR 4.7 e 0.89 K 0.076
  • 41.
    40 American Institute ofAeronautics and Astronautics hceiling (ft) 400 ρcieling (slug/ft3 ) 0.0023176 σceiling 0.9750 Design Assumptions for Helicopter FM 0.70 ɳp, mechanical 0.97 f 1.03 ROC (fps) 2 Table 21 - Forward Flight Design Point Forward Thrust Design Point Throttle Setting 70% W/SW (lbs/ft2 ) 2.3 W/P (lbs/hp) 25.6 Table 22 - Vertical Thrust Design Point Vertical Thrust Efficient Design Throttle Setting 80% W/SD (lbs/ft2 ) 7.0 W/P (lbs/hp) 5.7 Appendix VII—Airfoil Data Points Table 23. Modified MH 114 Wing Airfoil – Modified MH114 Tail Airfoil – NACA 0009 X Y X Y 1 0 1 0 0.99665 0.00106 0.99572 0.00057 0.98722 0.0043 0.98296 0.00218 0.97276 0.00943 0.96194 0.00463 0.95372 0.01577 0.93301 0.0077 0.93005 0.02295 0.89668 0.01127 0.90199 0.03097 0.85355 0.01522 0.87001 0.03972 0.80438 0.01945 0.83463 0.04896 0.75 0.02384 0.79632 0.05841 0.69134 0.02823 0.75558 0.06774 0.62941 0.03247 0.71288 0.07668 0.56526 0.03638 0.66868 0.08496 0.5 0.03978 0.6234 0.09231 0.43474 0.04248 0.57735 0.09857 0.37059 0.04431
  • 42.
    41 American Institute ofAeronautics and Astronautics 0.53089 0.10359 0.33928 0.04484 0.48438 0.10728 0.30866 0.04509 0.4382 0.10956 0.27886 0.04504 0.39274 0.11039 0.25 0.04466 0.3484 0.10975 0.22221 0.04397 0.30554 0.10767 0.19562 0.04295 0.26453 0.10418 0.17033 0.04161 0.22566 0.09936 0.14645 0.03994 0.18921 0.0933 0.12408 0.03795 0.15539 0.08611 0.10332 0.03564 0.12443 0.07791 0.08427 0.03305 0.09655 0.06887 0.06699 0.03023 0.07192 0.05915 0.05156 0.0272 0.0507 0.04893 0.03806 0.02395 0.033 0.03841 0.02653 0.02039 0.01891 0.02782 0.01704 0.01646 0.00857 0.01742 0.00961 0.01214 0.00198 0.00754 0.00428 0.00767 0.00032 0.00285 0.00107 0.00349 0 0.00025 0 0 0.00022 -0.00214 0.00107 -0.00349 0.00062 -0.00355 0.00428 -0.00767 0.0012 -0.00476 0.00961 -0.01214 0.002 -0.00586 0.01704 -0.01646 0.0031 -0.00697 0.02653 -0.02039 0.00525 -0.00862 0.03806 -0.02395 0.00795 -0.01024 0.05156 -0.0272 0.01348 -0.01288 0.06699 -0.03023 0.02894 -0.01783 0.08427 -0.03305 0.05011 -0.02186 0.10332 -0.03564 0.07665 -0.02485 0.12408 -0.03795 0.10836 -0.02673 0.14645 -0.03994 0.14492 -0.02753 0.17033 -0.04161 0.18598 -0.0273 0.19562 -0.04295 0.23112 -0.02613 0.22221 -0.04397 0.27985 -0.02415 0.25 -0.04466 0.33164 -0.02145 0.27886 -0.04504 0.38589 -0.01817 0.30866 -0.04509 0.44199 -0.01444 0.33928 -0.04484 0.49927 -0.01046 0.37059 -0.04431 0.55703 -0.00645 0.43474 -0.04248
  • 43.
    42 American Institute ofAeronautics and Astronautics 0.61454 -0.00262 0.5 -0.03978 0.671 0.00085 0.56526 -0.03638 0.72557 0.00378 0.62941 -0.03247 0.77737 0.00601 0.69134 -0.02823 0.82556 0.00742 0.75 -0.02384 0.86933 0.00793 0.80438 -0.01945 0.90792 0.00757 0.85355 -0.01522 0.94063 0.00634 0.89668 -0.01127 0.96666 0.00442 0.93301 -0.0077 0.9853 0.0023 0.96194 -0.00463 0.99635 0.00063 0.98296 -0.00218 1 0 0.99572 -0.00057 1 0 Appendix VIII—Wind Tunnel Data Reduction %% Wind Tunnel Analysis %Team Paparazzi clear clc %% Conversion Factors % < < Distance > > nm_2_miles = 1.15078; %multiply to convert from nm to miles miles_2_ft = 5280; %multiply to convert from miles to feet in_2_ft = 1/12; %multiply to convert from in to ft % < < Speed > > kts_2_mph = 1.1508; %multiply to convert from kts to mph kts_2_fps = 1.6878; %multiply to convert from kts to fps mph_2_fps = 1.46667; %multiply to convert from mph to fps % < < Mass > > oz_2_lbs = 1/16; %multiply to convert from oz to lbs % < < Temperature > > fah_2_rank = 460.67; %add to convert from Fahrenheit to Rankine % < < Pressure > > inHg_2_psf = 70.7262; %multiply to convert from inches Mercury to Psf % < < Time > > hour_2_sec = 3600; %multiply to convert from hours to seconds min_2_sec = 60; %multiply to convert from min to seconds % < < Angles > > deg_2_rad = pi/180; %multiply to convert from degrees to radians %% Atmospheric Conditions Tatm = 76; %Fahrenheit Tatm = Tatm + fah_2_rank; %Convert to working units Patm = 29.5; %inches of Mercury Patm = Patm*inHg_2_psf; %Convert to working units Rair = 1716; %Air Constant in engineering units Density = Patm/(Rair*Tatm); %Air Density at Given Conditions mu = (3.62*10^- 7)*((Tatm/518.7)^1.5)*((518.7+198.72)/(Tatm+198.72)); %air viscocity in engineering units at Patm and Tatm %-> Got equation from Introduction to Flight 7th ed. nu = mu/Density; a_SL = 1116; %Speed of Sound at SL in fps %% Chosen Testing Variables Vvec = [0 15 20 25 30 35 40 45 60 92]; %Wind Tunnel Speeds in mph Vvec = Vvec*mph_2_fps; %Convert to working units q_s = 0.5*Density*Vvec.^2; %Uncorrected Dynamic Pressure Vector %% Wind Tunnel Test Section Geometry H = 28; %Test Section Height in inches H = H*in_2_ft; %Convert to working units B = 40; %Test Section Width in inches B = B*in_2_ft; %Convert to working units Lts = 54; %Test Section Length in inches Lts = Lts*in_2_ft; %Convert to working units Acs = H*B; %Test Section Cross-sectional (Frontal) Area Ats = H*Lts; %Test Section Area Strut_D = 1.5; %Strut Diameter in inches <<NOT UPDATED>> Strut_D = Strut_D*in_2_ft; %Convert to working units Strut_L = 15; %Strut Length in inches <<NOT UPDATED>>
  • 44.
    43 American Institute ofAeronautics and Astronautics Strut_L = Strut_L*in_2_ft; %Convert to working units Astrut = Strut_D*Strut_L; %THis is the Area in contact with free stream %% Paparazzi Aircraft Wind Tunnel Model Geometry % < < Wing > > bw = 20; %Wing Span in inches bw = bw*in_2_ft; %Convert to working units cbar_w = 4.25; %Wing MAC in inches cbar_w = cbar_w*in_2_ft; %Convert to working units Sw = bw*cbar_w; %Wing Area ARw = (bw^2)/Sw; %Wing Aspect Ratio Vol_w = 31.29; %Wing Volume in inches cube Vol_w = Vol_w*(in_2_ft^3); %Convert to working units X_CG = 2; %CG location from wing LE in inches X_CG = X_CG*in_2_ft; %Convert to working units tw = 0.1305*cbar_w; %Wing Thickness Rew = (Vvec*cbar_w)/nu; %Wing Reynolds Number Vector % < < Tail > > bt = 10.63; %Tail Span in inches bt = bt*in_2_ft; %Convert to working units cbar_t = 3.25; %Tail MAC in inches cbar_t = cbar_t*in_2_ft; %Convert to working units St = bt*cbar_t; %Tail Area ARt = (bt^2)/St; %Tail Aspect Ratio lt = 7.5; %Distance from CG to Tail Aerodynamic Center (@ c/4) in inches lt = lt*in_2_ft; %Convert to working units V_H = (lt*St)/(cbar_w*Sw); %Tail Volume Coefficient Ret = (Vvec*cbar_t)/nu; %Tail Reynolds Number Vector % < < Fuselage > > Vol_f = 7.4668; %Fuselage Volume in inches cube Vol_f = Vol_f*(in_2_ft^3); %Convert to working units X_balance_CG = 0.94; %X-Distance between Balance and Aircraft CG in inches X_balance_CG = X_balance_CG*in_2_ft; %Convert to working units Z_balance_CG = 0.50; %Z-Distance between Balance and Aircraft CG in inches Z_balance_CG = Z_balance_CG*in_2_ft; %Convert to working units D_f = 1.5; %Fuselage Diameter in inches D_f = D_f*in_2_ft; %Convert to working units L_f = 6.875; %Fuselage Length in inches L_f = L_f*in_2_ft; %Convert to working units %% Figure Parameters % < < Figure 6.23 > > % Read from ARw and Taper Ratio = 1 bv_b = 0.86; %Get % < < Figure 6.29 > > bv = bv_b*bw; be = (bw + bv)*0.5; K = be/B; be_B = be/B; %Read and Taper Ratio = 1 Delta = 0.146; %Get % < < Figure 6.52 > > lt_B = lt/B; %Read and Taper Ratio = 1 Tau2 = 0.35; %Get % < < Figure 6.13 > > tw_cbarw = tw/cbar_w; %Read (Airfoil not in the chart, approximated) Df_Lf = D_f/L_f; %Read K1 = 0.997; %Get K3 = 0.95; %Get % < < Figure 6.14 > > b2_B = 2*bw/B; %Read B_H = B/H; %Read Tau1 = 0.9125; %Get %% Constant Correction Coefficients Esbw = (K1*Tau1*Vol_w)/(Acs^(3/2)); EsbB = (K3*Tau1*Vol_f)/(Acs^(3/2)); Esbt = Esbw+EsbB; Estrut_windshield = 0.25*(Acs/Ats); DCmcg_Ddelta = -0.0626*V_H; %Assuming %% Wind Tunnel Test %% No Wind with Model Data %import .dat file to matlab [Data,SizeData] = importfile('no_wind.dat', 2); %Substract First Row which to substract Zero offset error
  • 45.
    44 American Institute ofAeronautics and Astronautics for i = 2:1:SizeData(1) Data(i,:) = Data(i,:) - Data(1,:); end alpha_no_wind = Data(2:end,1); %AoA vector in Deg. Lift_no_wind = Data(2:end,2); %Lift Vector in lbs. Drag_no_wind = Data(2:end,3); %Drag Vector in lbs. Pitch_no_wind = Data(2:end,4)*in_2_ft; %Pitching Moment Vector in lbs*ft Side_no_wind = Data(2:end,5); %Sideforce Vector in lbs Roll_no_wind = Data(2:end,6)*in_2_ft; %Rolling Moment Vector in lbs*ft Yaw_no_wind = Data(2:end,7)*in_2_ft; %Yawing Moment Vector in lbs*ft %% No Model with Wind at 92 mph Data %import .dat file to matlab [Data]= importfile('no_model_92mph.dat', 2); alpha_no_model_92mph = Data(1:end,1); %AoA vector in Deg. Lift_no_model_92mph = Data(1:end,2); %Lift Vector in lbs. Drag_no_model_92mph = Data(1:end,3); %Drag Vector in lbs. Pitch_no_model_92mph = Data(1:end,4)*in_2_ft; %Pitching Moment Vector in lbs*ft Side_no_model_92mph = Data(1:end,5); %Sideforce Vector in lbs Roll_no_model_92mph = Data(1:end,6)*in_2_ft; %Rolling Moment Vector in lbs*ft Yaw_no_model_92mph = Data(1:end,7)*in_2_ft; %Yawing Moment Vector in lbs*ft %To correct Cruise conditions besides 92 mph, we need to nondimensionalize the Data %Divide Loads by 0.5*Density*V^2*Sstruts %Divide Moments by 0.5*Density*V^2*Sstruts*Dstrut CLs_no_model = Lift_no_model_92mph/(0.5*Density*(Vvec(end)^2)*Astrut); CDs_no_model = Drag_no_model_92mph/(0.5*Density*(Vvec(end)^2)*Astrut); CSFs_no_model = Side_no_model_92mph/(0.5*Density*(Vvec(end)^2)*Astrut); CMs_no_model = Pitch_no_model_92mph/(0.5*Density*(Vvec(end)^2)*Astrut*Stru t_D); CLRs_no_model = Roll_no_model_92mph/(0.5*Density*(Vvec(end)^2)*Astrut*Strut _D); CNs_no_model = Yaw_no_model_92mph/(0.5*Density*(Vvec(end)^2)*Astrut*Strut _D); %% Cruise Analysis: %% < < Speed = 30 mph > > %import .dat file to matlab [Data,SizeData] = importfile('cruise_30mph.dat', 2); %Substract First Row which to substract Zero offset error for i = 2:1:SizeData(1) Data(i,:) = Data(i,:) - Data(1,:); end alpha_cruise_30mph = Data(2:end,1); %AoA vector in Deg. Lift_cruise_30mph = Data(2:end,2); %Lift Vector in lbs. Drag_cruise_30mph = Data(2:end,3); %Drag Vector in lbs. Pitch_cruise_30mph = Data(2:end,4)*in_2_ft; %Pitching Moment Vector in lbs*ft Side_cruise_30mph = Data(2:end,5); %Sideforce Vector in lbs Roll_cruise_30mph = Data(2:end,6)*in_2_ft; %Rolling Moment Vector in lbs*ft Yaw_cruise_30mph = Data(2:end,7)*in_2_ft; %Yawing Moment Vector in lbs*ft %First, we correct for no wind effect Lift_cruise_30mph_corr = Lift_cruise_30mph - Lift_no_wind; Drag_cruise_30mph_corr = Drag_cruise_30mph - Drag_no_wind; Pitch_cruise_30mph_corr = Pitch_cruise_30mph - Pitch_no_wind; Side_cruise_30mph_corr = Side_cruise_30mph - Side_no_wind; Roll_cruise_30mph_corr = Roll_cruise_30mph - Roll_no_wind; Yaw_cruise_30mph_corr = Yaw_cruise_30mph - Yaw_no_wind; %Now, Since V is not 92 mph, we nondimensionalize Lift and Drag %To correct for no model in Lift and Drag to find other correction factors CLs_cruise_30mph_corr = Lift_cruise_30mph_corr/(0.5*Density*(Vvec(5)^2)*Sw); CDs_cruise_30mph_corr = Drag_cruise_30mph_corr/(0.5*Density*(Vvec(5)^2)*Sw); %Now we correct for no model error CLs_cruise_30mph_corr = CLs_cruise_30mph_corr - CLs_no_model; CDs_cruise_30mph_corr = CDs_cruise_30mph_corr - CDs_no_model; %Now we compute CL squared to find K and CD0 CLs_cruise_30mph_CG_sq = CLs_cruise_30mph_corr.^2; %{ %We plot to have a sense of the results (Should be a straigth line) figure plot(CLs_cruise_30mph_CG_sq,CDs_cruise_30mph_corr) %} %We do a linear fit to compute the slope and the CD intercept (CD0) CL_sq_CD_30mph_Eq = polyfit(CLs_cruise_30mph_CG_sq,CDs_cruise_30mph_corr,1); %Compute K K_cruise_30mph = CL_sq_CD_30mph_Eq(1); %Compute e e_osw_cruise_30mph = 1/(K_cruise_30mph*ARw*pi); %Compute CD0 CD0_cruise_30mph = CL_sq_CD_30mph_Eq(2); %Find Missing correction factors Ewbt_cruise_30mph = (Sw/(4*Acs))*CD0_cruise_30mph; Etot_cruise_30mph = Esbt + Ewbt_cruise_30mph + Estrut_windshield; %Compute Corrected dynamic pressure q_corr_cruise_30mph = q_s(5)*(1+Etot_cruise_30mph)^2; %Use Corrected dynamic pressure to compute all coefficients CLs_cruise_30mph_corr = Lift_cruise_30mph_corr/(q_corr_cruise_30mph*Sw); CDs_cruise_30mph_corr = Drag_cruise_30mph_corr/(q_corr_cruise_30mph*Sw);
  • 46.
    45 American Institute ofAeronautics and Astronautics CSFs_cruise_30mph_corr = Side_cruise_30mph_corr/(q_corr_cruise_30mph*Sw); CMs_cruise_30mph_corr = Pitch_cruise_30mph_corr/(q_corr_cruise_30mph*Sw*cbar_w); CLRs_cruise_30mph_corr = Roll_cruise_30mph_corr/(q_corr_cruise_30mph*Sw*cbar_w); CNs_cruise_30mph_corr = Yaw_cruise_30mph_corr/(q_corr_cruise_30mph*Sw*cbar_w); %Now we correct all coefficients for no model error CLs_cruise_30mph_corr = CLs_cruise_30mph_corr - CLs_no_model; CDs_cruise_30mph_corr = CDs_cruise_30mph_corr - CDs_no_model; CSFs_cruise_30mph_corr = CSFs_cruise_30mph_corr - CSFs_no_model; CMs_cruise_30mph_corr = CMs_cruise_30mph_corr - CMs_no_model; CLRs_cruise_30mph_corr = CLRs_cruise_30mph_corr - CLRs_no_model; CNs_cruise_30mph_corr = CNs_cruise_30mph_corr - CNs_no_model; %Compute AoA correction Vector Delta_alpha_cruise_30mph = Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_cruise_30mph_corr; %Corrected AoA alpha_cruise_30mph_corr = alpha_cruise_30mph + Delta_alpha_cruise_30mph; %Drag Wall Correction Delta_Cd_cruise_30mph = Delta*(Sw/Acs)*(CLs_cruise_30mph_corr.^2); %Tail Moment Coefficient Correction Vector Delta_Cm_CG_cruise_30mph = DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*... CLs_cruise_30mph_corr; %Now we translate the Loads and moments from Balance Center to CG %Loads_CG = Loads_Balance %Moments_CG = Moment_Balance +- Loads*distance CLs_cruise_30mph_corr_CG = CLs_cruise_30mph_corr; CDs_cruise_30mph_corr_CG = CDs_cruise_30mph_corr + Delta_Cd_cruise_30mph; CSFs_cruise_30mph_corr_CG = CSFs_cruise_30mph_corr; CMs_cruise_30mph_corr_CG = (CMs_cruise_30mph_corr +... CLs_cruise_30mph_corr*(X_balance_CG/cbar_w)-... CDs_cruise_30mph_corr*(Z_balance_CG/cbar_w)) - Delta_Cm_CG_cruise_30mph; CLRs_cruise_30mph_corr_CG = CLRs_cruise_30mph_corr -... CSFs_cruise_30mph_corr*(Z_balance_CG/cbar_w); CNs_cruise_30mph_corr_CG = CNs_cruise_30mph_corr +... CSFs_cruise_30mph_corr*(X_balance_CG/cbar_w); %{ %Plot Results for further Study figure plot(alpha_cruise_30mph_corr,CLs_cruise_30mph_corr_CG) title('Lift Coefficient vs. Angle of Attack at 30mph') xlabel('Angle of Attack (Degrees)') ylabel('C_L') figure plot(CLs_cruise_30mph_corr_CG,CDs_cruise_30mph_corr_CG) title('Drag Polar at 30mph') xlabel('C_L') ylabel('C_D') figure plot(CLs_cruise_30mph_corr_CG,CMs_cruise_30mph_corr_CG) title('Moment Coefficient vs. Lift Coefficient at 30mph') xlabel('C_L') ylabel('C_m about CG') figure plot(alpha_cruise_30mph_corr,CLRs_cruise_30mph_corr_CG) title('Rolling Moment Coefficient vs. Angle of Attack at 30mph') xlabel('Angle of Attack (Degrees)') ylabel('C_Lroll') figure plot(alpha_cruise_30mph_corr,CNs_cruise_30mph_corr_CG) title('Yawing Moment Coefficient vs. Angle of Attack at 30mph') xlabel('Angle of Attack (Degrees)') ylabel('C_N') %} %% < < Speed = 60 mph > > %import .dat file to matlab [Data,SizeData] = importfile('cruise_60mph.dat', 2); %Substract First Row which to substract Zero offset error for i = 2:1:SizeData(1) Data(i,:) = Data(i,:) - Data(1,:); end alpha_cruise_60mph = Data(2:end,1); %AoA vector in Deg. Lift_cruise_60mph = Data(2:end,2); %Lift Vector in lbs. Drag_cruise_60mph = Data(2:end,3); %Drag Vector in lbs. Pitch_cruise_60mph = Data(2:end,4)*in_2_ft; %Pitching Moment Vector in lbs*ft Side_cruise_60mph = Data(2:end,5); %Sideforce Vector in lbs Roll_cruise_60mph = Data(2:end,6)*in_2_ft; %Rolling Moment Vector in lbs*ft Yaw_cruise_60mph = Data(2:end,7)*in_2_ft; %Yawing Moment Vector in lbs*ft %First, we correct for no wind effect Lift_cruise_60mph_corr = Lift_cruise_60mph - Lift_no_wind; Drag_cruise_60mph_corr = Drag_cruise_60mph - Drag_no_wind; Pitch_cruise_60mph_corr = Pitch_cruise_60mph - Pitch_no_wind; Side_cruise_60mph_corr = Side_cruise_60mph - Side_no_wind; Roll_cruise_60mph_corr = Roll_cruise_60mph - Roll_no_wind; Yaw_cruise_60mph_corr = Yaw_cruise_60mph - Yaw_no_wind; %Now, Since V is not 92 mph, we nondimensionalize Lift and Drag %To correct for no model in Lift and Drag to find other correction factors CLs_cruise_60mph_corr = Lift_cruise_60mph_corr/(0.5*Density*(Vvec(end-1)^2)*Sw); CDs_cruise_60mph_corr = Drag_cruise_60mph_corr/(0.5*Density*(Vvec(end-1)^2)*Sw); %Now we correct for no model error CLs_cruise_60mph_corr = CLs_cruise_60mph_corr - CLs_no_model; CDs_cruise_60mph_corr = CDs_cruise_60mph_corr - CDs_no_model; %Now we compute CL squared to find K and CD0 CLs_cruise_60mph_CG_sq = CLs_cruise_60mph_corr.^2;
  • 47.
    46 American Institute ofAeronautics and Astronautics %{ %We plot to have a sense of the results (Should be a straigth line) figure plot(CLs_cruise_60mph_CG_sq,CDs_cruise_60mph_corr) %} %We do a linear fit to compute the slope and the CD intercept (CD0) CL_sq_CD_60mph_Eq = polyfit(CLs_cruise_60mph_CG_sq,CDs_cruise_60mph_corr,1); %Compute K K_cruise_60mph = CL_sq_CD_60mph_Eq(1); %Compute e e_osw_cruise_60mph = 1/(K_cruise_60mph*ARw*pi); %Compute CD0 CD0_cruise_60mph = CL_sq_CD_60mph_Eq(2); %Find Missing correction factors Ewbt_cruise_60mph = (Sw/(4*Acs))*CD0_cruise_60mph; Etot_cruise_60mph = Esbt + Ewbt_cruise_60mph + Estrut_windshield; %Compute Corrected dynamic pressure q_corr_cruise_60mph = q_s(end-1)*(1+Etot_cruise_60mph)^2; %Use Corrected dynamic pressure to compute all coefficients CLs_cruise_60mph_corr = Lift_cruise_60mph_corr/(q_corr_cruise_60mph*Sw); CDs_cruise_60mph_corr = Drag_cruise_60mph_corr/(q_corr_cruise_60mph*Sw); CSFs_cruise_60mph_corr = Side_cruise_60mph_corr/(q_corr_cruise_60mph*Sw); CMs_cruise_60mph_corr = Pitch_cruise_60mph_corr/(q_corr_cruise_60mph*Sw*cbar_w); CLRs_cruise_60mph_corr = Roll_cruise_60mph_corr/(q_corr_cruise_60mph*Sw*cbar_w); CNs_cruise_60mph_corr = Yaw_cruise_60mph_corr/(q_corr_cruise_60mph*Sw*cbar_w); %Now we correct all coefficients for no model error CLs_cruise_60mph_corr = CLs_cruise_60mph_corr - CLs_no_model; CDs_cruise_60mph_corr = CDs_cruise_60mph_corr - CDs_no_model; CSFs_cruise_60mph_corr = CSFs_cruise_60mph_corr - CSFs_no_model; CMs_cruise_60mph_corr = CMs_cruise_60mph_corr - CMs_no_model; CLRs_cruise_60mph_corr = CLRs_cruise_60mph_corr - CLRs_no_model; CNs_cruise_60mph_corr = CNs_cruise_60mph_corr - CNs_no_model; %Compute AoA correction Vector Delta_alpha_cruise_60mph = Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_cruise_60mph_corr; %Corrected AoA alpha_cruise_60mph_corr = alpha_cruise_60mph + Delta_alpha_cruise_60mph; %Drag Wall Correction Delta_Cd_cruise_60mph = Delta*(Sw/Acs)*(CLs_cruise_60mph_corr.^2); %Tail Moment Coefficient Correction Vector Delta_Cm_CG_cruise_60mph = DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*... CLs_cruise_60mph_corr; %Now we translate the Loads and moments from Balance Center to CG %Loads_CG = Loads_Balance %Moments_CG = Moment_Balance CLs_cruise_60mph_corr_CG = CLs_cruise_60mph_corr; CDs_cruise_60mph_corr_CG = CDs_cruise_60mph_corr + Delta_Cd_cruise_60mph; CSFs_cruise_60mph_corr_CG = CSFs_cruise_60mph_corr; CMs_cruise_60mph_corr_CG = (CMs_cruise_60mph_corr +... CLs_cruise_60mph_corr*(X_balance_CG/cbar_w)-... CDs_cruise_60mph_corr*(Z_balance_CG/cbar_w)) - Delta_Cm_CG_cruise_60mph; CLRs_cruise_60mph_corr_CG = CLRs_cruise_60mph_corr -... CSFs_cruise_60mph_corr*(Z_balance_CG/cbar_w); CNs_cruise_60mph_corr_CG = CNs_cruise_60mph_corr +... CSFs_cruise_60mph_corr*(X_balance_CG/cbar_w); %{ %Plot Results for further Study figure plot(alpha_cruise_60mph_corr,CLs_cruise_60mph_corr_CG) title('Lift Coefficient vs. Angle of Attack at 60mph') xlabel('Angle of Attack (Degrees)') ylabel('C_L') figure plot(CLs_cruise_60mph_corr_CG,CDs_cruise_60mph_corr_CG) title('Drag Polar at 60mph') xlabel('C_L') ylabel('C_D') figure plot(CLs_cruise_60mph_corr_CG,CMs_cruise_60mph_corr_CG) title('Moment Coefficient vs. Lift Coefficient at 60mph') xlabel('C_L') ylabel('C_m') figure plot(alpha_cruise_60mph_corr,CLRs_cruise_60mph_corr_CG) title('Rolling Moment Coefficient vs. Angle of Attack at 60mph') xlabel('Angle of Attack (Degrees)') ylabel('C_Lroll') figure plot(alpha_cruise_60mph_corr,CNs_cruise_60mph_corr_CG) title('Yawing Moment Coefficient vs. Angle of Attack at 60mph') xlabel('Angle of Attack (Degrees)') ylabel('C_N') %} %% < < Speed = 92 mph (Design Speed) > > %import .dat file to matlab [Data,SizeData] = importfile('cruise_92mph.dat', 2); %Substract First Row which to substract Zero offset error for i = 2:1:SizeData(1) Data(i,:) = Data(i,:) - Data(1,:); end alpha_cruise_92mph = Data(2:end,1); %AoA vector in Deg. Lift_cruise_92mph = Data(2:end,2); %Lift Vector in lbs. Drag_cruise_92mph = Data(2:end,3); %Drag Vector in lbs. Pitch_cruise_92mph = Data(2:end,4)*in_2_ft; %Pitching Moment Vector in lbs*ft
  • 48.
    47 American Institute ofAeronautics and Astronautics Side_cruise_92mph = Data(2:end,5); %Sideforce Vector in lbs Roll_cruise_92mph = Data(2:end,6)*in_2_ft; %Rolling Moment Vector in lbs*ft Yaw_cruise_92mph = Data(2:end,7)*in_2_ft; %Yawing Moment Vector in lbs*ft %First, we correct for no wind and no model effects Lift_cruise_92mph_corr = Lift_cruise_92mph - Lift_no_wind(1:end-1) - Lift_no_model_92mph; Drag_cruise_92mph_corr = Drag_cruise_92mph - Drag_no_wind(1:end-1) - Drag_no_model_92mph; Pitch_cruise_92mph_corr = Pitch_cruise_92mph - Pitch_no_wind(1:end-1) - Pitch_no_model_92mph; Side_cruise_92mph_corr = Side_cruise_92mph - Side_no_wind(1:end-1) - Side_no_model_92mph; Roll_cruise_92mph_corr = Roll_cruise_92mph - Roll_no_wind(1:end-1) - Roll_no_model_92mph; Yaw_cruise_92mph_corr = Yaw_cruise_92mph - Yaw_no_wind(1:end-1) - Yaw_no_model_92mph; %Compute CG Lift and Drag Coefficients with uncorrected dynamic pressure CLs_cruise_92mph_corr = Lift_cruise_92mph_corr/(0.5*Density*(Vvec(end)^2)*Sw); CDs_cruise_92mph_corr = Drag_cruise_92mph_corr/(0.5*Density*(Vvec(end)^2)*Sw); %Now we compute CL squared to find K and CD0 CLs_cruise_92mph_CG_sq = CLs_cruise_92mph_corr.^2; %{ %We plot to have a sense of the results (Should be a straigth line) figure plot(CLs_cruise_92mph_CG_sq,CDs_cruise_92mph_corr) %} %We do a linear fit to compute the slope and the CD intercept (CD0) CL_sq_CD_92mph_Eq = polyfit(CLs_cruise_92mph_CG_sq,CDs_cruise_92mph_corr,1); %Compute K K_cruise_92mph = CL_sq_CD_92mph_Eq(1); %Compute e e_osw_cruise_92mph = 1/(K_cruise_92mph*ARw*pi); %Compute CD0 CD0_cruise_92mph = CL_sq_CD_92mph_Eq(2); %Find Missing correction factors Ewbt_cruise_92mph = (Sw/(4*Acs))*CD0_cruise_92mph; Etot_cruise_92mph = Esbt + Ewbt_cruise_92mph + Estrut_windshield; %Compute Corrected dynamic pressure q_corr_cruise_92mph = q_s(end)*(1+Etot_cruise_92mph)^2; %Use Corrected dynamic pressure to compute all coefficients CLs_cruise_92mph_corr = Lift_cruise_92mph_corr/(q_corr_cruise_92mph*Sw); CDs_cruise_92mph_corr = Drag_cruise_92mph_corr/(q_corr_cruise_92mph*Sw); CSFs_cruise_92mph_corr = Side_cruise_92mph_corr/(q_corr_cruise_92mph*Sw); CMs_cruise_92mph_corr = Pitch_cruise_92mph_corr/(q_corr_cruise_92mph*Sw*cbar_w); CLRs_cruise_92mph_corr = Roll_cruise_92mph_corr/(q_corr_cruise_92mph*Sw*cbar_w); CNs_cruise_92mph_corr = Yaw_cruise_92mph_corr/(q_corr_cruise_92mph*Sw*cbar_w); %Compute AoA correction Vector Delta_alpha_cruise_92mph = Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_cruise_92mph_corr; %Corrected AoA alpha_cruise_92mph_corr = alpha_cruise_92mph + Delta_alpha_cruise_92mph; %Drag Wall Correction Delta_Cd_cruise_92mph = Delta*(Sw/Acs)*(CLs_cruise_92mph_corr.^2); %Tail Moment Coefficient Correction Vector Delta_Cm_CG_cruise_92mph = DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*... CLs_cruise_92mph_corr; %Now we translate the Loads and moments from Balance Center to CG %Loads_CG = Loads_Balance %Moments_CG = Moment_Balance CLs_cruise_92mph_corr_CG = CLs_cruise_92mph_corr; CDs_cruise_92mph_corr_CG = CDs_cruise_92mph_corr + Delta_Cd_cruise_92mph; CSFs_cruise_92mph_corr_CG = CSFs_cruise_92mph_corr; CMs_cruise_92mph_corr_CG = (CMs_cruise_92mph_corr +... CLs_cruise_92mph_corr*(X_balance_CG/cbar_w)-... CDs_cruise_92mph_corr*(Z_balance_CG/cbar_w)) - Delta_Cm_CG_cruise_92mph; CLRs_cruise_92mph_corr_CG = CLRs_cruise_92mph_corr -... CSFs_cruise_92mph_corr*(Z_balance_CG/cbar_w); CNs_cruise_92mph_corr_CG = CNs_cruise_92mph_corr +... CSFs_cruise_92mph_corr*(X_balance_CG/cbar_w); %Linear Fits CM_cruise_92mph_alpha_fit = polyfit(alpha_cruise_92mph_corr,CMs_cruise_92mph_corr_CG,1) ; CM_cruise_92mph_CL_fit = polyfit(CLs_cruise_92mph_corr_CG,CMs_cruise_92mph_corr_C G,1); CL_alpha_cruise_92mph_fit = polyfit(alpha_cruise_92mph_corr(2:9),CLs_cruise_92mph_corr_C G(2:9),1); %Plot linear fits CM_cruise_92mph_alpha_Eq = polyval(CM_cruise_92mph_alpha_fit,alpha_cruise_92mph_corr); CM_cruise_92mph_CL_Eq = polyval(CM_cruise_92mph_CL_fit,CLs_cruise_92mph_corr_CG); CL_alpha_cruise_92mph_Eq = polyval(CL_alpha_cruise_92mph_fit,alpha_cruise_92mph_corr); %CL_alpha CL_alpha_cruise_92mph = CL_alpha_cruise_92mph_fit(1); %1/deg %Cm_alpha CM_alpha_cruise_92mph = CM_cruise_92mph_alpha_fit(1); %1/deg %Cm_CL CM_CL_cruise_92mph = CM_cruise_92mph_CL_fit(1); %Static Margin Kn = (-1/CM_CL_cruise_92mph); %percentage
  • 49.
    48 American Institute ofAeronautics and Astronautics %{%} %Plot Results for further Study figure plot(alpha_cruise_92mph_corr,CLs_cruise_92mph_corr_CG,'Line Width',2) hold on plot(alpha_cruise_92mph_corr,CL_alpha_cruise_92mph_Eq,'-- k','Linewidth',2) title('Lift Coefficient vs. Angle of Attack at 92mph') xlabel('Angle of Attack (Degrees)') ylabel('C_L') legend('Wind Tunnel Result','Linear Fit','location','SouthEast') figure plot(CLs_cruise_92mph_corr_CG,CDs_cruise_92mph_corr_CG,'L ineWidth',2) title('Drag Polar at 92mph') xlabel('C_L') ylabel('C_D') figure plot(alpha_cruise_92mph_corr,CMs_cruise_92mph_corr_CG,'b','L ineWidth',2) hold on plot(alpha_cruise_92mph_corr,CM_cruise_92mph_alpha_Eq,'-- k','LineWidth',2) title('Moment Coefficient vs. Angle of Attack') xlabel('Angle of Attack (Deg.)') ylabel('C_m') legend('Wind Tunnel Result','Linear Fit','Location','SouthEast') figure plot(CLs_cruise_92mph_corr_CG,CMs_cruise_92mph_corr_CG,' b','LineWidth',2) hold on plot(CLs_cruise_92mph_corr_CG,CM_cruise_92mph_CL_Eq,'-- k','LineWidth',2) title('Moment Coefficient vs. Lift Coefficient at 92mph') xlabel('C_L') ylabel('C_m') legend('Wind Tunnel Result','LinearFit','location','SouthEast') figure plot(alpha_cruise_92mph_corr,CLRs_cruise_92mph_corr_CG,'Lin eWidth',2) title('Rolling Moment Coefficient vs. Angle of Attack at 92mph') xlabel('Angle of Attack (Degrees)') ylabel('C_Lroll') figure plot(alpha_cruise_92mph_corr,CNs_cruise_92mph_corr_CG,'Line Width',2) title('Yawing Moment Coefficient vs. Angle of Attack at 92mph') xlabel('Angle of Attack (Degrees)') ylabel('C_N') %% Zero Reference for Stability Analysis %import .dat file to matlab [Data,SizeData] = importfile('zero_reference_control.dat', 2); %Substract First Row which to substract Zero offset error for i = 2:1:SizeData(1) Data(i,:) = Data(i,:) - Data(1,:); end alpha_zero_reference_control = Data(2:end,1); %AoA vector in Deg. Lift_zero_reference_control = Data(2:end,2); %Lift Vector in lbs. Drag_zero_reference_control = Data(2:end,3); %Drag Vector in lbs. Pitch_zero_reference_control = Data(2:end,4)*in_2_ft; %Pitching Moment Vector in lbs*ft Side_zero_reference_control = Data(2:end,5); %Sideforce Vector in lbs Roll_zero_reference_control = Data(2:end,6)*in_2_ft; %Rolling Moment Vector in lbs*ft Yaw_zero_reference_control = Data(2:end,7)*in_2_ft; %Yawing Moment Vector in lbs*ft %First, we correct for no wind effect Lift_zero_reference_control_corr = Lift_zero_reference_control - Lift_no_wind(4); Drag_zero_reference_control_corr = Drag_zero_reference_control - Drag_no_wind(4); Pitch_zero_reference_control_corr = Pitch_zero_reference_control - Pitch_no_wind(4); Side_zero_reference_control_corr = Side_zero_reference_control - Side_no_wind(4); Roll_zero_reference_control_corr = Roll_zero_reference_control - Roll_no_wind(4); Yaw_zero_reference_control_corr = Yaw_zero_reference_control - Yaw_no_wind(4); %Use Corrected dynamic pressure to compute all coefficients CLs_zero_reference_control_corr = Lift_zero_reference_control_corr/(q_corr_cruise_30mph*Sw); CDs_zero_reference_control_corr = Drag_zero_reference_control_corr/(q_corr_cruise_30mph*Sw); CSFs_zero_reference_control_corr = Side_zero_reference_control_corr/(q_corr_cruise_30mph*Sw); CMs_zero_reference_control_corr = Pitch_zero_reference_control_corr/(q_corr_cruise_30mph*Sw*cba r_w); CLRs_zero_reference_control_corr = Roll_zero_reference_control_corr/(q_corr_cruise_30mph*Sw*cbar _w); CNs_zero_reference_control_corr = Yaw_zero_reference_control_corr/(q_corr_cruise_30mph*Sw*cba r_w); %Now we correct all coefficients for no model error CLs_zero_reference_control_corr = CLs_zero_reference_control_corr - CLs_no_model; CDs_zero_reference_control_corr = CDs_zero_reference_control_corr - CDs_no_model; CSFs_zero_reference_control_corr = CSFs_zero_reference_control_corr - CSFs_no_model; CMs_zero_reference_control_corr = CMs_zero_reference_control_corr - CMs_no_model; CLRs_zero_reference_control_corr = CLRs_zero_reference_control_corr - CLRs_no_model; CNs_zero_reference_control_corr = CNs_zero_reference_control_corr - CNs_no_model; %Compute AoA correction Vector Delta_alpha_zero_reference_control = Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_zero_reference_control_ corr; %Corrected AoA alpha_zero_reference_control_corr = alpha_zero_reference_control + Delta_alpha_zero_reference_control; %Drag Wall Correction Delta_Cd_zero_reference_control = Delta*(Sw/Acs)*(CLs_zero_reference_control_corr.^2);
  • 50.
    49 American Institute ofAeronautics and Astronautics %Tail Moment Coefficient Correction Vector Delta_Cm_CG_zero_reference_control = DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*... CLs_zero_reference_control_corr; %Now we translate the Loads and moments from Balance Center to CG %Loads_CG = Loads_Balance %Moments_CG = Moment_Balance CLs_zero_reference_control_corr_CG = CLs_zero_reference_control_corr; CDs_zero_reference_control_corr_CG = CDs_zero_reference_control_corr + Delta_Cd_zero_reference_control; CSFs_zero_reference_control_corr_CG = CSFs_zero_reference_control_corr; CMs_zero_reference_control_corr_CG = (CMs_zero_reference_control_corr +... CLs_zero_reference_control_corr*(X_balance_CG/cbar_w)-... CDs_zero_reference_control_corr*(Z_balance_CG/cbar_w)) - Delta_Cm_CG_zero_reference_control; CLRs_zero_reference_control_corr_CG = CLRs_zero_reference_control_corr -... CSFs_zero_reference_control_corr*(Z_balance_CG/cbar_w); CNs_zero_reference_control_corr_CG = CNs_zero_reference_control_corr +... CSFs_zero_reference_control_corr*(X_balance_CG/cbar_w); %% Roll Body Stability Analysis %% < < Left Wing 11 Degrees Down > > %Import .dat File into Matlab [Data,SizeData] = importfile('roll_left_wing_11deg_down.dat', 2); %Substract First Row which to substract Zero offset error for i = 2:1:SizeData(1) Data(i,:) = Data(i,:) - Data(1,:); end alpha_roll_11deg_down = Data(2:end,1); %AoA vector in Deg. Lift_roll_11deg_down = Data(2:end,2); %Lift Vector in lbs. Drag_roll_11deg_down = Data(2:end,3); %Drag Vector in lbs. Pitch_roll_11deg_down = Data(2:end,4)*in_2_ft; %Pitching Moment Vector in lbs*ft Side_roll_11deg_down = Data(2:end,5); %Sideforce Vector in lbs Roll_roll_11deg_down = Data(2:end,6)*in_2_ft; %Rolling Moment Vector in lbs*ft Yaw_roll_11deg_down = Data(2:end,7)*in_2_ft; %Yawing Moment Vector in lbs*ft %First, we correct for no wind effect Lift_roll_11deg_down_corr = Lift_roll_11deg_down - Lift_no_wind(4); Drag_roll_11deg_down_corr = Drag_roll_11deg_down - Drag_no_wind(4); Pitch_roll_11deg_down_corr = Pitch_roll_11deg_down - Pitch_no_wind(4); Side_roll_11deg_down_corr = Side_roll_11deg_down - Side_no_wind(4); Roll_roll_11deg_down_corr = Roll_roll_11deg_down - Roll_no_wind(4); Yaw_roll_11deg_down_corr = Yaw_roll_11deg_down - Yaw_no_wind(4); %Use Corrected dynamic pressure to compute all coefficients CLs_roll_11deg_down_corr = Lift_roll_11deg_down_corr/(q_corr_cruise_30mph*Sw); CDs_roll_11deg_down_corr = Drag_roll_11deg_down_corr/(q_corr_cruise_30mph*Sw); CSFs_roll_11deg_down_corr = Side_roll_11deg_down_corr/(q_corr_cruise_30mph*Sw); CMs_roll_11deg_down_corr = Pitch_roll_11deg_down_corr/(q_corr_cruise_30mph*Sw*cbar_w); CLRs_roll_11deg_down_corr = Roll_roll_11deg_down_corr/(q_corr_cruise_30mph*Sw*cbar_w); CNs_roll_11deg_down_corr = Yaw_roll_11deg_down_corr/(q_corr_cruise_30mph*Sw*cbar_w); %Now we correct all coefficients for no model error CLs_roll_11deg_down_corr = CLs_roll_11deg_down_corr - CLs_no_model; CDs_roll_11deg_down_corr = CDs_roll_11deg_down_corr - CDs_no_model; CSFs_roll_11deg_down_corr = CSFs_roll_11deg_down_corr - CSFs_no_model; CMs_roll_11deg_down_corr = CMs_roll_11deg_down_corr - CMs_no_model; CLRs_roll_11deg_down_corr = CLRs_roll_11deg_down_corr - CLRs_no_model; CNs_roll_11deg_down_corr = CNs_roll_11deg_down_corr - CNs_no_model; %Compute AoA correction Vector Delta_alpha_roll_11deg_down = Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_roll_11deg_down_corr; %Corrected AoA alpha_roll_11deg_down_corr = alpha_roll_11deg_down + Delta_alpha_roll_11deg_down; %Drag Wall Correction Delta_Cd_roll_11deg_down = Delta*(Sw/Acs)*(CLs_roll_11deg_down_corr.^2); %Tail Moment Coefficient Correction Vector Delta_Cm_CG_roll_11deg_down = DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*... CLs_roll_11deg_down_corr; %Now we translate the Loads and moments from Balance Center to CG %Loads_CG = Loads_Balance %Moments_CG = Moment_Balance CLs_roll_11deg_down_corr_CG = CLs_roll_11deg_down_corr; CDs_roll_11deg_down_corr_CG = CDs_roll_11deg_down_corr + Delta_Cd_roll_11deg_down; CSFs_roll_11deg_down_corr_CG = CSFs_roll_11deg_down_corr; CMs_roll_11deg_down_corr_CG = (CMs_roll_11deg_down_corr +... CLs_roll_11deg_down_corr*(X_balance_CG/cbar_w)-... CDs_roll_11deg_down_corr*(Z_balance_CG/cbar_w)) - Delta_Cm_CG_roll_11deg_down; CLRs_roll_11deg_down_corr_CG = CLRs_roll_11deg_down_corr -... CSFs_roll_11deg_down_corr*(Z_balance_CG/cbar_w); CNs_roll_11deg_down_corr_CG = CNs_roll_11deg_down_corr +... CSFs_roll_11deg_down_corr*(X_balance_CG/cbar_w); %% < < Left Wing 8 Degrees Up > > %Import .dat File into Matlab [Data,SizeData] = importfile('roll_left_wing_8deg_up.dat', 2);
  • 51.
    50 American Institute ofAeronautics and Astronautics %Substract First Row which to substract Zero offset error for i = 2:1:SizeData(1) Data(i,:) = Data(i,:) - Data(1,:); end alpha_roll_8deg_up = Data(2:end,1); %AoA vector in Deg. Lift_roll_8deg_up = Data(2:end,2); %Lift Vector in lbs. Drag_roll_8deg_up = Data(2:end,3); %Drag Vector in lbs. Pitch_roll_8deg_up = Data(2:end,4)*in_2_ft; %Pitching Moment Vector in lbs*ft Side_roll_8deg_up = Data(2:end,5); %Sideforce Vector in lbs Roll_roll_8deg_up = Data(2:end,6)*in_2_ft; %Rolling Moment Vector in lbs*ft Yaw_roll_8deg_up = Data(2:end,7)*in_2_ft; %Yawing Moment Vector in lbs*ft %First, we correct for no wind effect Lift_roll_8deg_up_corr = Lift_roll_8deg_up - Lift_no_wind(4); Drag_roll_8deg_up_corr = Drag_roll_8deg_up - Drag_no_wind(4); Pitch_roll_8deg_up_corr = Pitch_roll_8deg_up - Pitch_no_wind(4); Side_roll_8deg_up_corr = Side_roll_8deg_up - Side_no_wind(4); Roll_roll_8deg_up_corr = Roll_roll_8deg_up - Roll_no_wind(4); Yaw_roll_8deg_up_corr = Yaw_roll_8deg_up - Yaw_no_wind(4); %Use Corrected dynamic pressure to compute all coefficients CLs_roll_8deg_up_corr = Lift_roll_8deg_up_corr/(q_corr_cruise_30mph*Sw); CDs_roll_8deg_up_corr = Drag_roll_8deg_up_corr/(q_corr_cruise_30mph*Sw); CSFs_roll_8deg_up_corr = Side_roll_8deg_up_corr/(q_corr_cruise_30mph*Sw); CMs_roll_8deg_up_corr = Pitch_roll_8deg_up_corr/(q_corr_cruise_30mph*Sw*cbar_w); CLRs_roll_8deg_up_corr = Roll_roll_8deg_up_corr/(q_corr_cruise_30mph*Sw*cbar_w); CNs_roll_8deg_up_corr = Yaw_roll_8deg_up_corr/(q_corr_cruise_30mph*Sw*cbar_w); %Now we correct all coefficients for no model error CLs_roll_8deg_up_corr = CLs_roll_8deg_up_corr - CLs_no_model; CDs_roll_8deg_up_corr = CDs_roll_8deg_up_corr - CDs_no_model; CSFs_roll_8deg_up_corr = CSFs_roll_8deg_up_corr - CSFs_no_model; CMs_roll_8deg_up_corr = CMs_roll_8deg_up_corr - CMs_no_model; CLRs_roll_8deg_up_corr = CLRs_roll_8deg_up_corr - CLRs_no_model; CNs_roll_8deg_up_corr = CNs_roll_8deg_up_corr - CNs_no_model; %Compute AoA correction Vector Delta_alpha_roll_8deg_up = Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_roll_8deg_up_corr; %Corrected AoA alpha_roll_8deg_up_corr = alpha_roll_8deg_up + Delta_alpha_roll_8deg_up; %Drag Wall Correction Delta_Cd_roll_8deg_up = Delta*(Sw/Acs)*(CLs_roll_8deg_up_corr.^2); %Tail Moment Coefficient Correction Vector Delta_Cm_CG_roll_8deg_up = DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*... CLs_roll_8deg_up_corr; %Now we translate the Loads and moments from Balance Center to CG %Loads_CG = Loads_Balance %Moments_CG = Moment_Balance CLs_roll_8deg_up_corr_CG = CLs_roll_8deg_up_corr; CDs_roll_8deg_up_corr_CG = CDs_roll_8deg_up_corr + Delta_Cd_roll_8deg_up; CSFs_roll_8deg_up_corr_CG = CSFs_roll_8deg_up_corr; CMs_roll_8deg_up_corr_CG = (CMs_roll_8deg_up_corr +... CLs_roll_8deg_up_corr*(X_balance_CG/cbar_w)-... CDs_roll_8deg_up_corr*(Z_balance_CG/cbar_w)) - Delta_Cm_CG_roll_8deg_up; CLRs_roll_8deg_up_corr_CG = CLRs_roll_8deg_up_corr -... CSFs_roll_8deg_up_corr*(Z_balance_CG/cbar_w); CNs_roll_8deg_up_corr_CG = CNs_roll_8deg_up_corr +... CSFs_roll_8deg_up_corr*(X_balance_CG/cbar_w); %% < < Left Wing 16 Degrees Up > > %Import .dat File into Matlab [Data,SizeData] = importfile('roll_left_wing_16deg_up.dat', 2); %Substract First Row which to substract Zero offset error for i = 2:1:SizeData(1) Data(i,:) = Data(i,:) - Data(1,:); end alpha_roll_16deg_up = Data(2:end,1); %AoA vector in Deg. Lift_roll_16deg_up = Data(2:end,2); %Lift Vector in lbs. Drag_roll_16deg_up = Data(2:end,3); %Drag Vector in lbs. Pitch_roll_16deg_up = Data(2:end,4)*in_2_ft; %Pitching Moment Vector in lbs*ft Side_roll_16deg_up = Data(2:end,5); %Sideforce Vector in lbs Roll_roll_16deg_up = Data(2:end,6)*in_2_ft; %Rolling Moment Vector in lbs*ft Yaw_roll_16deg_up = Data(2:end,7)*in_2_ft; %Yawing Moment Vector in lbs*ft %First, we correct for no wind effect Lift_roll_16deg_up_corr = Lift_roll_16deg_up - Lift_no_wind(4); Drag_roll_16deg_up_corr = Drag_roll_16deg_up - Drag_no_wind(4); Pitch_roll_16deg_up_corr = Pitch_roll_16deg_up - Pitch_no_wind(4); Side_roll_16deg_up_corr = Side_roll_16deg_up - Side_no_wind(4); Roll_roll_16deg_up_corr = Roll_roll_16deg_up - Roll_no_wind(4); Yaw_roll_16deg_up_corr = Yaw_roll_16deg_up - Yaw_no_wind(4); %Use Corrected dynamic pressure to compute all coefficients CLs_roll_16deg_up_corr = Lift_roll_16deg_up_corr/(q_corr_cruise_30mph*Sw); CDs_roll_16deg_up_corr = Drag_roll_16deg_up_corr/(q_corr_cruise_30mph*Sw); CSFs_roll_16deg_up_corr = Side_roll_16deg_up_corr/(q_corr_cruise_30mph*Sw); CMs_roll_16deg_up_corr = Pitch_roll_16deg_up_corr/(q_corr_cruise_30mph*Sw*cbar_w); CLRs_roll_16deg_up_corr = Roll_roll_16deg_up_corr/(q_corr_cruise_30mph*Sw*cbar_w); CNs_roll_16deg_up_corr = Yaw_roll_16deg_up_corr/(q_corr_cruise_30mph*Sw*cbar_w); %Now we correct all coefficients for no model error
  • 52.
    51 American Institute ofAeronautics and Astronautics CLs_roll_16deg_up_corr = CLs_roll_16deg_up_corr - CLs_no_model; CDs_roll_16deg_up_corr = CDs_roll_16deg_up_corr - CDs_no_model; CSFs_roll_16deg_up_corr = CSFs_roll_16deg_up_corr - CSFs_no_model; CMs_roll_16deg_up_corr = CMs_roll_16deg_up_corr - CMs_no_model; CLRs_roll_16deg_up_corr = CLRs_roll_16deg_up_corr - CLRs_no_model; CNs_roll_16deg_up_corr = CNs_roll_16deg_up_corr - CNs_no_model; %Compute AoA correction Vector Delta_alpha_roll_16deg_up = Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_roll_16deg_up_corr; %Corrected AoA alpha_roll_16deg_up_corr = alpha_roll_16deg_up + Delta_alpha_roll_16deg_up; %Drag Wall Correction Delta_Cd_roll_16deg_up = Delta*(Sw/Acs)*(CLs_roll_16deg_up_corr.^2); %Tail Moment Coefficient Correction Vector Delta_Cm_CG_roll_16deg_up = DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*... CLs_roll_16deg_up_corr; %Now we translate the Loads and moments from Balance Center to CG %Loads_CG = Loads_Balance %Moments_CG = Moment_Balance CLs_roll_16deg_up_corr_CG = CLs_roll_16deg_up_corr; CDs_roll_16deg_up_corr_CG = CDs_roll_16deg_up_corr + Delta_Cd_roll_16deg_up; CSFs_roll_16deg_up_corr_CG = CSFs_roll_16deg_up_corr; CMs_roll_16deg_up_corr_CG = (CMs_roll_16deg_up_corr +... CLs_roll_16deg_up_corr*(X_balance_CG/cbar_w)-... CDs_roll_16deg_up_corr*(Z_balance_CG/cbar_w)) - Delta_Cm_CG_roll_16deg_up; CLRs_roll_16deg_up_corr_CG = CLRs_roll_16deg_up_corr -... CSFs_roll_16deg_up_corr*(Z_balance_CG/cbar_w); CNs_roll_16deg_up_corr_CG = CNs_roll_16deg_up_corr +... CSFs_roll_16deg_up_corr*(X_balance_CG/cbar_w); CLRs_wing_incidence = [CLRs_roll_11deg_down_corr_CG... CLRs_zero_reference_control_corr_CG... CLRs_roll_8deg_up_corr_CG... CLRs_roll_16deg_up_corr_CG]; CNs_wing_incidence = [CNs_roll_11deg_down_corr_CG... CNs_zero_reference_control_corr_CG... CNs_roll_8deg_up_corr_CG... CNs_roll_16deg_up_corr_CG]; Wing_incidence_angles = [-11 0 8 16]; CLR_Wing_incidence_fit = polyfit(Wing_incidence_angles,CLRs_wing_incidence,1); CN_Wing_incidecne_fit = polyfit(Wing_incidence_angles,CNs_wing_incidence,1); CLRs_Equation_incidence = polyval(CLR_Wing_incidence_fit,Wing_incidence_angles); CNs_Equation_incidence = polyval(CN_Wing_incidecne_fit,Wing_incidence_angles); %Compute Stability Derivative DCLroll_Di = CLR_Wing_incidence_fit(1); %1/deg DCN_Di = CN_Wing_incidecne_fit(1); %SHould be negative, it is positive probably due to decrease in Drag as AoA increases!! %{%} figure plot(Wing_incidence_angles,CLRs_wing_incidence,'b','LineWidth' ,2) hold on plot(Wing_incidence_angles,CLRs_Equation_incidence,'-- k','LineWidth',2) title('Rolling Moment Coefficient vs. Wing Incidence Angle') xlabel('Wing Incidence Angle (Deg.)') ylabel('C_Lroll') legend('Wind Tunel Result','Linear Fit','Location','SouthEast') figure plot(Wing_incidence_angles,CNs_wing_incidence,'b','LineWidth', 2) hold on plot(Wing_incidence_angles,CNs_Equation_incidence,'-- k','LineWidth',2) title('Yawing Moment Coefficient vs. Wing Incidence Angle') xlabel('Wing Incidence Angle (Deg.)') ylabel('C_N') legend('Wind Tunel Result','Linear Fit','Location','SouthEast') %% Yaw Body Stability Analysis % < < Sideslip = 8 Deg. Counterclockwise > > %Import .dat File into Matlab [Data,SizeData] = importfile('yaw_8deg_counterclockwise.dat', 2); %Substract First Row which to substract Zero offset error for i = 2:1:SizeData(1) Data(i,:) = Data(i,:) - Data(1,:); end alpha_yaw_8deg_counter = Data(2:end,1); %AoA vector in Deg. Lift_yaw_8deg_counter = Data(2:end,2); %Lift Vector in lbs. Drag_yaw_8deg_counter = Data(2:end,3); %Drag Vector in lbs. Pitch_yaw_8deg_counter = Data(2:end,4)*in_2_ft; %Pitching Moment Vector in lbs*ft Side_yaw_8deg_counter = Data(2:end,5); %Sideforce Vector in lbs Roll_yaw_8deg_counter = Data(2:end,6)*in_2_ft; %Rolling Moment Vector in lbs*ft Yaw_yaw_8deg_counter = Data(2:end,7)*in_2_ft; %Yawing Moment Vector in lbs*ft %First, we correct for no wind effect Lift_yaw_8deg_counter_corr = Lift_yaw_8deg_counter - Lift_no_wind(4); Drag_yaw_8deg_counter_corr = Drag_yaw_8deg_counter - Drag_no_wind(4); Pitch_yaw_8deg_counter_corr = Pitch_yaw_8deg_counter - Pitch_no_wind(4); Side_yaw_8deg_counter_corr = Side_yaw_8deg_counter - Side_no_wind(4); Roll_yaw_8deg_counter_corr = Roll_yaw_8deg_counter - Roll_no_wind(4); Yaw_yaw_8deg_counter_corr = Yaw_yaw_8deg_counter - Yaw_no_wind(4); %Use Corrected dynamic pressure to compute all coefficients CLs_yaw_8deg_counter_corr = Lift_yaw_8deg_counter_corr/(q_corr_cruise_30mph*Sw);
  • 53.
    52 American Institute ofAeronautics and Astronautics CDs_yaw_8deg_counter_corr = Drag_yaw_8deg_counter_corr/(q_corr_cruise_30mph*Sw); CSFs_yaw_8deg_counter_corr = Side_yaw_8deg_counter_corr/(q_corr_cruise_30mph*Sw); CMs_yaw_8deg_counter_corr = Pitch_yaw_8deg_counter_corr/(q_corr_cruise_30mph*Sw*cbar_w ); CLRs_yaw_8deg_counter_corr = Roll_yaw_8deg_counter_corr/(q_corr_cruise_30mph*Sw*cbar_w) ; CNs_yaw_8deg_counter_corr = Yaw_yaw_8deg_counter_corr/(q_corr_cruise_30mph*Sw*cbar_w ); %Now we correct all coefficients for no model error CLs_yaw_8deg_counter_corr = CLs_yaw_8deg_counter_corr - CLs_no_model; CDs_yaw_8deg_counter_corr = CDs_yaw_8deg_counter_corr - CDs_no_model; CSFs_yaw_8deg_counter_corr = CSFs_yaw_8deg_counter_corr - CSFs_no_model; CMs_yaw_8deg_counter_corr = CMs_yaw_8deg_counter_corr - CMs_no_model; CLRs_yaw_8deg_counter_corr = CLRs_yaw_8deg_counter_corr - CLRs_no_model; CNs_yaw_8deg_counter_corr = CNs_yaw_8deg_counter_corr - CNs_no_model; %Compute AoA correction Vector Delta_alpha_yaw_8deg_counter = Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_yaw_8deg_counter_corr ; %Corrected AoA alpha_yaw_8deg_counter_corr = alpha_yaw_8deg_counter + Delta_alpha_yaw_8deg_counter; %Drag Wall Correction Delta_Cd_yaw_8deg_counter = Delta*(Sw/Acs)*(CLs_yaw_8deg_counter_corr.^2); %Tail Moment Coefficient Correction Vector Delta_Cm_CG_yaw_8deg_counter = DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*... CLs_yaw_8deg_counter_corr; %Now we translate the Loads and moments from Balance Center to CG %Loads_CG = Loads_Balance %Moments_CG = Moment_Balance CLs_yaw_8deg_counter_corr_CG = CLs_yaw_8deg_counter_corr; CDs_yaw_8deg_counter_corr_CG = CDs_yaw_8deg_counter_corr + Delta_Cd_yaw_8deg_counter; CSFs_yaw_8deg_counter_corr_CG = CSFs_yaw_8deg_counter_corr; CMs_yaw_8deg_counter_corr_CG = (CMs_yaw_8deg_counter_corr +... CLs_yaw_8deg_counter_corr*(X_balance_CG/cbar_w)-... CDs_yaw_8deg_counter_corr*(Z_balance_CG/cbar_w)) - Delta_Cm_CG_yaw_8deg_counter; CLRs_yaw_8deg_counter_corr_CG = CLRs_yaw_8deg_counter_corr -... CSFs_yaw_8deg_counter_corr*(Z_balance_CG/cbar_w); CNs_yaw_8deg_counter_corr_CG = CNs_yaw_8deg_counter_corr +... CSFs_yaw_8deg_counter_corr*(X_balance_CG/cbar_w); % < < Sideslip = 9 Deg. clockwise > > %Import .dat File into Matlab [Data,SizeData] = importfile('yaw_9deg_clockwise.dat', 2); %Substract First Row which to substract Zero offset error for i = 2:1:SizeData(1) Data(i,:) = Data(i,:) - Data(1,:); end alpha_yaw_9deg_colockw = Data(2:end,1); %AoA vector in Deg. Lift_yaw_9deg_colockw = Data(2:end,2); %Lift Vector in lbs. Drag_yaw_9deg_colockw = Data(2:end,3); %Drag Vector in lbs. Pitch_yaw_9deg_colockw = Data(2:end,4)*in_2_ft; %Pitching Moment Vector in lbs*ft Side_yaw_9deg_colockw = Data(2:end,5); %Sideforce Vector in lbs Roll_yaw_9deg_colockw = Data(2:end,6)*in_2_ft; %Rolling Moment Vector in lbs*ft Yaw_yaw_9deg_colockw = Data(2:end,7)*in_2_ft; %Yawing Moment Vector in lbs*ft %First, we correct for no wind effect Lift_yaw_9deg_colockw_corr = Lift_yaw_9deg_colockw - Lift_no_wind(4); Drag_yaw_9deg_colockw_corr = Drag_yaw_9deg_colockw - Drag_no_wind(4); Pitch_yaw_9deg_colockw_corr = Pitch_yaw_9deg_colockw - Pitch_no_wind(4); Side_yaw_9deg_colockw_corr = Side_yaw_9deg_colockw - Side_no_wind(4); Roll_yaw_9deg_colockw_corr = Roll_yaw_9deg_colockw - Roll_no_wind(4); Yaw_yaw_9deg_colockw_corr = Yaw_yaw_9deg_colockw - Yaw_no_wind(4); %Use Corrected dynamic pressure to compute all coefficients CLs_yaw_9deg_colockw_corr = Lift_yaw_9deg_colockw_corr/(q_corr_cruise_30mph*Sw); CDs_yaw_9deg_colockw_corr = Drag_yaw_9deg_colockw_corr/(q_corr_cruise_30mph*Sw); CSFs_yaw_9deg_colockw_corr = Side_yaw_9deg_colockw_corr/(q_corr_cruise_30mph*Sw); CMs_yaw_9deg_colockw_corr = Pitch_yaw_9deg_colockw_corr/(q_corr_cruise_30mph*Sw*cbar_ w); CLRs_yaw_9deg_colockw_corr = Roll_yaw_9deg_colockw_corr/(q_corr_cruise_30mph*Sw*cbar_w ); CNs_yaw_9deg_colockw_corr = Yaw_yaw_9deg_colockw_corr/(q_corr_cruise_30mph*Sw*cbar_ w); %Now we correct all coefficients for no model error CLs_yaw_9deg_colockw_corr = CLs_yaw_9deg_colockw_corr - CLs_no_model; CDs_yaw_9deg_colockw_corr = CDs_yaw_9deg_colockw_corr - CDs_no_model; CSFs_yaw_9deg_colockw_corr = CSFs_yaw_9deg_colockw_corr - CSFs_no_model; CMs_yaw_9deg_colockw_corr = CMs_yaw_9deg_colockw_corr - CMs_no_model; CLRs_yaw_9deg_colockw_corr = CLRs_yaw_9deg_colockw_corr - CLRs_no_model; CNs_yaw_9deg_colockw_corr = CNs_yaw_9deg_colockw_corr - CNs_no_model; %Compute AoA correction Vector
  • 54.
    53 American Institute ofAeronautics and Astronautics Delta_alpha_yaw_9deg_colockw = Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_yaw_9deg_colockw_cor r; %Corrected AoA alpha_yaw_9deg_colockw_corr = alpha_yaw_9deg_colockw + Delta_alpha_yaw_9deg_colockw; %Drag Wall Correction Delta_Cd_yaw_9deg_colockw = Delta*(Sw/Acs)*(CLs_yaw_9deg_colockw_corr.^2); %Tail Moment Coefficient Correction Vector Delta_Cm_CG_yaw_9deg_colockw = DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*... CLs_yaw_9deg_colockw_corr; %Now we translate the Loads and moments from Balance Center to CG %Loads_CG = Loads_Balance %Moments_CG = Moment_Balance CLs_yaw_9deg_colockw_corr_CG = CLs_yaw_9deg_colockw_corr; CDs_yaw_9deg_colockw_corr_CG = CDs_yaw_9deg_colockw_corr + Delta_Cd_yaw_9deg_colockw; CSFs_yaw_9deg_colockw_corr_CG = CSFs_yaw_9deg_colockw_corr; CMs_yaw_9deg_colockw_corr_CG = (CMs_yaw_9deg_colockw_corr +... CLs_yaw_9deg_colockw_corr*(X_balance_CG/cbar_w)-... CDs_yaw_9deg_colockw_corr*(Z_balance_CG/cbar_w)) - Delta_Cm_CG_yaw_9deg_colockw; CLRs_yaw_9deg_colockw_corr_CG = CLRs_yaw_9deg_colockw_corr -... CSFs_yaw_9deg_colockw_corr*(Z_balance_CG/cbar_w); CNs_yaw_9deg_colockw_corr_CG = CNs_yaw_9deg_colockw_corr +... CSFs_yaw_9deg_colockw_corr*(X_balance_CG/cbar_w); CNs_beta_sweep = [CNs_yaw_8deg_counter_corr_CG... CNs_zero_reference_control_corr_CG... CNs_yaw_9deg_colockw_corr_CG]; CLRs_beta_sweep = [CLRs_yaw_8deg_counter_corr_CG... CLRs_zero_reference_control_corr_CG... CLRs_yaw_9deg_colockw_corr_CG]; beta_angles = [-8 0 9]; CN_beta_fit = polyfit(beta_angles,CNs_beta_sweep,1); CLR_beta_fit = polyfit(beta_angles,CLRs_beta_sweep,1); CLRs_Equation_beta = polyval(CLR_beta_fit,beta_angles); CNs_Equation_beta = polyval(CN_beta_fit,beta_angles); %Compute Stability Derivative DCLroll_DBeta = CLR_beta_fit(1); %1/deg DCN_DBeta = CN_beta_fit(1); %{%} figure plot(beta_angles,CLRs_beta_sweep,'b','LineWidth',2) hold on plot(beta_angles,CLRs_Equation_beta,'--k','LineWidth',2) title('Rolling Moment Coefficient vs. Sideslip Angle') xlabel('Sideslip Angle (Deg.)') ylabel('C_Lroll') legend('Wind Tunel Result','Linear Fit','Location','SouthEast') figure plot(beta_angles,CNs_beta_sweep,'b','LineWidth',2) hold on plot(beta_angles,CNs_Equation_beta,'--k','LineWidth',2) title('Yawing Moment Coefficient vs. Sideslip Angle') xlabel('Sideslip Angle (Deg.)') ylabel('C_N') legend('Wind Tunel Result','Linear Fit','Location','SouthEast') %% Pitch Body Stability Analysis %% < < Tail 5 Degrees Down > > %Import .dat File into Matlab [Data,SizeData] = importfile('pitch_5deg_down.dat', 2); %Substract First Row which to substract Zero offset error for i = 2:1:SizeData(1) Data(i,:) = Data(i,:) - Data(1,:); end alpha_pitch_5deg_down = Data(2:end,1); %AoA vector in Deg. Lift_pitch_5deg_down = Data(2:end,2); %Lift Vector in lbs. Drag_pitch_5deg_down = Data(2:end,3); %Drag Vector in lbs. Pitch_pitch_5deg_down = Data(2:end,4)*in_2_ft; %Pitching Moment Vector in lbs*ft Side_pitch_5deg_down = Data(2:end,5); %Sideforce Vector in lbs Roll_pitch_5deg_down = Data(2:end,6)*in_2_ft; %Rolling Moment Vector in lbs*ft Yaw_pitch_5deg_down = Data(2:end,7)*in_2_ft; %Yawing Moment Vector in lbs*ft %First, we correct for no wind effect Lift_pitch_5deg_down_corr = Lift_pitch_5deg_down - Lift_no_wind(4); Drag_pitch_5deg_down_corr = Drag_pitch_5deg_down - Drag_no_wind(4); Pitch_pitch_5deg_down_corr = Pitch_pitch_5deg_down - Pitch_no_wind(4); Side_pitch_5deg_down_corr = Side_pitch_5deg_down - Side_no_wind(4); Roll_pitch_5deg_down_corr = Roll_pitch_5deg_down - Roll_no_wind(4); Yaw_pitch_5deg_down_corr = Yaw_pitch_5deg_down - Yaw_no_wind(4); %Use Corrected dynamic pressure to compute all coefficients CLs_pitch_5deg_down_corr = Lift_pitch_5deg_down_corr/(q_corr_cruise_30mph*Sw); CDs_pitch_5deg_down_corr = Drag_pitch_5deg_down_corr/(q_corr_cruise_30mph*Sw); CSFs_pitch_5deg_down_corr = Side_pitch_5deg_down_corr/(q_corr_cruise_30mph*Sw); CMs_pitch_5deg_down_corr = Pitch_pitch_5deg_down_corr/(q_corr_cruise_30mph*Sw*cbar_w) ; CLRs_pitch_5deg_down_corr = Roll_pitch_5deg_down_corr/(q_corr_cruise_30mph*Sw*cbar_w); CNs_pitch_5deg_down_corr = Yaw_pitch_5deg_down_corr/(q_corr_cruise_30mph*Sw*cbar_w); %Now we correct all coefficients for no model error CLs_pitch_5deg_down_corr = CLs_pitch_5deg_down_corr - CLs_no_model; CDs_pitch_5deg_down_corr = CDs_pitch_5deg_down_corr - CDs_no_model; CSFs_pitch_5deg_down_corr = CSFs_pitch_5deg_down_corr - CSFs_no_model;
  • 55.
    54 American Institute ofAeronautics and Astronautics CMs_pitch_5deg_down_corr = CMs_pitch_5deg_down_corr - CMs_no_model; CLRs_pitch_5deg_down_corr = CLRs_pitch_5deg_down_corr - CLRs_no_model; CNs_pitch_5deg_down_corr = CNs_pitch_5deg_down_corr - CNs_no_model; %Compute AoA correction Vector Delta_alpha_pitch_5deg_down = Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_pitch_5deg_down_corr; %Corrected AoA alpha_pitch_5deg_down_corr = alpha_pitch_5deg_down + Delta_alpha_pitch_5deg_down; %Drag Wall Correction Delta_Cd_pitch_5deg_down = Delta*(Sw/Acs)*(CLs_pitch_5deg_down_corr.^2); %Tail Moment Coefficient Correction Vector Delta_Cm_CG_pitch_5deg_down = DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*... CLs_pitch_5deg_down_corr; %Now we translate the Loads and moments from Balance Center to CG %Loads_CG = Loads_Balance %Moments_CG = Moment_Balance CLs_pitch_5deg_down_corr_CG = CLs_pitch_5deg_down_corr; CDs_pitch_5deg_down_corr_CG = CDs_pitch_5deg_down_corr + Delta_Cd_pitch_5deg_down; CSFs_pitch_5deg_down_corr_CG = CSFs_pitch_5deg_down_corr; CMs_pitch_5deg_down_corr_CG = (CMs_pitch_5deg_down_corr +... CLs_pitch_5deg_down_corr*(X_balance_CG/cbar_w)-... CDs_pitch_5deg_down_corr*(Z_balance_CG/cbar_w)) - Delta_Cm_CG_pitch_5deg_down; CLRs_pitch_5deg_down_corr_CG = CLRs_pitch_5deg_down_corr -... CSFs_pitch_5deg_down_corr*(Z_balance_CG/cbar_w); CNs_pitch_5deg_down_corr_CG = CNs_pitch_5deg_down_corr +... CSFs_pitch_5deg_down_corr*(X_balance_CG/cbar_w); %% < < Tail 10 Degrees Up > > %Import .dat File into Matlab [Data,SizeData] = importfile('pitch_10deg_up.dat', 2); %Substract First Row which to substract Zero offset error for i = 2:1:SizeData(1) Data(i,:) = Data(i,:) - Data(1,:); end alpha_pitch_10deg_up = Data(2:end,1); %AoA vector in Deg. Lift_pitch_10deg_up = Data(2:end,2); %Lift Vector in lbs. Drag_pitch_10deg_up = Data(2:end,3); %Drag Vector in lbs. Pitch_pitch_10deg_up = Data(2:end,4)*in_2_ft; %Pitching Moment Vector in lbs*ft Side_pitch_10deg_up = Data(2:end,5); %Sideforce Vector in lbs Roll_pitch_10deg_up = Data(2:end,6)*in_2_ft; %Rolling Moment Vector in lbs*ft Yaw_pitch_10deg_up = Data(2:end,7)*in_2_ft; %Yawing Moment Vector in lbs*ft %First, we correct for no wind effect Lift_pitch_10deg_up_corr = Lift_pitch_10deg_up - Lift_no_wind(4); Drag_pitch_10deg_up_corr = Drag_pitch_10deg_up - Drag_no_wind(4); Pitch_pitch_10deg_up_corr = Pitch_pitch_10deg_up - Pitch_no_wind(4); Side_pitch_10deg_up_corr = Side_pitch_10deg_up - Side_no_wind(4); Roll_pitch_10deg_up_corr = Roll_pitch_10deg_up - Roll_no_wind(4); Yaw_pitch_10deg_up_corr = Yaw_pitch_10deg_up - Yaw_no_wind(4); %Use Corrected dynamic pressure to compute all coefficients CLs_pitch_10deg_up_corr = Lift_pitch_10deg_up_corr/(q_corr_cruise_30mph*Sw); CDs_pitch_10deg_up_corr = Drag_pitch_10deg_up_corr/(q_corr_cruise_30mph*Sw); CSFs_pitch_10deg_up_corr = Side_pitch_10deg_up_corr/(q_corr_cruise_30mph*Sw); CMs_pitch_10deg_up_corr = Pitch_pitch_10deg_up_corr/(q_corr_cruise_30mph*Sw*cbar_w); CLRs_pitch_10deg_up_corr = Roll_pitch_10deg_up_corr/(q_corr_cruise_30mph*Sw*cbar_w); CNs_pitch_10deg_up_corr = Yaw_pitch_10deg_up_corr/(q_corr_cruise_30mph*Sw*cbar_w); %Now we correct all coefficients for no model error CLs_pitch_10deg_up_corr = CLs_pitch_10deg_up_corr - CLs_no_model; CDs_pitch_10deg_up_corr = CDs_pitch_10deg_up_corr - CDs_no_model; CSFs_pitch_10deg_up_corr = CSFs_pitch_10deg_up_corr - CSFs_no_model; CMs_pitch_10deg_up_corr = CMs_pitch_10deg_up_corr - CMs_no_model; CLRs_pitch_10deg_up_corr = CLRs_pitch_10deg_up_corr - CLRs_no_model; CNs_pitch_10deg_up_corr = CNs_pitch_10deg_up_corr - CNs_no_model; %Compute AoA correction Vector Delta_alpha_pitch_10deg_up = Delta*(1+Tau2)*(Sw/Acs)*(180/pi)*CLs_pitch_10deg_up_corr; %Corrected AoA alpha_pitch_10deg_up_corr = alpha_pitch_10deg_up + Delta_alpha_pitch_10deg_up; %Drag Wall Correction Delta_Cd_pitch_10deg_up = Delta*(Sw/Acs)*(CLs_pitch_10deg_up_corr.^2); %Tail Moment Coefficient Correction Vector Delta_Cm_CG_pitch_10deg_up = DCmcg_Ddelta*(Sw/Acs)*(180/pi)*Delta*Tau2*... CLs_pitch_10deg_up_corr; %Now we translate the Loads and moments from Balance Center to CG %Loads_CG = Loads_Balance %Moments_CG = Moment_Balance CLs_pitch_10deg_up_corr_CG = CLs_pitch_10deg_up_corr; CDs_pitch_10deg_up_corr_CG = CDs_pitch_10deg_up_corr + Delta_Cd_pitch_10deg_up; CSFs_pitch_10deg_up_corr_CG = CSFs_pitch_10deg_up_corr; CMs_pitch_10deg_up_corr_CG = (CMs_pitch_10deg_up_corr -... CLs_pitch_10deg_up_corr*(X_balance_CG/cbar_w)+... CDs_pitch_10deg_up_corr*(Z_balance_CG/cbar_w)) - Delta_Cm_CG_pitch_10deg_up;
  • 56.
    55 American Institute ofAeronautics and Astronautics CLRs_pitch_10deg_up_corr_CG = CLRs_pitch_10deg_up_corr - ... CSFs_pitch_10deg_up_corr*(Z_balance_CG/cbar_w); CNs_pitch_10deg_up_corr_CG = CNs_pitch_10deg_up_corr +... CSFs_pitch_10deg_up_corr*(X_balance_CG/cbar_w); CLs_Tail_incidence_sweep = [CLs_pitch_5deg_down_corr_CG... CLs_zero_reference_control_corr_CG... CLs_pitch_10deg_up_corr_CG]; CMs_Tail_incidence_sweep = [CMs_pitch_5deg_down_corr_CG... CMs_zero_reference_control_corr_CG... CMs_pitch_10deg_up_corr_CG]; Tail_incidence_angles = [-5 0 10]; CM_tail_incidence_fit = polyfit(Tail_incidence_angles,CMs_Tail_incidence_sweep,1); CL_tail_incidence_fit = polyfit(Tail_incidence_angles,CLs_Tail_incidence_sweep,1); CLs_Equation_tail_incidence = polyval(CL_tail_incidence_fit,Tail_incidence_angles); CMs_Equation_tail_incidence = polyval(CM_tail_incidence_fit,Tail_incidence_angles); %Compute Stability Derivative DCL_DTi = CL_tail_incidence_fit(1); %1/deg DCM_DTi = CM_tail_incidence_fit(1); %1/deg %{%} figure plot(Tail_incidence_angles,CLs_Tail_incidence_sweep,'b','LineWi dth',2) hold on plot(Tail_incidence_angles,CLs_Equation_tail_incidence,'-- k','LineWidth',2) title('Lift Coefficient vs. Tail Incidence Angle') xlabel('Tail Incidence Angle (Deg.)') ylabel('C_L') legend('Wind Tunel Result','Linear Fit','Location','SouthEast') figure plot(Tail_incidence_angles,CMs_Tail_incidence_sweep,'b','LineW idth',2) hold on plot(Tail_incidence_angles,CMs_Equation_tail_incidence,'-- k','LineWidth',2) title('Pitching Moment Coefficient vs. Sideslip Angle') xlabel('Tail Incidence Angle (Deg.)') ylabel('C_m') legend('Wind Tunel Result','Linear Fit','Location','SouthEast') %% Transition Analysis Data % < < Wings 30 Degrees Up > > %import .dat file to matlab [Data,SizeData] = importfile('transition_wing_30deg_up_0_20_30_35_40_45mph.dat ', 2); %Substract First Row which to substract Zero offset error for i = 2:1:SizeData(1) Data(i,:) = Data(i,:) - Data(1,:); end alpha_transition_30deg = Data(2:end,1); %AoA vector in Deg. Lift_transition_30deg = Data(2:end,2); %Lift Vector in lbs. Drag_transition_30deg = Data(2:end,3); %Drag Vector in lbs. Pitch_transition_30deg = Data(2:end,4)*in_2_ft; %Pitching Moment Vector in lbs*ft Side_transition_30deg = Data(2:end,5); %Sideforce Vector in lbs Roll_transition_30deg = Data(2:end,6)*in_2_ft; %Rolling Moment Vector in lbs*ft Yaw_transition_30deg = Data(2:end,7)*in_2_ft; %Yawing Moment Vector in lbs*ft % < < Wings 60 Degrees Up > > %import .dat file to matlab [Data,SizeData] = importfile('transition_wing_60deg_up_0_20_25_30_35.dat', 2); %Substract First Row which to substract Zero offset error for i = 2:1:SizeData(1) Data(i,:) = Data(i,:) - Data(1,:); end alpha_transition_60deg = Data(2:end,1); %AoA vector in Deg. Lift_transition_60deg = Data(2:end,2); %Lift Vector in lbs. Drag_transition_60deg = Data(2:end,3); %Drag Vector in lbs. Pitch_transition_60deg = Data(2:end,4)*in_2_ft; %Pitching Moment Vector in lbs*ft Side_transition_60deg = Data(2:end,5); %Sideforce Vector in lbs Roll_transition_60deg = Data(2:end,6)*in_2_ft; %Rolling Moment Vector in lbs*ft Yaw_transition_60deg = Data(2:end,7)*in_2_ft; %Yawing Moment Vector in lbs*ft % < < Wings 90 Degrees Up > > %import .dat file to matlab [Data,SizeData] = importfile('transition_wing_90deg_up_0_15_20_25_30.dat', 2); %Substract First Row which to substract Zero offset error for i = 2:1:SizeData(1) Data(i,:) = Data(i,:) - Data(1,:); end alpha_transition_90deg = Data(2:end,1); %AoA vector in Deg. Lift_transition_90deg = Data(2:end,2); %Lift Vector in lbs. Drag_transition_90deg = Data(2:end,3); %Drag Vector in lbs. Pitch_transition_90deg = Data(2:end,4)*in_2_ft; %Pitching Moment Vector in lbs*ft Side_transition_90deg = Data(2:end,5); %Sideforce Vector in lbs Roll_transition_90deg = Data(2:end,6)*in_2_ft; %Rolling Moment Vector in lbs*ft Yaw_transition_90deg = Data(2:end,7)*in_2_ft; %Yawing Moment Vector in lbs*ft
  • 57.
    56 American Institute ofAeronautics and Astronautics Appendix IX—Wind Tunnel Data Wind Tunnel Results: -10 -5 0 5 10 15 -0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 Lift Coefficient vs. Angle of Attack at 92mph Angle of Attack (Degrees) C L Wind Tunnel Result Linear Fit 0 0.2 0.4 0.6 0.8 1 1.2 1.4 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 Drag Polar at 92mph CL C D
  • 58.
    57 American Institute ofAeronautics and Astronautics -10 -5 0 5 10 15 -0.5 -0.45 -0.4 -0.35 -0.3 -0.25 -0.2 -0.15 Moment Coefficient vs. Angle of Attack Angle of Attack (Deg.) C m Wind Tunnel Result Linear Fit 0 0.2 0.4 0.6 0.8 1 1.2 1.4 -0.5 -0.45 -0.4 -0.35 -0.3 -0.25 -0.2 -0.15 Moment Coefficient vs. Lift Coefficient at 92mph CL C m Wind Tunnel Result LinearFit -10 -5 0 5 10 15 -0.08 -0.07 -0.06 -0.05 -0.04 -0.03 -0.02 -0.01 Rolling Moment Coefficient vs. Angle of Attack at 92mph Angle of Attack (Degrees) C L roll
  • 59.
    58 American Institute ofAeronautics and Astronautics -10 -5 0 5 10 15 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 Yawing Moment Coefficient vs. Angle of Attack at 92mph Angle of Attack (Degrees) C N -15 -10 -5 0 5 10 15 20 -0.3 -0.25 -0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2 Rolling Moment Coefficient vs. Wing Incidence Angle Wing Incidence Angle (Deg.) C L roll Wind Tunel Result Linear Fit -15 -10 -5 0 5 10 15 20 -0.35 -0.3 -0.25 -0.2 -0.15 -0.1 -0.05 0 0.05 Yawing Moment Coefficient vs. Wing Incidence Angle Wing Incidence Angle (Deg.) C N Wind Tunel Result Linear Fit
  • 60.
    59 American Institute ofAeronautics and Astronautics -8 -6 -4 -2 0 2 4 6 8 10 -0.15 -0.145 -0.14 -0.135 -0.13 -0.125 -0.12 -0.115 -0.11 -0.105 Rolling Moment Coefficient vs. Sideslip Angle Sideslip Angle (Deg.) C L roll Wind Tunel Result Linear Fit -8 -6 -4 -2 0 2 4 6 8 10 -1.2 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 Yawing Moment Coefficient vs. Sideslip Angle Sideslip Angle (Deg.) C N Wind Tunel Result Linear Fit -5 0 5 10 0.4 0.5 0.6 0.7 0.8 0.9 1 Lift Coefficient vs. Tail Incidence Angle Tail Incidence Angle (Deg.) C L Wind Tunel Result Linear Fit
  • 61.
    60 American Institute ofAeronautics and Astronautics Transition Wind Tunnel Data: -5 0 5 10 0.2 0.25 0.3 0.35 0.4 0.45 0.5 Pitching Moment Coefficient vs. Sideslip Angle Sideslip Angle (Deg.) C m Wind Tunel Result Linear Fit
  • 62.
    61 American Institute ofAeronautics and Astronautics Appendix IX—Control Design Longitundal %Senior Design - Paparazzi %Dynamic Stability and Feedback Control clear close all %% Longitudinal State Space %X(1) = udot %X(2) = alphadot %X(3) = thetadot (pitch) %X(4) = qdot %X(5) = hdot % A = [ Xu/m Xw/m 0 -g... % Zu/(m-Zwdot) Zw/(m-Zwdot) (Zq+m*U0)/(m- Zwdot) 0... % (Mu+Zu*Gamma)/Iyy (Mw+Zw*Gamma)/Iyy ((Mq+(Zq+m*U0))*Gamma)/Iyy 0... % 0 0 1 0] %B = [ %% Conversion Factors y = 0.0107x - 0.4115 y = 0.0281x - 0.4924 y = 0.0457x - 0.4233 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0 5 10 15 20 25 Cm Speed (kts) 30 Deg. 60 Deg. 90 Deg.
  • 63.
    62 American Institute ofAeronautics and Astronautics % < < Distance > > nm_2_miles = 1.15078; %multiply to convert from nm to miles miles_2_ft = 5280; %multiply to convert from miles to feet in_2_ft = 1/12; %multiply to convert from in to ft % < < Speed > > kts_2_mph = 1.1508; %multiply to convert from kts to mph kts_2_fps = 1.6878; %multiply to convert from kts to fps mph_2_fps = 1.46667; %multiply to convert from mph to fps % < < Mass > > oz_2_lbs = 1/16; %multiply to convert from oz to lbs % < < Temperature > > fah_2_rank = 460.67; %add to convert from Fahrenheit to Rankine % < < Pressure > > inHg_2_psf = 70.7262; %multiply to convert from inches Mercury to Psf % < < Time > > hour_2_sec = 3600; %multiply to convert from hours to seconds min_2_sec = 60; %multiply to convert from min to seconds % < < Angles > > deg_2_rad = pi/180; %multiply to convert from degrees to radians %% Given Constant Atmospheric Data P_SL = 2116.2; %psf T_SL = 518.69; %Deg. Rankine Rho_SL = 0.002377; %slugs/ft3 Gamma_Air = 1.4; %Constant R_Air = 1716; %Air Constant mu_Air = 3.7424*10^-7; %Air Constant delta_STL = 0.9822; theta_STL_STD = 0.997; theta_STL_Cold = 0.784; theta_STL_Hot = 1.0812; delta_500_STL = 0.9692; theta_500_STL_STD = 0.994; theta_500_STL_Cold = 0.7972; theta_500_STL_Hot = 1.0774; sigma_500_STL = 0.975; mu_500_STL = 3.72497*10^-7; Tatm = T_SL*theta_STL_STD; %Rank Rair = 1716; g = 32.2; %gravity constant in ft/sec2 rho = 0.002377*sigma_500_STL; %Density at trim level mu = (3.62*10^- 7)*((Tatm/518.7)^1.5)*((518.7+198.72)/(Tatm+198.72)); %air viscocity in engineering units at Patm and Tatm %-> Got equation from Introduction to Flight 7th ed. nu = mu/rho; a_SL = 1116; %Speed of Sound at SL in fps %% Vehicle Geometry lH = 16.45; %inches lH = lH*in_2_ft; %ft cbar_w = 8.5; %in cbar_w = cbar_w*in_2_ft; cbar_H = 6.5; cbar_H = cbar_H*in_2_ft; alpha0H = 0; bw = 40; bw = bw*in_2_ft; bH = 22; bH = bH*in_2_ft; Sw = bw*cbar_w; %Wing Planform Area SH = bH*cbar_H; ARw = (bw^2)/Sw; ARH = (bH^2)/SH; ht = lH/cbar_w; hcg = (4*in_2_ft)/cbar_w; VH = (SH*lH)/(Sw*cbar_w); etaH = .9; %assumed due to propeller influence dTh = 0; XdTh = 13.5; XdTh = XdTh*in_2_ft; M = 5.5/g; %mass of the vehicle Imat = [4.214*10^6 1.4502*10^3 -2.5678*10^4;... %in lbs*in^2 1.4502*10^3 4.215*10^6 3.563*10^4;... -2.5678*10^4 3.563*10^4 2.5144*10^5]; Imat = Imat*(in_2_ft^2)/g; %in slugs*ft^2 Iyy = Imat(2,2); %slugs*ft^2 CD0 = 0.02385; %From Drag build-up Excel File %% Trim Conditions U0 = 40; %Trim Speed in fps U0 = U0*kts_2_fps; qinf = 0.5*rho*U0^2; %dynamic pressure at trim qSM = qinf*Sw/M; %Constant in control derivatives qSCIyy = qinf*Sw*cbar_w/Iyy; CL0 = g/qSM; %Lift Coefficient at trim ew = 4.61*(1-0.045*ARw^0.68)-3.1; ewH = 4.61*(1-0.045*ARH^0.68)-3.1; CDt = CD0 + (1/(pi*ARw*ew))*CL0^2; TH_tot = CDt*qinf*Sw; TH_mot = TH_tot/3; alpha0 = 0; Theta_T = 0; Cm0 = 0.025; iH = 1.94*deg_2_rad; %% Stability Derivatives CTh = TH_mot/(qinf*Sw);
  • 64.
    63 American Institute ofAeronautics and Astronautics CD_alpha_fun = [0.04584 0.23491]; %1/rad CD_alpha = polyval(CD_alpha_fun,alpha0); CD_alphadot = 0.04584; CLw_alpha = 4.58; CLH_alpha = 4.12; CLih = CLH_alpha*(etaH)*(SH/Sw);% + CTh; %Since we are including (d/dih)(CTh*sin(ih)) which was approx as slope ih. Cmih = -CLH_alpha*ht*etaH*(SH/Sw); Cm_alphadot = -32.97; %From wind tunnel analysis matlab dE_dalpha = (2*CLw_alpha)/(pi*ARw); CLH0 = CLH_alpha*(((1-dE_dalpha)*alpha0)+iH-alpha0H); CDih = (2*CLH_alpha*CLH0*etaH*(SH/Sw))/(pi*ARH*ewH); Cm_alpha = -0.2406; %1/rad %Cm_alpha = -0.59; %% Control Derivatives Xu_Xpu = qSM*(-1*(((2/U0)*CD0))); %Xalphadot = -qSM*CD_alphadot; Xalphadot = 0; Xalpha = qSM*(CL0-CD_alpha); Xq = 0; Xdih = -qSM*CDih; XdT = qSCIyy*cos(Theta_T)/M; Zu_Zpu = qSM*(-1*((2/U0)*CL0)); Zalpha = qSM*(CD0-CLw_alpha); Zq = -VH*CLw_alpha; Zalphadot = Zq*dE_dalpha; Zih = -qSM*CLih; ZdT = -sin(Theta_T)/M; Mu_Mpu = qSCIyy*((2/U0)*Cm0); Mq = Zq*hcg; Malphadot = qSCIyy*Cm_alphadot; Malpha_Mpalpha = -3.8657; %From Wind Tunnel analysis 1/rad Mih = .5*qinf*Sw*Cmih; MdT = (dTh*cos(Theta_T) - XdTh*sin(Theta_T))/Iyy; %% State Space a11 = Xu_Xpu+((Xalphadot*(Zu_Zpu))/(U0-Zalphadot)); a12 = Xalpha+((Xalphadot*Zalpha)/(U0-Zalphadot)); a13 = -g; a14 = Xq+(Xalphadot*((U0+Zq)/(U0-Zalphadot))); a15 = 0; a21 = ((Zu_Zpu)/(U0-Zalphadot)); a22 = Zalpha/(U0-Zalphadot); a23 = 0; a24 = ((U0+Zq)/(U0-Zalphadot)); a25 = 0; a31 = 0; a32 = 0; a33 = 0; a34 = 1; a35 = 0; a41 = Mu_Mpu + ((Malphadot*Zu_Zpu)/(U0-Zalphadot)); a42 = Malpha_Mpalpha + ((Malphadot*Zalpha)/(U0-Zalphadot)); a43 = 0; a44 = Mq + Malphadot*(((U0+Zq)/(U0-Zalphadot))); a45 = 0; a51 = 0; a52 = -U0; a53 = U0; a54 = 0; a55 = 0; %b11 = Xdih+((Xalphadot*Zih)/(U0-Zalphadot)); b11 = 0; b12 = XdT+((Xalphadot*ZdT)/(U0-Zalphadot)); b21 = Zih/(U0-Zalphadot); b22 = ZdT/(U0-Zalphadot); b31 = 0; b32 = 0; b41 = Mih + ((Malphadot*Zih)/(U0-Zalphadot)); b42 = MdT + ((Malphadot*ZdT)/(U0-Zalphadot)); b51 = 0; b52 = 0; A = [a11 a12 a13 a14 a15;... a21 a22 a23 a24 a25;... a31 a32 a33 a34 a35;... a41 a42 a43 a44 a45;... a51 a52 a53 a54 a55]; B = [b11 b21 b31 b41 b51;... b12 b22 b32 b42 b52]'; % Get the number of states, n, number of controls, m, and the number of % outputs, p. [n,m] = size(B); C = eye(n,n); p = size(C,1); D = zeros(p,m); % Define the state space model. sys_ss = ss(A,B,C,D); % Convert to transfer function. sys_tf = tf(sys_ss); % Convert to zero-pole description. sys_zpk = zpk(sys_ss); % Convert back to state space sys_ssa = ss(sys_tf); %{ %% Simulation of State Space System % Find the characteristic polynomial. CharPoly = poly(A); % Find the system poles. Poles = roots(CharPoly); dt = 0.01; tfinal = 50; time_s = 0:dt:tfinal; % Compute the left eigenvectors of A. These are used in tests for % controllability. [W,Dc] = eig(A.'); W = conj(W); % Compute the right eigenvectors of A. These are used in tests for % observability. [V,Do] = eig(A); %% Initial Simulation t0 = 0:.05:20; u0(2,1:401) = 0; u0(1,1:60) = 3.5/57.3;
  • 65.
    64 American Institute ofAeronautics and Astronautics u0(1,61:120) = 1/57.3; u0(1,121:180) = 3.5/57.3; u0(1,181:401) = 0/57.3; %u0(1,101:401) = 0/57.3; %{ u0(1,41:80) = 0; u0(1,81:120) = 1/57.3; u0(1,121:401) = 0; %} x0 = [67.51;0;0;0;400]; %trim [y1,t1,x1] = lsim(sys_ss,u0,t0,x0); figure subplot(5,1,1) plot(t1,y1(:,1)) xlabel('time (s)') ylabel('speed (fps)') title('Surge Velocity vs. time') subplot(5,1,2) plot(t1,y1(:,2)*57.3) xlabel('time (s)') ylabel('alpha (deg)') subplot(5,1,3) plot(t1,y1(:,3)*57.3) xlabel('time (s)') ylabel('theta (deg)') title('Pitch Attitude vs. time') subplot(5,1,4) plot(t1,y1(:,4)*57.3) xlabel('time (s)') ylabel('Pitch Rate (deg/s)') subplot(5,1,5) plot(t1,y1(:,5)) xlabel('time (s)') ylabel('Altitude (ft)') figure plot(t1,u0(1,:)*57.3) xlabel('time (sec)') ylabel('Tail Incidence Angle (deg.)') %} %% System for Control Acc = A(1:4,1:4); Bcc = B(1:4,1:2); %Bcc = B(1:4,1); [nc,mc] = size(Bcc); Ccc = eye(nc,nc); pcc = size(Ccc,1); Dcc = zeros(pcc,mc); % Define the state space model. sys_cc = ss(Acc,Bcc,Ccc,Dcc); % Convert to transfer function. sys_tf = tf(sys_cc); % Convert to zero-pole description. sys_zpk = zpk(sys_cc); % Convert back to state space sys_ssa = ss(sys_tf); % Find the characteristic polynomial. CharPoly = poly(Acc); % Find the system poles. Poles = roots(CharPoly); % Compute the left eigenvectors of A. These are used in tests for % controllability. [W,Dc] = eig(Acc.'); W = conj(W); % Compute the right eigenvectors of A. These are used in tests for % observability. [V,Do] = eig(Acc); % Damping characteristics damp(Acc) % Compute the controllability matrix, P, using the MATLAB function. P = ctrb(sys_cc); % Determine if the system is controllable by checking the rank of P. % The rank of P should match the number of rows (or columns) of the square % matrix A. if rank(P) == nc disp('The system is controllable.'); else disp('The system is NOT controllable.'); end disp(' '); % Compute the condition number for impending singularity. Cn = cond(Acc); % Degree of Controllability between Mode i and Control j. DoC = zeros(nc,mc); for i = 1:nc for j = 1:mc DoC(i,j) = abs(dot(Bcc(:,j), W(i,:))/norm(Bcc(:,j))/norm(W(i,:))); end end % Compute the inverse matrix Pccfi. Pccfi = zeros(nc,nc); base = CharPoly(nc:-1:2); for i = nc:-1:1 if i == nc % Last row. Set the first element to 1. Pccfi(i,1) = 1; else % Populate the ith row Pccfi(i,1:nc-i+1) = [base(i:end) 1]; end end %{ % Compute the Transformation matrix, Tccf. Tccf = P*Pccfi; % Compute the CCF matrices. Accf = TccfAcc*Tccf; Bccf = TccfBcc; Cccf = Ccc*Tccf; Dccf = Dcc;
  • 66.
    65 American Institute ofAeronautics and Astronautics %} % Compute the observability matrix, Q, using the MATLAB function. Q = obsv(sys_cc); % Determine if the system is observable by checking the rank of Q. % The rank of Q should match the number of rows (or columns) of the square % matrix A. if rank(Q) == nc disp('The system is observable.'); else disp('The system is NOT observable.'); end disp(' '); % Degree of Observability between Mode i and Measurement j. DoO = zeros(pcc,nc); for j = 1:pcc for i = 1:nc DoO(j,i) = abs(dot(Ccc(j,:), V(:,i))/norm(Ccc(j,:))/norm(V(:,i))); end end % Perform a stability analysis using Lyapunov stability. disp('Lyapunov Stability Analysis.'); % Find the poles with zero real part. i_zero_real = find(real(Poles) == 0); if ~isempty(i_zero_real) % Lyapunov stabilty analysis will not work if there is at least one % pole with zero real part. At this point, we can only check for % marginally stable or unstable systems. else % Lyapunov stability analysis will work. % Form a positive definite matrix, Q. Qc = eye(nc); % Solve the Lyapunov equation for P. Pc = lyap(Acc',Qc); % Perform Sylvester's Method to determine if P is positive definite. pm = zeros(1,nc); for i = 1:nc pm(i) = det(Pc(1:i,1:i)); end if all(pm > 0) disp('P is positive definite. System is asymptotically stable.'); elseif any(pm < 0) disp('P is not positive definite. System is unstable.'); else disp('P is positive semi-definite. Try another Q.'); end end % Determine a desired response for the system. Two approaches are % investigated: (1.) second order dominant; (2.) 6th order ITAE. % Specify the overshoot percentage and settling time. PO = 5; ts = 1.5; % Determine damping ratio from PO and natural frequency from settling time % and zeta. term = pi^2 + log(PO/100)^2; zeta = abs(log(PO/100))/sqrt(term); wn = 4/(zeta*ts); % Desired 2nd order system. num2 = wn^2; den2 = [1 2*zeta*wn wn^2]; Des2 = tf(num2,den2); % Dominant 2nd order eigenvalues. DesEig2 = roots(den2); % Get the stepinfo stepinfo(Des2) % Augment with 2 additional poles. Aug4 = zeros(2,1); Aug4(1) = 10*real(DesEig2(1)); Aug4(2) = Aug4(1)-1; % 4th order transfer function with augmented poles, den_Aug4 = conv(den2,conv([1 -Aug4(1)],([1 -Aug4(2)]))); Aug2 = tf(num2, den_Aug4); % Plot the dominant 2nd order response. figure step(Des2, 'b-', Aug2*den_Aug4(end)/num2, 'g--');grid on legend('Desired 2nd', 'Augmented 2nd order'); % Compute the state feedback regulator based upon the augmented 2nd order % system. K = place(Acc,Bcc,[DesEig2;Aug4]); % Form plant system. Set output matrix for state feedback control. sys_p.Ap = Acc; sys_p.Bp = Bcc; sys_p.Cp = eye(nc); sys_p.Dp = zeros(nc,mc); % Form controller system. sys_c.Ac = 0; sys_c.Bc1= 0; sys_c.Bc2= 0; sys_c.Cc = 0; sys_c.Dc1= -K; sys_c.Dc2= zeros(mc,mc); % Form closed loop system. [Acl,Bcl,Ccl,Dcl] = closed_loop_system(sys_p, sys_c); sys_cl = ss(Acl,Bcl,Ccl,Dcl); %% Simulation t = 0:.05:200; x0 = [0;0;1.5/57.3;0]; %trim % Closed-loop response (zero input, ICs). [Yo,t,Xo] = lsim(sys_cc,zeros(numel(t),mc),t,x0); [Yc,t,Xc] = lsim(sys_cl,zeros(numel(t),mc),t,x0);
  • 67.
    66 American Institute ofAeronautics and Astronautics figure plot(Xo(:,3)*57.3,Xo(:,4)*57.3) grid on xlabel('theta, deg.') ylabel('dtheta / dt, deg./s') title('Phase Diagram for Pitch Attitude') % Control signals. u = zeros(numel(t),mc); for i = 1:mc for j = 1:numel(t) u(j,i) = -K(i,:)*Xc(j,:)'; end end % Plot the control signals. figure %subplot(2,1,1); plot(t, u(:,1)*57.3);grid on xlabel('Time, s'); ylabel('di_t (deg.)'); title('Regulating controls vs. Time'); %{ subplot(2,1,2); plot(t, u(:,2));grid on xlabel('Time, s'); ylabel('dThrust, N'); %} % Open-loop and closed loop plots of the model states. figure subplot(4,1,1); plot(t,Xo(:,1),'--b',t,Xc(:,1),'-r');grid on xlabel('Time, s'); ylabel('speed, fps'); title('Model States vs. Time with 0 input and I.C.s') subplot(4,1,2); plot(t,Xo(:,2)*57.3,'--b',t,Xc(:,2)*57.3,'-r');grid on xlabel('Time, s'); ylabel('alpha , rad'); subplot(4,1,3); plot(t,Xo(:,3)*57.3,'--b',t,Xc(:,3)*57.3,'-r');grid on xlabel('Time, s'); ylabel('theta , rad'); subplot(4,1,4); plot(t,Xo(:,4)*57.3,'--b',t,Xc(:,4)*57.3,'-r');grid on xlabel('Time, s'); ylabel('pitch rate, rad/s'); legend('Uncontrolled Response','Controlled Response','Location','NorthEast') Acl2 = zeros(n,n); Acl2(1:4,1:4) = Acl; Acl2(5,:) = A(5,:); sys_cl2 = ss(Acl2,B,C,D); t0 = 0:.05:10; %{%} u0(2,1:401) = 0; u0(1,1:60) = 0/57.3; u0(1,61:100) = 1.5/57.3; u0(1,101:180) = 0/57.3; u0(1,181:220) = -1.5/57.3; u0(1,221:401) = 0/57.3; u01 = 1/57.3*ones(numel(t0),1); u02 = 0*ones(numel(t0),1); u03 = 1*ones(numel(t0),1); xx0 = [0;0;0;0;400]; %trim [y1,t1,x1] = lsim(sys_cl2,[u01 u02],t0,xx0); [y2,t2,x2] = lsim(sys_ss,[u01 u02],t0,xx0); [y3,t3,x3] = lsim(sys_cl2,[u02 u03],t0,xx0); [y4,t4,x4] = lsim(sys_ss,[u02 u03],t0,xx0); figure subplot(5,1,1) plot(t1,y1(:,1),'-r') hold on plot(t1,y2(:,1),'--b') xlabel('time (s)') ylabel('speed (fps)') title('Surge Velocity vs. time') subplot(5,1,2) plot(t1,y1(:,2)*57.3,'-r') hold on plot(t1,y2(:,2)*57.3,'--b') xlabel('time (s)') ylabel('alpha (deg)') subplot(5,1,3) plot(t1,y1(:,3)*57.3,'-r') hold on plot(t1,y2(:,3)*57.3,'--b') xlabel('time (s)') ylabel('theta (deg)') title('Pitch Attitude vs. time') subplot(5,1,4) plot(t1,y1(:,4)*57.3,'-r') hold on plot(t1,y2(:,4)*57.3,'--b') xlabel('time (s)') ylabel('Pitch Rate (deg/s)') title('Pitch Rate vs. time') subplot(5,1,5) plot(t1,y1(:,5),'-r') hold on plot(t1,y2(:,5),'--b') xlabel('time (s)') ylabel('Altitude (ft)') title('Model State vs. Time with 0 I.C.s and Tail Incidence step input') legend('Controlled Response','Uncontrolled Response') figure subplot(5,1,1) plot(t1,y3(:,1),'-r') hold on plot(t1,y4(:,1),'--b') xlabel('time (s)') ylabel('speed (fps)') title('Surge Velocity vs. time') subplot(5,1,2) plot(t1,y3(:,2)*57.3,'-r') hold on plot(t1,y4(:,2)*57.3,'--b') xlabel('time (s)') ylabel('alpha (deg)') subplot(5,1,3) plot(t1,y3(:,3)*57.3,'-r') hold on plot(t1,y4(:,3)*57.3,'--b') xlabel('time (s)') ylabel('theta (deg)') title('Pitch Attitude vs. time') subplot(5,1,4)
  • 68.
    67 American Institute ofAeronautics and Astronautics plot(t1,y3(:,4)*57.3,'-r') hold on plot(t1,y4(:,4)*57.3,'--b') xlabel('time (s)') ylabel('Pitch Rate (deg/s)') title('Pitch Rate vs. time') subplot(5,1,5) plot(t1,y3(:,5),'-r') hold on plot(t1,y4(:,5),'--b') xlabel('time (s)') ylabel('Altitude (ft)') title('Model State vs. Time with 0 I.C.s and Thrust step input') legend('Controlled Response','Uncontrolled Response') t6 = 0:length(u0)-1; %{%} figure plot(t6,u0(1,:)*57.3) xlabel('time (sec)') ylabel('Tail Incidence Angle (deg.)') [y5,t6,x5] = lsim(sys_cl2,u0,t6,xx0); [y6,t6,x6] = lsim(sys_ss,u0,t6,xx0); figure subplot(1,2,1) plot(t6,y5(:,5),'-r') hold on plot(t6,y6(:,5),'--b') xlabel('time (s)') ylabel('Altitude (ft)') subplot(1,2,2) plot(t6,u0(1,:)*57.3) xlabel('time (sec)') ylabel('Tail Incidence Angle (deg.)') title('Altitude vs. Time with Tail Incidence Control') %%%%% SERVO MECHANISM TRACKING %%%%% % Track outputs y1, y2 and y3. CC = zeros(2,5); CC(1,:) = C(1,:); %CC(2,:) = C(3,:); CC(2,:) = C(5,:); Csv = CC; p = 3; % Matrices Asv = zeros(n+m, n+m); Asv(1:n,1:n) = A; Asv(n+1:end,1:n) = -Csv; Bsv = zeros(n+m, m); Bsv(1:n,:) = B; % Gain design. Add 3 additional eigenvalues for each reference. Ksv = place(Asv,Bsv,[DesEig2;Aug4;-6;-12;-7]); Kv = Ksv(:,1:n); kI = -Ksv(:,n+1:end); % Closed loop system % Aclsv = [A-B*Kv, B*kI;-Csv, zeros(p,m)]; % Bclsv = [zeros(n,m);eye(m)]; % Cclsv = [Csv, zeros(m,m)]; % Dclsv = 0; % sys_clsv = ss(Aclsv,Bclsv,Cclsv,Dclsv); % Form plant system. Set output matrix for state feedback control. sys_p.Ap = A; sys_p.Bp = B; sys_p.Cp = eye(n); sys_p.Dp = zeros(n,m); % Form controller system. Tracking on each of the three position states. sys_c.Ac = zeros(m,m); sys_c.Bc1= -CC; sys_c.Bc2= eye(m); sys_c.Cc = kI; sys_c.Dc1= -Kv; sys_p.Dc2= zeros(n,m); % Form closed loop system. [Aclsv, Bclsv, Cclsv, Dclsv] = closed_loop_system(sys_p, sys_c); sys_clsv = ss(Aclsv,Bclsv,Cclsv,Dclsv); % Simulation dt = 0.01; tfinal = 10; t = 0:dt:tfinal; % Simulation #1: r1 = 1, r2 = 1 and r3 = 1. Zero I.C. r1 = ones(numel(t),1); r2 = ones(numel(t),1); %r3 = ones(numel(t),1); [y_clsv,time_clsv,x_clsv] = lsim(sys_clsv,[r1, r2],t); % Control signals. u = zeros(numel(t),m); for i = 1:m for j = 1:numel(t) u(j,i) = -Kv(i,:)*x_clsv(j,1:n)'+kI(i,:)*x_clsv(j,n+1:end)'; end end % Plot the control signals. figure subplot(2,1,1); plot(t, u(:,1)*57.3);grid on xlabel('Time, s'); ylabel('delta_{tail}, deg.'); title('Tracking controls vs. Time'); subplot(2,1,2); plot(t, u(:,2)/38);grid on xlabel('Time, s'); ylabel('delta_{thrust}, lbf'); % Plot output responses. figure subplot(3,1,1); plot(time_clsv, y_clsv(:,1),'b-');grid on xlabel('Time, s'); ylabel('y_1, m'); title('Unit step responses for each output vs. Time'); subplot(3,1,2); plot(time_clsv, y_clsv(:,2),'b-');grid on xlabel('Time, s'); ylabel('y_2, m'); subplot(3,1,3); plot(time_clsv, y_clsv(:,3),'b-');grid on xlabel('Time, s'); ylabel('y_3, m'); figure subplot(3,1,1); plot(time_clsv, x_clsv(:,1),'b-');grid on
  • 69.
    68 American Institute ofAeronautics and Astronautics xlabel('Time, s'); ylabel('speed, fps'); title('Unit step responses for each output vs. Time'); subplot(3,1,2); plot(time_clsv, x_clsv(:,3)*57.3,'b-');grid on xlabel('Time, s'); ylabel('theta, deg.'); subplot(3,1,3); plot(time_clsv, x_clsv(:,5),'b-');grid on xlabel('Time, s'); ylabel('altitude, ft'); %%%%% FREQUENCY ANALYSIS %%%%% % Perform frequency analysis of servo tracker. w = logspace(0,4,400); freq_resp1 = freq_analysis(sys_p, sys_c, w, 1, 3); freq_resp2 = freq_analysis(sys_p, sys_c, w, 2, 3); % Plot frequency data. %plot_freq_resp(freq_resp1, w); %plot_freq_resp(freq_resp2, w); %% Altitude Autopilot Control %% Comparison of Elevator input Controlled/Uncontrolled %{%} Hmax = 500; Hc = zeros(312,1); Hc(:,1)=[zeros(10,1);Hmax/100*[0:1:100]';Hmax*ones(50,1);Hma x/100*[100:-1:0]';zeros(50,1)]; t4 = 0:length(Hc)-1; %{ [Yh,t4]=lsim(sys_cl2(:,2),Hc,t4); [Yh2,t4]=lsim(sys_ss(:,2),Hc,t4); %} %{%} [Yh,t4]=lsim(sys_cl2(:,2),Hc,t4); [Yh2,t4]=lsim(sys_ss(:,2),Hc,t4); figure subplot(5,1,1) plot(t4,Yh(:,1),'-r') hold on plot(t4,Yh2(:,1),'--b') xlabel('time, sec') ylabel('Velocity, fps') subplot(5,1,2) plot(t4,Yh(:,2),'-r') hold on plot(t4,Yh2(:,2),'--b') xlabel('time, sec') ylabel('alpha, deg.') subplot(5,1,3) plot(t4,Yh(:,3),'-r') hold on plot(t4,Yh2(:,3),'--b') xlabel('time, sec') ylabel('theta, deg.') subplot(5,1,4) plot(t4,Yh(:,4),'-r') hold on plot(t4,Yh2(:,4),'--b') xlabel('time, sec') ylabel('dtheta/dt, deg./sec') subplot(5,1,5) plot(t4,Yh(:,5),'-r') hold on plot(t4,Yh2(:,5),'--b') xlabel('time, sec') ylabel('Altitude, ft.') %% simplified model Ashort = A(2:4,2:4); Bshort = B(2:4,1:2); Ashort = [Ashort(1,1) Ashort(1,3);Ashort(3,1) Ashort(3,3)]; Bshort = [Bshort(1,1) Bshort(3,1)]'; Cshort = eye(2); Dshort = zeros(2,1); sys_short = ss(Ashort, Bshort, Cshort, Dshort); CPshort = poly(Ashort); % Calculate the open-loop system eigenvalues, zeta and wn from ABCD [wn0_short,zeta0_short,Eigs0_short] = damp(Ashort); % Convert to transfer function. sys_tf_short = tf(sys_short); time_short = 0:0.001:3.0; x0sh = [0; 0]; u = zeros(size(time_short)); u(1:500) = -1/57.3; [Y0sh,t_short,X0sh] = lsim(sys_short,u,time_short,x0sh); Tp_short = (2*pi)/(wn0_short(1)); %Seconds T_Half_short = -log(2)/(real(Eigs0_short(1))); %Seconds figure plot(t_short,X0sh(:,1)*57.3,'-b','LineWidth',2) xlabel('time (sec)') ylabel('alpha (deg.)') title('Short Period Response to alpha = 0.5 deg. Disturbance') %% SImulation [Vsh2, Gamsh2] = eig(A); xshort = real(Vsh2(:,2)); xphug = real(Vsh2(:,4)); xshort = xshort/norm(xshort); xphug = xphug/norm(xphug); Nsamp = 100; yshort = zeros(5,Nsamp); timesh = linspace(0,3,Nsamp); for i = 1:Nsamp yshort(:,i) = C*expm(timesh(i)*A)*xshort; end figure subplot(3,2,1) plot(timesh,yshort(1,:)) ylabel('speed (fps)') xlabel('time (sec)') title('Short Period Responses')
  • 70.
    69 American Institute ofAeronautics and Astronautics subplot(3,2,2) plot(timesh,yshort(2,:)/deg_2_rad) ylabel('alpha (deg)') xlabel('time (sec)') subplot(3,2,3) plot(timesh,yshort(3,:)/deg_2_rad) ylabel('q (deg./sec)') xlabel('time (sec)') subplot(3,2,4) plot(timesh,yshort(4,:)/deg_2_rad) ylabel('theta (deg)') xlabel('time (sec)') subplot(3,2,5) plot(timesh,yshort(5,:)) ylabel('altitude (ft)') xlabel('time (sec)') h1=zeros(5,Nsamp); h2=zeros(5,Nsamp); for i=1:Nsamp, h1(:,i)=C*expm(timesh(i)*A)*B(:,1); % impulse response from u_w h2(:,i)=C*expm(timesh(i)*A)*B(:,2); % imp resp from v_w end figure subplot(3,2,1) plot(timesh,h1(1,:)) ylabel('speed (fps)') xlabel('time (sec)') title('Impulse Responses to Wing Incidence') subplot(3,2,2) plot(timesh,h1(2,:)/deg_2_rad) ylabel('alpha (deg)') xlabel('time (sec)') subplot(3,2,3) plot(timesh,h1(3,:)/deg_2_rad) ylabel('theta (deg)') xlabel('time (sec)') subplot(3,2,4) plot(timesh,h1(4,:)/deg_2_rad) ylabel('q (deg./sec)') xlabel('time (sec)') subplot(3,2,5) plot(timesh,h1(5,:)) ylabel('altitude (ft)') xlabel('time (sec)') figure subplot(3,2,1) plot(timesh,h2(1,:)) ylabel('speed (fps)') xlabel('time (sec)') title('Impulse Responses to Change in Thrust') subplot(3,2,2) plot(timesh,h2(2,:)/deg_2_rad) ylabel('alpha (deg)') xlabel('time (sec)') subplot(3,2,3) plot(timesh,h2(3,:)/deg_2_rad) ylabel('theta (deg)') xlabel('time (sec)') subplot(3,2,4) plot(timesh,h2(4,:)/deg_2_rad) ylabel('q (deg./sec)') xlabel('time (sec)') subplot(3,2,5) plot(timesh,h2(5,:)) ylabel('altitude (ft)') xlabel('time (sec)') %% Phugoid Nsamp = 1000; %number of time samples yphug=zeros(5,Nsamp); tphug=linspace(0,1000,Nsamp); for i=1:Nsamp yphug(:,i)=C*expm(tphug(i)*A)*xphug; end figure subplot(3,2,1) plot(tphug,yphug(1,:)) ylabel('speed (fps)') xlabel('time (sec)') title('Phugoid Motion') subplot(3,2,2) plot(tphug,yphug(2,:)/deg_2_rad) ylabel('alpha (deg)') xlabel('time (sec)') subplot(3,2,3) plot(tphug,yphug(3,:)) ylabel('q_{inf} (psf)') xlabel('time (sec)') subplot(3,2,4) plot(tphug,yphug(4,:)/deg_2_rad) ylabel('theta (deg)') xlabel('time (sec)') subplot(3,2,5) plot(tphug,yphug(5,:)) ylabel('altitude (ft)') xlabel('time (sec)') figure plot(tphug,yphug(1,:),'-r','LineWidth',2) hold on plot(tphug,yphug(5,:),'--b','LineWidth',2) xlabel('time (sec)') ylabel('Amplitude') title('Phugoid Mode') legend('Speed','Altitude','Location','NorthEast') axis([0 100 -1 1]) % Calculate the open-loop system eigenvalues, zeta and wn from ABCD [wn0,zeta0,Eigs0] = damp(A); Eigs_phug = Eigs0(4:5); Damp_phug = zeta0(4:5); wn_phug = wn0(4:5); Tp_phug = (2*pi)/(wn_phug(1)); %Seconds T_Half_phug = -log(2)/(real(Eigs_phug(1))); %Seconds Lateral %Senior Design - Paparazzi %Dynamic Stability and Feedback Control clear close all
  • 71.
    70 American Institute ofAeronautics and Astronautics %% Longitudinal State Space %X(1) = Beta (Sideslip Angle) %X(2) = Phi (Bank Angle) %X(3) = p (roll rate) %X(4) = r (yaw rate) %X(5) = psy (Heading Angle) % A = [ Xbet/U0 g/U0 Yp/U0 (Yr/U0 -1) 0... % 0 0 1 0 0... % Lbet 0 Lp Lr 0... % Nbet 0 Np Nr 0... % 0 0 0 1 0] %B = [ %% Conversion Factors % < < Distance > > nm_2_miles = 1.15078; %multiply to convert from nm to miles miles_2_ft = 5280; %multiply to convert from miles to feet in_2_ft = 1/12; %multiply to convert from in to ft % < < Speed > > kts_2_mph = 1.1508; %multiply to convert from kts to mph kts_2_fps = 1.6878; %multiply to convert from kts to fps mph_2_fps = 1.46667; %multiply to convert from mph to fps % < < Mass > > oz_2_lbs = 1/16; %multiply to convert from oz to lbs % < < Temperature > > fah_2_rank = 460.67; %add to convert from Fahrenheit to Rankine % < < Pressure > > inHg_2_psf = 70.7262; %multiply to convert from inches Mercury to Psf % < < Time > > hour_2_sec = 3600; %multiply to convert from hours to seconds min_2_sec = 60; %multiply to convert from min to seconds % < < Angles > > deg_2_rad = pi/180; %multiply to convert from degrees to radians %% Given Constant Atmospheric Data P_SL = 2116.2; %psf T_SL = 518.69; %Deg. Rankine Rho_SL = 0.002377; %slugs/ft3 Gamma_Air = 1.4; %Constant R_Air = 1716; %Air Constant mu_Air = 3.7424*10^-7; %Air Constant delta_STL = 0.9822; theta_STL_STD = 0.997; theta_STL_Cold = 0.784; theta_STL_Hot = 1.0812; delta_500_STL = 0.9692; theta_500_STL_STD = 0.994; theta_500_STL_Cold = 0.7972; theta_500_STL_Hot = 1.0774; sigma_500_STL = 0.975; mu_500_STL = 3.72497*10^-7; Tatm = T_SL*theta_STL_STD; %Rank Rair = 1716; g = 32.2; %gravity constant in ft/sec2 rho = 0.002377*sigma_500_STL; %Density at trim level mu = (3.62*10^- 7)*((Tatm/518.7)^1.5)*((518.7+198.72)/(Tatm+198.72)); %air viscocity in engineering units at Patm and Tatm %-> Got equation from Introduction to Flight 7th ed. nu = mu/rho; a_SL = 1116; %Speed of Sound at SL in fps %% Vehicle Geometry lH = 16.45; %inches lH = lH*in_2_ft; %ft cbar_w = 8.5; %in cbar_w = cbar_w*in_2_ft; cbar_H = 6.5; cbar_H = cbar_H*in_2_ft; alpha0H = 0; bw = 40; bw = bw*in_2_ft; bH = 22; bH = bH*in_2_ft; Sw = bw*cbar_w; %Wing Planform Area SH = bH*cbar_H; ARw = (bw^2)/Sw; ARH = (bH^2)/SH; ht = lH/cbar_w; hcg = (4*in_2_ft)/cbar_w; VH = (SH*lH)/(Sw*cbar_w); etaH = .9; %assumed due to propeller influence dTh = 0; XdTh = 13.5; XdTh = XdTh*in_2_ft; M = 5.5/g; %mass of the vehicle Imat = [4.214*10^6 1.4502*10^3 -2.5678*10^4;... %in lbs*in^2 1.4502*10^3 4.215*10^6 3.563*10^4;... -2.5678*10^4 3.563*10^4 2.5144*10^5]; Imat = Imat*(in_2_ft^2)/g; %in slugs*ft^2 Iyy = Imat(2,2); %slugs*ft^2 CD0 = 0.02385; %From Drag build-up Excel File %% Trim Conditions U0 = 40; %Trim Speed in fps U0 = U0*kts_2_fps; qinf = 0.5*rho*U0^2; %dynamic pressure at trim
  • 72.
    71 American Institute ofAeronautics and Astronautics qSM = qinf*Sw/M; %Constant in control derivatives qSCIyy = qinf*Sw*cbar_w/Iyy; CL0 = g/qSM; %Lift Coefficient at trim ew = 4.61*(1-0.045*ARw^0.68)-3.1; ewH = 4.61*(1-0.045*ARH^0.68)-3.1; CDt = CD0 + (1/(pi*ARw*ew))*CL0^2; TH_tot = CDt*qinf*Sw; TH_mot = TH_tot/3; alpha0 = 0; Theta_T = 0; %% Stability Derivatives Cn_bet = 0.0019*180/pi; %1/rad CL_bet = 0; CL_p = -0.245; CL_r = -0.0012; CL_dw = 0.0032*180/pi; %Cn_p = -0.0016; Cn_p = -0.00; Cn_r = -0.3234; %Cn_r = -0.3234; Cn_dw = 0.0027*180/pi; CTh = TH_mot/(qinf*Sw); %% Control Derivatives Y_bet = qSM*Cn_bet; Y_p = 0; Y_r = 0; L_bet = (qinf*Sw*bw/Imat(1,1))*CL_bet; L_p = (qinf*Sw*bw/Imat(1,1))*CL_p; L_r = (qinf*Sw*bw/Imat(1,1))*CL_r; L_dr = 0; L_dw =(qinf*Sw*bw/Imat(1,1))*(CL_dw + (2*CTh/pi)); N_bet = (qinf*Sw*bw/Imat(3,3))*Cn_bet; N_p = (qinf*Sw*bw/Imat(3,3))*Cn_p; N_r = (qinf*Sw*bw/Imat(3,3))*Cn_r; N_dr = (qinf*Sw*bw/Imat(3,3))*(2*CTh/pi)*ht; N_dw = (qinf*Sw*bw/Imat(3,3))*(Cn_dw+ (2*CTh/pi)); Ydr = qSM*(2*CTh/pi); %% State Space a11 = Y_bet/U0; a12 = g/U0; a13 = 0; a14 = -1; a15 = 0; a21 = 0; a22 = 0; a23 = 1; a24 = 0; a25 = 0; a31 = (L_bet+(N_bet*Imat(1,3)/Imat(1,1)))/(1- ((Imat(1,3)^2)/(Imat(1,1)*Imat(3,3)))); a32 = 0; a33 = (L_p+(N_p*Imat(1,3)/Imat(1,1)))/(1- ((Imat(1,3)^2)/(Imat(1,1)*Imat(3,3)))); a34 = (L_r+(N_r*Imat(1,3)/Imat(1,1)))/(1- ((Imat(1,3)^2)/(Imat(1,1)*Imat(3,3)))); a35 = 0; a41 = (N_bet+(L_bet*Imat(1,3)/Imat(3,3)))/(1- ((Imat(1,3)^2)/(Imat(1,1)*Imat(3,3)))); a42 = 0; a43 = (N_p+(L_p*Imat(1,3)/Imat(3,3)))/(1- ((Imat(1,3)^2)/(Imat(1,1)*Imat(3,3)))); a44 = (N_r+(L_r*Imat(1,3)/Imat(3,3)))/(1- ((Imat(1,3)^2)/(Imat(1,1)*Imat(3,3)))); a45 = 0; a51 = 0; a52 = 0; a53 = 0; a54 = 1; a55 = 0; b11 = 0; b12 = Ydr/U0; b21 = 0; b22 = 0; b31 = (L_dw+(N_dw*Imat(1,3)/Imat(1,1)))/(1- ((Imat(1,3)^2)/(Imat(1,1)*Imat(3,3)))); b32 = (L_dr+(N_dr*Imat(1,3)/Imat(1,1)))/(1- ((Imat(1,3)^2)/(Imat(1,1)*Imat(3,3)))); b41 = (N_dw+(L_dw*Imat(1,3)/Imat(3,3)))/(1- ((Imat(1,3)^2)/(Imat(1,1)*Imat(3,3)))); b42 = (N_dr+(L_dr*Imat(1,3)/Imat(3,3)))/(1- ((Imat(1,3)^2)/(Imat(1,1)*Imat(3,3)))); b51 = 0; b52 = 0; A = [a11 a12 a13 a14 a15;... a21 a22 a23 a24 a25;... a31 a32 a33 a34 a35;... a41 a42 a43 a44 a45;... a51 a52 a53 a54 a55]; damp(A) B = [b11 b21 b31 b41 b51;... b12 b22 b32 b42 b52]'; % Get the number of states, n, number of controls, m, and the number of % outputs, p. [n,m] = size(B); C = eye(n,n); p = size(C,1); D = zeros(p,m); % Define the state space model. sys_ss = ss(A,B,C,D); % Convert to transfer function. sys_tf = tf(sys_ss); % Convert to zero-pole description. sys_zpk = zpk(sys_ss); % Convert back to state space sys_ssa = ss(sys_tf);
  • 73.
    72 American Institute ofAeronautics and Astronautics %{ %% Simulation of State Space System % Find the characteristic polynomial. CharPoly = poly(A); % Find the system poles. Poles = roots(CharPoly); dt = 0.01; tfinal = 50; time_s = 0:dt:tfinal; % Compute the left eigenvectors of A. These are used in tests for % controllability. [W,Dc] = eig(A.'); W = conj(W); % Compute the right eigenvectors of A. These are used in tests for % observability. [V,Do] = eig(A); %% Initial Simulation t0 = 0:.05:20; u0(2,1:401) = 0; u0(1,1:60) = 3.5/57.3; u0(1,61:120) = 1/57.3; u0(1,121:180) = 3.5/57.3; u0(1,181:401) = 0/57.3; %u0(1,101:401) = 0/57.3; %{ u0(1,41:80) = 0; u0(1,81:120) = 1/57.3; u0(1,121:401) = 0; %} x0 = [67.51;0;0;0;400]; %trim [y1,t1,x1] = lsim(sys_ss,u0,t0,x0); figure subplot(5,1,1) plot(t1,y1(:,1)) xlabel('time (s)') ylabel('speed (fps)') title('Surge Velocity vs. time') subplot(5,1,2) plot(t1,y1(:,2)*57.3) xlabel('time (s)') ylabel('alpha (deg)') subplot(5,1,3) plot(t1,y1(:,3)*57.3) xlabel('time (s)') ylabel('theta (deg)') title('Pitch Attitude vs. time') subplot(5,1,4) plot(t1,y1(:,4)*57.3) xlabel('time (s)') ylabel('Pitch Rate (deg/s)') subplot(5,1,5) plot(t1,y1(:,5)) xlabel('time (s)') ylabel('Altitude (ft)') figure plot(t1,u0(1,:)*57.3) xlabel('time (sec)') ylabel('Tail Incidence Angle (deg.)') %} %% System for Control Acc = A(1:4,1:4); Bcc = B(1:4,1:2); %Bcc = B(1:4,1); [nc,mc] = size(Bcc); Ccc = eye(nc,nc); pcc = size(Ccc,1); Dcc = zeros(pcc,mc); % Define the state space model. sys_cc = ss(Acc,Bcc,Ccc,Dcc); % Convert to transfer function. sys_tf = tf(sys_cc); % Convert to zero-pole description. sys_zpk = zpk(sys_cc); % Convert back to state space sys_ssa = ss(sys_tf); % Find the characteristic polynomial. CharPoly = poly(Acc); % Find the system poles. Poles = roots(CharPoly); % Compute the left eigenvectors of A. These are used in tests for % controllability. [W,Dc] = eig(Acc.'); W = conj(W); % Compute the right eigenvectors of A. These are used in tests for % observability. [V,Do] = eig(Acc); % Damping characteristics damp(Acc) % Compute the controllability matrix, P, using the MATLAB function. P = ctrb(sys_cc); % Determine if the system is controllable by checking the rank of P. % The rank of P should match the number of rows (or columns) of the square % matrix A. if rank(P) == nc disp('The system is controllable.'); else disp('The system is NOT controllable.'); end disp(' '); % Compute the condition number for impending singularity. Cn = cond(Acc); % Degree of Controllability between Mode i and Control j. DoC = zeros(nc,mc);
  • 74.
    73 American Institute ofAeronautics and Astronautics for i = 1:nc for j = 1:mc DoC(i,j) = abs(dot(Bcc(:,j), W(i,:))/norm(Bcc(:,j))/norm(W(i,:))); end end % Compute the inverse matrix Pccfi. Pccfi = zeros(nc,nc); base = CharPoly(nc:-1:2); for i = nc:-1:1 if i == nc % Last row. Set the first element to 1. Pccfi(i,1) = 1; else % Populate the ith row Pccfi(i,1:nc-i+1) = [base(i:end) 1]; end end %{ % Compute the Transformation matrix, Tccf. Tccf = P*Pccfi; % Compute the CCF matrices. Accf = TccfAcc*Tccf; Bccf = TccfBcc; Cccf = Ccc*Tccf; Dccf = Dcc; %} % Compute the observability matrix, Q, using the MATLAB function. Q = obsv(sys_cc); % Determine if the system is observable by checking the rank of Q. % The rank of Q should match the number of rows (or columns) of the square % matrix A. if rank(Q) == nc disp('The system is observable.'); else disp('The system is NOT observable.'); end disp(' '); % Degree of Observability between Mode i and Measurement j. DoO = zeros(pcc,nc); for j = 1:pcc for i = 1:nc DoO(j,i) = abs(dot(Ccc(j,:), V(:,i))/norm(Ccc(j,:))/norm(V(:,i))); end end % Perform a stability analysis using Lyapunov stability. disp('Lyapunov Stability Analysis.'); % Find the poles with zero real part. i_zero_real = find(real(Poles) == 0); if ~isempty(i_zero_real) % Lyapunov stabilty analysis will not work if there is at least one % pole with zero real part. At this point, we can only check for % marginally stable or unstable systems. else % Lyapunov stability analysis will work. % Form a positive definite matrix, Q. Qc = eye(nc); % Solve the Lyapunov equation for P. Pc = lyap(Acc',Qc); % Perform Sylvester's Method to determine if P is positive definite. pm = zeros(1,nc); for i = 1:nc pm(i) = det(Pc(1:i,1:i)); end if all(pm > 0) disp('P is positive definite. System is asymptotically stable.'); elseif any(pm < 0) disp('P is not positive definite. System is unstable.'); else disp('P is positive semi-definite. Try another Q.'); end end % Determine a desired response for the system. Two approaches are % investigated: (1.) second order dominant; (2.) 6th order ITAE. % Specify the overshoot percentage and settling time. PO = 5; ts = 1.5; % Determine damping ratio from PO and natural frequency from settling time % and zeta. term = pi^2 + log(PO/100)^2; zeta = abs(log(PO/100))/sqrt(term); wn = 4/(zeta*ts); % Desired 2nd order system. num2 = wn^2; den2 = [1 2*zeta*wn wn^2]; Des2 = tf(num2,den2); % Dominant 2nd order eigenvalues. DesEig2 = roots(den2); % Get the stepinfo stepinfo(Des2) % Augment with 2 additional poles. Aug4 = zeros(2,1); Aug4(1) = 10*real(DesEig2(1)); Aug4(2) = Aug4(1)-1; % 4th order transfer function with augmented poles, den_Aug4 = conv(den2,conv([1 -Aug4(1)],([1 -Aug4(2)]))); Aug2 = tf(num2, den_Aug4); % Plot the dominant 2nd order response. figure step(Des2, 'b-', Aug2*den_Aug4(end)/num2, 'g--');grid on legend('Desired 2nd', 'Augmented 2nd order'); % Compute the state feedback regulator based upon the augmented 2nd order % system. K = place(Acc,Bcc,[DesEig2;Aug4]); % Form plant system. Set output matrix for state feedback control. sys_p.Ap = Acc; sys_p.Bp = Bcc;
  • 75.
    74 American Institute ofAeronautics and Astronautics sys_p.Cp = eye(nc); sys_p.Dp = zeros(nc,mc); % Form controller system. sys_c.Ac = 0; sys_c.Bc1= 0; sys_c.Bc2= 0; sys_c.Cc = 0; sys_c.Dc1= -K; sys_c.Dc2= zeros(mc,mc); % Form closed loop system. [Acl,Bcl,Ccl,Dcl] = closed_loop_system(sys_p, sys_c); sys_cl = ss(Acl,Bcl,Ccl,Dcl); %% Simulation t = 0:.05:200; x0 = [0;1/57.3;0;0]; %trim Accs = zeros(5,5); Accs(1:4,1:4) = Acl; Accs(5,:) = A(5,:); sys_cl2 = ss(Accs,B,C,D); % Closed-loop response (zero input, ICs). [Yo,t,Xo] = lsim(sys_cc,zeros(numel(t),mc),t,x0); [Yc,t,Xc] = lsim(sys_cl,zeros(numel(t),mc),t,x0); [Ys,t,Xs] = lsim(sys_ss,zeros(numel(t),mc),t,[x0; 0]); [Ycs,t,Xcs] = lsim(sys_cl2,zeros(numel(t),mc),t,[x0; 0]); figure plot(Xo(:,2)*57.3,Xo(:,3)*57.3) grid on xlabel('theta, deg.') ylabel('dtheta / dt, deg./s') title('Phase Diagram for Pitch Attitude') % Control signals. u = zeros(numel(t),mc); for i = 1:mc for j = 1:numel(t) u(j,i) = -K(i,:)*Xc(j,:)'; end end % Plot the control signals. figure subplot(2,1,1); plot(t, u(:,1));grid on xlabel('Time, s'); ylabel('Wing Incidence (deg.)'); title('Regulating controls vs. Time'); subplot(2,1,2); plot(t, u(:,2));grid on xlabel('Time, s'); ylabel('Back Rotor Incidence, deg.'); % Open-loop and closed loop plots of the model states. figure subplot(5,1,1); plot(t,Xo(:,1)*57.3,'--b',t,Xc(:,1)*57.3,'-r');grid on xlabel('Time, s'); ylabel('beta, deg.'); title('Model States vs. Time with 0 input and I.C.s') subplot(5,1,2); plot(t,Xo(:,2)*57.3,'--b',t,Xc(:,2)*57.3,'-r');grid on xlabel('Time, s'); ylabel('phi , deg.'); subplot(5,1,3); plot(t,Xo(:,3)*57.3,'--b',t,Xc(:,3)*57.3,'-r');grid on xlabel('Time, s'); ylabel('Roll Rate, deg./s'); subplot(5,1,4); plot(t,Xo(:,4)*57.3,'--b',t,Xc(:,4)*57.3,'-r');grid on xlabel('Time, s'); ylabel('Yaw rate, deg./s'); subplot(5,1,5); plot(t,Xs(:,5)*57.3,'--b',t,Xcs(:,5)*57.3,'-r');grid on xlabel('Time, s'); ylabel('psy, deg.'); legend('Uncontrolled Response','Controlled Response','Location','NorthEast') %{%} u0(2,1:401) = 0; u0(1,1:3) = 1/57.3; u0(1,4:100) = 0/57.3; u0(1,101:180) = 0/57.3; u0(1,181:220) = 0/57.3; u0(1,221:401) = 0/57.3; u01(1,1:401) = 0; u01(2,1:3) = 1/57.3; u01(2,4:180) = 0/57.3; u01(2,181:220) = 0/57.3; u01(2,221:401) = 0/57.3; t0 = linspace(0,300,length(u0)); xx0 = [0;0;0;0;0]; %trim [y1,t1,x1] = lsim(sys_cl2,u0,t0,xx0); [y2,t2,x2] = lsim(sys_ss,u0,t0,xx0); [y3,t3,x3] = lsim(sys_cl2,u01,t0,xx0); [y4,t4,x4] = lsim(sys_ss,u01,t0,xx0); figure subplot(5,1,1) plot(t1,y1(:,1)*57.3,'-r') hold on plot(t1,y2(:,1)*57.3,'--b') xlabel('time (s)') ylabel('speed (fps)') title('Surge Velocity vs. time') subplot(5,1,2) plot(t1,y1(:,2)*57.3,'-r') hold on plot(t1,y2(:,2)*57.3,'--b') xlabel('time (s)') ylabel('alpha (deg)') subplot(5,1,3) plot(t1,y1(:,3)*57.3,'-r') hold on plot(t1,y2(:,3)*57.3,'--b') xlabel('time (s)') ylabel('theta (deg)') title('Pitch Attitude vs. time') subplot(5,1,4) plot(t1,y1(:,4)*57.3,'-r') hold on plot(t1,y2(:,4)*57.3,'--b')
  • 76.
    75 American Institute ofAeronautics and Astronautics xlabel('time (s)') ylabel('Pitch Rate (deg/s)') title('Pitch Rate vs. time') subplot(5,1,5) plot(t1,y1(:,5)*57.3,'-r') hold on plot(t1,y2(:,5)*57.3,'--b') xlabel('time (s)') ylabel('Altitude (ft)') title('Model State vs. Time with 0 I.C.s and Tail Incidence step input') legend('Controlled Response','Uncontrolled Response') figure subplot(5,1,1) plot(t1,y3(:,1)*57.3,'-r') hold on plot(t1,y4(:,1)*57.3,'--b') xlabel('time (s)') ylabel('speed (fps)') title('Surge Velocity vs. time') subplot(5,1,2) plot(t1,y3(:,2)*57.3,'-r') hold on plot(t1,y4(:,2)*57.3,'--b') xlabel('time (s)') ylabel('alpha (deg)') subplot(5,1,3) plot(t1,y3(:,3)*57.3,'-r') hold on plot(t1,y4(:,3)*57.3,'--b') xlabel('time (s)') ylabel('theta (deg)') title('Pitch Attitude vs. time') subplot(5,1,4) plot(t1,y3(:,4)*57.3,'-r') hold on plot(t1,y4(:,4)*57.3,'--b') xlabel('time (s)') ylabel('Pitch Rate (deg/s)') title('Pitch Rate vs. time') subplot(5,1,5) plot(t1,y3(:,5)*57.3,'-r') hold on plot(t1,y4(:,5)*57.3,'--b') xlabel('time (s)') ylabel('Altitude (ft)') title('Model State vs. Time with 0 I.C.s and Thrust step input') legend('Controlled Response','Uncontrolled Response') t6 = 0:length(u0)-1; %{%} figure plot(t6,u0(1,:)*57.3) xlabel('time (sec)') ylabel('Tail Incidence Angle (deg.)') [y5,t6,x5] = lsim(sys_cl2,u0,t6,xx0); [y6,t6,x6] = lsim(sys_ss,u0,t6,xx0); figure subplot(1,2,1) plot(t6,y5(:,5),'-r') hold on plot(t6,y6(:,5),'--b') xlabel('time (s)') ylabel('Altitude (ft)') subplot(1,2,2) plot(t6,u0(1,:)*57.3) xlabel('time (sec)') ylabel('Tail Incidence Angle (deg.)') title('Altitude vs. Time with Tail Incidence Control') %%%%% SERVO MECHANISM TRACKING %%%%% % Track outputs y1, y2 and y3. CC = zeros(2,5); CC(1,:) = C(1,:); %CC(2,:) = C(3,:); CC(2,:) = C(5,:); Csv = CC; p = 3; % Matrices Asv = zeros(n+m, n+m); Asv(1:n,1:n) = A; Asv(n+1:end,1:n) = -Csv; Bsv = zeros(n+m, m); Bsv(1:n,:) = B; % Gain design. Add 3 additional eigenvalues for each reference. Ksv = place(Asv,Bsv,[DesEig2;Aug4;-6;-12;-7]); Kv = Ksv(:,1:n); kI = -Ksv(:,n+1:end); % Closed loop system % Aclsv = [A-B*Kv, B*kI;-Csv, zeros(p,m)]; % Bclsv = [zeros(n,m);eye(m)]; % Cclsv = [Csv, zeros(m,m)]; % Dclsv = 0; % sys_clsv = ss(Aclsv,Bclsv,Cclsv,Dclsv); % Form plant system. Set output matrix for state feedback control. sys_p.Ap = A; sys_p.Bp = B; sys_p.Cp = eye(n); sys_p.Dp = zeros(n,m); % Form controller system. Tracking on each of the three position states. sys_c.Ac = zeros(m,m); sys_c.Bc1= -CC; sys_c.Bc2= eye(m); sys_c.Cc = kI; sys_c.Dc1= -Kv; sys_p.Dc2= zeros(n,m); % Form closed loop system. [Aclsv, Bclsv, Cclsv, Dclsv] = closed_loop_system(sys_p, sys_c); sys_clsv = ss(Aclsv,Bclsv,Cclsv,Dclsv); % Simulation dt = 0.01; tfinal = 10; t = 0:dt:tfinal; % Simulation #1: r1 = 1, r2 = 1 and r3 = 1. Zero I.C. r1 = ones(numel(t),1); r2 = ones(numel(t),1); %r3 = ones(numel(t),1); [y_clsv,time_clsv,x_clsv] = lsim(sys_clsv,[r1, r2],t); % Control signals. u = zeros(numel(t),m); for i = 1:m for j = 1:numel(t) u(j,i) = -Kv(i,:)*x_clsv(j,1:n)'+kI(i,:)*x_clsv(j,n+1:end)';
  • 77.
    76 American Institute ofAeronautics and Astronautics end end % Plot the control signals. figure subplot(2,1,1); plot(t, u(:,1)*57.3);grid on xlabel('Time, s'); ylabel('delta_{tail}, deg.'); title('Tracking controls vs. Time'); subplot(2,1,2); plot(t, u(:,2)/38);grid on xlabel('Time, s'); ylabel('delta_{thrust}, lbf'); % Plot output responses. figure subplot(3,1,1); plot(time_clsv, y_clsv(:,1),'b-');grid on xlabel('Time, s'); ylabel('y_1, m'); title('Unit step responses for each output vs. Time'); subplot(3,1,2); plot(time_clsv, y_clsv(:,2),'b-');grid on xlabel('Time, s'); ylabel('y_2, m'); subplot(3,1,3); plot(time_clsv, y_clsv(:,3),'b-');grid on xlabel('Time, s'); ylabel('y_3, m'); figure subplot(3,1,1); plot(time_clsv, x_clsv(:,1),'b-');grid on xlabel('Time, s'); ylabel('speed, fps'); title('Unit step responses for each output vs. Time'); subplot(3,1,2); plot(time_clsv, x_clsv(:,3)*57.3,'b-');grid on xlabel('Time, s'); ylabel('theta, deg.'); subplot(3,1,3); plot(time_clsv, x_clsv(:,5),'b-');grid on xlabel('Time, s'); ylabel('altitude, ft'); %%%%% FREQUENCY ANALYSIS %%%%% % Perform frequency analysis of servo tracker. w = logspace(0,4,400); freq_resp1 = freq_analysis(sys_p, sys_c, w, 1, 3); freq_resp2 = freq_analysis(sys_p, sys_c, w, 2, 3); % Plot frequency data. plot_freq_resp(freq_resp1, w); plot_freq_resp(freq_resp2, w); %% Altitude Autopilot Control %% Comparison of Elevator input Controlled/Uncontrolled %{%} Hmax = 500; Hc = zeros(312,1); Hc(:,1)=[zeros(10,1);Hmax/100*[0:1:100]';Hmax*ones(50,1);Hma x/100*[100:-1:0]';zeros(50,1)]; t4 = 0:length(Hc)-1; %{ [Yh,t4]=lsim(sys_cl2(:,2),Hc,t4); [Yh2,t4]=lsim(sys_ss(:,2),Hc,t4); %} %{%} [Yh,t4]=lsim(sys_cl2(:,1),Hc,t4); [Yh2,t4]=lsim(sys_ss(:,1),Hc,t4); figure subplot(5,1,1) plot(t4,Yh(:,1),'-r') hold on plot(t4,Yh2(:,1),'--b') xlabel('time, sec') ylabel('Velocity, fps') subplot(5,1,2) plot(t4,Yh(:,2),'-r') hold on plot(t4,Yh2(:,2),'--b') xlabel('time, sec') ylabel('alpha, deg.') subplot(5,1,3) plot(t4,Yh(:,3),'-r') hold on plot(t4,Yh2(:,3),'--b') xlabel('time, sec') ylabel('theta, deg.') subplot(5,1,4) plot(t4,Yh(:,4),'-r') hold on plot(t4,Yh2(:,4),'--b') xlabel('time, sec') ylabel('dtheta/dt, deg./sec') subplot(5,1,5) plot(t4,Yh(:,5),'-r') hold on plot(t4,Yh2(:,5),'--b') xlabel('time, sec') ylabel('Altitude, ft.') %% simplified model Ashort = A(2:4,2:4); Bshort = B(2:4,1:2); Ashort = [Ashort(1,1) Ashort(1,3);Ashort(3,1) Ashort(3,3)]; Bshort = [Bshort(1,1) Bshort(3,1)]'; Cshort = eye(2); Dshort = zeros(2,1); sys_short = ss(Ashort, Bshort, Cshort, Dshort); CPshort = poly(Ashort); % Calculate the open-loop system eigenvalues, zeta and wn from ABCD [wn0_short,zeta0_short,Eigs0_short] = damp(Ashort); % Convert to transfer function. sys_tf_short = tf(sys_short); time_short = 0:0.1:2.5; x0sh = [(.5*pi/180); qinf]; u = zeros(size(time_short));
  • 78.
    77 American Institute ofAeronautics and Astronautics [Y0sh,t_short,X0sh] = lsim(sys_short,u,time_short,x0sh); Tp_short = (2*pi)/(wn0_short(1)); %Seconds T_Half_short = -log(2)/(real(Eigs0_short(1))); %Seconds figure plot(t_short,X0sh(:,1),'-b','LineWidth',2) xlabel('time (sec)') ylabel('alpha (deg.)') title('Short Period Response to alpha = 0.5 deg. Disturbance') %% SImulation [Vsh2, Gamsh2] = eig(A); xshort = real(Vsh2(:,2)); xphug = real(Vsh2(:,4)); xshort = xshort/norm(xshort); xphug = xphug/norm(xphug); Nsamp = 100; yshort = zeros(5,Nsamp); timesh = linspace(0,3,Nsamp); for i = 1:Nsamp yshort(:,i) = C*expm(timesh(i)*A)*xshort; end figure subplot(3,2,1) plot(timesh,yshort(1,:)) ylabel('speed (fps)') xlabel('time (sec)') title('Short Period Responses') subplot(3,2,2) plot(timesh,yshort(2,:)/deg_2_rad) ylabel('alpha (deg)') xlabel('time (sec)') subplot(3,2,3) plot(timesh,yshort(3,:)) ylabel('q_{inf} (psf)') xlabel('time (sec)') subplot(3,2,4) plot(timesh,yshort(4,:)/deg_2_rad) ylabel('theta (deg)') xlabel('time (sec)') subplot(3,2,5) plot(timesh,yshort(5,:)) ylabel('altitude (ft)') xlabel('time (sec)') h1=zeros(5,Nsamp); h2=zeros(5,Nsamp); for i=1:Nsamp, h1(:,i)=C*expm(timesh(i)*A)*B(:,1); % impulse response from u_w h2(:,i)=C*expm(timesh(i)*A)*B(:,2); % imp resp from v_w end figure subplot(3,2,1) plot(timesh,h1(1,:)) ylabel('speed (fps)') xlabel('time (sec)') title('Impulse Responses to Wing Incidence') subplot(3,2,2) plot(timesh,h1(2,:)/deg_2_rad) ylabel('alpha (deg)') xlabel('time (sec)') subplot(3,2,3) plot(timesh,h1(3,:)/deg_2_rad) ylabel('theta (deg)') xlabel('time (sec)') subplot(3,2,4) plot(timesh,h1(4,:)) ylabel('q_{inf} (psf)') xlabel('time (sec)') subplot(3,2,5) plot(timesh,h1(5,:)) ylabel('altitude (ft)') xlabel('time (sec)') figure subplot(3,2,1) plot(timesh,h2(1,:)) ylabel('speed (fps)') xlabel('time (sec)') title('Impulse Responses to Change in Thrust') subplot(3,2,2) plot(timesh,h2(2,:)/deg_2_rad) ylabel('alpha (deg)') xlabel('time (sec)') subplot(3,2,3) plot(timesh,h2(3,:)/deg_2_rad) ylabel('theta (deg)') xlabel('time (sec)') subplot(3,2,4) plot(timesh,h2(4,:)) ylabel('q_{inf} (psf)') xlabel('time (sec)') subplot(3,2,5) plot(timesh,h2(5,:)) ylabel('altitude (ft)') xlabel('time (sec)') %% Phugoid Nsamp = 1000; %number of time samples yphug=zeros(5,Nsamp); tphug=linspace(0,1000,Nsamp); for i=1:Nsamp yphug(:,i)=C*expm(tphug(i)*A)*xphug; end figure subplot(3,2,1) plot(tphug,yphug(1,:)) ylabel('speed (fps)') xlabel('time (sec)') title('Phugoid Motion') subplot(3,2,2) plot(tphug,yphug(2,:)/deg_2_rad) ylabel('alpha (deg)') xlabel('time (sec)') subplot(3,2,3) plot(tphug,yphug(3,:)) ylabel('q_{inf} (psf)') xlabel('time (sec)') subplot(3,2,4) plot(tphug,yphug(4,:)/deg_2_rad) ylabel('theta (deg)') xlabel('time (sec)') subplot(3,2,5) plot(tphug,yphug(5,:)) ylabel('altitude (ft)') xlabel('time (sec)')
  • 79.
    78 American Institute ofAeronautics and Astronautics figure plot(tphug,yphug(1,:),'-r','LineWidth',2) hold on plot(tphug,yphug(5,:),'--b','LineWidth',2) xlabel('time (sec)') ylabel('Amplitude') title('Phugoid Mode') legend('Speed','Altitude','Location','NorthEast') axis([0 100 -1 1]) % Calculate the open-loop system eigenvalues, zeta and wn from ABCD [wn0,zeta0,Eigs0] = damp(A); Eigs_phug = Eigs0(4:5); Damp_phug = zeta0(4:5); wn_phug = wn0(4:5); Tp_phug = (2*pi)/(wn_phug(1)); %Seconds T_Half_phug = -log(2)/(real(Eigs_phug(1))); %Seconds %{ % Zero input for all time u = zeros(2,length(time_s)); %u(1,1:200) = -1.5*pi/180; %u(1,201:400) = 1.5*pi/180; % Initial conditions on states. x0 = [U0;1*pi/180;0;0;400]; % Calculate the open-loop system eigenvalues, zeta and wn from ABCD [wn0,zeta0,Eigs0] = damp(A); % Open-loop response. This is an impulse response, as the input, u, is % zero and there are non-zero ICs, x0. [Yo,t,Xo] = lsim(sys_ss,u,time_s,x0); %{%} % Open-loop plots of the system states. figure subplot(3,2,1); plot(t,Xo(:,1),'b');grid on xlabel('Time, s'); ylabel('u fps'); subplot(3,2,2); plot(t,Xo(:,2),'b');grid on xlabel('Time, s'); ylabel('alpha, rad'); subplot(3,2,3); plot(t,Xo(:,3),'b');grid on xlabel('Time, s'); ylabel('theta, rad'); subplot(3,2,4); plot(t,Xo(:,4),'b');grid on xlabel('Time, s'); ylabel('q, psf'); subplot(3,2,5); plot(t,Xo(:,5),'b');grid on xlabel('Time, s'); ylabel('h, ft'); %} %{ %% Controllability % Compute the controllability matrix, P, using the MATLAB function. P = ctrb(sys_ss); % Determine if the system is controllable by checking the rank of P. % The rank of P should match the number of rows (or columns) of the square % matrix A. disp(' ') if rank(P) == n disp('The system is controllable.'); else disp('The system is NOT controllable.'); end disp(' '); % Compute the condition number for impending singularity. Condition = cond(A); % Degree of Controllability between Mode i and Control j. DoC = zeros(n,m); for i = 1:n for j = 1:m DoC(i,j) = abs(dot(B(:,j), W(i,:))/norm(B(:,j))/norm(W(i,:))); end end % Compute the inverse matrix Pccfi. Pccfi = zeros(n,n); base = CharPoly(n:-1:2); for i = n:-1:1 if i == n % Last row. Set the first element to 1. Pccfi(i,1) = 1; else % Populate the ith row Pccfi(i,1:n-i+1) = [base(i:end) 1]; end end %{ % Compute the Transformation matrix, Tccf. Tccf = P*Pccfi; % Compute the CCF matrices. Accf = TccfA*Tccf; Bccf = TccfB; Cccf = C*Tccf; Dccf = D; %% Observability % Compute the observability matrix, Q, using the MATLAB function. Q = obsv(sys_ss); % Determine if the system is observable by checking the rank of Q. % The rank of Q should match the number of rows (or columns) of the square % matrix A. if rank(Q) == n disp('The system is observable.'); else disp('The system is NOT observable.'); end disp(' ');
  • 80.
    79 American Institute ofAeronautics and Astronautics % Degree of Observability between Mode i and Measurement j. DoO = zeros(p,n); for j = 1:p for i = 1:n DoO(j,i) = abs(dot(C(j,:), V(:,i))/norm(C(j,:))/norm(V(:,i))); end end % Compute the OCF form of the observability matrix. Qocf = inv(Pccfi); % Compute the Transformation matrix, Tocf = inv(Q)Qocf. Tocf = QQocf; % Compute the CCF matrices. Aocf = TocfA*Tocf; Bocf = TocfB; Cocf = C*Tocf; Docf = D; function [A,B,C,D] = closed_loop_system(sys_p, sys_c) %**************************************************** ********************** % % Function computes the closed loop matrices for a particular plant and % controller. % % % Inputs: % sys_p structure, plant state space system % Fields: % .Ap [nxn] matrix, State matrix % .Bp [nxm] matrix, Control matrix % .Cp [pxn] matrix, Output matrix % .Dp [pxm] matrix, Direct transmission matrix % sys_c structure, controller state space system % Fields: % .Ac [ncxnc] matrix, Controller state matrix % .Bc1 [ncxmc1] matrix, Plant output matrix % .Bc2 [ncxnr] matrix, Reference matrix % .Cc [mxnc] matrix, Controller output matrix % .Dc1 [mxmc1] matrix, Control-Plant output matrix % .Dc2 [mxnr] matrix, Control-Reference matrix % % % Outputs: % A [nxn] matrix, Closed loop state matrix % B [nxm] matrix, Closed loop control matrix % C [pxn] matrix, Closed loop output matrix % D [pxm] matrix, Closed loop direct transmission matrix % % % Version history: % 2013.12.30 KRB Initial release % %**************************************************** ********************** % Extract plant matrices. Ap = sys_p.Ap; Bp = sys_p.Bp; Cp = sys_p.Cp; Dp = sys_p.Dp; % Extract controller matrices. Ac = sys_c.Ac; Bc1 = sys_c.Bc1; Bc2 = sys_c.Bc2; Cc = sys_c.Cc; Dc1 = sys_c.Dc1; Dc2 = sys_c.Dc2; % Intermediate matrices. Dc1Dp = Dc1*Dp; Z = eye(size(Dc1Dp,1)) - Dc1Dp; DpiZDc1 = Dp*inv(Z)*Dc1; if (all(abs(sys_c.Ac(:)) < 1e-6) && all(abs(sys_c.Bc1(:)) < 1e-6) && ... all(abs(sys_c.Bc2(:)) < 1e-6)) % No controller state defined. % Closed loop A matrix. A = Ap + Bp*inv(Z)*Dc1*Cp; % Closed loop B matrix. B = Bp; % Closed loop C matrix. C = Cp; % Closed loop D matrix. D = Dp; else % Controller state defined. % Closed loop A matrix. A = [Ap + Bp*inv(Z)*Dc1*Cp, Bp*inv(Z)*Cc; Bc1*(eye(size(DpiZDc1,1))+DpiZDc1)*Cp, Ac+Bc1*Dp*inv(Z)*Cc]; % Closed loop B matrix. B = [Bp*inv(Z)*Dc2; Bc2 + Bc1*Dp*inv(Z)*Dc2]; % Closed loop C matrix. C = [(eye(size(DpiZDc1,1))+DpiZDc1)*Cp, Dp*inv(Z)*Cc]; % Closed loop D matrix. D = Dp*inv(Z)*Dc2; end function [freq_data] = freq_analysis(sys_p, sys_c, w, i_in, i_out) %**************************************************** ********************** % % Function performs a frequency analysis for a MIMO system for a particular % input / output pair. The analysis is performed at both the plant input % and the plant output. % % % Inputs: % sys_p structure, plant state space system % Fields: % .Ap [nxn] matrix, State matrix % .Bp [nxm] matrix, Control matrix % .Cp [pxn] matrix, Output matrix % .Dp [pxm] matrix, Direct transmission matrix % sys_c structure, controller state space system % Fields: % .Ac [ncxnc] matrix, Controller state matrix % .Bc1 [ncxmc1] matrix, Plant output matrix % .Bc2 [ncxnr] matrix, Reference matrix % .Cc [mxnc] matrix, Controller output matrix
  • 81.
    80 American Institute ofAeronautics and Astronautics % .Dc1 [mxmc1] matrix, Control-Plant output matrix % .Dc2 [mxnr] matrix, Control-Reference matrix % % % Outputs: % freq_data structure, frequency response data % Fields: % .input structure, frequency response broken at plant % input % .output structure, frequency response broken at plant % output % .system structure, data associated with closed loop % system of plant and controller % % % Version history: % 2013.12.30 KRB Initial release % 2014.03.17 KRB Fixed Cin in computing Lin % %**************************************************** ********************** % Get the number of frequencies. nf = numel(w); % Extract plant matrices. Ap = sys_p.Ap; Bp = sys_p.Bp; Cp = sys_p.Cp; Dp = sys_p.Dp; % Extract controller matrices. Ac = sys_c.Ac; Bc1 = sys_c.Bc1; Bc2 = sys_c.Bc2; Cc = sys_c.Cc; Dc1 = sys_c.Dc1; Dc2 = sys_c.Dc2; % Initialize input frequency analysis substructure. freq_data.input.Lin = zeros(nf,1); freq_data.input.ReturnDiff= zeros(nf,1); freq_data.input.StabRobust= zeros(nf,1); freq_data.input.LoopGainXover_rps= 0; freq_data.input.GMRD = [0,0]; freq_data.input.PMRD = [0,0]; freq_data.input.GMSR = [0,0]; freq_data.input.PMSR = [0,0]; freq_data.input.Gnoise = zeros(nf,1); % Initialize output frequency analysis substructure. freq_data.output.S = zeros(nf,1); freq_data.output.T = zeros(nf,1); % Initialize system substructure. freq_data.system.OLEvalues = []; freq_data.system.CLEvalues = []; % Close the loop Z = inv(eye(size(Dc1*Dp))-Dc1*Dp); Acl = [(Ap+Bp*Z*Dc1*Cp) (Bp*Z*Cc); (Bc1*Cp+Bc1*Dp*Z*Dc1*Cp) (Ac+Bc1*Dp*Z*Cc)]; Bcl = [(Bp*Z*Dc2); (Bc2+Bc1*Dp*Z*Dc2)]; Ccl = [(Cp+Dp*Z*Dc1*Cp) (Dp*Z*Cc)]; Dcl =(Dp*Z*Dc2); %%%%% EIGENVALUE ANALYSIS %%%%% % Compute the eignevalues of the open loop plant, and closed loop system. freq_data.system.OLEvalues = eig(Ap); freq_data.system.CLEvalues = eig(Acl); %%%%% LOOP GAIN AT PLANT INPUT ANALYSIS %%%%% %Create SS model of loop gain at the plant input. Ain = [ Ap 0.*Bp*Cc; Bc1*Cp Ac]; Bin = [ Bp; Bc1*Dp]; Cin = -[ Dc1*Cp Cc]; Din = -[ Dc1*Dp]; % Perform frequency analysis for each input. L_in = zeros(nf,1); RD_in= zeros(nf,1); SR_in= zeros(nf,1); Gnois= zeros(nf,1); for i = 1:nf % s = j*omega s = sqrt(-1)*w(i); % Controller object. KK = Cc*inv(s*eye(size(Ac))-Ac)*Bc1+Dc1; % Loop Gain. L_in(i) = Cin(i_in,:)*inv(s*eye(size(Ain))- Ain)*Bin(:,i_in)+Din(i_in,i_in); % Return difference. RD_in(i) = 1.+L_in(i); % Difference at actuator input. SR_in(i) = 1.+1./L_in(i); % Noise transfer function. Gnois(i) = max(svd(KK)); end % Compute crossover frequency. magdb = 20.*log10(abs(L_in)); wc = FindCrossover(magdb,w); % Compute the return difference and stability robustness MIMO margins. rtd = 180/pi; rdm = min(abs(RD_in)); srm = min(abs(SR_in)); rd_gm = [ (1/(1+rdm)) (1/(1-rdm)) ]; sr_gm = [ (1-rdm) (1+rdm) ]; rd_gm = 20*log10(rd_gm); sr_gm = 20*log10(sr_gm); rd_pm = rtd*2*asin(rdm/2); sr_pm = rtd*2*asin(srm/2); % Store. freq_data.input.Lin = L_in; freq_data.input.ReturnDiff= RD_in; freq_data.input.StabRobust= SR_in; freq_data.input.LoopGainXover_rps= wc; freq_data.input.GMRD = rd_gm; freq_data.input.PMRD = rd_pm; freq_data.input.GMSR = sr_gm; freq_data.input.PMSR = sr_pm; freq_data.input.Gnoise = Gnois;
  • 82.
    81 American Institute ofAeronautics and Astronautics %%%%% LOOP GAIN AT PLANT OUTPUT ANALYSIS %%%%% %SS model of loop gain at the plant output Aout = [ Ap Bp*Cc; 0.*Bc1*Cp Ac]; Bout = [ Bp*Dc1; Bc1]; Cout = [ Cp Dp*Cc]; Dout = [ Dp*Dc1]; sens = zeros(nf,1); compsens = zeros(nf,1); for i = 1:nf % s = j*omega s = sqrt(-1)*w(i); % Loop at Plant output (Az). Lout = Cout(i_out,:)*inv(s*eye(size(Aout))- Aout)*Bout(:,i_in)+Dout(i_out,i_in); % Sensitivity Sout = inv(eye(size(Lout))+Lout); % Complementary sensitivity Tout = Sout*Lout; % Get max SV for each sensitivity. sens(i) = max(svd(Sout)); compsens(i) = max(svd(Tout)); end % Store. freq_data.output.S = sens; freq_data.output.T = compsens; function t1 = FindCrossover(a,t) %find the value of t where a crosses zero n=numel(a); j=0; while j <= n, if a(n-j) > 0., i=n-j; j=n+1; end; j=j+1; end pp=inv([t(i) 1.;t(i+1) 1.])*[a(i);a(i+1)]; t1=-pp(2)/pp(1); function plot_freq_resp(freq_resp, w) %**************************************************** ********************** % % Generates various figures for the specified frequency response. % % % Inputs: % freq_resp Structure, frequency response data. Refer to the file % "freq_analysis.m" for field definitions % w n-element vector, frequency vector at which frequency % response data was collected (rps) % % % Outputs: % MATLAB figures % % % Version history: % 2013.12.30 KRB Initial release % %**************************************************** ********************** % Constant rtd = 180/pi; % Extract data from frequency response structure. L_in = freq_resp.input.Lin; wc = freq_resp.input.LoopGainXover_rps; RD_in = freq_resp.input.ReturnDiff; rd_min = min(abs(RD_in)); SR_in = freq_resp.input.StabRobust; sr_min = min(abs(SR_in)); sens = freq_resp.output.S; S_max = max(abs(sens)); compsens= freq_resp.output.T; T_max = max(abs(compsens)); Gnois = freq_resp.input.Gnoise; % Draw circles. dd=0.:.001:2*pi; xx1=cos(dd)-1;yy1=sin(dd); xx2=rd_min*cos(dd)-1;yy2=rd_min*sin(dd); % Nyquist plot figure, plot(xx1,yy1,'k',real(L_in),imag(L_in),'b',xx2,yy2,'r- ','LineWidth',2);grid axis([-2 2 -2 2]); text(.5,.5,['radius = ' num2str(rd_min)]) xlabel('Re(L)') ylabel('Im(L)') title('Nyquist') xw_plot = 2*min(w); % Loop Gain Bode magnitude figure semilogx(w,20*log10(abs(L_in)),'LineWidth',2);grid text(xw_plot,10.,['LGCF = ' num2str(wc)]) xlabel('Frequency (rps)') ylabel('Magnitude dB') title('Bode'); % Loop gain Bode phase figure semilogx(w,rtd*angle(L_in),'LineWidth',2);grid xlabel('Frequency (rps)') ylabel('Phase deg') title('Bode'); % Plot Return Difference 1+L magnitude. figure semilogx(w,20*log10(abs(RD_in)),'LineWidth',2);grid text(xw_plot,10.,['min = ' num2str(rd_min)]) xlabel('Frequency (rps)') ylabel('Magnitude dB') title('|I+L| at input') % Plot Stability Robustness 1+inv(L) magnitude. figure semilogx(w,20*log10(abs(SR_in)),'LineWidth',2);grid text(xw_plot,10.,['min = ' num2str(sr_min)]) xlabel('Frequency (rps)') ylabel('Magnitude dB')
  • 83.
    82 American Institute ofAeronautics and Astronautics title(' |I+inv(L)| at Plant Input') % Plot sensitivity. figure semilogx(w,20*log10(sens),'LineWidth',2);grid text(xw_plot,-10.,['max = ' num2str(S_max)]) xlabel('Frequency (rps)') ylabel('Magnitude dB') title(' |S| at Plant Output') % Plot complementary sensitivity. figure semilogx(w,20*log10(compsens),'LineWidth',2);grid text(xw_plot,-10.,['max = ' num2str(T_max)]) xlabel('Frequency (rps)') ylabel('Magnitude dB') title(' |T| at Plant Output') % Plot noise to control magnitude. figure semilogx(w,20*log10(Gnois),'LineWidth',2);grid xlabel('Frequency (rps)') ylabel('Magnitude dB') title('Noise-to-Control Transfer Function Matrix') Appendix IX — Nyquist Plots Figure 41. Nyquist Plot for Stability
  • 84.
    83 American Institute ofAeronautics and Astronautics Figure 42. Nyquist Plot for Stability Appendix IX — Visual Risk Chart Figure 43. Visual Representation of Risk Analysis Acknowledgments The team would like to thank Dr. Raymond Lebeau, Dr. Douglas Schwaab, Cody Alger, Ben Winokur, the faculty of Parks College of Engineering, Aviation, and Technology at Saint Louis University, and the Department of Aerospace and Mechanical Engineering for their mentorship, assistance, and financial support throughout this project. References 1 Leishman, J. Gordon. Principles of Helicopter Aerodynamics. Cambridge: Cambridge UP, 2006. Print. 2 Lennon, Andy. RC Model Airplane Design. Osceola, Wis., USA: Motor International, 1986. Print. 3 Raymer, Daniel P. Aircraft Design: A Conceptual Approach. Reston, VA: American Institute of Aeronautics and Astronautics, 2012. Print. 4 Roskam, Jan, and Chuan-Tau Edward Lan. Airplane Aerodynamics and Performance. Lawrence, KS: DARcorporation, 2008. Print. 5 Schmidt, D. K. Modern Flight Dynamics. New York, NY: McGraw-Hill, 2012. Print.