]> git.itanic.dy.fi Git - log-plotter/commitdiff
Add couple of example gnuplot files for plotting graphs
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sun, 29 Sep 2013 19:30:52 +0000 (22:30 +0300)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sun, 29 Sep 2013 19:30:52 +0000 (22:30 +0300)
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 <timo.t.kokkonen@iki.fi>
balancing.plot [new file with mode: 0644]
voltage_and_current.plot [new file with mode: 0644]

diff --git a/balancing.plot b/balancing.plot
new file mode 100644 (file)
index 0000000..3a9cfb2
--- /dev/null
@@ -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 (file)
index 0000000..d3e6b77
--- /dev/null
@@ -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 \