Project Space Transportation System 2016

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,620
Reaction score
857
Points
203
Location
Dallas, TX
I got the vc working. I updated the CCTV. So now the switch and light comes on.
rtVgM9e.jpg

Tunnel airlock and ods
41QqBmh.jpg

JJSjeEB.jpg

Questions.
This is why the tunnel airlock assembly need to be a mesh that is added or not in the shuttle. So that animationa are controlled.
mgNeQk3.jpg

Here the thermal cover is removed.
Question is what should the hatch look like? I am not sure if round or D shaped? I think D. I guess I will make it like the shuttle's
W5ct1mw.jpg

Window in it or not? Yes a 4" one:
"The 4-inch-diameter window in each external
airlock hatch is used for crew observation from
the cabin to the airlock and the airlock to the
payload bay."

rKKJ7qc.jpg


I guess also the tunnel adapter hatch needs to be done in case eva is done there?
 
Last edited:

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,620
Reaction score
857
Points
203
Location
Dallas, TX
I redid the body flap now it works like normal animation 0-1. But how to create a control surface or airfoil that adjustes to the BP position?
 

JDat

Addon Developer (maybe)
Joined
Sep 6, 2010
Messages
74
Reaction score
38
Points
18
Hmm.. Can you list all aerosurfces for your shuttle vessel? I don't want to google now what aerosurfaces have real shuttle.
 
Last edited:

DaveS

Space Shuttle Ultra Project co-developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,095
Reaction score
354
Points
173
Hmm.. Cen you list all aerosurfces for your shuttle vessel? I don't want to google now what aerosurfaces have real shuttle.
Shuttle Orbiter Vehicle aerosurfaces:
4xelevons (2xper wing, one inboard, one outboard), functions both as elevators and ailerons
2xRudder/Speedbrake panels (one left, one right), functions both as rudder and airbrake
1xBody flap for SSME thermal protection during entry and elevon trim position between Mach 2.0 and Mach 0.9.
 

Attachments

  • Elevons.jpg
    Elevons.jpg
    63.1 KB · Views: 1
  • Rudder_speedbrake.jpg
    Rudder_speedbrake.jpg
    40 KB · Views: 1
  • Bodyflap.jpg
    Bodyflap.jpg
    50.5 KB · Views: 1

JDat

Addon Developer (maybe)
Joined
Sep 6, 2010
Messages
74
Reaction score
38
Points
18
Thanks DaveS.

OK. Looks like Space Shuttle have only bodyflap.
In OrbiterAPI.h lines 1602 - 1620 are all available aerosuface types. Looks like gattispilot simply need to use FLAPs type. Or I am wrong because don't understand aerodynamics.
 
Last edited:

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,620
Reaction score
857
Points
203
Location
Dallas, TX
typedef enum { AIRCTRL_ELEVATOR, ///< elevator control (pitch control) AIRCTRL_RUDDER, ///< rudder control (yaw control) AIRCTRL_AILERON, ///< aileron control (bank control) AIRCTRL_FLAP, ///< flaps (lift, drag control) AIRCTRL_ELEVATORTRIM, ///< elevator trim AIRCTRL_RUDDERTRIM ///< rudder trim } AIRCTRL_TYPE;
shuttle code:
void Atlantis::CreateAirfoils () { CreateAirfoil (LIFT_VERTICAL, _V(0,0,-0.5), VLiftCoeff, 20, 270, 2.266); CreateAirfoil (LIFT_HORIZONTAL, _V(0,0,-4), HLiftCoeff, 20, 50, 1.5); CreateControlSurface (AIRCTRL_ELEVATOR, 5.0, 1.5, _V( 0, 0, -15), AIRCTRL_AXIS_XPOS, anim_elev); CreateControlSurface (AIRCTRL_RUDDER, 2.0, 1.5, _V( 0, 3, -16), AIRCTRL_AXIS_YPOS, anim_rudder); CreateControlSurface (AIRCTRL_AILERON, 3.0, 1.5, _V( 7,-0.5,-15), AIRCTRL_AXIS_XPOS, anim_raileron); CreateControlSurface (AIRCTRL_AILERON, 3.0, 1.5, _V(-7,-0.5,-15), AIRCTRL_AXIS_XNEG, anim_laileron); CreateControlSurface2(AIRCTRL_ELEVATORTRIM, 5, 1.75, _V(0, 0, -17), AIRCTRL_AXIS_XPOS); CreateVariableDragElement (&spdb_proc, 5, _V(0, 7.5, -14)); // speedbrake drag CreateVariableDragElement (&gear_proc, 2, _V(0,-3,0)); // landing gear drag CreateVariableDragElement (&rdoor_drag, 7, _V(2.9,0,10)); // right cargo door drag CreateVariableDragElement (&ldoor_drag, 7, _V(-2.9,0,10)); // right cargo door drag }

The real question is how to convert the bodyflap animation state (0-1) to a surface so the bodyflap animation changes the surface
 

JDat

Addon Developer (maybe)
Joined
Sep 6, 2010
Messages
74
Reaction score
38
Points
18
The real question is how to convert the bodyflap animation state (0-1) to a surface so the bodyflap animation changes the surface

With C++ code in original Atlantis.cpp file. ~ 150 lines below create airfoils function...
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,620
Reaction score
857
Points
203
Location
Dallas, TX
This: line 338-350 original Atlantis
void Atlantis::CreateAirfoils () { CreateAirfoil (LIFT_VERTICAL, _V(0,0,-0.5), VLiftCoeff, 20, 270, 2.266); CreateAirfoil (LIFT_HORIZONTAL, _V(0,0,-4), HLiftCoeff, 20, 50, 1.5); CreateControlSurface (AIRCTRL_ELEVATOR, 5.0, 1.5, _V( 0, 0, -15), AIRCTRL_AXIS_XPOS, anim_elev); CreateControlSurface (AIRCTRL_RUDDER, 2.0, 1.5, _V( 0, 3, -16), AIRCTRL_AXIS_YPOS, anim_rudder); CreateControlSurface (AIRCTRL_AILERON, 3.0, 1.5, _V( 7,-0.5,-15), AIRCTRL_AXIS_XPOS, anim_raileron); CreateControlSurface (AIRCTRL_AILERON, 3.0, 1.5, _V(-7,-0.5,-15), AIRCTRL_AXIS_XNEG, anim_laileron); CreateVariableDragElement (&spdb_proc, 5, _V(0, 7.5, -14)); // speedbrake drag CreateVariableDragElement (&gear_proc, 2, _V(0,-3,0)); // landing gear drag CreateVariableDragElement (&rdoor_drag, 7, _V(2.9,0,10)); // right cargo door drag CreateVariableDragElement (&ldoor_drag, 7, _V(-2.9,0,10)); // right cargo door drag }

As I understand it As the rudder moves according to keys or joystick then the anim_ rudder moves. What I what is the opposite. USe a key to move the Bodyflap then the animation state tells what the airfoils should be. In the original Atlantis there is no body flap.

In my version the elevator trim controls the body flap.

I did not see a command in the orbiter docs for flaps
 

JDat

Addon Developer (maybe)
Joined
Sep 6, 2010
Messages
74
Reaction score
38
Points
18
You are lazy reading source code, or... you are programming too much during night! Get some rest! Later check:
In Atlantis.cpp file for orbiter 2016 located on line ~480 there is function void Atlantis:: DefineAnimations (void)
Then read documentation how to use CreateAnimation() and AddAnimationComponent()

Use aerosurface type "flaps" for flaps and don't mix with other type of aerosurfaces or later this will become really messy to maintain your code.

PS: You can also inspire from DeltaGlider.cpp code to understand how to define aerosurfaces and animations including landing gear, radiator etc.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,620
Reaction score
857
Points
203
Location
Dallas, TX
Thanks.
Animation for body flap
//*******Body flap static UINT bfGrp[1] = { GRP_Group2 }; static MGROUP_ROTATE BodyFlap(midx, bfGrp, 1, _V(0, -2.199202, - 12.13037), _V(-1,0,0), (float)(34.2*RAD)); anim_bodyflap = CreateAnimation(0.34); AddAnimationComponent(anim_bodyflap, 0, 1, &BodyFlap);

Delta glider:
CreateControlSurface3 (AIRCTRL_ELEVATOR, 1.4, 1.7, _V( 0,0,-7.2), AIRCTRL_AXIS_XPOS, 1.0, anim_elevator); CreateControlSurface3 (AIRCTRL_RUDDER, 0.8, 1.7, _V( 0,0,-7.2), AIRCTRL_AXIS_YPOS, 1.0, anim_rudder); hlaileron = CreateControlSurface3 (AIRCTRL_AILERON, 0.3, 1.7, _V( 7.5,0,-7.2), AIRCTRL_AXIS_XPOS, 1.0, anim_raileron); hraileron = CreateControlSurface3 (AIRCTRL_AILERON, 0.3, 1.7, _V(-7.5,0,-7.2), AIRCTRL_AXIS_XNEG, 1.0, anim_laileron); CreateControlSurface3 (AIRCTRL_ELEVATORTRIM, 0.3, 1.7, _V( 0,0,-7.2), AIRCTRL_AXIS_XPOS, 1.0, anim_elevatortrim);
DOc:
17.57.3.37 void VESSEL::CreateControlSurface ( AIRCTRL_TYPE type, double area, double dCl, const VECTOR3 & ref, int axis = AIRCTRL_AXIS_AUTO, UINT anim = (UINT)-1 ) const Creates an aerodynamic control surface. Parameters Generated on Wed Aug 24 2016 00:01:08 for Orbiter API by Doxygen434 CONTENTS type control surface type (see Aerodynamic control surface types) area control surface area [m2 ] dCl shift in lift coefficient achieved by fully extended control ref centre of pressure in vessel coordinates [m] axis rotation axis (see Control surface axis orientation) anim animation reference, if applicable Note Control surfaces include elevators, rudders, ailerons, flaps, etc. They can be used to control the vessel during atmospheric flight. When selecting automatic axis control (axis=AIRCTRL_AXIS_AUTO), the following axes will be used for given control surfaces: Elevator XPOS Rudder YPOS Aileron XPOS if ref.x > 0, XNEG otherwise Flap XPOS For ailerons, at least 2 control surfaces should be defined (e.g. on left and right wing) with opposite rotation axes, to obtain the angular momentum for banking the vessel. Elevators typically use the XPOS axis, assuming the that the centre of pressure is aft of the centre of gravity. If pitch control is provided by a canard configuration ahead of the CoG, XNEG should be used instead. The centre of pressure defined by the ref parameter is the point at which the lift and drag forces for the control surface are applied. To improve performance, multiple control surfaces may sometimes be defined by a single call to Create←- ControlSurface. For example, the elevator controls on the left and right wing may be combined by setting a centered attack point. Control surfaces can be animated, by passing an animation reference to CreateControlSurface. The animation reference is obtained when creating the animation with CreateAnimation. The animation should support a state in the range from 0 to 1, with neutral surface position at state 0.5.

16.23.2.1 enum AIRCTRL_TYPE Control surfaces provide attitude and drag control during atmospheric flight. See also VESSEL::CreateControlSurface, VESSEL::CreateControlSurface2, VESSEL::CreateControlSurface3 Enumerator AIRCTRL_ELEVATOR elevator control (pitch control) AIRCTRL_RUDDER rudder control (yaw control) AIRCTRL_AILERON aileron control (bank control) AIRCTRL_FLAP flaps (lift, drag control) AIRCTRL_ELEVATORTRIM elevator trim AIRCTRL_RUDDERTRIM rudder trim



As I understand it. When you use the rudder keys. it changes the AIRCTRL_RUDDER. then this changes the rudder anim, right?

If i use the AIRCTRL_ELEVATORTRIM with this:
CreateControlSurface2(AIRCTRL_ELEVATORTRIM, 5, 1.75, _V(0, 0, -17), AIRCTRL_AXIS_XPOS) ,anim_bodyflap);

then as I change the elevator trim using ins/del the body flap moves.

Then how to set the anim_bodyflap on launch. I suppose you could on launch set animation (anim_bodyflap,0). That would move the body flap to 0 percent.
But would just change the anim_state but the control surface, right
 

JDat

Addon Developer (maybe)
Joined
Sep 6, 2010
Messages
74
Reaction score
38
Points
18
I am not experimenting with vessel source code. I can now compile DeltaGlider source code from examples. I am more interesting on interaction between outside world and orbiter. For example control orbiter from ethernet with TCP or HTTP+javascript. To control Aerosurfaces I am using SetControlSurfaceLevel() from vessel.h

As I understand how orbiter/vessel works internally:
When you initialise your vessel, You are creating aerosurfaces with some functions. Not related to any graphics. Only mathematics with atmosphere modeling.
Then you add graphic component and link it with aerosurface. So you can see visually how aerosurface graphics and animation works.

So When I (user/player) press numpad or call SetControlSurfaceLevel() into orbiter core via vessel.h, some magic happens. Orbiter find defined aerosurface form internal table/data structure, do some aerocalculatons in core, and do some animations by calling graphic client (internal or external D3D9).

Maybe there are also callbacks. Meaning: orbiter core call some function to yourvessel.dll and execute your code. But this is different topic.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,620
Reaction score
857
Points
203
Location
Dallas, TX
Oh so maybe this:
• void SetControlSurfaceLevel (AIRCTRL_TYPE type, double level) const Updates the position of an aerodynamic control surface. • void SetControlSurfaceLevel (AIRCTRL_TYPE type, double level, bool direct) const Updates the position of an aerodynamic control surface

Where the level would be the animation state? But if the range is -1 to 1 then need to do some math to get the 0-1 to be -1 to 1
 

JDat

Addon Developer (maybe)
Joined
Sep 6, 2010
Messages
74
Reaction score
38
Points
18
Hmm. If I understand correctly, you want some trim handle or button on cockpit to test and/or change your body flap position.
Check how elevator trim is working in Deltaglider source code AerodynSubsys.cpp:
ElevatorTrim::clbkParseScenarioLine
ElevatorTrimWheel::processMouse2D
ElevatorTrimWheel::processMouseVC

float myFloatVariable = 0; // or double, I don't remember, check docs
I am using vessel->SetControlSurfaceLevel(AIRCTRL_AELERON, myFloatVariable); for my experiments
AIRCTRL_AELERON is from AIRCTRL_TYPE enum in OrbiterAPI.h
myFloatVariable is in range -1 to +1 according to documentation.

Position 0 is center or normal position, for AELERON. -1 is max down postion, +1 is max up position.
You must research real Space Shuttle manual for correct body flap positions, and that program it in logical way into your code.

For some tests you can hack into Rcontrol.dll addon, add some buttons, scrollers etc and add SetControlSurfaceLevel() functionality for code testing. It will take some time for coding, but it is kinda easy. Then recompile Rcontrol.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,620
Reaction score
857
Points
203
Location
Dallas, TX
Yes I want the body flap to move with in the mouse. I got that to work. I think If do this get the bp animation state (0-1) x2 =(0to 2) -1 give -1 to 1.
like this:
double bodyflap1; bodyflap1 = (bodyflap * 2)-1; SetControlSurfaceLevel(AIRCTRL_ELEVATORTRIM, bodyflap1);

Of course I have a ctd issue not related to this
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,620
Reaction score
857
Points
203
Location
Dallas, TX
I think I found it. But not sure why it crashes. this is in prestep
SetAnimation(anim_BODYFLAPINDICATOR, bodyflap); SetAnimation(anim_bodyflap, bodyflap); //TRIM * 0, 354 - 0. 177 double bodyflap1; bodyflap1 = (bodyflap * 2) - 1; sprintf(oapiDebugString(), "bodyflap1 bodyflap %5.3f %5.3f", bodyflap1, bodyflap); //SetControlSurfaceLevel(AIRCTRL_ELEVATORTRIM, bodyflap1);

if I uncomment the
SetControlSurfaceLevel(AIRCTRL_ELEVATORTRIM, bodyflap1);

it CTD bodyflap1 is -1 to 1 in range
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,620
Reaction score
857
Points
203
Location
Dallas, TX
Back to no idea. I run the debugger it CTD but the debugger has no output.
 

JDat

Addon Developer (maybe)
Joined
Sep 6, 2010
Messages
74
Reaction score
38
Points
18
Where you are calling SetAnimation(); When initializing or when change bodyflap handle (button, scroll etc?) during simulation?
As I understand SetAnimation() must be called only when initializing vessel. SetControlSurfaceLevel() is called anywhere during simulation.
Remember SetControlSurfaceLevel() is callled every time when you press nupad buttons during simulation + when aerosurfaces are enabled.
 
Top