Project Space Transportation System 2016

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
This seems to work:
ATMPRESSURE = GetAtmPressure(); if (ATMPRESSURE >.1)//in atmosphere so use control surfaces { //EnableRCS(true); SetADCtrlMode(7);//set control surface enable (SetAttitudeMode(0));//no rcs } else { //in space SetADCtrlMode(0);//disable control surfaces (SetAttitudeMode(1)); (SetAttitudeMode(2)); }


bodyflap
//*******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)(22.5*RAD)); anim_bf = CreateAnimation(0.5); AddAnimationComponent(anim_bf, 0, 1, &BodyFlap);

CreateControlSurface2(AIRCTRL_ELEVATORTRIM, 5, 1.75, _V(0, 0, -17), AIRCTRL_AXIS_XPOS, anim_bf);


RMvYDJd.jpg


I think the real range is 22.5+11.7=34.2.

"The body flap scale reads body flap positions from zero to 100 percent of software-allowed travel. Zero percent corresponds to full up (-11.7°) and 100 percent corresponds to full down (+22.5°). The small pointer at 34 percent is fixed and shows the trail position."

So when does the body flap go from 0% up to 34% trail?
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
Seems correct. Range is 34.2 degrees.

Scale is displayed in %.
0% is -11.7º and 100% is +22.5º. The indicator at 34% corresponds to (the Trail position).

It goes from 0% to 34% when the angle goes from -11.7º to
(and of course, from 34% to 100% when the angle goes from 0º to 22.5º)
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
Thanks. So I wonder when the flap goes to the 34 %? I can make it automatic. Like in space the body flap goes to 34%. Then have keys control the flap. up/down,...
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
689
Points
203
This is from the Approach, Landing and Rollout Handbook:

2.4. BODY FLAP
When guidance transitions to the A/L phase (between 10 kft and 5 kft), the Body Flap (BF) is commanded to trail,
the 34% position. If the BF is not in the auto mode, the crew should return to auto BF, or manually move the BF
to trail. Having the BF at trail protects for tailscrape and ensures good pitch axis control. For the nominal case of
the BF at trail (at T/D), pitch attitude (theta) must be less than 14.6° in order to avoid scraping the BF.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
Thanks. I need to figure out how to make that work. Maybe have the user move to 34 % trail. I assume on launch the bf is at 0, right. Not sure if I can do the auto part though.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
ai44WWQ.jpg

Indicator for manual/automatic.

Switch for BF
Gno94nM.jpg


aoVYZiK.jpg

I can make the switch move the flap up/down.

I assume that if you move the bf switch up and release it goes back to center. So when the switch is moved it is manual and not moved Automatic?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
//*******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_bf = CreateAnimation(0.0); AddAnimationComponent(anim_bf, 0, 1, &BodyFlap); //INDICATOR static UINT bfINDGrp[1] = { GRP_bodyflap }; static MGROUP_TRANSLATE BodyFlapIND(vidx, bfINDGrp, 1, _V(0, -.0485, -.013)); anim_BODYFLAPINDICATOR = CreateAnimation(0.0); AddAnimationComponent(anim_BODYFLAPINDICATOR, 0, 1, &BodyFlapIND);

But the movement seems to tied to elevator trim
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, anim_bf); 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 } .

reference:
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.

So to change the BF you use the elevator trim buttons? It was set at anim_bf = CreateAnimation(0.5);

For the indicator? I guess get the elevator trim value and use as the bf movement? so if trim =1 then bf=100%


S4jExs7.jpg

SkK72s2.jpg


Not sure when that OFF changes to ON?

On the side the push buttons for bdy flap to change it from manual to auto. I think that one of the bars should be out.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
I can get the trim valve. the range is -1 to 1. But the animation is 0 to 1.

here the trim is at 0
XsBccOF.jpg

here the trim is up 1.0 up
vJ3BKHJ.jpg

and here the trim is -1 down
eH05QfK.jpg


I reversed the animation because at 1 the flap cut into the nozzles
//*******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_bf = CreateAnimation(0.0); AddAnimationComponent(anim_bf, 0, 1, &BodyFlap); //INDICATOR static UINT bfINDGrp[1] = { GRP_INDBODYFLAP }; static MGROUP_TRANSLATE BodyFlapIND(vidx, bfINDGrp, 1, _V(0, -.0485, -.013)); anim_BODYFLAPINDICATOR = CreateAnimation(0.0); AddAnimationComponent(anim_BODYFLAPINDICATOR, 0, 1, &BodyFlapIND);

double flapdegree = (GetControlSurfaceLevel(AIRCTRL_ELEVATORTRIM) ); SetAnimation(anim_BODYFLAPINDICATOR, flapdegree); sprintf(oapiDebugString(), "flapdegree %lf;", flapdegree);
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
Looking at your animation you have a single 34º rotation.

I think you need 2 animations:
» Rotation from from 0º to -11.7º (used when trim values are negative - )
» Rotation from 0 to 22.5º (used when trim values are positive + )

With these animations, trim ranges will match animation states (both will go from 0 to 1 if you consider absolute values)

Hope it helps!
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
Thanks. But then that has issues. How to do that with the same mesh groups? Sure I can make the BF animation 0-1. then how to tell the surface control.

I got this to work for the rudder:
double rudderdegree = (GetControlSurfaceLevel(AIRCTRL_RUDDER)); if (rudderdegree < 0)SetAnimation(anim_rudderINDICATOR, ((rudderdegree)/2)+.5); if (rudderdegree > 0)SetAnimation(anim_rudderINDICATOR, ((rudderdegree) / 2) + .5);// 0 to 1 add .5 so as to start at the middle if (rudderdegree == 0)SetAnimation(anim_rudderINDICATOR, .5);



But this seem to work. really ignore the -1to 0 trim. And move the flap with up trim.
not sure if it should be up trim or down trim, though

double flapdegree = (GetControlSurfaceLevel(AIRCTRL_ELEVATORTRIM) ); if (flapdegree<=0)SetAnimation(anim_BODYFLAPINDICATOR, 0); else SetAnimation(anim_BODYFLAPINDICATOR, flapdegree);
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
That would work but you need a symmetrical animation range.

Animation 0.0 = -22º
Animation 0.5 = 0º
Animation 1.0 = 22º

As long as you prevent the animation state from reaching zero it will look good visually (stop it at -17º)
But you still need to do something with the % indicator and trim.

Perhaps scale the values around an asymmetric middle point ;) ?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
Thanks. Which animation? On the body flap with the trim range of -1 to 1. It seems that maybe -1 is animation state 0 and 1 be animation state 1. So at trim 0 the flap would be at the trail position?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
I am looking the animation code.

// ***** 4. Elevator animation of elevons ***** static UINT ElevGrp[4] = {GRP_flapR,GRP_flapL,GRP_aileronL,GRP_aileronR}; static MGROUP_ROTATE Elevator (midx, ElevGrp, 4, _V(0,-2.173,-8.84), _V(1,0,0), (float)(30.0*RAD)); anim_elev = CreateAnimation (0.5); AddAnimationComponent (anim_elev, 0, 1, &Elevator); // ***** 5. Aileron animation of elevons ***** static UINT LAileronGrp[2] = {GRP_flapL,GRP_aileronL}; static MGROUP_ROTATE LAileron (midx, LAileronGrp, 2, _V(0,-2.173,-8.84), _V(-1,0,0), (float)(10.0*RAD)); static UINT RAileronGrp[2] = {GRP_flapR,GRP_aileronR}; static MGROUP_ROTATE RAileron (midx, RAileronGrp, 2, _V(0,-2.173,-8.84), _V(1,0,0), (float)(10.0*RAD)); anim_laileron = CreateAnimation (0.5); AddAnimationComponent (anim_laileron, 0, 1, &LAileron); anim_raileron = CreateAnimation (0.5); AddAnimationComponent (anim_raileron, 0, 1, &RAileron);

trying to figure out the left and right elevon and then the ailerons

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, anim_bf); 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 }

I may just got back to a static display rather than animate
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
On the body flap. I ran SF. they have the trim 0 with the body flap at trail mark. Then trim dn the BF was at 0 and trim up the BF 100
8foSo0y.jpg

IHdRI4A.jpg


But not sure if that is correct?
RMvYDJd.jpg


The easy way is just back the animation at 0-1. BUT then how to apply that to the surface airfoils?

I am really thinking just got with a static display

This is SF.
yXLQSQZ.jpg
 
Last edited:

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
Ok, I got it to work. But now how to move the trim value?

• #define OAPI_LKEY_IncElevatorTrim 68 increment elevator trim setting • #define OAPI_LKEY_DecElevatorTrim 69 decrement elevator trim setting
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
I think I am going to backtrack. Ths SPi will be static. the pushbuttons for AUTO/Manual on the side may be static also
 

Gargantua2024

The Desktop Orbinaut
Joined
Oct 14, 2016
Messages
1,057
Reaction score
1,268
Points
128
Location
San Jose Del Monte, Bulacan
Further ISS missions:
1625379476130.png
STS-120 (Discovery)

1625380184939.png
STS-122 (Atlantis)

1625379884869.png
STS-123 (Endeavour)

1625379587990.png
STS-124 (Discovery)

1625380040035.png
STS-126 (Endeavour)

1625379259808.png
STS-119 (Discovery)

1625379719498.png
STS-127 (Endeavour)

1625378969516.png
STS-128 (Discovery)

1625378023727.png
STS-129 (Atlantis)

The dates are obviously inaccurate, only the true positions of the payloads are done at this point
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,707
Reaction score
2,683
Points
203
Location
Dallas, TX
So this code has an issue.
What it is supposed to do is set rcs on/off and control surfaces active/non active based off atm pressure.

Works but no switching from translation to rotation.

I know why. this " (SetAttitudeMode(1));"sets the rcs to rotation and (SetAttitudeMode(2)); to translation. I need both.

ATMPRESSURE = GetAtmPressure(); if (ATMPRESSURE >.1)//in atmosphere so use control surfaces { //EnableRCS(true); SetADCtrlMode(7);//set control surface enable (SetAttitudeMode(0));//no rcs } else { //in space SetADCtrlMode(0);//disable control surfaces (SetAttitudeMode(1)); (SetAttitudeMode(2)); }
 
Top