Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/rocket/libs/vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,11 +524,11 @@ def check_and_adjust_throttle(self):
print(f"Total acceleration exceeded 2 Gs: {self.cur.A.total} Gs")
for engine in self.engines:
if engine.stage == "RLV" and engine.attached:
# Calculate the new throttle value, reducing the current throttle by 1%
new_throttle_value = engine.throt_cur * 0.99
# Calculate the new throttle value, reducing the current throttle proportionally to the time interval
new_throttle_value = engine.throt_cur * (1 - 0.01 * self.get_time_inc())
# Adjust the throttle using setThrottle, which considers the rate of change limit
engine.setThrottle(new_throttle_value, self.get_time_inc())
print(f"Adjusted {engine.name} throttle to {new_throttle_value:.2f} (reduced by 1%) due to exceeding acceleration limit.")
print(f"Adjusted {engine.name} throttle to {new_throttle_value:.2f} (reduced proportionally to time interval) due to exceeding acceleration limit.")



Expand Down