AVSLab / basilisk

Astrodynamics simulation framework
https://hanspeterschaub.info/basilisk
ISC License
127 stars 62 forks source link

Hardcoded Isp in thrusterStateEffector #735

Closed andrewmorell closed 4 weeks ago

andrewmorell commented 2 months ago

Describe the bug The thrusterStateEffector mass depletion is hardcoded to 100% for all time via line 344 in the effector's c++ file. This doesn't affect thrust output unless mass depletion force contributions are turned on, and the only other impact is when a fuel tank is connected.

To reproduce Steps to reproduce the behavior:

  1. Create a thrusterStateEffector
  2. override the "updateOnly" parameter for that THRSimConfig to be false, enabling mass depletion force contribution calculations
  3. See thrusting force outputting even with zero thrust command message

OR

  1. Create thrusterStateEffector
  2. Create a fuelTank effector
  3. Connect the thruster to the fuel tank with fuelTank.addThruster
  4. Set thruster command to off
  5. Plot fuel mass and/or fuel mass rate
  6. See fuel mass depleting at a constant rate

Expected behavior No mass depletion while thruster isn't firing.

Desktop (please complete the following information):

Additional context Current fix is being worked in the LASP fork of Basilisk, branch bug/thrusterStateEffector-IspFactor. Since the thrusterStateEffector already doesn't scale mass depletion according to ramp up/down (compare updateEffectorMassProps in thrusterStateEffector to computeStateContribution in thrusterDynamicEffector), the proposed solution is to change the conditional statements that check whether mass should be depleting to query against ops->ThrustFactor instead of ops->IspFactor.

schaubh commented 2 months ago

Howdy @spiggottCO , this is the issue we were discussing with the hard coded Isp value. Looks like two groups found this out within days of each other.