Jump to content

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


Diazo

Recommended Posts

I figured it shouldn't, but just wanted to make sure it was known that I don't yet have access to this part (it's experimental by virtue of the contract). I haven't seen anything like this before with such parts, though - just this one. Let me know if you need any other data or reproduction from my setup and I'll see what I can do.

Link to comment
Share on other sites

Version 1.17b

Download here.

-Rewrite Height Control code to use the correct kinematic equations.

-Rename height control buttons to make more sense. Actual mechanics of the buttons have not changed.

Caution: Due to a control delay loop in KSP's code I have not been able to isolate, on long height changes (including orbit drop), as your effective TWR goes up, you will see more overshoot of your target height.

It is not too serious however, my test vessel on the Mun with at TWR of about 20 was seeing roughly 100 meters of overshoot when dropping from 100km orbit to 500m in one shot. Just be aware and leave a bit of a safety margin so you don't crash please.

@Thrombo: Was unable to replicate your bug, however I added a bunch of error logging so if it happens again I will know exactly what is going on.

Have fun all,

D.

Link to comment
Share on other sites

I figured it shouldn't, but just wanted to make sure it was known that I don't yet have access to this part (it's experimental by virtue of the contract). I haven't seen anything like this before with such parts, though - just this one. Let me know if you need any other data or reproduction from my setup and I'll see what I can do.

The same thing started happening to me after updating to 1.17a this morning, except it occurs with every ship, not just ones with a contract item. Here is the snipped from the log where things appear to start going wrong:


...<SNIP>...
[LOG 23:44:13.628] Vessel assembly complete!
[LOG 23:44:13.629] stage manager starting...
[LOG 23:44:13.629] all systems started
[LOG 23:44:13.668] Vertical Veloctiy 1.17b Loaded
[LOG 23:44:13.710] Parsing vector3
[LOG 23:44:13.711] Parsing vector2
[LOG 23:44:13.726] Parsing int
[LOG 23:44:13.727] Parsing rect
[LOG 23:44:13.727] Parsing rect
[LOG 23:44:13.728] Parsing rect
[LOG 23:44:13.729] Parsing bool
[LOG 23:44:13.729] Parsing bool
[LOG 23:44:13.730] Parsing keycode
[LOG 23:44:13.730] Parsing bool
[LOG 23:44:13.731] Parsing bool
[LOG 23:44:13.732] Parsing bool
[LOG 23:44:13.732] Parsing bool
[LOG 23:44:13.733] Parsing double
[LOG 23:44:13.734] Parsing double
[LOG 23:44:13.734] Parsing double
[LOG 23:44:13.735] Parsing double
[LOG 23:44:13.735] Parsing double
[LOG 23:44:13.736] Parsing double
[LOG 23:44:13.737] Parsing double
[LOG 23:44:13.737] Parsing double
[LOG 23:44:13.738] Parsing double
[LOG 23:44:13.739] Parsing double
[LOG 23:44:13.739] Parsing double
[LOG 23:44:13.740] Parsing double
[LOG 23:44:13.740] Parsing double
[LOG 23:44:13.741] Parsing double
[LOG 23:44:13.742] Parsing double
[LOG 23:44:13.742] Parsing double
[LOG 23:44:13.743] Parsing double
[LOG 23:44:13.744] Parsing double
[LOG 23:44:13.744] Parsing double
[LOG 23:44:13.745] Parsing double
[LOG 23:44:13.746] Parsing double
[LOG 23:44:13.746] Parsing double
[LOG 23:44:13.747] Parsing double
[LOG 23:44:13.747] Parsing double
[LOG 23:44:13.748] Parsing double
[LOG 23:44:13.749] Parsing double
[LOG 23:44:13.749] Parsing double
[LOG 23:44:13.750] Parsing double
[LOG 23:44:13.751] Parsing double
[LOG 23:44:13.751] Parsing double
[LOG 23:44:13.752] Parsing double
[LOG 23:44:13.752] Parsing double
[LOG 23:44:13.753] Parsing double
[LOG 23:44:13.754] Parsing double
[LOG 23:44:13.754] Parsing double
[LOG 23:44:13.755] Parsing double
[LOG 23:44:13.756] Parsing double
[LOG 23:44:13.756] Parsing double
[LOG 23:44:13.757] Parsing double
[LOG 23:44:13.758] Parsing double
[LOG 23:44:13.758] Parsing double
[LOG 23:44:13.759] Parsing double
[LOG 23:44:13.759] Parsing double
[LOG 23:44:13.760] Parsing double
[LOG 23:44:13.761] Parsing double
[LOG 23:44:13.761] Parsing double
[LOG 23:44:13.762] Parsing double
[LOG 23:44:13.763] Parsing double
[LOG 23:44:13.763] Parsing double
[LOG 23:44:13.764] Parsing double
[LOG 23:44:13.765] Parsing double
[LOG 23:44:13.765] Parsing double
[LOG 23:44:13.766] Parsing double
[LOG 23:44:13.766] Parsing double
[LOG 23:44:13.767] Parsing double
[LOG 23:44:13.768] Parsing double
[LOG 23:44:13.768] Parsing double
[LOG 23:44:13.769] Parsing double
[LOG 23:44:13.770] Parsing double
[LOG 23:44:13.770] Parsing double
[LOG 23:44:13.771] Parsing double
[LOG 23:44:13.772] Parsing double
[LOG 23:44:13.772] Parsing double
[LOG 23:44:13.773] Parsing double
[LOG 23:44:13.774] Parsing int
[LOG 23:44:13.774] Parsing int
[LOG 23:44:13.775] Parsing int
[LOG 23:44:13.775] Parsing int
[LOG 23:44:13.776] Parsing double
[LOG 23:44:13.777] Parsing double
[LOG 23:44:13.777] Parsing double
...<SNIP>...
[LOG 23:44:14.477] TWR1 Fixed Fail: 17 System.ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
at System.Collections.Generic.List`1[UnityEngine.Transform].get_Item (Int32 index) [0x00000] in <filename unknown>:0
at VerticalVelocity.TWR1Data.FixedUpdate () [0x00000] in <filename unknown>:0
...<SNIP>...
[LOG 23:44:21.686] TWR1 Fixed Fail: 17 System.NullReferenceException: Object reference not set to an instance of an object
at VerticalVelocity.TWR1Data.FixedUpdate () [0x00000] in <filename unknown>:0
[LOG 23:44:21.690] Look rotation viewing vector is zero
[LOG 23:44:21.701] TWR1 Fixed Fail: 17 System.NullReferenceException: Object reference not set to an instance of an object
at VerticalVelocity.TWR1Data.FixedUpdate () [0x00000] in <filename unknown>:0

After that point it beings repeating

[LOG 23:44:22.467] TWR1 Fixed Fail: 17 System.NullReferenceException: Object reference not set to an instance of an object  at VerticalVelocity.TWR1Data.FixedUpdate () [0x00000] in <filename unknown>:0 
[LOG 23:44:22.468] Look rotation viewing vector is zero
[LOG 23:44:22.469] TWR1 Fixed Fail: 17 System.NullReferenceException: Object reference not set to an instance of an object
at VerticalVelocity.TWR1Data.FixedUpdate () [0x00000] in <filename unknown>:0
[ERR 23:44:22.473] Invalid parameter because it was infinity or nan.


[ERR 23:44:22.473] Invalid parameter because it was infinity or nan.


[ERR 23:44:22.474] Invalid parameter because it was infinity or nan.


[LOG 23:44:22.476] Look rotation viewing vector is zero
[LOG 23:44:22.477] Look rotation viewing vector is zero

Then other mods begin throwing errors due to not being able to find objects or scenes.

Link to comment
Share on other sites

Okay, it looks like it is that specific part.

[LOG 23:44:14.477] TWR1 Fixed Fail: 17 System.ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
at System.Collections.Generic.List`1[UnityEngine.Transform].get_Item (Int32 index) [0x00000] in <filename unknown>:0
at VerticalVelocity.TWR1Data.FixedUpdate () [0x00000] in <filename unknown>:0

means that when this mod is checking for the thrustTransform of the engine to see how far that engine is pointing off vertical, it can't find it.

If this is correct, it should only happen to some engines, but it will always happen to that specific engine type.

As I assumed every engine would have a thrustTransform (and all the ones I tested did) explains why this slipped through my testing.

Since I thought that if the engine does not have a thrustTransform, it shouldn't be producing thrust in game, I did not think to test specifically for this.

I'll update as soon as I get home tonight. For now, the error should only be limited to specific engines so if you can use different ones that will be okay as a workaround.

D.

Link to comment
Share on other sites

Okay, it looks like it is that specific part.

[LOG 23:44:14.477] TWR1 Fixed Fail: 17 System.ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
at System.Collections.Generic.List`1[UnityEngine.Transform].get_Item (Int32 index) [0x00000] in <filename unknown>:0
at VerticalVelocity.TWR1Data.FixedUpdate () [0x00000] in <filename unknown>:0

means that when this mod is checking for the thrustTransform of the engine to see how far that engine is pointing off vertical, it can't find it.

If this is correct, it should only happen to some engines, but it will always happen to that specific engine type.

As I assumed every engine would have a thrustTransform (and all the ones I tested did) explains why this slipped through my testing.

Since I thought that if the engine does not have a thrustTransform, it shouldn't be producing thrust in game, I did not think to test specifically for this.

I'll update as soon as I get home tonight. For now, the error should only be limited to specific engines so if you can use different ones that will be okay as a workaround.

D.

I ran into this as well when I started to build my first skycrane. Some engines worked, and some, the game just crashed.

for now, I've uninstalled the mod, will reinstall it when the next version comes out.

Link to comment
Share on other sites

Version 1.17c

-Fix ModuleEngineFX reference

Download here

Alright, here's the fix for some of the engines crashing to a black screen.

At this point, I believe the only outstanding issue is that the Height Control is not as accurate as I would like due to the control loop issue in KSP I still have not figured out.

Otherwise, there are no bugs and I aware of and everything is behaving as expected.

If not, let me know and I'll fix it up for you guys.

D.

edit: Link fixed.

Edited by Diazo
Link to comment
Share on other sites

Version 1.17c

-Fix ModuleEngineFX reference

Download here

Alright, here's the fix for some of the engines crashing to a black screen.

At this point, I believe the only outstanding issue is that the Height Control is not as accurate as I would like due to the control loop issue in KSP I still have not figured out.

Otherwise, there are no bugs and I aware of and everything is behaving as expected.

If not, let me know and I'll fix it up for you guys.

D.

edit: Link fixed.

Just a suggestion, if you add a phased slowdown like I had described earlier, this problem may go away, since it won't be doing a suicide burn.

Link to comment
Share on other sites

The issue is that even with a phased slow down, the control loop delay is still there, the phased slow down just hides it by making the overshoot only a few meters on final descent.

The basic math itself is correct, I'm hoping to spend some time this weekend tweaking the values I use to try and get something I'm satisfied with.

(No worries about any more bugs, this is just changing numbers already in the code, I'm not adding anything new.)

No promises though, I really have no clue what is causing this control loop delay and I want to try and figure that out first.

D.

Link to comment
Share on other sites

A great, lightweight solution compared to mechjeb! The only thing I think it is missing is horizontal velocity control, to keep the craft in place when using it as a skycrane. I would use mechjeb for this but it doesn't seem to agree with helicopters, as far as I can see.

That is exactly what my Horizontal Landing Aid mod is designed to do. Note that the version of that mod that works on a non-focus vessel is not released yet, but if you let it stabilize the in-game SAS will work for quite a while

The next version of the Landing Aid mod that does unfocused vessels is "done" in that I have written the code, I'm just squashing the last bugs before I release it. I want it to go smoother then the update to this mod did.

D.

Link to comment
Share on other sites

  • 1 month later...

First off, awesome mod, thanks! I just started using it for a large base I am constructing, and landing the modules on top of each other is much easier when I don't have to worry about both descent speed as well as horizontal offet.

One issue though: sometimes when I increment or decrement the velocity, my ship's current target is lost. Is there a reason that this mod is modifying the target? I would love to be able to use this mod without having to always re-target.

Thanks again for all your work on this!

Link to comment
Share on other sites

This mod does nothing to your target.

What I suspect is happening is that you are hitting the "click-through" effect where GUI windows do not stop mouse clicks from falling through to the 3D game space.

(edit: Confirmed via testing.)

You see this problem with this mod and not others because you have to double-click to deselect your target which you do to change the velocity by multiple steps, while other mods use buttons that only need a single click which does not clear your target.

I should be able to add a lockout that forces KSP to keep your current target when you mouse-over the window for this mod. The workaround for now is to slow down your click speed when changing the velocity setpoint.

D.

Edited by Diazo
Link to comment
Share on other sites

I should be able to add a lockout that forces KSP to keep your current target when you mouse-over the window for this mod. The workaround for now is to slow down your click speed when changing the velocity setpoint.

D.

Your explanation makes sense, thanks. Preventing the click from falling through the mod UI would be great. Also, I haven't tested this, but will typing numbers in the auto-height input box activate action groups attached to those numbers? If so, can that be prevented as well?

Link to comment
Share on other sites

Your explanation makes sense, thanks. Preventing the click from falling through the mod UI would be great. Also, I haven't tested this, but will typing numbers in the auto-height input box activate action groups attached to those numbers? If so, can that be prevented as well?

At the moment, maybe. On windows they will not but on linux the numbers will also activate the action groups. I am also adding a lockout for that to the next version, that is straightforward though and I know how to do it already.

I'm still figuring out how to lock the target so it can't change.

D.

Link to comment
Share on other sites

Version 1.18

-Prevent rapid clicking of velocity change buttons from falling through and acting as a double click which clears your current target.

-If ControlLock is installed, the text fields will now use that to prevent the number keys from activating their associated action groups. (For Linux users.)

Download version 1.18 here.

The ControlLock mod can be found here.

@JAD_Interplanetary: This should resolve things for you, let me know how it goes.

D.

Link to comment
Share on other sites

-Prevent rapid clicking of velocity change buttons from falling through and acting as a double click which clears your current target.

This works great! Thank you

-If ControlLock is installed, the text fields will now use that to prevent the number keys from activating their associated action groups. (For Linux users.)

Is this supposed to happen automatically when the input field is focused? It works when I explicitly turn ControlLock on in the toolbar, but not automatically.

Link to comment
Share on other sites

It should.

Does the ControlLock icon gain a red border? That means that it is this mod locking things out.

The yellow border is when you click on the ControlLock icon to manually lock everything.

I'll double check on my end.

D.

edit: Working as intended on my end. If it does not work for you, can you please get me an output_log.txt and your mod list please as it probably means there is a mod conflict happening.

Edited by Diazo
Link to comment
Share on other sites

Does the ControlLock icon gain a red border? That means that it is this mod locking things out.

...

If it does not work for you, can you please get me an output_log.txt and your mod list please as it probably means there is a mod conflict happening.

It's definitely not turning red when I focus the field. I'll get you a log and a mod list, but it may be a day or so before that happens. Thanks for looking into it.

Link to comment
Share on other sites

Here is my mod list:

Active Texture Management x86 Basic - v4-3

Chatterer - v0.8.1

Control Lock - v1.2

Docking Port Alignment Indicator - v5.1

Flag Decals - v2.1

Hullcam VDS - v0.33

Kerbal Alarm Clock - v3.2.3.0

Kerbal Engineer Redux - v1.0.15.2

Module Manager - v2.5.9

SCANSat - v10.0

Vertical Velocity Controller - v1.18

Here is a copy of a log where I used vertical velocity control from the launchpad. First, I used in the auto height field without manually toggling on ControlLock. It didn't turn red. Then I manually toggled it on, and it turned yellow and did not let me send commands to the main window until I toggled it off again.

https://www.dropbox.com/s/7o7ulhzackostrw/KSP.log?dl=0

Link to comment
Share on other sites

@JAD: Alright. Real life got a hold of me but I have now had a chance to look at your log file.

And there are no errors in it that would point out what is not working correctly.

Which probably means it is some tiny difference between Windows and Linux that is tripping me up.

I'll have to ask you to keep clicking the button manually for now, actually getting this working correctly is going to require me to get a linux virtual machine working so I can dig into this.

There is a chance the player.log recorded something the KSP.log missed if you are able to upload a copy of that for me, but it is not a large chance. (The How to Get Support sticky would have that file's location.)

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