Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter SDK
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Orbiter SDK Orbiter software developers post your questions and answers about the SDK, the API interface, LUA, meshing, etc.

Reply
 
Thread Tools
Old 12-10-2017, 10:08 AM   #1
zachary77
Orbinaut
Question Set Center Of Pressure when key is pressed

I'm a total newbie to C++ and the API, so please excuse my ignorance

I'm designing a tailsitter rocket (pain to land, I must say). So, to assist with keeping the nose vertical, I would like to implement a system that:
  • Sets the COP when a key is pressed (K to shift forward, M for aft)
  • Overrides HLVL AP to hold 90 deg pitch
  • Overrides ALT HOLD AP to use mains

How would I go about it? So far, whatever I've tried has broke my code

Any help would be welcome.

Thanks,
Zachary77
zachary77 is offline   Reply With Quote
Old 12-10-2017, 10:16 AM   #2
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Well, I would take a look at the lift function in your first case, especially the context parameter. To be specific - you can solve this by moving the COP as reference of the airfoil or by changing the moment function of the airfoil to have the effects of a different COP. I would try the latter if you try to create the COP shift by aerodynamic means. If you want to have a CoG shift instead by moving mass.

The second and third would be a bit harder, but AFAIR, Orbiter 2016 has a new callback for exactly those cases.

Last edited by Urwumpe; 12-10-2017 at 10:19 AM.
Urwumpe is offline   Reply With Quote
Old 12-10-2017, 10:26 AM   #3
zachary77
Orbinaut
Default

Quote:
Originally Posted by Urwumpe View Post
 Well, I would take a look at the lift function in your first case, especially the context parameter.

The second and third would be a bit harder, but AFAIR, Orbiter 2016 has a new callback for exactly those cases.
Err... that's the issue. I don't understand the lift function at all. (Using ShuttlePB as template) What would I need to change?

Thanks for reply, BTW.
zachary77 is offline   Reply With Quote
Old 12-10-2017, 10:36 AM   #4
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by zachary77 View Post
 Err... that's the issue. I don't understand the lift function at all. (Using ShuttlePB as template) What would I need to change?

Thanks for reply, BTW.
Did the PB ever really have one? Take a look at the DG there for some initial idea.

Basically, you are supposed to calculate the following values there:

Lift coefficient
Drag coefficient
Moment coefficient

The latter value should be zero if the COP is the same position as the reference position of the airfoil.

If you shift the COP, you can shift the whole air foil. Or you start generating moment/torque that rotates the vessel.
Urwumpe is offline   Reply With Quote
Old 12-10-2017, 10:40 AM   #5
Face
Beta Tester
 
Face's Avatar

Default

Urwumpe is right, there is a new callback (API reference p. 581): VESSEL4::clbkNavProcess(int mode). However, it just allows you to tell Orbiter that it should do nothing for a specific AP mode, giving your code the chance to do your own autopilot procedures. The later are not trivial to code, if you want them somewhat realistic.

For the center of pressure, could you please explain why you want that moved? Rotation assist during transition phase?
Face is offline   Reply With Quote
Thanked by:
Old 12-10-2017, 11:06 AM   #6
zachary77
Orbinaut
Default

Quote:
Originally Posted by Face View Post
 Urwumpe is right, there is a new callback (API reference p. 581): VESSEL4::clbkNavProcess(int mode). However, it just allows you to tell Orbiter that it should do nothing for a specific AP mode, giving your code the chance to do your own autopilot procedures. The later are not trivial to code, if you want them somewhat realistic.

For the center of pressure, could you please explain why you want that moved? Rotation assist during transition phase?
Yes, to help stall the wing. Right now I need very overpowered RCS, which isn't precise at all.
zachary77 is offline   Reply With Quote
Old 12-10-2017, 11:09 AM   #7
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by zachary77 View Post
 Yes, to help stall the wing. Right now I need very overpowered RCS, which isn't precise at all.
So you mean something like a spoiler on an aircraft and the problem is actually lift force? Like, minimal forward speed resulting in you flying a curve already?
Urwumpe is offline   Reply With Quote
Old 12-10-2017, 11:31 AM   #8
zachary77
Orbinaut
Default

Quote:
Originally Posted by Urwumpe View Post
 So you mean something like a spoiler on an aircraft and the problem is actually lift force? Like, minimal forward speed resulting in you flying a curve already?
No, when I try to pitch up to 90 deg from level flight, I can't. It just oscillates up and down. If you've ever tried to realistically reenter the stock DG or Shuttle, you know what I mean
zachary77 is offline   Reply With Quote
Old 12-10-2017, 11:36 AM   #9
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by zachary77 View Post
 No, when I try to pitch up to 90 deg from level flight, I can't. It just oscillates up and down. If you've ever tried to realistically reenter the stock DG or Shuttle, you know what I mean
Yes, the aircraft is too stable then. So you want to destabilize it?
Urwumpe is offline   Reply With Quote
Old 12-10-2017, 11:44 AM   #10
zachary77
Orbinaut
Default

Quote:
Originally Posted by Urwumpe View Post
 Yes, the aircraft is too stable then. So you want to destabilize it?
Yes, to land easier.
zachary77 is offline   Reply With Quote
Old 12-10-2017, 11:47 AM   #11
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by zachary77 View Post
 Yes, to land easier.
Then simply make all moments zero, reduce lift for landing and have COP = CoG. This can be done by the context parameter - you can pass data from the vessel to the lift function that way.
Urwumpe is offline   Reply With Quote
Old 12-10-2017, 01:48 PM   #12
Thorsten
Orbinaut
 
Thorsten's Avatar
Default

Quote:
No, when I try to pitch up to 90 deg from level flight, I can't. It just oscillates up and down.
Isn't there a possibility to just reduce the pitching moment as function of alpha? This is what causes this behavior - for large alpha the pitching moment generated by this coefficient is larger than whatever moments airfoils/thrusters can generate - moving center of pressure around or nulling moments sounds like fudging the real issue to me...

(Note that planes which can do this in real life - the Su-27 for instance - usually have thrust vector control because airfoils have little action at high AoA - and TVC gives you very powerful moments.)
Thorsten is offline   Reply With Quote
Old 12-11-2017, 01:18 AM   #13
zachary77
Orbinaut
Default

Quote:
Originally Posted by Thorsten View Post
 Isn't there a possibility to just reduce the pitching moment as function of alpha? This is what causes this behavior - for large alpha the pitching moment generated by this coefficient is larger than whatever moments airfoils/thrusters can generate - moving center of pressure around or nulling moments sounds like fudging the real issue to me...

(Note that planes which can do this in real life - the Su-27 for instance - usually have thrust vector control because airfoils have little action at high AoA - and TVC gives you very powerful moments.)
So TVC is the best solution?
zachary77 is offline   Reply With Quote
Old 12-11-2017, 06:27 AM   #14
Thorsten
Orbinaut
 
Thorsten's Avatar
Default

I'm not familiar with the API or what kind of spacecraft precisely you have in mind, but in reality it would seem TVC is the best option to go from horizontal to tail-down hover flight - basically aerodynamical control won't do (in static hover, you have zero dynamical pressure on the airfoils and hence they have no action - not to mention that they're oriented the wrong way) and RCS thrusters would have to be rather powerful.

So TVC seems the natural choice for that kind of problem to me. It's still hard, mind - there's a reason the tail-down VTOL concept for aircraft was given up and modern VTOL jet craft have more complicated (and heavier) engine arrangements instead. Handling in tail-down hover is very difficult - expect to have to provide massive automated flight assistance...
Thorsten is offline   Reply With Quote
Old 12-11-2017, 07:44 AM   #15
Face
Beta Tester
 
Face's Avatar

Default

I think for tailsitter concepts you should work out what the stall speed in cruise flight is. If it is low enough, you can probably work with RCS mechanisms. If it is too high, I guess you can't really go without thrust vectoring.

I can imagine that a low-stall-speed aircraft can be made "unstable" enough to be able to pitch up beyond laminar air flow break-down, at which point RCS can take over because the aerodynamic forces it has to counter are already small enough.

Perhaps this report gives some hints on the power of real-life VTOL RCS concepts: https://ntrs.nasa.gov/archive/nasa/c...9940030488.pdf .
Face is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter SDK

Tags
c++ question, code, cop


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 11:03 PM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.