Added Warning Cell Voltage

Added Warning Cell Voltage to Battery voltage in Configuration tab. When battery has deployed to level that is defined with warning cell voltage buzzer starts slow beeping and copter can still land safely. When min voltage is reached beeper start fast "screaming" and LIPO is empty (to point when it could be damaged from over discharging if using that default 3.3V).
10.3.x-maintenance
jaahaavi 2014-12-09 10:37:02 +02:00
parent b3ae9b2967
commit 9cf60224b2
4 changed files with 13 additions and 2 deletions

View File

@ -379,6 +379,9 @@
"configurationBatteryMinimum": { "configurationBatteryMinimum": {
"message": "Minimum Cell Voltage" "message": "Minimum Cell Voltage"
}, },
"configurationBatteryWarning": {
"message": "Warning Cell Voltage"
},
"configurationBatteryMaximum": { "configurationBatteryMaximum": {
"message": "Maximum Cell Voltage" "message": "Maximum Cell Voltage"
}, },

View File

@ -305,7 +305,7 @@ var MSP = {
MISC.vbatscale = data.getUint8(18, 1); // 10-200 MISC.vbatscale = data.getUint8(18, 1); // 10-200
MISC.vbatmincellvoltage = data.getUint8(19, 1) / 10; // 10-50 MISC.vbatmincellvoltage = data.getUint8(19, 1) / 10; // 10-50
MISC.vbatmaxcellvoltage = data.getUint8(20, 1) / 10; // 10-50 MISC.vbatmaxcellvoltage = data.getUint8(20, 1) / 10; // 10-50
MISC.placeholder3 = data.getUint8(21, 1); MISC.vbatwarningcellvoltage = data.getUint8(21, 1) / 10; // 10-50
break; break;
case MSP_codes.MSP_MOTOR_PINS: case MSP_codes.MSP_MOTOR_PINS:
console.log(data); console.log(data);
@ -679,7 +679,7 @@ MSP.crunch = function (code) {
buffer.push(MISC.vbatscale); buffer.push(MISC.vbatscale);
buffer.push(MISC.vbatmincellvoltage * 10); buffer.push(MISC.vbatmincellvoltage * 10);
buffer.push(MISC.vbatmaxcellvoltage * 10); buffer.push(MISC.vbatmaxcellvoltage * 10);
buffer.push(MISC.placeholder3); buffer.push(MISC.vbatwarningcellvoltage * 10);
break; break;
case MSP_codes.MSP_SET_SERVO_CONF: case MSP_codes.MSP_SET_SERVO_CONF:
for (var i = 0; i < SERVO_CONFIG.length; i++) { for (var i = 0; i < SERVO_CONFIG.length; i++) {

View File

@ -106,6 +106,12 @@
<span i18n="configurationBatteryMinimum"></span> <span i18n="configurationBatteryMinimum"></span>
</label> </label>
</div> </div>
<div class="number">
<label>
<input type="number" name="warningcellvoltage" step="0.1" min="1" max="5" />
<span i18n="configurationBatteryWarning"></span>
</label>
</div>
<div class="number"> <div class="number">
<label> <label>
<input type="number" name="maxcellvoltage" step="0.1" min="1" max="5" /> <input type="number" name="maxcellvoltage" step="0.1" min="1" max="5" />

View File

@ -211,6 +211,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
// fill battery // fill battery
$('input[name="mincellvoltage"]').val(MISC.vbatmincellvoltage); $('input[name="mincellvoltage"]').val(MISC.vbatmincellvoltage);
$('input[name="warningcellvoltage"]').val(MISC.vbatwarningcellvoltage);
$('input[name="maxcellvoltage"]').val(MISC.vbatmaxcellvoltage); $('input[name="maxcellvoltage"]').val(MISC.vbatmaxcellvoltage);
$('input[name="voltagescale"]').val(MISC.vbatscale); $('input[name="voltagescale"]').val(MISC.vbatscale);
@ -250,6 +251,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
MISC.mincommand = parseInt($('input[name="mincommand"]').val()); MISC.mincommand = parseInt($('input[name="mincommand"]').val());
MISC.vbatmincellvoltage = parseFloat($('input[name="mincellvoltage"]').val()); MISC.vbatmincellvoltage = parseFloat($('input[name="mincellvoltage"]').val());
MISC.vbatwarningcellvoltage = parseFloat($('input[name="warningcellvoltage"]').val());
MISC.vbatmaxcellvoltage = parseFloat($('input[name="maxcellvoltage"]').val()); MISC.vbatmaxcellvoltage = parseFloat($('input[name="maxcellvoltage"]').val());
MISC.vbatscale = parseInt($('input[name="voltagescale"]').val()); MISC.vbatscale = parseInt($('input[name="voltagescale"]').val());