Request UMMU Compatible Helicopter?

gattispilot - would it be possible to add payload manager into the DLL? It would be good to be able to attach things to the helicopter.

I had an idea last night of attaching a spotlight to it for SAR ops. :)
 
gattispilot - would it be possible to add payload manager into the DLL? It would be good to be able to attach things to the helicopter.

I had an idea last night of attaching a spotlight to it for SAR ops. :)

Maybe but not familiar with it. You can add attachment point in the cfg.


attached is the cargo pallet so you can carry more cargo.


seakingcargo.jpg
 

Attachments

If I recall correctly (and I'll check) Payload manager is just an additional library that needs to be added and a single line of code to include it.
 
If I recall correctly (and I'll check) Payload manager is just an additional library that needs to be added and a single line of code to include it.

Had been a few more lines of code, but generally speaking, it was no rocket science to include.
 
No familiar with it. Where can it be found and I see about adding it.
 
Got it and compiled. But When I run it I don't see the Payload manager in the scenario editor. It is active from the start.



Code:
DLLCLBK void secInit (HWND hEditor, OBJHANDLE hVessel){
	//Here you can define your own Scenario Editor vessel-specific pages
	//...

	//Define PayloadManager Scenario Editor interface
	PayloadManager::DefineScenarioEditorPage(hEditor, hVessel);
}


How is this determined?
const VECTOR3 CS = _V(606, 614, 254);
 
Got it and compiled. But When I run it I don't see the Payload manager in the scenario editor. It is active from the start.

Remember that you need to tell Orbiter in the .cfg file to use your vessel module for scenario editing of your vessel class, it is possible to have two different modules for simulation and scenario editing, both declared by their own attributes in the .cfg
 
I guess you may just have to watch your alt. Not sure how to get it to stop climbing at 4500.

Make lift/thrust a function of Rotor pitch setting and air density. (as it is IRL)

If the air is too thin than you wont' have enough lift to overcome gravity and you'll be unable to maintain a positive rate of climb.
 
Make lift/thrust a function of Rotor pitch setting and air density. (as it is IRL)

If the air is too thin than you wont' have enough lift to overcome gravity and you'll be unable to maintain a positive rate of climb.

You can actually even use a lift function for calculating it, if you want to be precise.
 
Make lift/thrust a function of Rotor pitch setting and air density. (as it is IRL)

If the air is too thin than you wont' have enough lift to overcome gravity and you'll be unable to maintain a positive rate of climb.


Not sure how to code that. On the Ummu plane we got the air pressure and if it was light then adjusted the CW.

this is what I have for the lift:

Code:
//vertical lift component (wings and body)
void VLiftCoeff(VESSEL *v,double aoa,double M,double Re,void *context,double *cl,double *cm,double *cd)
{
 int i;
 const int nabsc=9;
 static const double AOA[nabsc]={-180*RAD,-60*RAD,-30*RAD, -2*RAD, 15*RAD,20*RAD,25*RAD,60*RAD,180*RAD};
 static const double CL[nabsc] ={       0,      0,   -0.4,      0,    0.7,     1,   0.8,     0,      0};
 static const double CM[nabsc] ={       0,      0,  0.014, 0.0039, -0.006,-0.008,-0.010,     0,      0};
 for(i=0;i<nabsc-1 && AOA[i+1]<aoa;i++);
 double f=(aoa-AOA[i])/(AOA[i+1]-AOA[i]);
 *cl=CL[i]+(CL[i+1]-CL[i])*f;  //aoa-dependent lift coefficient
 *cm=CM[i]+(CM[i+1]-CM[i])*f;  //aoa-dependent moment coefficient
 double saoa=sin(aoa);
 double pd=0.015+0.4*saoa*saoa;  //profile drag
 *cd=pd+oapiGetInducedDrag(*cl,1.5,0.7)+oapiGetWaveDrag(M,0.75,1.0,1.1,0.04);
 //profile drag+(lift-)induced drag+transonic/supersonic wave (compressibility) drag
}
//############################################################################//
//horizontal lift component (vertical stabilisers and body)
void HLiftCoeff(VESSEL *v,double betta,double M,double Re,void *context,double *cl,double *cm,double *cd)
{
 int i;
 const int nabsc=8;
 static const double BETA[nabsc]={-180*RAD,-135*RAD,-90*RAD,-45*RAD,45*RAD,90*RAD,135*RAD,180*RAD};
 static const double CL[nabsc]  ={       0,    +0.3,      0,   -0.3,  +0.3,     0,   -0.3,      0};
 for(i=0;i<nabsc-1 && BETA[i+1]<betta;i++);
 *cl=CL[i]+(CL[i+1]-CL[i])*(betta-BETA[i])/(BETA[i+1]-BETA[i]);
 *cm=0.0;
 *cd=0.015+oapiGetInducedDrag(*cl,1.5,0.6)+oapiGetWaveDrag(M,0.75,1.0,1.1,0.04);
}

Code:
//Airfoils
 CreateAirfoil3(LIFT_VERTICAL,_V(0,0,-0.5),VLiftCoeff,0,0,1,1);
 CreateAirfoil3(LIFT_HORIZONTAL,_V(0,0,-4),HLiftCoeff,0,0,1,1);
 CreateControlSurface2(AIRCTRL_AILERON ,1,1,_V(7,-0.5,-15),0);
 CreateControlSurface2(AIRCTRL_AILERON ,1,1,_V(-7,-0.5,-15),0);
 CreateControlSurface2(AIRCTRL_ELEVATOR,1,1,_V(0,0,-15),0);
 CreateControlSurface2(AIRCTRL_RUDDER  ,1,1,_V(0,3,-16),0);
 
Well if we want to do a proper job of it.

Helicopters generally fall into two basic forms.

"Collective Pitch Control" and "Direct Axis Control".

In direct throttle control you have an engine who's drive shaft is attatched directly the rotor/rotors. You increase/decreas your lift by speeding up or slowing down the engine. Steering inputs are managed via a simple swash-plate assembly or by tilting the rotor. Generally you see this scheme in small single engine helis and kit-built craft.

"Collective Pitch Control", orginally concieved by Igor Sikorsky is more mechanically complex but is also more aerodynamically efficient and allows greater range of control inputs. Pretty much all large multi-engine helicopters use it. (I'd say all but it wouldn't surprise me to find out that there is some obscure russian cold-war design that doesn't)

To understand how Collective Pitch Control works imagine each individual rotor blade as an indipendant wing. As the rotor-head spins air flows over the wings producing lift.

In a helicopter using Collective Pitch Control there is a pivot joint at the base of each blade where it attaches to the Hub that allows the blade to move independantly of the head. (The mechanical complexity I mentioned) By increasing the rotor blade/wing's angle of attach(pitch) you also increase the amount of lift it produces.

Likewise by manipulating the AOA of each rotor blade in sequence you can change the vector of your lift producing (in effect) thrust vectoring and allowing you to do fun stuff like fly upside-down (using negative AOA values).

---------- Post added at 07:03 PM ---------- Previous post was at 06:49 PM ----------

Ok if I were to code a helicopter here is how I would do it...

This is very rough but should give you some ideas.

I would create a thruster called "collective" and give it a very low (but still noticable) amount of thrust.

The important thing is that collective should not be strong enough to lift the helicopter on it's own.

I would then write a lift function (airfoil) based on the dimensions of our rotor blades.

Then in the somehwere in the lift function I would incorperate the following.

Airflow (airspeed over the wing) = RotorCircumfrence * 1/2 RotorRPM + ForwardAirspeed

AOA = AOA + CollectivePitchRange * CollectiveThrustLevel

If we wanted to do a truly accurate job we'd model the position of each blade independantly to allow thrust (err lift) vectoring but I'm not sure how I'd code that off the top of my head.
 
Code:
If you adjust the touchdown points you can be on a ship.
SEAKINGCARRIER.jpg


Maybe a input window with the new ground level might be nice.

Ok Maybe like this:

Code:
if(key==OAPI_KEY_O)

{
					oapiOpenInputBox("What is your new Ground Altitude?",ChoiceBox,0,5,(void*)this);
					
				}

But not sure how to get the value the person entered.
 
Last edited:
But not sure how to get the value the person entered.

You need a buffer to write into. In my MFD project I used a global variable in my module because MFD classes are created and destroyed much too often. Within a vessel there may be no such problem and this could be a normal member.
PHP:
char inputstr[80];

Then you need a callback function like this
PHP:
bool MyClass::InputCallback (void *id, char *str, void *usrdata)
{
  sprintf(inputstr, "%s", str);
  // react to the input
  // there convert it to double and store in your properties 
  // or whatever you want
  SetSomeMemberProperty(inputstr);
  return true;
}

And then you open the input box anywhere you need
PHP:
char outputstr[80];
sprintf(outputstr, ""); // this may contain a preset value
sprintf(inputstr, "");
oapiOpenInputBox("Enter Value", &MyClass::InputCallback, outputstr);
 
Thanks. But how do you use the value? Like if someone enter 15 then take that value and adjust the touchdown points.
 
Thanks. But how do you use the value? Like if someone enter 15 then take that value and adjust the touchdown points.

You have to write such a method I called SetSomeMemberProperty()
PHP:
void MyClass::SetSomeMemberProperty(char *str)
{
  double data;
  if(sscanf_s(str, "%lf",&data) == 1)
  {
    // do your attachment stuff I'm not familiar with
    // and use "data" as the input
  }
}

My comments for current version
  • Yaw thrust still much too strong
  • K should start rotor animation and sound
  • Rotor speed should not depend on thrust (thrust controlled by rotor blade angle, not RPM, like Hlynkacg said already)
  • Calc your "hover" thrust not only at vessel creation or by pressing k but every timestep and use vessel->GetAtmPressure() as a multiplicator - that automatically causes an altitude limit and disfunction on moon
 
My comments for current version
  • Yaw thrust still much too strong
  • K should start rotor animation and sound
  • Rotor speed should not depend on thrust (thrust controlled by rotor blade angle, not RPM, like Hlynkacg said already)
  • Calc your "hover" thrust not only at vessel creation or by pressing k but every timestep and use vessel->GetAtmPressure() as a multiplicator - that automatically causes an altitude limit and disfunction on moon
I think K does that now.
So Rotors show turn at a set rate, right
I PM Hlynkacg so maybe we can work on a good model of the engine.

So calculate the Horizonal lift and use the atm pressure as a factor, right?
 
So calculate the Horizonal lift and use the atm pressure as a factor, right?

I don't know what would be physically correct but when the atm pressure is a factor the alt limit would be solved (and moon problem also).
For me personally a simple calculation would be nice enough.
 
this is what I have for the lift:

Code:
//vertical lift component (wings and body)
void VLiftCoeff(VESSEL *v,double aoa,double M,double Re,void *context,double *cl,double *cm,double *cd)
{
 int i;
 const int nabsc=9;
 static const double AOA[nabsc]={-180*RAD,-60*RAD,-30*RAD, -2*RAD, 15*RAD,20*RAD,25*RAD,60*RAD,180*RAD};
 static const double CL[nabsc] ={       0,      0,   -0.4,      0,    0.7,     1,   0.8,     0,      0};
 static const double CM[nabsc] ={       0,      0,  0.014, 0.0039, -0.006,-0.008,-0.010,     0,      0};
 for(i=0;i<nabsc-1 && AOA[i+1]<aoa;i++);
 double f=(aoa-AOA[i])/(AOA[i+1]-AOA[i]);
 *cl=CL[i]+(CL[i+1]-CL[i])*f;  //aoa-dependent lift coefficient
 *cm=CM[i]+(CM[i+1]-CM[i])*f;  //aoa-dependent moment coefficient
 double saoa=sin(aoa);
 double pd=0.015+0.4*saoa*saoa;  //profile drag
 *cd=pd+oapiGetInducedDrag(*cl,1.5,0.7)+oapiGetWaveDrag(M,0.75,1.0,1.1,0.04);
 //profile drag+(lift-)induced drag+transonic/supersonic wave (compressibility) drag
}
//############################################################################//
//horizontal lift component (vertical stabilisers and body)
void HLiftCoeff(VESSEL *v,double betta,double M,double Re,void *context,double *cl,double *cm,double *cd)
{
 int i;
 const int nabsc=8;
 static const double BETA[nabsc]={-180*RAD,-135*RAD,-90*RAD,-45*RAD,45*RAD,90*RAD,135*RAD,180*RAD};
 static const double CL[nabsc]  ={       0,    +0.3,      0,   -0.3,  +0.3,     0,   -0.3,      0};
 for(i=0;i<nabsc-1 && BETA[i+1]<betta;i++);
 *cl=CL[i]+(CL[i+1]-CL[i])*(betta-BETA[i])/(BETA[i+1]-BETA[i]);
 *cm=0.0;
 *cd=0.015+oapiGetInducedDrag(*cl,1.5,0.6)+oapiGetWaveDrag(M,0.75,1.0,1.1,0.04);
}
Code:
//Airfoils
 CreateAirfoil3(LIFT_VERTICAL,_V(0,0,-0.5),VLiftCoeff,0,0,1,1);
 CreateAirfoil3(LIFT_HORIZONTAL,_V(0,0,-4),HLiftCoeff,0,0,1,1);
 CreateControlSurface2(AIRCTRL_AILERON ,1,1,_V(7,-0.5,-15),0);
 CreateControlSurface2(AIRCTRL_AILERON ,1,1,_V(-7,-0.5,-15),0);
 CreateControlSurface2(AIRCTRL_ELEVATOR,1,1,_V(0,0,-15),0);
 CreateControlSurface2(AIRCTRL_RUDDER  ,1,1,_V(0,3,-16),0);


Not sure about it but adjust LIFT_HORIZONAL. So it Atm pressure is 0 then no thrust. solves the moon. So if we use hover thruster aka collective. Then get thrusterlevel hover X atm pressure?

.............................

What if we put in a vectored thruster. So that it would simulate the angle of the blades. So you would be able to adjust the thrust and angle of the thrust. and maybe the angle of the main blades to match the thrust
 
Last edited:
Back
Top