Skip to content

Commit

Permalink
Add error for motors that do not produce thrust
Browse files Browse the repository at this point in the history
  • Loading branch information
reilleya committed Feb 6, 2024
1 parent a364c84 commit 0ff1670
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions motorlib/motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,11 @@ def runSimulation(self, callback=None):
alert = SimAlert(SimAlertLevel.WARNING, SimAlertType.VALUE, desc, 'Nozzle')
simRes.addAlert(alert)

if simRes.getAverageForce() < burnoutThrustThres:
desc = 'Motor did not generate thrust. Check chamber pressure and expansion ratio.'
alert = SimAlert(SimAlertLevel.ERROR, SimAlertType.VALUE, desc, 'Motor')
simRes.addAlert(alert)

# Note that this only adds all errors found on the first datapoint where there were errors to avoid repeating
# errors. It should be revisited if getPressureErrors ever returns multiple types of errors
for pressure in simRes.channels['pressure'].getData():
Expand Down

0 comments on commit 0ff1670

Please sign in to comment.