From 139c04847ec8600ed41f8c2f3c882ac1207d60e4 Mon Sep 17 00:00:00 2001 From: alexklimaj Date: Sat, 13 Jul 2024 23:26:28 -0600 Subject: [PATCH] Remove filtered voltage. Add open circuit voltage and internal resistance if available. --- app/plot_app/configured_plots.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/plot_app/configured_plots.py b/app/plot_app/configured_plots.py index c12d386ac..e05ad2868 100644 --- a/app/plot_app/configured_plots.py +++ b/app/plot_app/configured_plots.py @@ -857,13 +857,16 @@ def generate_plots(ulog, px4_ulog, db_data, vehicle_data, link_to_3d_page, y_start=0, title='Power', plot_height='small', changed_params=changed_params, x_range=x_range) - data_plot.add_graph(['voltage_v', 'voltage_filtered_v', + data_plot.add_graph(['voltage_v', 'current_a', lambda data: ('discharged_mah', data['discharged_mah']/100), lambda data: ('remaining', data['remaining']*10)], - colors8[::2]+colors8[1:2], - ['Battery Voltage [V]', 'Battery Voltage filtered [V]', + colors8[0:4], + ['Battery Voltage [V]', 'Battery Current [A]', 'Discharged Amount [mAh / 100]', 'Battery remaining [0=empty, 10=full]']) + data_plot.add_graph(['ocv_estimate', lambda data: ('internal_resistance_estimate', + data['internal_resistance_estimate']*1000)], + colors8[4:6], ['OCV Estimate [V]', 'Internal Resistance Estimate [mOhm]']) data_plot.change_dataset('system_power') if data_plot.dataset: if 'voltage5v_v' in data_plot.dataset.data and \ @@ -871,7 +874,7 @@ def generate_plots(ulog, px4_ulog, db_data, vehicle_data, link_to_3d_page, data_plot.add_graph(['voltage5v_v'], colors8[7:8], ['5 V']) if 'sensors3v3[0]' in data_plot.dataset.data and \ np.amax(data_plot.dataset.data['sensors3v3[0]']) > 0.0001: - data_plot.add_graph(['sensors3v3[0]'], colors8[5:6], ['3.3 V']) + data_plot.add_graph(['sensors3v3[0]'], colors8[6:7], ['3.3 V']) if data_plot.finalize() is not None: plots.append(data_plot)