Jump to content

[1.3](Jun04/17) Automate Vertical Velocity and Altitude Control


Diazo

Recommended Posts

Is there a way to make it work as an Autopilot Altitude Holder for an atmospheric airplane? it doesn't work as of now... or i'm doing something wrong if it's supposed to work...

It just manages the throttle but it's not trying to pitch to maintain an altitude with the control surfaces my plane has (and it has plenty of control authority, with and without FAR helpers on)... I'm just trying to find a mod that can hold altitude or trim the airplane, or even let me do the trimming but in a very controlled way so i can trim it perfectly to keep 0m/s Vertical Speed... the current stock trim function sucks... it depends on the amount of microseconds you keep the key pressed, so it's not consistent therefore it's impossible to trim an airplane properly...

I already tried a bunch of mods, MJ included, and none of those use the control surfaces to properly fly a plane, and if you disable the torque, they do absolutly nothing... at all... (with torque enabled it wobbles to the point of not being able to hold anything)...

btw the plane is perfectly flyable by hand with a keyboard... but for a long flight i would prefer not to be trimming it back and forth every minute for those crappy 5m/s the stock trim won't let me get rid off...

Link to comment
Share on other sites

I don't think this mod can do what you are asking.

This mod automatically throttles downwards pointing engines to keep your vertical speed at the set rate. If you have no downwards pointing engines, this mod will not do anything.

Neither does this mod have any sort of heading control or stability functions. The default SAS function has been enough to control any skycrane I have flown (which is quite different from your flight profile).

The mod is aware of lift generated by wings and will compensate for that while engaged, this is notably used for VTOL's when they switch from vertical lift to horizontal flight when taking off, but only to the extent of controlling the throttle on the downwards pointing engines.

At its heart, this mod is to land skycranes smoothly, I have adapted it for use on VTOL's to control their vertical flight, but that means this mod requires downwards pointing engines to have any effect on your craft.

D.

Edited by Diazo
Link to comment
Share on other sites

I don't think this mod can do what you are asking.

This mod automatically throttles downwards pointing engines to keep your vertical speed at the set rate. If you have no downwards pointing engines, this mod will not do anything.

Neither does this mod have any sort of heading control or stability functions. The default SAS function has been enough to control any skycrane I have flown (which is quite different from your flight profile).

The mod is aware of lift generated by wings and will compensate for that while engaged, this is notably used for VTOL's when they switch from vertical lift to horizontal flight when taking off, but only to the extent of controlling the throttle on the downwards pointing engines.

At its heart, this mod is to land skycranes smoothly, I have adapted it for use on VTOL's to control their vertical flight, but that means this mod requires downwards pointing engines to have any effect on your craft.

D.

:(, well at least i tried it, and i find it useful, for other things haha, thank you anyway! S2

Link to comment
Share on other sites

  • 3 weeks later...

This mod appears to work off your other mod that calculates height from the lowest part of the ship to the surface. While this is reasonable, it does have some strange side effects. For example, I tried to hover 10 m above the ground to lower a KAS magnet on a winch. Unfortunately, as I tried to lower it, my craft started flying away! I was really confused until I realized that what was happening was that the magnet was being selected as the bottom of the craft, so the height control was constantly moving me up to keep the magnet 10m off the ground. Since then I switch to Zero Velocity mode instead of height mode before deploying the magnet (if I remember...).

Link to comment
Share on other sites

Yes, I do use the same code to detect the distance from the bottom of the craft and as the magnet gets lowered, the reported distance would use the magnet.

While working as intended that doesn't really make much sense and I'll add an exception for the winches.

D.

Link to comment
Share on other sites

This does not interface with MechJeb at all.

If Mechjeb has any sort of altitude control I expect they would fight with each other.

Do you know how MechJeb's control works? Is it just plane pitch or does it modify engine thrust?

D.

Edited by Diazo
Link to comment
Share on other sites

Version 1.15 release

Download here.

Due to issues with KAS winches causing the mod to think the lowered winch head was the bottom of the vessel, and due to ray cast issues revealed while investigating this at extremely low altitude (the less then 5 meters range), the altitude of the Vessel is now to the vessel's center of mass, the same as KER and MechJeb use.

Instead, when the vessel is landed, the "Altitude" in the main window will now change to a green "LANDED" to indicate your vessel is touching the ground. Note that for KAS users, this Landed indication will show when the winch touches the ground even if your vessel is hovering in the air.

This now means that Altitude will never read zero, even on a small lander an altitude of 2 or 3 meters will be landed and larger landers will read higher when they touch down.

The problem that cause me to switch back to the vessel center of mass was the raycast reporting weird distances as you came in to land. Notably as you get really close to the ground, the raycast stops working. Previously this was hidden by the fact that I overrode the altitude to always display at least a height of 1 meter if you were not landed and forced an altitude of 0 if you were landed. Add in rounding errors to this and it hid the problem.

To add an exception for KAS winches, I had to disable this override of altitude so it revealed the problem and I've been unable to find a work around as the raycast itself is done by Unity, I have no control over it. So instead of having the altitude readout increase as you come in to land, I've reverted to using the vessel's center of mass for altitude and the visual display if your vessel is landed is now the green LANDED text that appears.

D.

Edited by Diazo
Link to comment
Share on other sites

This does not interface with MechJeb at all.

If Mechjeb has any sort of altitude control I expect they would fight with each other.

Do you know how MechJeb's control works? Is it just plane pitch or does it modify engine thrust?

D.

MechJeb's spaceplane guidance operates aerodynamic and RCS controls to aim at the target. The two default target runways have a start and an end setting. It appears to aim at whichever end is closest and align the flight vector through both locations.

What it doesn't do is control the throttle. Nor does it compensate for terrain in the way or for a glideslope angle that when engaged from too low altitude and/or too far out will fly the plane into the ground or water.

Manual control inputs work to override the guidance, as long as they are being input. Getting a plane out of orbit with MechJeb is a bit of a job. Use Landing Guidance to deorbit then turn it off and wait for drag to take the plane down low enough for control surfaces to work. Throttle up and let Spaceplane Guidance aim for the runway. Keep a finger on S to force it up and over obstacles. Also be ready on the throttle.

A standalone spaceplane guidance plugin that can both launch it from the runway and bring it down from orbit and land it, all hands off, would be a very nifty plugin. I've launched planes to orbit with Ascent Guidance but the ascent profile can't really be adjusted properly. It works better to take off manually, get altitude and use SAS to hold about a 45 degree angle until it runs out of air, then let Ascent Guidance take it to orbit.

Link to comment
Share on other sites

Hmmm.

I'm not sure I can give you exactly what you are looking for.

The best would be that if you had some downwards pointing engines, you could engage height control on the Vertical Velocity mod at some low altitude (100 meters?) and if you fell below this it would turn those engines on to try and keep you at 100 meters.

The issue is that MechJeb would then use the RCS and/or pitch down as this mod is pushing the spaceplane higher then MechJeb is trying to put it.

Klunky, and not really what you are asking for, but the best I can think of at the moment as an "avoid the ground" method.

D.

Link to comment
Share on other sites

Ouch, I don't think this mod will be of much help.

It is really a skycrane landing mod that I've shoe-horned some support for space planes into. That imposes a hard limit on what the mod does and it sounds like you are trying to do something else.

If you need to control downwards pointing engines to control your descent, this is the mod for you. Anything else and I'm going to have to say it can't do it.

Note that it is smart about "downwards", if it is activated on a plane in a tumble, it will throttle the engines assigned to it up when they are pointed down, and throttle them down when they are pointed upwards.

D.

Link to comment
Share on other sites

  • 2 weeks later...

OK.. I'm a big into spaceplanes... this mod does do what mechjeb smart ASS does, or translatron, or a combination of the two. However what this mod does that Mechjeb does NOT do is handle thermal turbojets from KSP-Interstellar. Mechjeb2 basically cannot understand how these engines spool, and everything ends in a crash. This module can actual maintain height with them. Also with spaceplanes with downward facing engines, it works brilliantly to hover and maneuver. I love this mod.

My only desire is for a "kill all horizontal velocity" function. it can be very tricky to land safely if you can't kill all the velocity... is this a possibility? the MJ2 version has this, but as I said, can't work with my thermal turbojets/thermal rockets. And the MJ2 version doesn't work with spaceplanes nearly as well as this does.

Link to comment
Share on other sites

This mod does not touch horizontal velocity itself.

However, I did make the RCS LandAid mod (link in my sig) in order to take care of that. It will use use RCS jets to kill your horizontal velocity, or can be used to hover over a specific point on the ground.

This mod, the RCS Land Aid and Davon's Throttle Control mod are the three mods I run to plan my landings, not just fly a controlled crash that does not break anything.

D.

Link to comment
Share on other sites

Hello,would it be possible for this mod to take control of engine gimbal to cancel horizontal velocity.Im using this and RCS LandAid mod,but as you said " Due to how low the thrust of the stock RCS blocks are, on higher gravity worlds you will need several of them in order to be effective",and you need a lot.It's not problem with small crafts,but when building big,you get to magic circle where you need more rsc bloks-more monopropellant tanks-more engines-more fuel-... more parts over all,to balance out something that looked nice and clean at start and you end with rcs block monster :huh: .Don't get me wrong,i find both of your mods very helpful and they made bulding VTOL's much more fun for me,i simply hacked one of rcs blocks to high thrust and isp.

This would get especially handy in sky crane mode with help of not so much rcs bloks or without any.

Regards and thank you.

Link to comment
Share on other sites

That is actually quite a good idea.

The mechanics of it though, those are tricky.

Let me think on it for a bit and run some tests, I'm not even sure how to hook into the gimbal at the moment.

No promises, but I'll at least see what my tests dig up.

D.

Link to comment
Share on other sites

Looking at this for the first time. For a skycrane an extremely handy option would be for it to be able to hold altitude but match a specified target's lat/long. That way you could have it easily come in and hover over a vessel to be lifted. Since you're checking ground height, you basically have a terrain following craft that could track to a given target.

If you can hook into the gimbal that alone might give you the horizontal acceleration you need, then it's just doing the coordinate translation to home in on the target.

Link to comment
Share on other sites

Alright, having had a sleep on it, controlling the gimbals themselves will not work.

Turning the gimbal will make the thrust no longer run through the center of mass of the craft which means the craft will start to tip over.

However, I have since learned how to talk to the SAS system and I should be able to tip the craft back and forth in a controlled fashion to achieve the same effect.

Having said that, this conversation is in the wrong place.

This mod (Vertical Velocity) is deliberately limited to controlling you vertical velocity only, horizontal velocity is controlled by my RCS LandAid mod and I'm going to move this conversation there.

@johnsonwax: The linked RCS LandAid mod already has the functionality to hover over a specific location on the ground, it may be what you are looking for.

D.

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.

×
×
  • Create New...