From 359e8f284a186a53c11837bc2681dd8e19c342b3 Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Thu, 1 Aug 2019 18:11:05 -0600 Subject: [PATCH] latest calibration for test stand using 1600psi sensor --- altoslib/AltosEepromRecordFireTwo.java | 15 ++++++++------- altosuilib/AltosGraph.java | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/altoslib/AltosEepromRecordFireTwo.java b/altoslib/AltosEepromRecordFireTwo.java index 165fbc1a..49a262ba 100644 --- a/altoslib/AltosEepromRecordFireTwo.java +++ b/altoslib/AltosEepromRecordFireTwo.java @@ -47,17 +47,18 @@ public class AltosEepromRecordFireTwo extends AltosEepromRecord { public static double adc_to_pa(int adc) { -// /* 1600psi sensor measured 2019.04.30, these values based on that */ -// double ADC_MIN = 405; -// double ADC_SLOPE = 1.95; + /* 1600psi sensor measured 2019.07.10, these values based on that */ + double ADC_MIN = 405; + double ADC_SLOPE = 2.020; /* adc counts per psi */ + double ADC_OFFSET = 14.79; /* psi at ADC_MIN */ - /* 2500psi sensor measured 2019.04.30, these values based on that */ - double ADC_MIN = 392; - double ADC_SLOPE = 0.46; /* adc counts per psi */ +// /* 2500psi sensor measured 2019.04.30, these values based on that */ +// double ADC_MIN = 392; +// double ADC_SLOPE = 0.46; /* adc counts per psi */ /* sensor is asserted to be linear 0 - max psi over ADC_MIN to ADC_MAX */ double raw = adc; - double psi = ((raw - ADC_MIN) / ADC_SLOPE); + double psi = ((raw - ADC_MIN) / ADC_SLOPE) + ADC_OFFSET; return AltosConvert.psi_to_pa(psi); diff --git a/altosuilib/AltosGraph.java b/altosuilib/AltosGraph.java index c4a49d68..7dc336e9 100644 --- a/altosuilib/AltosGraph.java +++ b/altosuilib/AltosGraph.java @@ -102,15 +102,15 @@ public class AltosGraph extends AltosUIGraph { AltosUIAxis course_axis, dop_axis, tick_axis; if (stats != null && stats.serial != AltosLib.MISSING && stats.product != null && stats.flight != AltosLib.MISSING) - setName(String.format("%s %d flight %d\n", stats.product, stats.serial, stats.flight)); + setName(String.format("%s %d test %d\n", stats.product, stats.serial, stats.flight)); - height_axis = newAxis("Height", AltosConvert.height, height_color); - pressure_axis = newAxis("Pressure", AltosConvert.pressure, pressure_color, 0); - speed_axis = newAxis("Speed", AltosConvert.speed, speed_color); + height_axis = newAxis("Height", AltosConvert.height, height_color,0); + pressure_axis = newAxis("Pressure", AltosConvert.pressure, pressure_color); + speed_axis = newAxis("Speed", AltosConvert.speed, speed_color,0); thrust_axis = newAxis("Thrust", AltosConvert.force, accel_color); tick_axis = newAxis("Tick", tick_units, accel_color, 0); - accel_axis = newAxis("Acceleration", AltosConvert.accel, accel_color); - voltage_axis = newAxis("Voltage", AltosConvert.voltage, battery_voltage_color); + accel_axis = newAxis("Acceleration", AltosConvert.accel, accel_color,0); + voltage_axis = newAxis("Voltage", AltosConvert.voltage, battery_voltage_color,0); temperature_axis = newAxis("Temperature", AltosConvert.temperature, temperature_color, 0); nsat_axis = newAxis("Satellites", null, gps_nsat_color, AltosUIAxis.axis_include_zero | AltosUIAxis.axis_integer); @@ -146,7 +146,7 @@ public class AltosGraph extends AltosUIGraph { flight_series.register_axis(AltosUIFlightSeries.accel_name, accel_color, - true, + false, accel_axis); flight_series.register_axis(AltosUIFlightSeries.vert_accel_name, @@ -166,7 +166,7 @@ public class AltosGraph extends AltosUIGraph { flight_series.register_axis(AltosUIFlightSeries.speed_name, speed_color, - true, + false, speed_axis); flight_series.register_axis(AltosUIFlightSeries.kalman_speed_name, @@ -176,12 +176,12 @@ public class AltosGraph extends AltosUIGraph { flight_series.register_axis(AltosUIFlightSeries.pressure_name, pressure_color, - false, + true, pressure_axis); flight_series.register_axis(AltosUIFlightSeries.height_name, height_color, - true, + false, height_axis); flight_series.register_axis(AltosUIFlightSeries.altitude_name, -- 2.39.5