From f6565fd6843ae5d597f850f01219e5a567cfb814 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Sun, 29 Sep 2013 22:30:52 +0300 Subject: [PATCH] Add couple of example gnuplot files for plotting graphs voltage_and_current.plot: This one plots somewhat typical charging graphs with voltage, current and accumulated charge visible. balancing.plot: This one plots a graph of the balancing action. Cell voltages compared to the average cell voltages (over average of five samples) is plotted. Signed-off-by: Timo Kokkonen --- balancing.plot | 21 +++++++++++++++++++++ voltage_and_current.plot | 15 +++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 balancing.plot create mode 100644 voltage_and_current.plot diff --git a/balancing.plot b/balancing.plot new file mode 100644 index 0000000..3a9cfb2 --- /dev/null +++ b/balancing.plot @@ -0,0 +1,21 @@ +set term png size 800,480 + +set datafile separator ";" + +set ylabel "Voltage (mV)" + +datafile = "logfile.log" + +samples(x) = $0 > 4 ? 5 : ($0+1) +avg5(x) = (shift5(x), (back1 + back2 + back3 + back4 + back5) / samples($0)) +shift5(x) = (back5 = back4, \ + back4 = back3, \ + back3 = back2, \ + back2 = back1, \ + back1 = x) +init(x) = (back1 = back2 = back3 = back4 = back5 = sum = 0) + +plot sum=init(0), \ + datafile using (avg5($7 - ($7 + $8 + $9) / 3)), \ + datafile using (avg5($8 - ($7 + $8 + $9) / 3)), \ + datafile using (avg5($9 - ($7 + $8 + $9) / 3)) diff --git a/voltage_and_current.plot b/voltage_and_current.plot new file mode 100644 index 0000000..d3e6b77 --- /dev/null +++ b/voltage_and_current.plot @@ -0,0 +1,15 @@ +set term png size 800,480 + +set datafile separator ";" + +datafile = "logfile.log" + +set ylabel "Voltage (mV)" +set y2label "Current (mA)" +set y2tics border + +plot datafile using 7 axes x1y1, \ + datafile using 8 axes x1y1, \ + datafile using 9 axes x1y1, \ + datafile using 6 axes x1y2, \ + datafile using 15 axes x1y2 \ -- 2.44.0