From 57218127ee39724e985fefcf203991401f01cc84 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 22 Apr 2018 20:01:01 -0700 Subject: altoslib: Clarify terms in Mega pyro config Suggestions from Bob Brown et al Speed -> ascent rate Height -> height above ground Acceleration -> Vertical acceleration Signed-off-by: Keith Packard --- altoslib/AltosPyro.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'altoslib/AltosPyro.java') diff --git a/altoslib/AltosPyro.java b/altoslib/AltosPyro.java index 0ea3bfc1..18f0da56 100644 --- a/altoslib/AltosPyro.java +++ b/altoslib/AltosPyro.java @@ -29,24 +29,24 @@ public class AltosPyro { public static final int pyro_accel_greater = 0x00000002; public static final String pyro_accel_less_string = "a<"; public static final String pyro_accel_greater_string = "a>"; - public static final String pyro_accel_less_name = "Acceleration less than"; - public static final String pyro_accel_greater_name = "Acceleration greater than"; + public static final String pyro_accel_less_name = "Vertical acceleration less than"; + public static final String pyro_accel_greater_name = "Vertical acceleration greater than"; public static final double pyro_accel_scale = 16.0; public static final int pyro_speed_less = 0x00000004; public static final int pyro_speed_greater = 0x00000008; public static final String pyro_speed_less_string = "s<"; public static final String pyro_speed_greater_string = "s>"; - public static final String pyro_speed_less_name = "Speed less than"; - public static final String pyro_speed_greater_name = "Speed greater than"; + public static final String pyro_speed_less_name = "Ascent rate less than"; + public static final String pyro_speed_greater_name = "Ascent rate greater than"; public static final double pyro_speed_scale = 16.0; public static final int pyro_height_less = 0x00000010; public static final int pyro_height_greater = 0x00000020; public static final String pyro_height_less_string = "h<"; public static final String pyro_height_greater_string = "h>"; - public static final String pyro_height_less_name = "Height less than"; - public static final String pyro_height_greater_name = "Height greater than"; + public static final String pyro_height_less_name = "Height above pad less than"; + public static final String pyro_height_greater_name = "Height above pad greater than"; public static final double pyro_height_scale = 1.0; public static final int pyro_orient_less = 0x00000040; @@ -90,7 +90,10 @@ public class AltosPyro { public static final String pyro_state_greater_or_equal_name = "Flight state after"; public static final double pyro_state_scale = 1.0; + public static final int pyro_deprecate = pyro_ascending | pyro_descending; + public static final int pyro_all = 0x0000ffff; + public static final int pyro_all_useful = pyro_all ^ pyro_deprecate; public static final int pyro_no_value = (pyro_ascending | pyro_descending); -- cgit v1.2.3 From 0d57c78dde3c6e61576a4769b0e0fae7e88c107d Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 5 Aug 2018 11:09:34 +0800 Subject: altos: Add separate 'ao_launch_tick'. Use in pyro and lockout. Prior to this, there was only ao_boost_tick, which got reset at each motor burn start. That meant there wasn't any way to measure total flight time for pyro channels and 'apogee lockout' was based on time since most recent motor start instead of total flight time. Now pyro channels and apogee lockout both use total flight time, while motor burn length still uses time since most recent motor burn start (as it should). Docs and UI updated to use 'launch' instead of 'boost' to try and make the change clear. Signed-off-by: Keith Packard --- altoslib/AltosPyro.java | 4 ++-- altosui/AltosConfigFCUI.java | 2 +- doc/config-device.inc | 8 +++++++- doc/pyro-channels.inc | 10 +++++++--- src/kernel/ao_flight.c | 7 ++++--- src/kernel/ao_flight.h | 1 + src/kernel/ao_pyro.c | 8 ++++---- 7 files changed, 26 insertions(+), 14 deletions(-) (limited to 'altoslib/AltosPyro.java') diff --git a/altoslib/AltosPyro.java b/altoslib/AltosPyro.java index 18f0da56..fea4fd59 100644 --- a/altoslib/AltosPyro.java +++ b/altoslib/AltosPyro.java @@ -61,8 +61,8 @@ public class AltosPyro { public static final int pyro_time_greater = 0x00000200; public static final String pyro_time_less_string = "t<"; public static final String pyro_time_greater_string = "t>"; - public static final String pyro_time_less_name = "Time since boost less than (s)"; - public static final String pyro_time_greater_name = "Time since boost greater than (s)"; + public static final String pyro_time_less_name = "Time since launch less than (s)"; + public static final String pyro_time_greater_name = "Time since launch greater than (s)"; public static final double pyro_time_scale = 100.0; public static final int pyro_ascending = 0x00000400; diff --git a/altosui/AltosConfigFCUI.java b/altosui/AltosConfigFCUI.java index 1e875dec..9bd265f0 100644 --- a/altosui/AltosConfigFCUI.java +++ b/altosui/AltosConfigFCUI.java @@ -440,7 +440,7 @@ public class AltosConfigFCUI apogee_lockout_value.setEditable(true); apogee_lockout_value.addItemListener(this); pane.add(apogee_lockout_value, c); - apogee_lockout_value.setToolTipText("Time after boost while apogee detection is locked out"); + apogee_lockout_value.setToolTipText("Time after launch while apogee detection is locked out"); row++; /* Frequency */ diff --git a/doc/config-device.inc b/doc/config-device.inc index 99d5c008..0ca6afff 100644 --- a/doc/config-device.inc +++ b/doc/config-device.inc @@ -23,7 +23,7 @@ ifdef::altusmetrum[] ==== Apogee Lockout - Apogee lockout is the number of seconds after boost + Apogee lockout is the number of seconds after launch where the flight computer will not fire the apogee charge, even if the rocket appears to be at apogee. This is often called 'Mach Delay', as it is @@ -35,6 +35,12 @@ ifdef::altusmetrum[] pressure increase, and so this setting should be left at the default value of zero to disable it. + [WARNING] + Firmware versions older than 1.8.6 have a + bug which resets the time since launch to zero each + time a motor starts burning. Update firmware to get + the correct behavior. + endif::altusmetrum[] ifdef::radio[] diff --git a/doc/pyro-channels.inc b/doc/pyro-channels.inc index 68bbf910..ab5baef0 100644 --- a/doc/pyro-channels.inc +++ b/doc/pyro-channels.inc @@ -42,9 +42,13 @@ launch pad and initialize the system. of less than that value. ==== -Flight Time:: Time since boost was detected. Select a value and choose -whether to activate the pyro channel before or after that amount of -time. +Flight Time:: Time since launch. Select a value and choose whether to +activate the pyro channel before or after that amount of time. + +[WARNING] +Firmware versions older than 1.8.6 have a bug which resets the time +since launch to zero each time a motor starts burning. Update firmware +to get the correct behavior. Ascending:: A deprecated configuration value which was the same as setting Ascent rate > 0. Existing configurations using this will be diff --git a/src/kernel/ao_flight.c b/src/kernel/ao_flight.c index 7b3cb9fa..c2700d20 100644 --- a/src/kernel/ao_flight.c +++ b/src/kernel/ao_flight.c @@ -48,7 +48,8 @@ /* Main flight thread. */ __pdata enum ao_flight_state ao_flight_state; /* current flight state */ -__pdata uint16_t ao_boost_tick; /* time of launch detect */ +__pdata uint16_t ao_boost_tick; /* time of most recent boost detect */ +__pdata uint16_t ao_launch_tick; /* time of first boost detect */ __pdata uint16_t ao_motor_number; /* number of motors burned so far */ #if HAS_SENSOR_ERRORS @@ -199,7 +200,7 @@ ao_flight(void) ) { ao_flight_state = ao_flight_boost; - ao_boost_tick = ao_sample_tick; + ao_launch_tick = ao_boost_tick = ao_sample_tick; /* start logging data */ ao_log_start(); @@ -269,7 +270,7 @@ ao_flight(void) * number of seconds. */ if (ao_config.apogee_lockout) { - if ((int16_t) (ao_sample_tick - ao_boost_tick) < + if ((int16_t) (ao_sample_tick - ao_launch_tick) < AO_SEC_TO_TICKS(ao_config.apogee_lockout)) break; } diff --git a/src/kernel/ao_flight.h b/src/kernel/ao_flight.h index 6894fe59..005c7e84 100644 --- a/src/kernel/ao_flight.h +++ b/src/kernel/ao_flight.h @@ -40,6 +40,7 @@ enum ao_flight_state { extern __pdata enum ao_flight_state ao_flight_state; extern __pdata uint16_t ao_boost_tick; +extern __pdata uint16_t ao_launch_tick; extern __pdata uint16_t ao_motor_number; #if HAS_IMU || HAS_MMA655X diff --git a/src/kernel/ao_pyro.c b/src/kernel/ao_pyro.c index 3c872354..527112ac 100644 --- a/src/kernel/ao_pyro.c +++ b/src/kernel/ao_pyro.c @@ -160,14 +160,14 @@ ao_pyro_ready(struct ao_pyro *pyro) #endif case ao_pyro_time_less: - if ((int16_t) (ao_time() - ao_boost_tick) <= pyro->time_less) + if ((int16_t) (ao_time() - ao_launch_tick) <= pyro->time_less) continue; - DBG("time %d > %d\n", (int16_t)(ao_time() - ao_boost_tick), pyro->time_less); + DBG("time %d > %d\n", (int16_t)(ao_time() - ao_launch_tick), pyro->time_less); break; case ao_pyro_time_greater: - if ((int16_t) (ao_time() - ao_boost_tick) >= pyro->time_greater) + if ((int16_t) (ao_time() - ao_launch_tick) >= pyro->time_greater) continue; - DBG("time %d < %d\n", (int16_t)(ao_time() - ao_boost_tick), pyro->time_greater); + DBG("time %d < %d\n", (int16_t)(ao_time() - ao_launch_tick), pyro->time_greater); break; case ao_pyro_ascending: -- cgit v1.2.3