The changes to the tumble transition discussed on or-dev

This commit is contained in:
bkuker 2014-02-25 15:39:12 -05:00
parent 7c72bc88b1
commit 8e063f0a64
4 changed files with 37 additions and 10 deletions

View File

@ -1539,6 +1539,8 @@ Warning.PARALLEL_FINS = Too many parallel fins
Warning.SUPERSONIC = Body calculations may not be entirely accurate at supersonic speeds.
Warning.RECOVERY_LAUNCH_ROD = Recovery device device deployed while on the launch guide.
Warning.RECOVERY_HIGH_SPEED = Recovery device deployment at high speed
Warning.TUMBLE_UNDER_THRUST = Stage began to tumble under thrust.
Warning.TUMBLE_BEFORE_APOGEE = Sustainer became unstable before apogee.
! Scale dialog

View File

@ -325,4 +325,10 @@ public abstract class Warning {
public static final Warning RECOVERY_LAUNCH_ROD =
new Other(trans.get("Warning.RECOVERY_LAUNCH_ROD"));
public static final Warning TUMBLE_UNDER_THRUST =
new Other(trans.get("Warning.TUMBLE_UNDER_THRUST"));
public static final Warning TUMBLE_BEFORE_APOGEE =
new Other(trans.get("Warning.TUMBLE_BEFORE_APOGEE"));
}

View File

@ -42,10 +42,14 @@ public class BasicEventSimulationEngine implements SimulationEngine {
private SimulationStepper landingStepper = new BasicLandingStepper();
private SimulationStepper tumbleStepper = new BasicTumbleStepper();
// Constant holding 10 degress in radians. This is the AOA condition
// Constant holding 20 degress in radians. This is the AOA condition
// necessary to transistion to tumbling.
private final static double AOA_TUMBLE_CONDITION = Math.PI / 9.0;
// The thrust must be below this value for the transition to tumbling.
// TODO: this is an arbitrary value
private final static double THRUST_TUMBLE_CONDITION = 0.01;
private SimulationStepper currentStepper;
private SimulationStatus status;
@ -202,18 +206,32 @@ public class BasicEventSimulationEngine implements SimulationEngine {
// Check for Tumbling
// Conditions for transision are:
// apogee reached
// apogee reached (if sustainer stage)
// and is not already tumbling
// and not stable (cg > cp)
// and aoa > 30
// and aoa > AOA_TUMBLE_CONDITION threshold
// and thrust < THRUST_TUMBLE_CONDITION threshold
if (status.isApogeeReached() && !status.isTumbling()) {
double cp = status.getFlightData().getLast(FlightDataType.TYPE_CP_LOCATION);
double cg = status.getFlightData().getLast(FlightDataType.TYPE_CG_LOCATION);
double aoa = status.getFlightData().getLast(FlightDataType.TYPE_AOA);
if (cg > cp && aoa > AOA_TUMBLE_CONDITION) {
addEvent(new FlightEvent(FlightEvent.Type.TUMBLE, status.getSimulationTime()));
status.setTumbling(true);
if (!status.isTumbling()) {
final double t = status.getFlightData().getLast(FlightDataType.TYPE_THRUST_FORCE);
final double cp = status.getFlightData().getLast(FlightDataType.TYPE_CP_LOCATION);
final double cg = status.getFlightData().getLast(FlightDataType.TYPE_CG_LOCATION);
final double aoa = status.getFlightData().getLast(FlightDataType.TYPE_AOA);
final boolean wantToTumble = (cg > cp && aoa > AOA_TUMBLE_CONDITION);
if (wantToTumble) {
final boolean tooMuchThrust = t > THRUST_TUMBLE_CONDITION;
final boolean isSustainer = status.getConfiguration().isStageActive(0);
final boolean notUntilApogee = isSustainer && !status.isApogeeReached();
if (tooMuchThrust) {
status.getWarnings().add(Warning.TUMBLE_UNDER_THRUST);
} else if (notUntilApogee) {
status.getWarnings().add(Warning.TUMBLE_BEFORE_APOGEE);
} else {
addEvent(new FlightEvent(FlightEvent.Type.TUMBLE, status.getSimulationTime()));
status.setTumbling(true);
}
}
}

View File

@ -39,6 +39,7 @@ public class EventGraphics {
EVENT_COLORS.put(FlightEvent.Type.RECOVERY_DEVICE_DEPLOYMENT, new Color(0, 0, 128));
EVENT_COLORS.put(FlightEvent.Type.GROUND_HIT, new Color(0, 0, 0));
EVENT_COLORS.put(FlightEvent.Type.SIMULATION_END, new Color(128, 0, 0));
EVENT_COLORS.put(FlightEvent.Type.TUMBLE, new Color(196, 0, 255));
}
private static final Map<FlightEvent.Type, Image> EVENT_IMAGES = new HashMap<FlightEvent.Type, Image>();