Jump to content

[1.8.x] KSPWheel - Physics Based Alternate Wheel Collider [API Only]


Shadowmage

Recommended Posts

Hehe... if you think the new power balance seems hungry now... imagine if I did it at 1EC/s = 1kw (which is the ratio stated by many other mods) -- you would have 65x higher power draw than you see currently, for the same torque output.

The new power draw is based on the input/output ratio from the stock TR-2L wheel.  1EC/s = 65kw.  The old power draw was...highly inaccurate, done entirely by hand, with no accounting for realism or physics-based balancing.  All of the parts were >100% efficient, some upwards of 1000%.

The new power draw balancing uses a portion of the part mass to determine the motor mass, and then uses a set kw-per-kg to determine the final motor output power for that mass of motor; input power is based on the output power with a further conversion for motor efficiency.

Link to comment
Share on other sites

38 minutes ago, SpannerMonkey(smce) said:

See this is what happens, I get out of the habit of lobbing great big  generator modules in everything and once again I need to boost the juice, no biggy  I'll just make some new generation equipment to suit , I shudder to think what it;s going to take to push the 50tonner :)

 

About 100kw to get to 15m/s based off real world vehicles. How the kW relates to stuff in Ksp is still up for grabs. To go faster requires a lot more juice though. 

Link to comment
Share on other sites

50 minutes ago, SpannerMonkey(smce) said:

See this is what happens, I get out of the habit of lobbing great big  generator modules in everything and once again I need to boost the juice, no biggy  I'll just make some new generation equipment to suit , I shudder to think what it;s going to take to push the 50tonner :)

 

This kind of thing is what the APU was for. I wonder if there's any chance of resurrecting that part of the plugin?

Link to comment
Share on other sites

The EC hogginess really starts rear it's head during difficult climbs where you're pushing the motors hard.  Using both the medium and large wheels I was able to cope strictly with a pair of the big fuel cells.  I would drop in power during heavy demand periods but as long as I had intervals of relative clam cruising it would come back up again.  It's definitely not carrying a few hundred measly EC anymore though and I love it!

Link to comment
Share on other sites

2 hours ago, Shadowmage said:

Hehe... if you think the new power balance seems hungry now... imagine if I did it at 1EC/s = 1kw (which is the ratio stated by many other mods) -- you would have 65x higher power draw than you see currently, for the same torque output.

For the same torque output and RPM, I think. 1EC=65kJ is quite generous - it's about twice what one would infer from battery capacities, which are the stock parts that seem to suggest the highest EC:J ratio.

Link to comment
Share on other sites

Hi, I noticed that a craft of mine that uses IR rotatrons to rotate landing legs doesn't work anymore. I looked a bit and it turns out that all landing legs and wheels have "Locked Autostrut to Heaviest Part" activated, and I can't turn it off, so it breaks any IR moving parts that have legs or wheels attached. I'm not sure if it has anything to do with KSPWheel, but I thought that it could be related to this plugin. Here's an imgur album with a couple pics to ilustrate the problem http://imgur.com/a/cQYds 

Link to comment
Share on other sites

5 minutes ago, Krux said:

Hi, I noticed that a craft of mine that uses IR rotatrons to rotate landing legs doesn't work anymore. I looked a bit and it turns out that all landing legs and wheels have "Locked Autostrut to Heaviest Part" activated, and I can't turn it off, so it breaks any IR moving parts that have legs or wheels attached. I'm not sure if it has anything to do with KSPWheel, but I thought that it could be related to this plugin. Here's an imgur album with a couple pics to ilustrate the problem http://imgur.com/a/cQYds 

You can turn that off, but you need to turn on advanced settings first. Or, did you try that already?

Link to comment
Share on other sites

On 21/02/2017 at 11:29 PM, 0111narwhalz said:

This kind of thing is what the APU was for. I wonder if there's any chance of resurrecting that part of the plugin?

Indeed it was and worked pretty damn well, was hoping it would make a return so that i could start using my  generator engines in the tanks and trucks . While true they work as plain and simple throttle controlled generators the auto control was definitely a nicer option

Spoiler

4PWCczL.png

 

Link to comment
Share on other sites

2 hours ago, SpannerMonkey(smce) said:

Indeed it was and worked pretty damn well, was hoping it would make a return so that i could start using my  generator engines in the tanks and trucks . While true they work as plain and simple throttle controlled generators the auto control was definitely a nicer option

  Reveal hidden contents

4PWCczL.png

 

I swear. You always have the coolest toys my friend :)

Link to comment
Share on other sites

3 hours ago, Krux said:

Hi, I noticed that a craft of mine that uses IR rotatrons to rotate landing legs doesn't work anymore. I looked a bit and it turns out that all landing legs and wheels have "Locked Autostrut to Heaviest Part" activated, and I can't turn it off, so it breaks any IR moving parts that have legs or wheels attached. I'm not sure if it has anything to do with KSPWheel, but I thought that it could be related to this plugin. Here's an imgur album with a couple pics to ilustrate the problem http://imgur.com/a/cQYds 

KSPWheel does not (currently) touch any landing legs, so whatever is going on there has nothing to do with KSPWheel (or at least nothing that I've done; other mods may be using it that I'm unaware of).

However, you might be able to patch those legs to use the KSPWheels modules, in which case the auto-strut limitation will be removed.

 

On 2/21/2017 at 4:29 PM, 0111narwhalz said:

This kind of thing is what the APU was for. I wonder if there's any chance of resurrecting that part of the plugin?

Possibility yeah, sure.  I never used the APU previously, so have zero reference as to how it was supposed to function.  So if/when I get around to it, it is going to take some time as I'll need to first learn what it was -supposed- to do, and then I'll have to re-implement the code in a way that will work in with the new plugins and changes in KSP 1.2.  (If I'm very lucky the old code might be directly portable.... but I'm seldom that lucky)

 

Link to comment
Share on other sites

@Shadowmage The apu was a load sensing generator and responded to current draw/ or something :)   at rest it would be at idle producing virtually no output , and when hard accelerating it would be flat out producing max output

I found a really really ancient video of the code working on one of my toys

 

Link to comment
Share on other sites

Update release is available:

https://github.com/shadowmage45/KSPWheel/releases/tag/0.9.4.14

Lots of bug-fixing, and a few new features as well.  See the link for change-log and downloads.

WARNING - Changes to the deployment module will have impact on mods that are using it. Craft using the deployment module won't break, but colliders may be incorrectly positioned during the deploy/retract animation.  The configs for deployable parts may need to be updated prior to being compatible with this version of KSPWheel.  Please contact me if you need details on how to best adjust the config for this change, be prepared to show model hierarchy as the config is entirely model dependent.  You may also look at the configs and hierarchy for the new KF leg for examples. 

Link to comment
Share on other sites

  • 2 weeks later...

Updated release is available:

https://github.com/shadowmage45/KSPWheel/releases/tag/0.9.4.15

Several bugfixes and minor improvements to a few modules.  Should not be any breaking changes in this release.  See the link above for full change-log and downloads.  This will likely be the final release for KSP 1.2.2, future development will be switching over to the pre-releases in preparation for 1.3.

Link to comment
Share on other sites

Last night saw the final finishing and figuring out of the motor power equations.  Nothing should be changing much for power consumption (the numbers calculated are 'correct'), but the method to arrive at those numbers is so much cleaner and easier to understand.  The solution ended up coming to finding the intersection of a line and curve within a specific domain (the peak efficiency rpm%), and using that intersect point to calculate input power at a known point (where the efficiency is a known value); from there finding the min/max power draw is simply a factor of applying a line/slope from that point.

This cleans up and removes the 'magic numbers' that I had previously calculated/put together to 'simplify' the power calculations.  True, the calculations are a slight bit more complex now, but considering they only need to run once during part initialization, I'll gladly take 'correct' over 'simple'.

This means that BonVoyage should be able to have a much easier time deriving the power-use stats for any given KSPWheels parts in future releases.  Also means I should be able to give more accurate display values for the part info (editor part list) and action windows (editor/flight).

 

I also spotted a worrying bug (that I thought I had already fixed) -- one of my test craft would refuse to be recovered on the runway.  Only occurred after I had retracted and re-deployed the landing legs (was actually deployable wheels in this instance, but legs should have the same effect).  Is there anyone else who has experienced and/or can confirm this bug? (It could just be a quirk of the part I was testing)

Link to comment
Share on other sites

1 hour ago, Shadowmage said:

Last night saw the final finishing and figuring out of the motor power equations.  Nothing should be changing much for power consumption (the numbers calculated are 'correct'), but the method to arrive at those numbers is so much cleaner and easier to understand.  The solution ended up coming to finding the intersection of a line and curve within a specific domain (the peak efficiency rpm%), and using that intersect point to calculate input power at a known point (where the efficiency is a known value); from there finding the min/max power draw is simply a factor of applying a line/slope from that point.

This cleans up and removes the 'magic numbers' that I had previously calculated/put together to 'simplify' the power calculations.

See, you always end up doing it my way. :-)

(Kidding aside, I am extremely impressed with and grateful for your efforts on KSPWheel.)

Link to comment
Share on other sites

2 hours ago, Shadowmage said:

 

I also spotted a worrying bug (that I thought I had already fixed) -- one of my test craft would refuse to be recovered on the runway.  Only occurred after I had retracted and re-deployed the landing legs (was actually deployable wheels in this instance, but legs should have the same effect).  Is there anyone else who has experienced and/or can confirm this bug? (It could just be a quirk of the part I was testing)

I haven't had this problem with any of my planes using the adjustable landing gears, but I'm not on the most recent version of kspWheel, will dl tonight and check

Link to comment
Share on other sites

2 hours ago, Shadowmage said:

I also spotted a worrying bug (that I thought I had already fixed) -- one of my test craft would refuse to be recovered on the runway.  Only occurred after I had retracted and re-deployed the landing legs (was actually deployable wheels in this instance, but legs should have the same effect).  Is there anyone else who has experienced and/or can confirm this bug? (It could just be a quirk of the part I was testing)

I've been staying up to date with all the changes you've been making and have been regularly going back to the KSPWheel testing install I have to do quick tests after updates.  I've quickly tried all the retractable parts and couldn't get it to trigger.  These were quick and dirty tests but on first pass I've seen nothing.  Will keep digging to see if I can reproduce...

Link to comment
Share on other sites

Thanks, I'm thinking it might be related to the part I was testing with having multiple wheel colliders on the same part, as I certainly remember testing it with the ALG parts without any problems.

At least that lets me know where to start looking :)

Link to comment
Share on other sites

  • 2 weeks later...

@Shadowmage

I'm adding support for KSPWheel into Fusebox.

How can I see the current EC usage for the various modules?  Specifically:

 

for KSPWheelMotor:

I see maxECDraw, which works in the editor, but I need the current usage when in flight.

For KSPWheelRepulsor:

I see energyUse, which I assume shows the energy being used, but then I also see guiEnergyUse.  I need to see the max energy which it can use as well as the current amount (max energy is used in the Editor)

 

For KFAPUController:

I see energyOutput and throttle, I assume that I multiply the two together to get the current output?

and for in the editor, just the energyOutput

and any other modules which consume EC, I'll need to get both values (max usage as well as current usage)

 

Thanks

Edited by linuxgurugamer
Link to comment
Share on other sites

14 hours ago, linuxgurugamer said:

@Shadowmage

I'm adding support for KSPWheel into Fusebox.

How can I see the current EC usage for the various modules?  Specifically:

 

for KSPWheelMotor:

I see maxECDraw, which works in the editor, but I need the current usage when in flight.

For KSPWheelRepulsor:

I see energyUse, which I assume shows the energy being used, but then I also see guiEnergyUse.  I need to see the max energy which it can use as well as the current amount (max energy is used in the Editor)

 

For KFAPUController:

I see energyOutput and throttle, I assume that I multiply the two together to get the current output?

and for in the editor, just the energyOutput

and any other modules which consume EC, I'll need to get both values (max usage as well as current usage)

 

Thanks

For KSPMotor, none of those values are available directly from the config, but only from the parts after they have been initialized.

Max EC draw:  https://github.com/shadowmage45/KSPWheel/blob/master/VSProject/KSPWheel/PartModules/KSPWheelMotor.cs#L128
Current EC draw:  https://github.com/shadowmage45/KSPWheel/blob/master/VSProject/KSPWheel/PartModules/KSPWheelMotor.cs#L110

Or, to calculate the max without a live part (dev branch, will be available in the next public release):  https://github.com/shadowmage45/KSPWheel/blob/motorCleanup/VSProject/KSPWheel/PartModules/KSPWheelMotor.cs#L428-L474  (gives max in KW, which then needs to be converted from the config-specified conversion factor)


For KSPRepulsor the Max EC draw is unbounded, it depends upon the load being supported.  It is calculated from ' energyUse' * wheel.spring*0.1f (current tons supported)
Current EC draw can be queried from the 'guiEnergyUse' field ( https://github.com/shadowmage45/KSPWheel/blob/master/VSProject/KSPWheel/PartModules/KSPWheelRepulsor.cs#L21 ).


For KFAPUController -- it extends the stock resource conversion module (  ModuleResourceConverter ), so whatever works for the stock modules should work for it.  I honestly have no idea how to retrieve data from those stock interfaces though.

 

Please let me know if there was any more information you needed on those.  I think those are the only three EC consuming/producing modules at the moment.

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