Jump to content

Aircraft control question


barfing_skull
 Share

Recommended Posts

[Moderator's note. This series of posts was originally split off from the MechJeb thread, since it's really more about "how to accomplish a thing" with various mods being discussed as possibilities, rather than being about MechJeb itself.]

Hey all.

I'm having a problem doing something that seems simple with Smart A.S.S. but yet the way to do it is eluding me.  Essentially I want to keep my craft's roll and pitch at zero when it's in the air, regardless of which direction it's facing or moving.

What I want is SURF-> Up (which does a pitch of 90 degrees) to have a pitch of 0 degrees, and complete freedom in the horizontal plane.  I've tried ADV -> SURFACE_HORIZONTAL but it requires a horizontal reference which in my case is irrelevant, I want control over where it's pointing in the horizontal direction.  I could probably do this by having a "control from here" part that's oriented vertically, but "forward" for this craft needs to be in the horizontal plane as it's designed for atmospheric flight.

There's SURF -> SURF then check both PIT and ROL to 0, HDG unchecked. which works fine until I point the craft in another direction more than 90 degrees, at which point it flips it over on its back to point it in the original direction, which is definitely not what I'm looking for.  The craft needs to stay horizontal relative to the ground regardless of the heading, not flip over front to back.

Any hints on how I can achieve this?

Cheers!

Edited by Snark
Note added by moderator
Link to comment
Share on other sites

13 hours ago, barfing_skull said:

*snip* Essentially I want to keep my craft's roll and pitch at zero when it's in the air, regardless of which direction it's facing or moving. *snip*

Any hints on how I can achieve this?

Cheers!

Hello! Can I recommend you look at Mechjeb's Aircraft Autopilot feature, which allows you to do exactly this: use Roll Hold to control your roll, and set Vertical Speed Hold to zero. (Most aircraft require a degree of pitch up to fly a level course, so Vertical Speed Hold would operate this for you.

I believe there are other Autopilot mods you could look at if MechJeb's doesn't quite suit you.

Have fun!

Link to comment
Share on other sites

15 hours ago, softweir said:

Hello! Can I recommend you look at Mechjeb's Aircraft Autopilot feature, which allows you to do exactly this: use Roll Hold to control your roll, and set Vertical Speed Hold to zero. (Most aircraft require a degree of pitch up to fly a level course, so Vertical Speed Hold would operate this for you.

I believe there are other Autopilot mods you could look at if MechJeb's doesn't quite suit you.

Have fun!

Thanks, I looked at it a bit more carefully, still not quite what I want.  I probably should have elaborated in that what I'm trying to fly is essentially a VTOL rover using lift fans, with a propulsive fan at the back for forward thrust.  No wings.  So, a helicopter, more or less.  So the traditional spaceplane stuff doesn't really help, since it seems geared toward flying a fixed wing aircraft, and this isn't that.   The roll component of MJ's Aircraft Autopilot is useful, but there's no way to zero the pitch.  I've tried Kramax autopilot, too, but it has some odd side effects on this type of craft.  Kramax has worked well for me in the past for fixed wing craft, but it's not quite the same with this.

Tried Atmosphere Autopilot but that's way more complicated than what I'm looking for.

I've got a mod for vertical control of the VTOL with an auto-height function that works well.  Vertical Velocity Controller Redux.  I just need a way to keep the VTOL flat, zero pitch, zero roll, for cruising.  Obviously it's good to be able to turn that off and fly manually for landings using pitch/roll, but for longer flights keeping it flat and just letting Vertical Velocity keep it at a constant altitude above terrain is what I'm looking for.....so something more akin to Smart A.S.S.  Except, that doesn't flip the craft over when I turn it around.  Flying a VTOL upside down is what is often called "undesirable" unless you're practicing lithobraking.

One would think this would be a simple, common thing to desire in attitude control, but a lot of these mods don't really seem to implement it quite that way.

Cheers, and thanks!

Link to comment
Share on other sites

7 hours ago, barfing_skull said:

Thanks, I looked at it a bit more carefully, still not quite what I want...

Ah! I see!

OK, weird thought: add a probe core to the craft, oriented upwards. Control from the prove core, and then you can use the SAS Radial Hold option. This will determinedly keep the probe core pointed away from the ground, which would achieve what you want. Also, check that your command pod doesn't have a switchable Control Point that can be set to Up. If so, setting that to Up and using SAS Radial Hold would also work.

I hope this is useful!

Link to comment
Share on other sites

15 hours ago, softweir said:

Ah! I see!

OK, weird thought: add a probe core to the craft, oriented upwards. Control from the prove core, and then you can use the SAS Radial Hold option. This will determinedly keep the probe core pointed away from the ground, which would achieve what you want. Also, check that your command pod doesn't have a switchable Control Point that can be set to Up. If so, setting that to Up and using SAS Radial Hold would also work.

I hope this is useful!

I've done similar things before with attaching a probe facing up, but in that instance the control point is facing upwards....which screws with the navball when you're trying to fly something in the same horizontal orientation of a plane.   So maybe if there were a way to have the navball follow something other than the point of control.  I'd have to experiment with that and research if there's some way to do it.

The funny thing is that in concept what I want to do is really simple...and multiple mods don't really implement it that way.

Link to comment
Share on other sites

23 hours ago, barfing_skull said:

I've done similar things before with attaching a probe facing up, but in that instance the control point is facing upwards....which screws with the navball when you're trying to fly something in the same horizontal orientation of a plane.   So maybe if there were a way to have the navball follow something other than the point of control.  I'd have to experiment with that and research if there's some way to do it.

The funny thing is that in concept what I want to do is really simple...and multiple mods don't really implement it that way.

I just use docking ports as one can control from them also.  And you get another point to dock to in the deal

Edited by darthgently
Link to comment
Share on other sites

46 minutes ago, darthgently said:

I just use docking ports as one can control from them also.  And you get another point to dock to in the deal

 

So here's the craft in question below.  I added the docking port on top as suggested, but it changes all the controls and the navball, since the control point is relative.  The nav ball shows it pointing up, but the craft is not pointing up, it's pointing east.  The control point needs to remain pointed forward/east to have the controls and navball act correctly, unless there's some way to change the nav/control not to follow the "control from here" part, but have MJ follow that new control point.  I'm guessing that's not possible?

nemEKvF.png

Link to comment
Share on other sites

6 minutes ago, barfing_skull said:

 

So here's the craft in question below.  I added the docking port on top as suggested, but it changes all the controls and the navball, since the control point is relative.  The nav ball shows it pointing up, but the craft is not pointing up, it's pointing east.  The control point needs to remain pointed forward/east to have the controls and navball act correctly, unless there's some way to change the nav/control not to follow the "control from here" part, but have MJ follow that new control point.  I'm guessing that's not possible?

nemEKvF.png

I thought you needed an up-facing control point for vertical flight.  If you put the dock port on the front then forward would be forward.  But the cockpit should give you that.  Are you using kOS or another way beyond stock?  I wouldn't want to try to change the modes of a vehicle like that without something like kOS.  That is a very cool looking cart/hover thing, btw.  Noice.  I haven't explored much in the way of controlling something like that, only rovers, planes, jets, and rockets that have a single mode mostly.  But I have played with a rover that could hop around using thrusters but I just used kOS where you can do about anything you want with regards to steering, which way is up/fwd, etc, in software.  I think I've seen examples of dual mode vehicles using action groups to switch from one mode to another but have no idea how they did it as I don't use action groups beyond simple functions

Link to comment
Share on other sites

On 11/19/2021 at 10:06 AM, Starwaster said:

@barfing_skullSmartASS/SmartACS should do what you want. Surface mode and then set pitch/roll. If you dont want yaw then you can clear that option.

This *almost* works, the problem being that when I rotate (yaw) the craft more than 90 degrees it pitches over upside down in an attempt to point the nose in the original direction, which is not what I want.  I need it to ignore which direction the nose is pointed in the horizontal plane.

Link to comment
Share on other sites

9 minutes ago, darthgently said:

I thought you needed an up-facing control point for vertical flight.  If you put the dock port on the front then forward would be forward.  But the cockpit should give you that.  Are you using kOS or another way beyond stock?  I wouldn't want to try to change the modes of a vehicle like that without something like kOS.  That is a very cool looking cart/hover thing, btw.  Noice.  I haven't explored much in the way of controlling something like that, only rovers, planes, jets, and rockets that have a single mode mostly.  But I have played with a rover that could hop around using thrusters but I just used kOS where you can do about anything you want with regards to steering, which way is up/fwd, etc, in software.  I think I've seen examples of dual mode vehicles using action groups to switch from one mode to another but have no idea how they did it as I don't use action groups beyond simple functions

I'm not using kOS...didn't know about that one.  I looked it up and at first glance it seems like it might have some promise here, though I'm guessing there's at least some learning curve to it.  I suppose being a software engineer I should at least understand the programming aspect, but how that works in the KSP environment and what it actually does to craft could be something interesting to explore.

The rover is actually fairly flyable, with the Vertical Velocity mod which will use engine power to keep it at a preset distance above ground, and just SAS for decent but not great stability.  Set VV to 1000 m above surface, it'll stay there as long as it's got enough power and the orientation of the thrust allows it.  Obviously if the craft tilts in pitch or roll, that changes the thrust orientation, which can be useful in small amounts to move forward, back, sideways.  But I'd like something that returns it to flat with zero pitch and roll for even finer grained control, and the ability to let it just cruise for a while without worrying about the roll or pitch going off level.

The purpose of the craft is that I'm playing the Beyond Home planet pack, and Hydrus has a non-oxygen atmosphere, and floating islands (like on Pandora in Avatar) that I want to land on.  So I'm working on this hovering rover using electric fans to get onto those.

Thanks for the tips!

Link to comment
Share on other sites

5 minutes ago, barfing_skull said:

I'm not using kOS...didn't know about that one.  I looked it up and at first glance it seems like it might have some promise here, though I'm guessing there's at least some learning curve to it.  I suppose being a software engineer I should at least understand the programming aspect, but how that works in the KSP environment and what it actually does to craft could be something interesting to explore.

The rover is actually fairly flyable, with the Vertical Velocity mod which will use engine power to keep it at a preset distance above ground, and just SAS for decent but not great stability.  Set VV to 1000 m above surface, it'll stay there as long as it's got enough power and the orientation of the thrust allows it.  Obviously if the craft tilts in pitch or roll, that changes the thrust orientation, which can be useful in small amounts to move forward, back, sideways.  But I'd like something that returns it to flat with zero pitch and roll for even finer grained control, and the ability to let it just cruise for a while without worrying about the roll or pitch going off level.

The purpose of the craft is that I'm playing the Beyond Home planet pack, and Hydrus has a non-oxygen atmosphere, and floating islands (like on Pandora in Avatar) that I want to land on.  So I'm working on this hovering rover using electric fans to get onto those.

Thanks for the tips!

Looks like a job for kOS.  Quite a few people have built quad/drone/VTOL flight control systems with kOS.  You basically have control over most aspects of the vehicle along with some vector operations and a scripting language.  Bring or learn as you go the physics involved you should be good to go.  It is not the most elegant language, but it is actively maintained and improving.  Like most things KSP, it is a bit of an odd duck.  Especially if you have a programming background.  Those who don't have that background don't know it is an odd duck, lol

Link to comment
Share on other sites

  • 2 weeks later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...