Jump to content

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


Diazo

Recommended Posts

@GoldenShadowGS: Can I have a .craft file? That sounds nothing like what my tests show, but I only test 2 or 3 vessel builds so you are probably using something that is outside my current design.

For comparison, the amount of overshoot I see is almost always less then 5 meters and even when I throw a ship at the moon with hyperedit at high speed, I still only see 10 meters or so of overshoot.

Note that I can't remove the overshoot entirely due to how the mod evolved (it's a velocity control mod first, with the height control added later), but in the latest version it should be down to only a few meters max. That's why I recommend that you do not land on Height Control, but Velocity Control, I can't promise that Height Control will not overshoot its target.

Lastly, there should be no question if the height control is activated or not, the button on the GUI window tells you what mode it is in. (The one along the bottom.) When in Height Control, the button should change to say "In Auto". If the GUI window it saying one thing and doing another that's a critical error that I will fix ASAP.

D.

Edited by Diazo
Link to comment
Share on other sites

The altitude overshoot might have been due to rapid changes in elevation, so I'm not very worried about that.

the problem is I can click on the button for height control and it doesn't always switch to showing "In Auto" How does the mod decide when to be in that mode versus "Free pitch?"

Link to comment
Share on other sites

When not in auto, it should say "Auto Height (now)" or "Auto Height (Free)" that tells you which mode it will enter when you click the button.

Auto Height (Now): Height mode immediately engages and takes over the throttle control to take you to your desired altitude.

Auto height (Free): I also call this 'Orbit Drop' mode, but this means you are high enough that it will take over 20 seconds of freefall before the engine needs to activate to stop you at your target height. While in this mode, the mod does not control the throttle (in fact in this mode, it does nothing), then once you hit the 20 seconds until the mod needs to take control it will switch to "Thrust Warning" to give you enough time to get your vessel back to vertical for when it switches to 'Auto Height (now)' mode and it takes control of the engine.

The point of this is to not have to worry about your altitude as you descend. How it is supposed to work is that while in orbit, enter your target altitude and go into Auto Height (Free) mode. Then start your braking burn to drop out of orbit with full control of the throttle to control your speed and so you can target where you want to land. Then you get the "Thrust Warning", get your vessel back to vertical and the mod brings you to a stop in a hover at your target altitude.

Or at least it is supposed to, it sounds like this is not happening correctly for you. Can you point out what is not working for you in this?

D.

Link to comment
Share on other sites

How does the button decide when to change from "Auto Height(Free)" to "Auto Height (Now)"? I think that's the problem I had. It must have been in the wrong mode when I clicked it. It worked every time it said (Now).

Edited by GoldenShadowGS
Link to comment
Share on other sites

It is supposed to use the same logic (20 seconds of free fall) but from the sounds of it that is broken and it's not switching correctly. Notably, switching late so once the 20 seconds of thrust warning finish and it goes to (Now), there is not sufficient time left.

I'll look at the numbers and run some tests myself and see if I can tighten things up.

D.

Link to comment
Share on other sites

I've been attempting to launch my Saturn V recreation into orbit with a single burn with no coasting to apoapsis (like the real life Saturn V). Do you think this mod would be handy for this? I've read the description and most of the thread but I won't be home for a few days to try it.

Link to comment
Share on other sites

@Walsht9: It depends, but for launch I don't think so.

In velocity mode, you set a vertical speed and the mod will maintain that speed, but only in the vertical axis. As you tip over, your actual speed and vertical speed will become farther and farther apart as you increase your horizontal speed for orbit.

I've used it on high TWR vessels before so I don't lose speed to going too fast on launch, but once you leave the lower atmosphere that really is not relevant any more. (In atmosphere once you start going faster then terminal velocity, even if it is away from the planet, you lose too much DeltaV to drag.)

In height control mode it might be okay for the first part of the trip, but as you pitch over it will exceed the angle limit and height control will disengage itself. The height control calculations assume that 80% of your thrust will always be available for vertical thrust. Once the angle of the vessel exceeds about 50° from vertical, this amount of thrust is no longer available and so height control turns off and goes to velocity control with a setpoint of 0m/s to try and stop the vessel from crashing. Remember that this is usually used while descending, if height control mode does not have the thrust it needs, you are looking at a crash and I need to avoid that if I can.

In thinking on it while writing this, I'm pretty sure that this mod will not really do what you are looking for.

D.

Link to comment
Share on other sites

@Walsht9: It depends, but for launch I don't think so.

In velocity mode, you set a vertical speed and the mod will maintain that speed, but only in the vertical axis. As you tip over, your actual speed and vertical speed will become farther and farther apart as you increase your horizontal speed for orbit.

I've used it on high TWR vessels before so I don't lose speed to going too fast on launch, but once you leave the lower atmosphere that really is not relevant any more. (In atmosphere once you start going faster then terminal velocity, even if it is away from the planet, you lose too much DeltaV to drag.)

In height control mode it might be okay for the first part of the trip, but as you pitch over it will exceed the angle limit and height control will disengage itself. The height control calculations assume that 80% of your thrust will always be available for vertical thrust. Once the angle of the vessel exceeds about 50° from vertical, this amount of thrust is no longer available and so height control turns off and goes to velocity control with a setpoint of 0m/s to try and stop the vessel from crashing. Remember that this is usually used while descending, if height control mode does not have the thrust it needs, you are looking at a crash and I need to avoid that if I can.

In thinking on it while writing this, I'm pretty sure that this mod will not really do what you are looking for.

D.

Thanks for the reply. After reading a bit more I figured that might be the case. I'm not so much interested in efficiency as I am in historic realism. I'm on of THOSE ocd nerds haha. Do you know if there is any plugin that will let me set a specific TWR or acceleration limit for specific engines?

Link to comment
Share on other sites

Do you know if there is any plugin that will let me set a specific TWR or acceleration limit for specific engines?

On most of my lifters I leave a safety buffer of deltaV so I just use KER's display and keep my TWR in the 1.4-1.7 range until I clear the lower atmosphere and accept that I'm using more deltaV then I need to.

Not scientific and far from the optimal ascent method, but it works.

I think the terminal velocity ascent speed is closer to TWR of 2.0, but I play with FAR installed so if you hit the terminal velocity wall your ship starts tumbling end over end and that's a flight failure with the larger vessels I tend towards.

D.

Link to comment
Share on other sites

@Golenpeach: Yes and no.

Yes: If you engage height control mode with a set altitude of 5 meters, the mod will attempt to maintain 5 meters altitude above terrain as you move sideways.

No: To actually stop at the desired altitude, the closer you get to your desired altitude, the slower the mod changes your velocity so you come to a stop as close as possible to your target height. If you are sliding sideways over hilly terrain or mountains, the height of the ground could easily be changing faster then the mod can keep up with. Compounding this is that the mod only knows the terrain directly under the vessel, it has no prediction for the terrain you are about to cross.

There were experiments with this previously by another user (pages 12, 13 of the thread) and in Version 1.13 I made the height control more aggressive to try and account for what you are trying to do.

Currently, the math looks like this: On Kerbin if you set the desired height to 5 meters, at 4.9m below target, so 0.1m above the ground, the mod will only try to raise the vessel at a speed of 3.5m/s. If you are sliding horizontally at 10m/s, it only requires the ground to be rising at a 20° angle for the ground to be rising faster then the mod is trying to raise you up. (10m/s at 20° has the ground rising at 3.6m/s.)

So yes, the mod does what you are looking for, but the lower you get the less of a safety margin you have for it to keep you from hitting the ground.

D.

Link to comment
Share on other sites

Thank you for the answer!

Also, your mod is cool: I used it with KAS to take a probe core(for the sole purpose of trying KAS) in mid-air.

The most challenging part was to stabilize the "crane" over the core, until I remember that since 0.24 we have vernier engine!

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

KSP Version 0.25 Compatible

Version 1.13 is KSP 0.25 compatible and no download is required if you already have this version.

Note however that the Z key is used by default to control this mod, this will conflict with the new "Set throttle to max" option introduced in 0.25 as that is Z by default.

I recommend changing the "Set Throttle to Max" to the tilde key (~ key, above TAB and left of the 1 key) and leaving this mod bound to Z.

Every other nearby key is already bound to something else by default and the tilde is the closest free key.

I recommend this because you need to press and hold the Z key and press throttle up/down/cut (shift/ctrl/X) to use this mod while using the Set Throttle to Max function requires just tapping the key assigned to it.

Note that you can also unbind the Z key from this mod and all its functions are available via mouse-click on screen.

Also, if you leave both this mod and the Set Throttle to Max option to Z, this mod will override the Set Throttle to Max function as pressing Z with this mod installed will lock you vertical velocity at you current vertical velocity.

I do not recommend this as every time you press the Z key, the throttle will spike to max for an instant before the mod cuts in and set the throttle to your velocity setpoint which could lead to vessels bouncing more then they should. I would rather you unbound the Set Throttle to Max function to avoid this.

I have no plans to change the key this mod is bound to. In the default key layout there is no other nearby key I can use that allows you to control this mod and the throttle one-handed. (Suggestions welcome if you have an idea on a better way to deal with this.)

D.

Edited by Diazo
Link to comment
Share on other sites

Can you make this craft-dependent so that if you set something to hover and then switch to it, it will still hover.

Also, is there a way to make it also cancel out horizontal speed, either using RCS or yawing?

No, I am not able to keep a vessel hovering when you switch away from it. This is a KSP limitation, you are not allowed to switch away from a vessel if the throttle is not zero.

For canceling out your horizontal speed, that is what my RCS Land Aid mod does (link in my sig). It also gives you the option of hovering over a specific point on the ground to allow precision landing when assembling a base.

D.

Link to comment
Share on other sites

Version 1.14

-Add in-game support for un-binding the key this mod uses.

Previously while you could change the bound key, you could not unbind it.

-Change the mod so that upon first installation it is not bound to a key. The Z key has been taken by Squad for the Set Throttle to Max command and there is no other key nearby that will work that is not already bound to something else.

If you need to unbind the key for the mod manually for some reason, find the GameData\Diazo\TWR1\TWR1.cfg file and change the TWR1Key line to:

TWR1Key = None

Note the caps, 'none' will throw an error and not work.

@brusura: Thank you for pointing this out, this was a holdover from the earlier versions where mouse control was not possible and if the key was unbound you could not use the mod.

D.

Edited by Diazo
Link to comment
Share on other sites

  • 2 weeks later...

ok i've read the OP and seen what this mod does but just to be on the safe side here and avoid me being an ass for misunderstanding i'll just ask this now.

1)am i right in saying that this mod will TRY to keep a VTOL stable and in the air even if you've completely ballsed up the design?

2)it will try to make the vtol hover if you set it up correctly.

3)and after you've messed around with it you can just turn it to "0" and use the plane function or will it try to make the VTOL/plane hover? (i'm using the movable engines from B9 so i'm curious if it will conflict with me changing the engines from downwards to forwards thrust)

if i'm wrong then please do correct me so that i can get a better idea of what this mod really does :D

Link to comment
Share on other sites

ok i've read the OP and seen what this mod does but just to be on the safe side here and avoid me being an ass for misunderstanding i'll just ask this now.

1)am i right in saying that this mod will TRY to keep a VTOL stable and in the air even if you've completely ballsed up the design?

No, this mod does not do that. However, this is the primary reason I recommend using Davon Throttle Control as well, it does offer this functionality for the player and I do officially support the two mods working together. (The other reason I recommend installing Davon as well is for the multiple throttles, see below.)

2)it will try to make the vtol hover if you set it up correctly.

Yes, this mod is designed to control your vertical speed, including a short-cut key to hover.

3)and after you've messed around with it you can just turn it to "0" and use the plane function or will it try to make the VTOL/plane hover? (i'm using the movable engines from B9 so i'm curious if it will conflict with me changing the engines from downwards to forwards thrust)

Yes, it can do that. Note that setting this mod to 0 (zero) will cause it to try and maintain a vertical speed of 0, you will want to turn this mod off once you are using the plane functions.

Now, the wildcard is that you are using movable engines. Right now, the procedure is to use the Davon Throttle Control mod and leave your (non-movable) vertical lift engines on Throttle 0, and put your horizontal thrust engines on Throttle 1. This mod will only try and control the engines on throttle 0 to control your vertical speed, it will ignore any engines on throttle 1. In this setup, this mod even detects the lift from your wings as your horizontal speed accelerates and will throttle down automatically as your wings generate more lift.

The catch is that this mod assumes all the engines it controls point straight down, relative to the set Up direction. (The red line display under settings.) Moveable engines will not stay pointing straight down and so I'm not sure exactly what will happen.

The reason I'm not sure is that as the engines turn from vertical to horizontal, the lift compensation will kick in thinking you have "negative lift" happening and boost it's output to compensate, but I'm not sure how fast or how smooth it would do this.

Do keep me posted, I have not used VTOL's extensively myself and I do want to make sure my mod correctly supports stuff like this.

D.

Link to comment
Share on other sites

There are actually several mods out there to auto-balance unstable craft, Davon throttle control is my preffered due to the other, additional options it offers. I did not see the need to rewrite that logic as there are several options out there to suit your needs.

However, there are no mods that I am aware of that allow you to control your vertical velocity to make a nice soft landing with a skycrane that this mod does so that is the niche I am trying to fill with it. (Full-up autopilots such as Mechjeb offer that option of course, but I don't install autopilots as a rule so this mod exists to fill that hole for me.)

D.

Link to comment
Share on other sites

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