JPLRepo / AmpYear

A KSP plugin that better manages electricity adds Reserve Power, ION & PPT RCS. See the ReadMe file below for dependencies.
7 stars 7 forks source link

SAS consuption tends to stay locked, reacts irratic #65

Closed rogersk closed 7 years ago

rogersk commented 7 years ago

ordering a full deflection and releasing it does not bring the SAS back to 0 EC (though rarely it does)

both the AY SAS and flywheel are indicated at their max.power in "parts". In fact, the flywheel is idle or even off, SAS is off, the craft is not moving and only the virtual AY SAS seems to draw additional power (indicated in resources)

(this HECS draws 0.025 at probe idle from battery, 0.125 on full deflection (0.025 +0.5 wheel +0.5 AY-SAS), and 0.7 in this weird "hot SAS" (0.5+0.025)) ampyear-sas

sometimes the loop can be broken by cycling SAS mode on/off (not in AY, on the craft by 'T'). disabling the SAS/manager in AY does not fix it (power is still drawn at last stable level)

also, the flywheel is always shown as "running" (in the probe rightclick menu) when SAS is on, even when it's not "reacting" and does not consume power.

JPLRepo commented 7 years ago

I'm not following this one. Full deflection and release does not zero SAS usage? That is probably indicative of the fact that SAS is actually using EC due to the mechanics of the SAS system. Unfortunately comparing it to stock does not help as it rounds everything to two decimal places. The actual Resources App (button top right) doesn't even do that. It calculates EC usage overall and then only by subtracting the current usage (whole vessel) from the previous frame. AY on the other hand actually goes and gets the real usage from every module on every part. and rounds to 3 decimals.

I don't follow the 0.025 + 0.5 and 0.7 weird "hot SAS" what are you referring to there?

Ok. so the bit about breaking the cycle of SAS mode. Can you confirm the reproduction steps so I can have a look at it? 1) SAS is on in AY 2) toggle SAS off/on using "T" key. 3) Disable SAS button in AY ??

the flywheel are you referring to something in the PAW (Part Action Window) when you right click the part? and if so. AmpYear does not change that. so if that is "running" that is stock behavour.

rogersk commented 7 years ago

rounding is not the real issue. the numbers add up as such. i might have got caught in the decimals though. the idea is:

in stock, when I deflect keyboard controls, SAS draws power. when I release them, it doesnt. (this are the 0.025 > 0.075 > 0.025 EC states).

this bug makes the AY-SAS continue draw power all the time after the keyboard is released (the actual wheel part consumption is not affected) - which goes from 0.025 > 0.125 > 0.075 (latter being the state on the original screenshot. AY shows it as 0.08, resource as 0.07). i'd expect going it back to idle (0.025) - look the SAS light is off in the AY screen, but it draws the shown 0.05/s

default idle state (correct): ay01

default manouvering state (semi-correct, AY shows only 0.08, in fact it draws 0.125): ay02

return to idle - ???: ay03

it can be "reset" by cycling the SAS (t). which leads to the "PAW effect": it's only present in AY. in stock, the wheel is idle when SAS is on, but not counteracting anything. in AY, the wheel is indicated 'running' all the time with SAS on.

ay04

JPLRepo commented 7 years ago

ok thanks for the details. That helps a lot. I'll look into it.

JPLRepo commented 7 years ago

Ok I looked into this further. To me the EC usage for reaction wheels continues to occur AFTER you turn SAS off. Even in stock. So I think this is actually a stock bug and AY is actually reporting it correctly. If you turn SAS on and yaw full over. the EC usage goes to max in the stock resources app (top right) and AY. If you toggle SAS off, it does not go back to zero in both. If you toggle SAS back on, it returns to zero.

rogersk commented 7 years ago

I cannot confirm that the reaction wheel draws power when it shouldn't in stock. (switching SAS off during a commanded maneuver shuts down the consumption as expected)

the issue I was referring to, was present without using the actual SAS. AY fails to account for the reaction wheel consumption going on and off (it does not add up in "AY drain"). It only adds the AY-SAS controller on top of it, but then fails to cancel itself out when the wheel returns to idle.

using SAS, it kinda works then, the AY-SAS consumption tries to follow the reaction wheel output, unless you shut SAS off before it reaches an equilibrium (when again, the flywheel shuts down, but AY-SAS fails to do so and stays locked in the last power level)

then, another question would be, what is the intended purpose of AY-SAS anyway? if it's a control system it should have a different consumption curve, because it's powering the computer only, and not eating away the same big amount of EC as the flywheel itself.

also looking at the VAB, reaction wheel consumption is not displayed correctly in parts. it's wildly off for each part (by factors of x0.3 up to x40)

ay-vab

JPLRepo commented 7 years ago

Ah. I see now. I have not updated AY to process SAS and reaction wheels independant of each other which changed a while back. Thanks for all your efforts to assist. It does save me a lot of time.

JPLRepo commented 7 years ago

Finally nailed it. Working now for SAS and Pilot/Normal mode. Correctly shows EC usage in Editor and in flight.