<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Looking at the discussion with Michael back in May, we came to some conclusions for this. I was happy back then with using ‘cell’ rather than ‘module’ as the naming, because (a) we are talking about cell/brick/module level here, not pack, and (b) it is shorter. It seems that the twizy has:<div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><tt style="background-color: rgb(255, 255, 255);" class="">xrt.b.cell.01.volt.act 3.995V</tt><tt style="background-color: rgb(255, 255, 255);" class=""><br class=""></tt><tt style="background-color: rgb(255, 255, 255);" class="">xrt.b.cell.01.volt.max 4.12V</tt><tt style="background-color: rgb(255, 255, 255);" class=""><br class=""></tt><tt style="background-color: rgb(255, 255, 255);" class="">xrt.b.cell.01.volt.maxdev 0.01V</tt><tt style="background-color: rgb(255, 255, 255);" class=""><br class=""></tt><tt style="background-color: rgb(255, 255, 255);" class="">xrt.b.cell.01.volt.min 3.795V</tt><tt style="background-color: rgb(255, 255, 255);" class=""><br class=""></tt></div><div class=""><tt style="background-color: rgb(255, 255, 255);" class="">...</tt></div><div class=""><tt style="background-color: rgb(255, 255, 255);" class="">xrt.b.cell.cnt 14</tt></div><div class=""><tt style="background-color: rgb(255, 255, 255);" class="">...</tt></div><div class=""><tt style="background-color: rgb(255, 255, 255);" class=""><tt class="">xrt.b.cmod.01.temp.act 17°C</tt><tt class=""><br class=""></tt><tt class="">xrt.b.cmod.01.temp.max 23°C</tt><tt class=""><br class=""></tt><tt class="">xrt.b.cmod.01.temp.maxdev 1°C</tt><tt class=""><br class=""></tt><tt class="">xrt.b.cmod.01.temp.min 16°C</tt></tt></div><div class=""><tt style="background-color: rgb(255, 255, 255);" class=""><tt class="">...</tt></tt></div><div class=""><tt style="background-color: rgb(255, 255, 255);" class=""><tt class="">xrt.b.cmod.cnt 7</tt></tt></div><div class=""><tt style="background-color: rgb(255, 255, 255);" class=""><tt class="">...</tt></tt></div><div class=""><tt style="background-color: rgb(255, 255, 255);" class=""><tt class=""><tt class="">xrt.b.pack.1.temp.alerts</tt><tt class=""><br class=""></tt><tt class="">xrt.b.pack.1.temp.max 23°C</tt><tt class=""><br class=""></tt><tt class="">xrt.b.pack.1.temp.min 16°C</tt><tt class=""><br class=""></tt><tt class="">xrt.b.pack.1.temp.stddev.max 1°C</tt><tt class=""><br class=""></tt><tt class="">xrt.b.pack.1.temp.watches</tt><tt class=""><br class=""></tt><tt class="">xrt.b.pack.1.volt.alerts</tt><tt class=""><br class=""></tt><tt class="">xrt.b.pack.1.volt.max 57.6V</tt><tt class=""><br class=""></tt><tt class="">xrt.b.pack.1.volt.min 52.8V</tt><tt class=""><br class=""></tt><tt class="">xrt.b.pack.1.volt.stddev.max 0.005V</tt><tt class=""><br class=""></tt><tt class="">xrt.b.pack.1.volt.watches 1,2,4,5,6,7,11,12,14</tt><tt class=""><br class=""></tt><tt class="">xrt.b.pack.cnt 1</tt></tt></tt></div><div class=""><tt style="background-color: rgb(255, 255, 255);" class=""><tt class=""><tt class="">...<br class=""></tt><tt class="">xrt.b.soc.max 100%</tt><tt class=""><br class=""></tt><tt class="">xrt.b.soc.min 69.78%</tt></tt></tt></div></blockquote><div class=""><div class=""><br class=""></div><div class="">Trying to come up with a standard representation for this (so everyone can use a shared library, and share output displays), that works across all vehicles... Assuming we have one-dimensional arrays for different types of measurement (for voltage, temperature, etc), measurements are taken at the group of cells level (with perhaps different groupings for different readings), and aggregations/limits being automatically calculated, I think this has:</div><div class=""><br class=""></div><div class=""><ol class="MailOutline"><li class="">v.b.c.voltage<br class=""><br class="">Vector<float> metric type array of voltage measurements<br class=""><br class=""></li><li class="">v.b.c.temp<br class=""><br class="">Vector<float> metric type array of temperature measurements<br class=""><br class=""></li><li class="">Aggregations / limits<br class=""><br class="">We could have v.b.c.voltage.min, v.b.c.voltage.max, v.b.c.voltage.maxdev, v.b.c.temp.min, v.b.c.temp.max, and v.b.c.temp.maxdev if we wanted to store these. Presumably they could be automatically calculated? I am guessing ‘min’ is the minimal value seen, and ‘max’ the maximum?<br class=""><br class=""></li><li class="">Setting as a batch<br class=""><br class="">The way I’ve implemented the Model S is to keep a bitmap of values set. For example, say we have 32 cell voltage measurements. Every time we set a voltage measurement, we set the appropriate bit. When the bitmap is full, zero the bitmap, then set the metric in bulk (setting the entire vector). That seems to work well for Model S at least. The aggregations/limits would be calculated (and set) when the batch is ready. I suggest something like:<br class=""><br class=""></li><ul class=""><li class="">OvmsVehicle::SetCellVoltage(int index, float value);</li><li class="">OvmsVehicle::SetCellTemperature(int index, float value);<br class=""><br class=""></li></ul><li class="">Arrangement<br class=""><br class="">My thinking is that the count of measurements available can be defined when the module initialises. We can also simply count the size of the vectors, to know that. The issue is the cell/brick/module/pack arrangement; How many voltage or temperature measurements per module, how many modules in the pack, etc. I think we need to tell the system (a) the number of readings expected, (b) the number of readings per module, and (c) a hint to say how many readings to show per row. I suggest something like:<br class=""><br class=""></li><ul class=""><li class="">OvmsVehicle::SetCellArrangementVoltage(int readings, int readingspermodule, int readingsperrow)</li><li class="">OvmsVehicle::SetCellArrangementTemperature(int readings, int readingspermodule, int readingsperrow)<br class=""><br class=""></li></ul><li class="">Commands<br class=""><br class="">Once the above is defined we can have a ‘vehicle bms status’ command to show the status (like the Tesla Model S one shown here, albeit more polished):</li></ol></div><div class=""><br class=""></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div class=""><div class=""> <font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> 1 | 3.981 V | 3.981 V | 3.981 V | 29.5 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> | 3.981 V | 3.981 V | 3.981 V | 30.3 C Max</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> 2 | 3.981 V | 3.981 V | 3.982 V | 29.4 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> | 3.981 V | 3.981 V | 3.981 V | 29.8 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> 3 | 3.982 V | 3.982 V | 3.981 V | 29.1 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> | 3.981 V | 3.981 V | 3.982 V | 29.7 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> 4 | 3.982 V | 3.982 V | 3.982 V | 28.9 C Min</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> | 3.981 V | 3.982 V | 3.982 V | 29.7 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> 5 | 3.982 V | 3.982 V | 3.982 V | 29.0 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> | 3.982 V | 3.981 V | 3.981 V | 29.6 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> 6 | 3.982 V | 3.982 V | 3.982 V | 29.3 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> | 3.982 V | 3.982 V | 3.982 V | 29.6 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> 7 | 3.981 V | 3.981 V | 3.981 V | 29.0 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> | 3.981 V | 3.981 V | 3.981 V | 29.6 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> 8 | 3.982 V | 3.983 V | 3.982 V | 29.2 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> | 3.983 V | 3.982 V | 3.982 V | 29.9 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> 9 | 3.982 V | 3.982 V | 3.981 V | 30.0 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> | 3.982 V | 3.981 V | 3.981 V | 29.7 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">10 | 3.979 V | 3.980 V | 3.979 V | 29.1 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> | 3.980 V | 3.979 V | 3.979 V | 29.8 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">11 | 3.980 V | 3.981 V | 3.981 V | 29.1 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> | 3.981 V | 3.981 V | 3.981 V | 29.4 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">12 | 3.981 V | 3.982 V | 3.981 V | 29.1 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> | 3.981 V | 3.981 V | 3.982 V | 29.3 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">13 | 3.982 V | 3.983 V | 3.982 V | 28.9 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> | 3.982 V | 3.982 V | 3.982 V | 29.4 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">14 | 3.981 V | 3.982 V | 3.982 V | 29.3 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> | 3.982 V | 3.982 V | 3.982 V | 29.5 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">15 | 3.981 V | 3.982 V | 3.981 V | 29.6 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> | 3.982 V | 3.981 V | 3.981 V | 29.9 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">16 | 3.982 V | 3.982 V | 3.982 V | 29.5 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> | 3.982 V | 3.981 V | 3.981 V | 29.8 C</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> Tmin: 28.9 Tmax: 30.3 Vmax: 3.983 Vmin: 3.979 Vmax-Vmin: 0.003 Vtot: 382.23</span></font></div></div></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""><br class=""></span></font></div><div class="">Another variant of this display would be:</div><div class=""><br class=""></div><div class=""><div class=""> <font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font><span style="font-family: "Andale Mono"; font-size: 14px;" class="">-------------------------------</span><span style="font-family: "Andale Mono"; font-size: 14px;" class="">--------------------</span></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> 1 | 3.981 V | 3.981 V | 3.981 V | </span></font><span style="font-family: "Andale Mono"; font-size: 14px;" class="">3.981 V | 3.981 V | 3.981 V </span><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">| 29.5 C. </span></font><span style="font-family: "Andale Mono"; font-size: 14px;" class="">30.3 C Max |</span></div><div class=""> <font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font><span style="font-family: "Andale Mono"; font-size: 14px;" class="">-------------------------------</span><span style="font-family: "Andale Mono"; font-size: 14px;" class="">--------------------</span></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> 2 | 3.981 V | 3.981 V | 3.982 V | </span></font><span style="font-family: "Andale Mono"; font-size: 14px;" class="">3.981 V | 3.981 V | 3.981 V | </span><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">29.4 C </span></font><span style="font-family: "Andale Mono"; font-size: 14px;" class="">29.8 C |</span></div><div class=""> <font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font><span style="font-family: "Andale Mono"; font-size: 14px;" class="">-------------------------------</span><span style="font-family: "Andale Mono"; font-size: 14px;" class="">--------------------</span></div><div class=""><span style="font-size: 14px; font-family: "Andale Mono";" class=""> 3 | 3.982 V | 3.982 V | 3.981 V | </span><span style="font-family: "Andale Mono"; font-size: 14px;" class="">3.981 V | 3.981 V | 3.982 V | </span><span style="font-size: 14px; font-family: "Andale Mono";" class="">29.1 C </span><span style="font-family: "Andale Mono"; font-size: 14px;" class="">29.7 C |</span></div><div class=""> <font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font><span style="font-family: "Andale Mono"; font-size: 14px;" class="">-------------------------------</span><span style="font-family: "Andale Mono"; font-size: 14px;" class="">--------------------</span></div><div class=""><span style="font-size: 14px; font-family: "Andale Mono";" class=""> 4 | 3.982 V | 3.982 V | 3.982 V | </span><span style="font-family: "Andale Mono"; font-size: 14px;" class="">3.981 V | 3.982 V | 3.982 V | </span><span style="font-size: 14px; font-family: "Andale Mono";" class="">28.9 C Min </span><span style="font-family: "Andale Mono"; font-size: 14px;" class="">29.7 C |</span></div><div class=""> <font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font><span style="font-family: "Andale Mono"; font-size: 14px;" class="">-------------------------------</span><span style="font-family: "Andale Mono"; font-size: 14px;" class="">--------------------</span></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> 5 | 3.982 V | 3.982 V | 3.982 V | </span></font><span style="font-family: "Andale Mono"; font-size: 14px;" class="">3.982 V | 3.981 V | 3.981 V | </span><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">29.0 C </span></font><span style="font-family: "Andale Mono"; font-size: 14px;" class="">29.6 C |</span></div><div class=""> <font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font><span style="font-family: "Andale Mono"; font-size: 14px;" class="">-------------------------------</span><span style="font-family: "Andale Mono"; font-size: 14px;" class="">--------------------</span></div><div class="">...</div><div class=""> <font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font><span style="font-family: "Andale Mono"; font-size: 14px;" class="">-------------------------------</span><span style="font-family: "Andale Mono"; font-size: 14px;" class="">--------------------</span></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">16 | 3.982 V | 3.982 V | 3.982 V | </span></font><span style="font-family: "Andale Mono"; font-size: 14px;" class="">3.982 V | 3.981 V | 3.981 V | </span><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">29.5 C </span></font><span style="font-family: "Andale Mono"; font-size: 14px;" class="">29.8 C. |</span></div><div class=""> <font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> -------------------------------</span></font><span style="font-family: "Andale Mono"; font-size: 14px;" class="">-------------------------------</span><span style="font-family: "Andale Mono"; font-size: 14px;" class="">--------------------</span></div><div class=""><span style="font-size: 14px; font-family: "Andale Mono";" class=""> Tmin: 28.9 Tmax: 30.3 Vmax: 3.983 Vmin: 3.979 Vmax-Vmin: 0.003 Vtot: 382.23</span></div></div><div class=""><span style="font-size: 14px; font-family: "Andale Mono";" class=""><br class=""></span></div><div class="">(The vehicle itself having the control via the SetCellArrangement methods)</div></blockquote><div class=""><div class=""><br class=""></div><div class="">To provide a baseline usage case, the Tesla Model S has:</div><div class=""><br class=""></div><div class=""><ul class="MailOutline"><li class="">96 bricks in the pack</li><li class="">6 bricks in each module</li><li class="">16 modules in the pack</li><li class="">Each brick has one voltage measurement (so, 96 individual voltage measurements)</li><li class="">Each module has two temperature measurements (so, 32 individual temperature measurements)</li><li class="">That means:</li><ul class=""><li class="">OvmsVehicle::SetCellArrangementVoltage(96, 6, 3)</li><li class="">OvmsVehicle::SetCellArrangementTemperature(32, 2, 1)</li></ul></ul><div><br class=""></div><div>Tesla Model X seems identical to Model S.</div><div><br class=""></div><div>I am still working on reverse engineering the Tesla Roadster, but it seems to have:</div><div><br class=""></div><div><ul class="MailOutline"><li class="">99 bricks in the pack</li><li class="">9 bricks in each module (aka sheet)</li><li class="">11 modules in the pack</li><li class="">Each brick has one voltage measurement (so, 11*9 = 99 individual voltage measurements)</li><li class="">Each module has four temperature measurements (so, 11*4 = 44 individual temperature measurements)</li><li class="">That means:</li><ul class=""><li class="">OvmsVehicle::SetCellArrangementVoltage(99, 9, 9)</li><li class="">OvmsVehicle::SetCellArrangementTemperature(44, 4, 4)</li></ul></ul></div><div><br class=""></div><div>For other cars that support cell-level measurements, do they fit this representation? If so, can we fill in the following for each car, to see how it fits in?</div><div><br class=""></div><div><ul class="MailOutline"><li class="">XX cell groups in the pack</li><li class="">XX cell groups in each module</li><li class="">XX modules in the pack</li><li class="">Each cell group has one voltage measurement (so, XX individual voltage measurements)</li><li class="">Each module has four temperature measurements (so, XX individual temperature measurements)</li><li class="">That means:</li><ul class=""><li class="">OvmsVehicle::SetCellArrangementVoltage(N, Y, Z)</li><li class="">OvmsVehicle::SetCellArrangementTemperature(N, Y, Z)</li></ul></ul><div class=""><br class=""></div><div class="">If they don’t fit, what changes are needed to make it work?</div><div class=""><br class=""></div><div class="">Regards, Mark.</div></div><div><br class=""><blockquote type="cite" class=""><div class="">On 11 Nov 2018, at 12:16 AM, Mark Webb-Johnson <<a href="mailto:mark@webb-johnson.net" class="">mark@webb-johnson.net</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">I originally thought ‘brick’, or ‘module’ rather than ‘cell’, but happy with either. These are readings for groups of cells, rather than whole pack.<br class=""><br class="">Tesla Model S is 16 modules. 6 voltage readings, and 2 temperatures, per module.<br class=""><br class="">What is Kia Soul arrangement?<br class=""><br class="">Regards, Mark<br class=""><br class=""><blockquote type="cite" class="">On 10 Nov 2018, at 11:26 PM, Henrik Scheel <<a href="mailto:henrik.scheel@spjeldager.dk" class="">henrik.scheel@spjeldager.dk</a>> wrote:<br class=""><br class="">Hi Mark.<br class=""><br class="">Good idea with a generic array type metric, and standard metrics for common EV features!<br class=""><br class="">Just a quick note:<br class="">The Kia Soul EV vehicle module will be able to utilize these metric-arrays. However, on the Soul, the voltages are for each physical pair of cells connected in parallel, and the temperatures are for 6 battery modules, and for the battery cooling air inlet. <br class=""><br class="">So, for the Kia Soul EV, the name “v.b.cell.temp” would be misleading, as each measured module temperature is representing the state for 16 pairs of cells.<br class=""><br class="">Aside from that, I am all for mapping the values in these new standardized metric types. Currently, the temperature average is calculated and mapped to a metric, and the 96 cell voltages are unmapped for Kia Soul EV.<br class=""><br class="">Best regards,<br class="">Henrik<br class="">-- <br class=""><br class="">Venlig hilsen / best regards <br class="">Henrik R. Scheel<br class=""><br class="">Spjeldager Consult ApS<br class="">Spjeldager 9 <br class="">DK-2630 Taastrup <br class="">CVR: 34491399 <br class="">T: +45 2720 9828 <br class=""><a href="http://www.spjeldager.dk/" class="">http://www.spjeldager.dk/</a><br class=""><br class=""><blockquote type="cite" class="">Den 10. nov. 2018 kl. 15.34 skrev ovmsdev-request@lists.openvehicles.com:<br class=""><br class="">Send OvmsDev mailing list submissions to<br class=""> ovmsdev@lists.openvehicles.com<br class=""><br class="">To subscribe or unsubscribe via the World Wide Web, visit<br class=""> http://lists.openvehicles.com/mailman/listinfo/ovmsdev<br class="">or, via email, send a message with subject or body 'help' to<br class=""> ovmsdev-request@lists.openvehicles.com<br class=""><br class="">You can reach the person managing the list at<br class=""> ovmsdev-owner@lists.openvehicles.com<br class=""><br class="">When replying, please edit your Subject line so it is more specific<br class="">than "Re: Contents of OvmsDev digest..."<br class=""><br class=""><br class="">Today's Topics:<br class=""><br class=""> 1. Re: Custom metrics (Mark Webb-Johnson)<br class=""><br class=""><br class="">----------------------------------------------------------------------<br class=""><br class="">Message: 1<br class="">Date: Sat, 10 Nov 2018 22:34:46 +0800<br class="">From: Mark Webb-Johnson <mark@webb-johnson.net><br class="">To: OVMS Developers <ovmsdev@lists.openvehicles.com><br class="">Subject: Re: [Ovmsdev] Custom metrics<br class="">Message-ID: <1E30255B-5CC6-4EC4-BA9F-9CA41D156B11@webb-johnson.net><br class="">Content-Type: text/plain; charset="utf-8"<br class=""><br class="">I?ve added UnregisterCommand() methods to ovms_command.{h, cpp}. I?ve also updated the vehicle_teslamodels code to UnregisterCommand in the destructor. I think that is cleaner. The unregistering of CAN buses already seems to be working properly, config parameters should persist (even without vehicle module loaded). I am still considering the situation with metrics (but tend to think that they should disappear when the vehicle module is unloaded).<br class=""><br class="">I?ve also changed the vehicle_teslamodels code to use single voltage and temperate metric arrays (I think my previous dual voltage temperature arrangement was incorrect). I think these can now become standard metrics (one for battery voltage, and another for temperature). How about v.b.cell.voltage and v.b.cell.temp? The interpretation of those vectors (how many modules primarily - with the calculation of voltages and temperatures per module being dependent on the realtime size of each array) will still be vehicle dependent, and I guess the vehicle module can provide hints to our standard component for this. Perhaps we can just implement it in vehicle.{h, cpp}? I think this standard module can deal with:<br class=""><br class="">An interface for specific vehicle module to specify the number of modules, number of voltage measurements, and number of temperature measurements available.<br class="">Internal storage of cell voltages and temperatures.<br class="">Tracking of when all voltages and temperatures have been set, and these should be written to metrics (as a transaction).<br class="">Standardised command to display on terminal (like ?xts bms?).<br class="">Web interface extensions (including the charting you have, a textual display, etc).<br class=""><br class="">I can handle all of the above, except the web interface. What do you think? Can these be standardised? Certainly for Tesla Roadster and Tesla Model S they appear to be able to be unified under one standard framework.<br class=""><br class="">Regards, Mark.<br class=""><br class=""><blockquote type="cite" class="">On 8 Nov 2018, at 6:49 AM, Michael Balzer <dexter@expeedo.de> wrote:<br class=""><br class="">Mark,<br class=""><br class="">1) yes, we're approaching a generic form now. The chart currently displays actual, min & max values from the arrays, and derives the overall average value. It automatically adapts to the number of voltages and temperatures stored in the arrays.<br class=""><br class="">It still lacks:<br class="">a) Displaying max deviations, current standard deviation and max standard deviation recorded.<br class="">b) Displaying cell/module warn & alert status. These are currently set metrics on the Twizy, could better be generalized as arrays as well, i.e. 0=normal, 1=warn, 2=alert.<br class="">c) SOH / capacity and internal resistance should be generally available per cell as well (no data on these yet on the Twizy).<br class=""><br class="">And as this will visually overload the chart it will need some buttons to show/hide the parts.<br class=""><br class="">A general vehicle base support for these metrics could automatically keep min & max values, calculate deviations and derive warn/alert status from these. So basically a vehicle adapter only needs to provide voltages and temperatures (+ SOH and internal resistance as available). The reset command then can also normally just be a generalized version.<br class=""><br class="">2) I should add some basic documentation on this to the developer manual (lacking time). For the RE tools I've got an API to inject arbitrary data into the websocket stream on my todo list, so live updates can be transported without polling.<br class=""><br class="">4) Interesting idea, similar to a reverse proxy. As the channel will be very slow we will need to reduce the websocket update frequency, make it configurable or maybe auto-adapt to the current speed. Also, the proxy should cache static assets to speed up first time connects.<br class=""><br class="">The v2 protocol using RC4 encryption is a bad base for this. What's the current encryption on v3/MQTT?<br class=""><br class="">Regards,<br class="">Michael<br class=""><br class=""><br class=""><blockquote type="cite" class="">Am 07.11.18 um 01:50 schrieb Mark Webb-Johnson:<br class="">Some questions/comments:<br class=""><br class="">I guess this is fairly generic. Voltages and temperatures, with possibly a different number of readings for each. Model S has two temperatures, but I guess we can just treat those as interleaved. Could it be put into a reusable component? Or could we have standard metrics for this now (battery module voltages and temperatures)? Maybe a single component that does all this (functions to set individual voltages and temperatures, define the layout for display, include web interface for chart and table, etc)?<br class=""><br class="">I really need to look at integration of extensions to the web interface. See how that is done. For my work on DBC and RE tools, it seems easiest to just create a web interface (rather than messing around with command line).<br class=""><br class="">Regarding the registration of commands and metrics, I am not sure if that is done correctly at the moment. In particular in the case a vehicle module is loaded, unloaded, then loaded again. It seems that RegisterCommand doesn?t do it right, and the metric object creation needs a guard to make sure the metric doesn?t already exist. I will try to tidy this up in Model S code, as a reference, before moving on to Roadster.<br class=""><br class="">I really haven?t used the web interface much, as it is not available over cellular. I was wondering if it could be encapsulated somehow within the v2/v3 protocol, and made available via the server? Something like https://api.openvehicles.com:8080/VEHICLEID <https://api.openvehicles.com:8080/VEHICLEID> tunnelled through (with authentication at the server level using the normal web server user account). Similarly for SSH access. These are both simple tcp/ip connections, so presumably could be injected into mongoose as fake connections. One possible approach would be SOCKS, and there is some reference code for LWIP <https://github.com/russdill/lwip/commit/dfeba616>. Another is TUN/TAP, again with reference code for LWIP <https://github.com/russdill/lwip/commit/47ca42f8>. And then there is the standard PPP (although that would technically then be PPP within tcp/ip over PPP within async within GSM, which is a bit freaky).<br class=""><br class="">Regards, Mark.<br class=""><br class=""><blockquote type="cite" class="">On 7 Nov 2018, at 4:52 AM, Michael Balzer <dexter@expeedo.de <mailto:dexter@expeedo.de>> wrote:<br class=""><br class="">Mark, Tam?s,<br class=""><br class="">I've prepared a more or less generalized array version of my Twizy battery chart (OvmsVehicleRenaultTwizy::WebBattMon) for you. Easier to collect the data from actual arrays than separate metrics.<br class=""><br class="">This ZIP?<br class=""><br class="">https://dexters-web.de/f/ovms-dev/ovms.zip <https://dexters-web.de/f/ovms-dev/ovms.zip><br class=""><br class="">?contains my local ovms web test/development folder. Unzip it into some local web server (needs to be run via http for javascript), then open the folder from a browser. You should see an OVMS web UI lookalike.<br class=""><br class="">Config ? CellChart loads "cellchart.htm". The blue button generates and injects test data. Should look like this:<br class=""><br class=""><eoibkbnkbpofdlab.png><br class=""><br class="">Assuming you'll add some min/max records as well I left that code including the reset button in there. If you can't provide that yet, you can simply set min & max = act in the get_xxx_data functions. Other than that you should basically just need to change the metrics names.<br class=""><br class="">To generate C/C++ syntax from the file, use the script bin/mksrc: "bin/mksrc cellchart.htm >cellchart.cpp". The chart init URL needs to be changed for the production environment (see comment), and the test data generator can be removed. See OvmsVehicleRenaultTwizy::WebBattMon for reference.<br class=""><br class="">Maybe I should add that stuff to the repository as well?<br class=""><br class="">Regards,<br class="">Michael<br class=""><br class=""><br class=""><blockquote type="cite" class="">Am 06.11.18 um 15:56 schrieb Mark Webb-Johnson:<br class="">Nice. I just implemented this for Model S using your new metric type.<br class=""><br class="">96 individual brick voltages for each of the bricks, plus two temperatures for each of the 16 modules.<br class=""><br class="">Works well.<br class=""><br class=""><br class=""><br class=""><br class=""><blockquote type="cite" class="">On 1 Nov 2018, at 5:58 PM, Michael Balzer <dexter@expeedo.de <mailto:dexter@expeedo.de>> wrote:<br class=""><br class="">Tam?s,<br class=""><br class="">I've been creating separate metrics for all cell values on the Twizy, but that only has 14 cells.<br class=""><br class="">We discussed this before, a better approach is introducing a new metric class for arrays. I have just done that for you, please pull.<br class=""><br class="">Usage example:<br class="">OvmsMetricVector<float>* vf = new OvmsMetricVector<float>("test.volts", SM_STALE_MIN, Volts);<br class="">vf->SetElemValue(3, 1.23);<br class="">vf->SetElemValue(17, 2.34);<br class="">float myvals[3] = { 5.5, 6.6, 7.7 };<br class="">vf->SetElemValues(10, 3, myvals);<br class="">With this data set, you get:<br class="">OVMS# met lis test<br class="">test.volts 0,0,0,1.23,0,0,0,0,0,0,5.5,6.6,7.7,0,0,0,0,2.34V<br class="">?and in the web framework:<br class="">metrics["test.volts"]<br class="">(18) [0, 0, 0, 1.23, 0, 0, 0, 0, 0, 0, 5.5, 6.6, 7.7, 0, 0, 0, 0, 2.34]<br class="">metrics["test.volts"][11]<br class="">6.6<br class="">See template definition in ovms_metrics.h for more.<br class=""><br class="">Regards,<br class="">Michael<br class=""><br class=""><br class=""><blockquote type="cite" class="">Am 31.10.18 um 20:08 schrieb Tam?s Kov?cs:<br class="">I have a Peugeot iOn, and i wan't to create own metrics for battery temp (66 piece) and voltage (88 (old) or 80(new) piece) for all cell (and show on web interface), and i don't understand how can i create it. Now my data in array-s from can messages 6E1-6E4.<br class="">My git fork: https://github.com/KommyKT/Open-Vehicle-Monitoring-System-3/tree/peugeot <https://github.com/KommyKT/Open-Vehicle-Monitoring-System-3/tree/peugeot><br class="">vehicle_mitsubishi<br class=""><br class=""></blockquote><br class="">-- <br class="">Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal<br class="">Fon 02333 / 833 5735 * Handy 0176 / 206 989 26<br class="">_______________________________________________<br class="">OvmsDev mailing list<br class="">OvmsDev@lists.openvehicles.com <mailto:OvmsDev@lists.openvehicles.com><br class="">http://lists.openvehicles.com/mailman/listinfo/ovmsdev <http://lists.openvehicles.com/mailman/listinfo/ovmsdev><br class=""></blockquote><br class=""><br class="">_______________________________________________<br class="">OvmsDev mailing list<br class="">OvmsDev@lists.openvehicles.com <mailto:OvmsDev@lists.openvehicles.com><br class="">http://lists.openvehicles.com/mailman/listinfo/ovmsdev <http://lists.openvehicles.com/mailman/listinfo/ovmsdev><br class=""></blockquote><br class="">-- <br class="">Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal<br class="">Fon 02333 / 833 5735 * Handy 0176 / 206 989 26<br class="">_______________________________________________<br class="">OvmsDev mailing list<br class="">OvmsDev@lists.openvehicles.com <mailto:OvmsDev@lists.openvehicles.com><br class="">http://lists.openvehicles.com/mailman/listinfo/ovmsdev <http://lists.openvehicles.com/mailman/listinfo/ovmsdev><br class=""></blockquote><br class=""><br class=""><br class="">_______________________________________________<br class="">OvmsDev mailing list<br class="">OvmsDev@lists.openvehicles.com <mailto:OvmsDev@lists.openvehicles.com><br class="">http://lists.openvehicles.com/mailman/listinfo/ovmsdev <http://lists.openvehicles.com/mailman/listinfo/ovmsdev><br class=""></blockquote><br class="">-- <br class="">Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal<br class="">Fon 02333 / 833 5735 * Handy 0176 / 206 989 26<br class="">_______________________________________________<br class="">OvmsDev mailing list<br class="">OvmsDev@lists.openvehicles.com<br class="">http://lists.openvehicles.com/mailman/listinfo/ovmsdev<br class=""></blockquote><br class="">-------------- next part --------------<br class="">An HTML attachment was scrubbed...<br class="">URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20181110/b17e54e7/attachment.html><br class=""><br class="">------------------------------<br class=""><br class="">Subject: Digest Footer<br class=""><br class="">_______________________________________________<br class="">OvmsDev mailing list<br class="">OvmsDev@lists.openvehicles.com<br class="">http://lists.openvehicles.com/mailman/listinfo/ovmsdev<br class=""><br class=""><br class="">------------------------------<br class=""><br class="">End of OvmsDev Digest, Vol 82, Issue 10<br class="">***************************************<br class=""></blockquote><br class="">_______________________________________________<br class="">OvmsDev mailing list<br class="">OvmsDev@lists.openvehicles.com<br class="">http://lists.openvehicles.com/mailman/listinfo/ovmsdev<br class=""></blockquote><br class="">_______________________________________________<br class="">OvmsDev mailing list<br class=""><a href="mailto:OvmsDev@lists.openvehicles.com" class="">OvmsDev@lists.openvehicles.com</a><br class="">http://lists.openvehicles.com/mailman/listinfo/ovmsdev<br class=""></div></div></blockquote></div><br class=""></div></div></body></html>