Jump to content

[Plugin,0.15] KICOIT - Kerbal Engineer 0.8, Advanced Brakes v2.1


jhultgre

Recommended Posts

The Kerbal Institute of Counting and Other Important Things would like to announce that recent discoveries in Number Theory have lead our scientist to be able to count beyond the number 9. We have many promising students who have participated in this research and are in search of internships(read: free labor for you tuition checks for us). With our students as part of your space program you will have no problems getting your feet off the ground.

v08screen.png

So I wanted to try my hand at a plugin and having no desire to try to compete on the auto pilot front, I thought I would see what was possible from within the VAB. There is no vessel to be had but the parts still have all of their information so a nice little utility tool seamed like a good place to start.

UI Overhaul Finished

The UI is new and shiny now and I think is a lot cleaner to read. There are currently two stat modules included. Basic stats includes things like mass, fuel amounts, and thrust. Advanced stats includes thrust to weight ratios, Isp, and deltaV. I make no guarantees on their accuracy and will probably be wrong on any stage that includes both solid rockets and liquid engines. Adding new modules should be pretty easy now and actually brings me to the secret feature slated for v1.0. With the way the code has been structured and how the UI is now functioning other mods should be able to add stats modules to the Engineers interface. This would be useful for mods that add life support or other fuel types where knowing how they will function before lift off.

Extending Engineer

I\'m calling this new extendibility the Consultant System. I\'m using the KSPEvent system to find any Consultants that want to be added to the Engineers stats window and provide them with the information that Engineer has already calculated. To add a Consultant to your mod you will need to extend the class KICOITConsultant which extends PartModule then add that to your part.cfg as a module. I plan on uploading an example project here pretty soon but for now look at the KICOITConsultant, ShipData, and StageData classes for the information I\'m provided and use KICOITBasicLogic and KICOITAdvancedLogic as examples.

The Consultant system in its present state works well for what I am currently doing with my stats but I realize it might not be perfect for what other people want to do. If you have feedback on the Consultant System or think things should be changed let me know. I plan to devote any releases between here and V1.0 to improving the system based on any feedback I get.

Change log:

v0.8

new interface

stats broken up into separate modules

can be extended by other mods

Advance Brakes included in same dll for now

v0.5

move to PartModule system

part.cfg now has two required modules

v0.3

aware of atmospheric engines

color coded to show mix of engines

green-only atmospheric engines

yellow-mix of rockets and atmospheric engines

white-only rockets

known issues:

deleted stages don\'t disappear from engineers list

v0.2.1

ported to KSP .15

stability enhancements

performance enhancements

known issues:

not aware of atmospheric engines

v0.2

New model by Evolution

added thrust weight ratios and cumulative weight at each stage

fixed ui not showing for loaded ships and hopefully related problems :P

the Engineer no longer counts itself in when counting parts or weight

known bugs:

placing more than one Engineers on a ship can confuse the UI - either load or start a new ship to fix

Development plan:


  • [li]v0.5 backend overhaul unlikely to have new features[/li]
    [li]v0.8 ui overhaul delta-V/Isp[/li]
    [li]v1.0 possible secret feature[/li]
    [li]v1.1+ COM, COT, etc...[/li]

source: https://bitbucket.org/jhultgre/ksp-plugins/src

download: https://bitbucket.org/jhultgre/ksp-plugins/downloads/Engineer0.8.zip

old versions: https://bitbucket.org/jhultgre/ksp-plugins/downloads

Advaced Brakes

advancedbrakes.png

The Kerbal Institute of Counting and Other Important Things is proud to announce that we have found another importing thing that demands our attention. Namely keeping our students from flipping their airplanes while landing at your aerospace agency. Our peer-reviewed breakthrough can feather the brakes on your landing gear to keep your expensive aircraft right side up on those hairy landings with new pilots.

So while taking a break from working on Engineer by building some planes I noticed they kept flipping over when I applied brakes while landing so I wrote this plugin to fix that. As your plane starts to tip forward the plugin takes power away from the brakes to try to keep you level. While using the plugin my test plane managed to safely stop from 40 m/s when normally it would flip at less than 20 m/s.

If you have an old version delete its dll and use Engineer above.

New features v2.1:

Pressing ALT+B will engage all parking brakes

Merged into Engineers plugin

New features v2:

Added a parking brake option to keep those pesky space planes in one spot. Automatically disengages when throttle above 10%.

Added Taxi Assist mode to help turn while taxing on the runway only activates when under a set speed (25m/s default).

Taxi Assist requires ABS to be on for it to work as a safety measure.

Added toggles to the parts right click menu.

I haven\'t tested this with vab launched planes or on the mun/minmus so if it doesn\'t work there let me know.

The plugin is a PartModule so you will need to add this to the end of SmallGearBay\'s part.cfg, or any other LandingGear type part.

MODULE
{
name = AdvancedBrakes
//all these values are optional, default values will be used if not set
//If vessel\'s angular x velocity is higher than this brakes have no effect
highTolerance = 4.0
//If vessel\'s angular x velocity is lower than this brakes have full effect
lowTolerance = 1.25
//Taxi Assist will only work below this speed (in m/s)
taxiAssistSpeed = 25.0
}

download: Now included with Engineers plugin above for ease of development on my end. If I make anymore non-Engineer centered plugins I will split it back off and combine it with those.

source: same as engineer above

On a side note what is up with the weird letter heights in the right click menu?

Link to comment
Share on other sites

I was not half an hour ago going \'I wish there was a calculator that would figure out my weight per-stage\'. Well done!

EDIT: I can\'t find this amongst my dozens of pages of parts... arrgh.

EDIT: Nevermind, I was looking for an RCS *tank*, not the thruster :P

Have your first bug reports:

1) When loading a new ship after Engineer has already been used on an existing model, Engineer window will not open. Visiting the launch pad and returning to the VAB fixes this.

2) After doing the above, I went back to the VAB, and put an Engineer on a saved ship. After the window opened, I recycled the part. When I hit \'launch\', the window came up saying 'Launch Pad Not Clear', but it had no buttons visible at all. When I click it, the window closes, and the Engineer window pops back up, but it is empty. When I click it, it disappears and the empty 'Pad not clear' window opens again. All buttons are grayed out. To fix this, I can grab a part off the ship which unlocks the buttons, then load a new ship and visit the launch pad which fixes the glitches as mentioned above.

Link to comment
Share on other sites

1) When loading a new ship after Engineer has already been used on an existing model, Engineer window will not open. Visiting the launch pad and returning to the VAB fixes this.

2) After doing the above, I went back to the VAB, and put an Engineer on a saved ship. After the window opened, I recycled the part. When I hit \'launch\', the window came up saying 'Launch Pad Not Clear', but it had no buttons visible at all. When I click it, the window closes, and the Engineer window pops back up, but it is empty. When I click it, it disappears and the empty 'Pad not clear' window opens again. All buttons are grayed out. To fix this, I can grab a part off the ship which unlocks the buttons, then load a new ship and visit the launch pad which fixes the glitches as mentioned above.

1. I tried to prevent multiple engineers from all trying to display their windows at once. Apparently I didn\'t do a very good job :(

2. Probly related to 1, I\'m not sure yet. It would be nice if there were more callbacks going on in the vab. As far as I can tell there is only onPartAttach, onPartDetach, and onEditorUpdate. It could be that I haven\'t figured out everything with the render manager yet.

I got bored:

screen.png

Not the best, want it anyways? Its supposed to be a small console screen and keypad.

That looks pretty good, definitely better than a rcs thruster. If you want to send me the model I could use it on the next release.

I\'d try sticking on the code inside the command module instead of a separate part.

I\'m not sure why I would want to do this. I would think that would prevent you from using this with other plugins that have specialized command pods.

Link to comment
Share on other sites

downloaded and if im not mistaken, it seems to be V1 still. no T/W ratios and it still looks like an RCS thruster.

is the link wrong or am i just being special and missing something?

Stupid url tags having two urls in it. Fixed now, thats what I get for uploading right before bed.

Is the TWR factoring in the combined weight of all stages above it?

Also, out of curiosity, what *is* the thrust / mass relationship in the game?

Yes all stages above are included. The formula I used is stage thrust / (total mass * surface gravity) using values from the wiki for the surface gravity of Kerbin and the Mun.

The part cost is in the cfg. Can you add that pls?

Cost isn\'t attached directly to the parts in the vab, instead there are separate menu objects that have it. I havent looked into getting info out of the cfg yet, but I should be able to get the information from some where once I go looking for it.

Link to comment
Share on other sites

version 0.2 released

I\'m open to ideas for other things to add although I\'ll have to come up with a plan to keep the UI from getting too out of hand.

Specific Impulse (effective exhaust velocity) and delta V for each stage? Specifit impulse is unfortunately a little difficult to calculate because of the weird way KSP handles fuel, but it\'s pretty straight forward.

Specific Impulse is (if I\'ve got the maths right):

Isp = fsT/fm = (T/c) / ((m_tf-m_te)/tc)

where:

Isp = specific impulse (m/s)

fsT = fuel specific impulse (kN*s/fuel unit) = T/c

fm = fuel mass (mt/fuel unit) = (m_tf-m_te)/tc

T = thrust (kN)

c = engine fuel consumption rate (fuel units/s)

m_tf = tank mass, full (mt)

m_te = tank mass, empty (mt)

tc = tank fuel capacity (fuel units)

Because different tanks and engines would have different parameters, you\'d have to calculate fsT and fm individually for each tank/engine, and then average them before plugging them into the formula.

delta V is:

dV = Isp*ln(m_0/m_1)

where:

dV = delta V (m/s)

Isp = specific impulse or effective exhaust velocity (m/s)

m_0 = full mass of entire craft (full mass of entire stage plus higher stages)

m_1 = empty mass of entire craft (empty mass of entire stage plus full mass of higher stages)

Link to comment
Share on other sites

Cost (not sure where, the ui is pretty big already)

Put a toggle for mun/kerbin, and you can halve the width of those columns.

S1-x instead of Stage 1-x

Parts count is probably superfluous.

Instead of Liquid Fuel just call it Fuel, narrows the column.

Instead of RCS Fuel just call it RCS, narrows the column.

Round stuff if needed. 3 significant digits of accuracy is more information than I need.

Actually, you could probably put a toggle for all the columns. Then I can hide the ones I don\'t care about and it frees you up to add as many columns as you want.

For Isp, the calc is easy enough. Its just (Thrust/Mass flow rate)/9.8

So for the stock 200 thrust engine and the stock 500 unit fuel, its..

2.5full - 0.3 empty = 2.2 fuel mass

2.2 fuel mass / 500 fuel units = 0.0044 mass per unit

the stock engine uses 8 fuel per second. 8 x 0.0044 = 0.0352 mass per second

200/0.0352 = 5681.8, divided by 9.8 = 579.7 Isp.

Since fuel mass is calculated on a per part basis, you\'d have to average it out between the tanks(fuel in the small tank is slightly lighter than in the large tank.. 0.0042 instead of 0.0044), and of course would have to average out the Isp of the various engines. It still may not be entirely accurate, since you\'re going by stage rather than actual connection, but it\'d be close enough for government work.

Also, out of curiosity, what *is* the thrust / mass relationship in the game?

1 thrust accelerates 1 mass at 1m/s^2

Exact same relationship as 1 Newton accelerates 1 kg at 1m/s^2. I like assuming 1 mass is 1000kg, and 1 thrust is 1 Kilonewton.

Link to comment
Share on other sites

fantastic tool mate!

i do have a few weird bugs to point out though. the engineer\'s weight shows up in the VAB as 0 [used to show up as E03C1 or soemthing] but if i leave it on the craft and launch it [i forgot to remove it] the craft tilts over to the side it is placed on and uncontrollably rotates till you hit the ground. weird since it has 0 drag 0 mass...

the other one is that complex stages don\'t seem to be calculated well. for example, i have a craft with drop tanks and it calculates the T/W of the stage when it has all the aux tanks fitted, but doesnt calculate the T/W for the stage with the tanks after they have dropped. seems to forget that the engines are still attached to that stage even though they were fired previously.

other than that, i really love this mod, its handy as hell for working out my staging. thanks a lot!

Link to comment
Share on other sites

Thanks for the suggestions everybody as well as providing the math :D I don\'t really have time to work on it this weekend so no new updates for a little while probably.

I think the plan is going to be to split the ui into two pages that you can flip through with the basics on one and move thrust weight ratio and delta V to the second. I also want to figure out the fuel lookout system so I can get accurate numbers on the amount of fuel per engine.

Since fuel mass is calculated on a per part basis, you\'d have to average it out between the tanks(fuel in the small tank is slightly lighter than in the large tank.. 0.0042 instead of 0.0044), and of course would have to average out the Isp of the various engines. It still may not be entirely accurate, since you\'re going by stage rather than actual connection, but it\'d be close enough for government work.

Do I want to average it, or can I total everything and treat it like one big fuel tank?

i do have a few weird bugs to point out though. the engineer\'s weight shows up in the VAB as 0 [used to show up as E03C1 or soemthing] but if i leave it on the craft and launch it [i forgot to remove it] the craft tilts over to the side it is placed on and uncontrollably rotates till you hit the ground. weird since it has 0 drag 0 mass...

I\'m not going to look too hard into this for now, I never intended for this to be a part that you would leave on during a flight. I may make it so it will disconnect or explode on flight start. Probly explode that seams more kerbal :P

the other one is that complex stages don\'t seem to be calculated well. for example, i have a craft with drop tanks and it calculates the T/W of the stage when it has all the aux tanks fitted, but doesnt calculate the T/W for the stage with the tanks after they have dropped. seems to forget that the engines are still attached to that stage even though they were fired previously.

I\'m not surprised, you get a pretty naive view of the ship when you only look at what stage a part is in. What you might be able to do is put your engines on their own stage below the drop tanks to check those numbers then move that stage above your drop tanks and check the numbers again.

This is pretty neat, though I suggest you add a 'total' at the bottom of all readings and a 'delta V' category. The algorithm was explained earlier for delta V, so I won\'t go through it myself.

I considered totals when I started, but the more I thought about it the less sense it made. Knowing total weight is handy and maybe rcs, but unless you\'re a serious roleplayer having a total for fuel across your stages is pointless and total thrust I found to be just nonsense.

Link to comment
Share on other sites

Do I want to average it, or can I total everything and treat it like one big fuel tank?

You need to average it, since as I said, the fuel mass inside a part is determined by that part. The stock parts are near enough that the difference could be ignored, but mod parts could be waaaaaay off, which would then affect the Isp calculation if you just assumed that every part follows the same 0.0044 mass per unit fuel. Most do, some don\'t.

Link to comment
Share on other sites

Would you change the mass value in the config to 0.001? Having no mass value does odd things if you launch with this attached to small rockets. It took me a little bit to figure out the model from this pack was doing it, and when I threw a 1 on the end of your 0.00 value my ship flew fine. Thank you!

Link to comment
Share on other sites

Cost isn\'t attached directly to the parts in the vab, instead there are separate menu objects that have it. I havent looked into getting info out of the cfg yet, but I should be able to get the information from some where once I go looking for it.

I am an idiot yes it is

After spending way too long writing code to match up tanks with engines I find out that fuelLookupTargets isn\'t even populated until flight start. So what I\'m going to do now is match engines up with all tanks above them until I come to another stage with liquid engines.

Would you change the mass value in the config to 0.001? Having no mass value does odd things if you launch with this attached to small rockets. It took me a little bit to figure out the model from this pack was doing it, and when I threw a 1 on the end of your 0.00 value my ship flew fine. Thank you!

will do

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