Sunday, December 21, 2008

Description of CRRCSIM



A Guided Tour of CRRCsim by Mark Drela 5 Dec 00
------------------------

The CRRCsim Project was kicked off when Jan Kansky announced
on the CRRC Email List that he was working on porting a freeware
flight simulator out of NASA Langley to run on his home computer.
He was looking for a means to generate the aero data for
any arbitrary airplane to plug into the simulator.
Cooincidentally, I had the means to generate such aero data
and was looking for a simulator to plug it into... A flurry
of email code exchanges between me and Jan followed.
The initial CRRCsim version was announced by Jan shortly thereafter.

During the quick development, I discovered that
the "guts" of the Langley simulator code which
computed the aerodynamic forces had serious limitations.
It assumed that the aircraft didn't deviate
very much from a single cruise speed, and performed only
benign maneuvers. If these restrictions were violated,
the computed forces would be seriously in error,
and unrealistic flight behavior might result.
I completely replaced the Langley code with new code
which does not have such restrictions. Even relatively
violent maneuvers can now be simulated with reasonable
accuracy.

The writeup below gives a brief overview of flight simulator
basics. The features specific to CRRCsim are
then described at the end.

Simulators 101
--------------
All flight simulators use the same basic approach
to keep track of the aircraft. At any instant
in time, the simulated aircraft has some location
and some orientation. These are defined by six
numbers: the aircraft's x,y,z coordinates (3 numbers),
and by its heading, elevation, and roll angles (3 more numbers).

These six quantities are used by the graphics routines
of the simulator to display the aircraft at that instant.
As the quantities change in time at some fast rate,
the airplane's position and orientation changes,
so that it appears to fly -- just like in a movie.

The main problem for the simulator program is to rapidly
calculate the correct sequence of the six quantities,
according to the airplane's properties and the pilot's
control inputs. The more accurate this calculation is,
the more realistic the plane's flight behavior appears.

Updating all six quantities requires calculation of the forces
and moments (torques) on the aircraft. Some, like gravity forces
or gyroscopic moments, are easy to compute. They only require
knowledge of the mass and inertias of the aircraft, which are
specified by the user. Other forces, like thrust, are set
directly by the pilot himself. The remaining forces and moments
are aerodynamic in origin, and are the most difficult to compute.


CRRCsim simulator
-----------------
CRRCsim computes aerodynamic forces and moments from data
generated by a "Vortex Lattice" program AVL, which in turn
takes its input from a geometric definition of the aircraft.
The geometric definition consists of chords, dihedral, twists,
airfoils, control surfaces, etc. which are specified by the user.
AVL is in effect a numerical wind tunnel which simulates
the airflow over the specified configuration and computes
the force and moment data. For example, it computes the
CL versus angle-of-attack curve which might otherwise be
measured in a wind tunnel. AVL actually computes about
20 such curves --- 3 forces and 3 moments, versus 2 flow angles
(angle-of-attack and sideslip angle), and 3 rotation rates
(roll, pitch, yaw rates), in appropriate combinations.

The AVL simulation accounts for most of the important aerodynamic
phenomena which might be present, e.g. the wing downwash
effects on the stab, roll moment due to sideslip angle,
adverse yaw moment of ailerons, etc.
Other customizable simulators on the market must use more crude
estimates for these effects, since their simple geometry input
does not allow specification of the necessary geometry details
needed for high-fidelity calculations.

Although AVL's aerodynamic force and moment results are
valid for any airspeed, its accuracy starts to degrade
if the angle of attack or sideslip angles exceed about
+/-20 degrees from straight ahead. This is due to
flow separation, stall, etc. which AVL does not model.
Flow separation occurs quite infrequently even during
violent flight maneuvers, but it's essential that the
computed forces remain at least reasonable for any flow angle.
In a tail slide, for example, the angle of atack is about 180 degrees!
If the resulting computed moments completely unreasonable, then
the tailslide recovery will not be realistic.

For maximum accuracy, CRRCsim itself estimates separation-caused
drag forces and moments, and adds them to what AVL's
output predicts. The overall result is very realistic
behavior of the aircraft in any flight situation.

CRRCSIM working with RC Tx in Ubuntu

Finally got this to work. The key is to right-click on the volume control and crank up the "Capture MUX" setting. Also make sure that the "input source" is set to be the "Front Mic". Once that is done, I actually seem to get pretty smooth control action.