Noiredd / PEGAS

Powered Explicit Guidance Ascent System - a KSP & RO autopilot using the Space Shuttle guidance algorithm, UPFG
http://forum.kerbalspaceprogram.com/index.php?/topic/142213-pegas-powered-explicit-guidance-ascent-system-devlog
MIT License
113 stars 31 forks source link

Throttling broken in RO #12

Closed Noiredd closed 6 years ago

Noiredd commented 6 years ago

Found by @Patrykz94 and posted as a comment in #10:

I noticed that the gLimit doesn't seem to hold the acceleration at the specified value, instead the acceleration is slowed down a bit. I'm guessing that's because Pegas doesn't take in to account the engine throttleability. This isn't a problem in stock as all engines can throttle down to 0 but it is in RO.

The throttle setting and the throttle indicator (by the NavBall) and even the thrust limiter slider in right click menu are not setting/showing the "actual" engine throttle, they control the usable range of the engine (range between minimum throttle and maximum throttle), with the exception that setting it to 0 will cause a shutdown. What I mean by that is if an engine can only be throttled down to a minimum of 50% then when you set the "throttle" via kOS or using the keyboard to 0.5 (slider exactly half way through the scale) then the engine will actually produce 75% of it's max thrust, which is 50% of it's throttle range. You can verify this by looking at the "Current Throttle" field in engine right click menu. You can see it on this video here.

I suggest adding another (optional) parameter to "engines" where users can specify the minimum throttle of an engine and Pegas could calculate what throttle setting it needs to use to acheive the desired result. In the script used in video above, I just made a multiplier (1 / (1 - (minThrottle * 0.01))), minThrottle being a percentage, then I set throttle to (multiplier * desiredThrottle) - (multiplier * minThrottle), desiredThrottle first being clamped between minimum and maximum values.

This essentially breaks constant acceleration mode.

I was convinced that RO clamps throttle setting, in the sense that if an engine throttles in 50-100% range and I set 70% then it goes on 70%, and if I set 30% then it stays at 50%, and 0 causes shutdown. But the scaling logic is just baffling... I have to admit, I can't imagine why is it designed this way :confused:

Now I understand why my const-acceleration stages were often a fraction or even a few seconds off (predicted vs actual burn time).

Noiredd commented 6 years ago

Fixed in 0c96c47. Bear in mind that this neccessitated inputting an additional vehicle key, minThrottle, to inform PEGAS of the engine throttle limitations.