Skip to content

Commit f38561b

Browse files
committed
update debug fields for 4.3
1 parent eeff258 commit f38561b

File tree

3 files changed

+121
-21
lines changed

3 files changed

+121
-21
lines changed

js/flightlog_fielddefs.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,10 @@ function adjustFieldDefsList(firmwareType, firmwareVersion) {
480480
DEBUG_MODE.splice(DEBUG_MODE.indexOf('DUAL_GYRO'), 1);
481481
DEBUG_MODE.splice(DEBUG_MODE.indexOf('DUAL_GYRO_COMBINED'), 1);
482482
}
483+
if(semver.gte(firmwareVersion, '4.3.0')) {
484+
DEBUG_MODE.splice(DEBUG_MODE.indexOf('FF_INTERPOLATED'), 1, 'FEEDFORWARD');
485+
DEBUG_MODE.splice(DEBUG_MODE.indexOf('FF_LIMIT'), 1, 'FEEDFORWARD_LIMIT');
486+
}
483487
DEBUG_MODE = makeReadOnly(DEBUG_MODE);
484488

485489
// Flight mode names

js/flightlog_fields_presenter.js

Lines changed: 60 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -404,17 +404,17 @@ function FlightLogFieldPresenter() {
404404
},
405405
'FF_LIMIT' : {
406406
'debug[all]':'FF Limit',
407-
'debug[0]':'FF [Roll]',
408-
'debug[1]':'FF [Pitch]',
409-
'debug[2]':'FF Final [Roll]',
407+
'debug[0]':'FF input [roll]',
408+
'debug[1]':'FF input [pitch]',
409+
'debug[2]':'FF limited [roll]',
410410
'debug[3]':'Not Used',
411411
},
412412
'FF_INTERPOLATED' : {
413-
'debug[all]':'FF Interpolated',
414-
'debug[0]':'Setpoint Delta Impl [Roll]',
415-
'debug[1]':'Boost Amount',
416-
'debug[2]':'Boost Amount Clip [Roll]',
417-
'debug[3]':'Clip',
413+
'debug[all]':'FF Interpolated [roll]',
414+
'debug[0]':'Setpoint Delta Impl [roll]',
415+
'debug[1]':'Boost amount [roll]',
416+
'debug[2]':'Boost amount, clipped [roll]',
417+
'debug[3]':'Clip amount [roll]',
418418
},
419419
'RTH' : {
420420
'debug[all]':'RTH',
@@ -431,16 +431,56 @@ function FlightLogFieldPresenter() {
431431

432432
DEBUG_FRIENDLY_FIELD_NAMES = {...DEBUG_FRIENDLY_FIELD_NAMES_INITIAL};
433433

434-
if (firmwareType === FIRMWARE_TYPE_BETAFLIGHT && semver.gte(firmwareVersion, '4.3.0')) {
435-
DEBUG_FRIENDLY_FIELD_NAMES.FF_INTERPOLATED = {
436-
'debug[0]':'Raw FF Derivative [Roll]',
437-
'debug[1]':'Cleaned FF Derivative ',
438-
'debug[2]':'Cleaned Boost Amount [Roll]',
439-
'debug[3]':'Duplicate Marker',
440-
};
434+
if (firmwareType === FIRMWARE_TYPE_BETAFLIGHT) {
435+
if (semver.gte(firmwareVersion, '4.3.0')) {
436+
DEBUG_FRIENDLY_FIELD_NAMES.FEEDFORWARD = {
437+
'debug[all]':'Feedforward [roll]',
438+
'debug[0]':'Setpoint, interpolated [roll]',
439+
'debug[1]':'Delta, smoothed [roll]',
440+
'debug[2]':'Boost, smoothed [roll]',
441+
'debug[3]':'rcCommand Delta [roll]',
442+
};
443+
DEBUG_FRIENDLY_FIELD_NAMES.FEEDFORWARD_LIMIT = {
444+
'debug[all]':'Feedforward Limit [roll]',
445+
'debug[0]':'Feedforward input [roll]',
446+
'debug[1]':'Feedforward input [pitch]',
447+
'debug[2]':'Feedforward limited [roll]',
448+
'debug[3]':'Not Used',
449+
};
450+
} else if (semver.gte(firmwareVersion, '4.2.0')) {
451+
DEBUG_FRIENDLY_FIELD_NAMES.FF_INTERPOLATED = {
452+
'debug[all]':'Feedforward [roll]',
453+
'debug[0]':'Setpoint Delta [roll]',
454+
'debug[1]':'Acceleration [roll]',
455+
'debug[2]':'Acceleration, clipped [roll]',
456+
'debug[3]':'Duplicate Counter [roll]',
457+
};
458+
DEBUG_FRIENDLY_FIELD_NAMES.FF_LIMIT = {
459+
'debug[all]':'Feedforward Limit [roll]',
460+
'debug[0]':'Feedforward input [roll]',
461+
'debug[1]':'Feedforward input [pitch]',
462+
'debug[2]':'Feedforward limited [roll]',
463+
'debug[3]':'Not Used',
464+
};
465+
} else if (semver.gte(firmwareVersion, '4.1.0')) {
466+
DEBUG_FRIENDLY_FIELD_NAMES.FF_INTERPOLATED = {
467+
'debug[all]':'Feedforward [roll]',
468+
'debug[0]':'Setpoint Delta [roll]',
469+
'debug[1]':'Boost [roll]',
470+
'debug[2]':'Boost, clipped [roll]',
471+
'debug[3]':'Duplicate Counter [roll]',
472+
};
473+
DEBUG_FRIENDLY_FIELD_NAMES.FF_LIMIT = {
474+
'debug[all]':'Feedforward Limit [roll]',
475+
'debug[0]':'FF limit input [roll]',
476+
'debug[1]':'FF limit input [pitch]',
477+
'debug[2]':'FF limited [roll]',
478+
'debug[3]':'Not Used',
479+
};
480+
}
441481
}
442482
};
443-
483+
444484
FlightLogFieldPresenter.presentFlags = function(flags, flagNames) {
445485
var
446486
printedFlag = false,
@@ -486,8 +526,9 @@ function FlightLogFieldPresenter() {
486526
};
487527

488528
FlightLogFieldPresenter.presentEnum = function presentEnum(value, enumNames) {
489-
if (enumNames[value] === undefined)
529+
if (enumNames[value] === undefined) {
490530
return value;
531+
}
491532

492533
return enumNames[value];
493534
};
@@ -500,8 +541,9 @@ function FlightLogFieldPresenter() {
500541
* @param value Value of the field
501542
*/
502543
FlightLogFieldPresenter.decodeFieldToFriendly = function(flightLog, fieldName, value, currentFlightMode) {
503-
if (value === undefined)
544+
if (value === undefined) {
504545
return "";
546+
}
505547

506548
switch (fieldName) {
507549
case 'time':

js/graph_config.js

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ function GraphConfig(graphConfig) {
4848
newGraph = $.extend(
4949
// Default values for missing properties:
5050
{
51-
height: 1
51+
height: 1,
5252
},
5353
// The old graph
5454
graph,
5555
// New fields to replace the old ones:
5656
{
57-
fields:[]
58-
}
57+
fields:[],
58+
},
5959
),
6060
colorIndex = 0;
6161

@@ -535,6 +535,60 @@ GraphConfig.load = function(config) {
535535
return getCurveForMinMaxFieldsZeroOffset(fieldName);
536536
}
537537
break;
538+
case 'FF_INTERPOLATED':
539+
switch (fieldName) {
540+
case 'debug[0]': // setpoint Delta
541+
case 'debug[1]': // AccelerationModified
542+
case 'debug[2]': // Acceleration
543+
return {
544+
offset: 0,
545+
power: 1.0,
546+
inputRange: 1000,
547+
outputRange: 1.0,
548+
};
549+
case 'debug[3]': // Clip or Count
550+
return {
551+
offset: -10,
552+
power: 1.0,
553+
inputRange: 10,
554+
outputRange: 1.0,
555+
};
556+
}
557+
break;
558+
case 'FEEDFORWARD': // replaces FF_INTERPOLATED in 4.3
559+
switch (fieldName) {
560+
case 'debug[0]': // in 4.3 is interpolated setpoint
561+
return {
562+
offset: 0,
563+
power: 1.0,
564+
inputRange: maxDegreesSecond(gyroScaleMargin),
565+
outputRange: 1.0,
566+
};
567+
case 'debug[1]': // feedforward delta element
568+
case 'debug[2]': // feedforward boost element
569+
return {
570+
offset: 0,
571+
power: 1.0,
572+
inputRange: 1000,
573+
outputRange: 1.0,
574+
};
575+
case 'debug[3]': // rcCommand delta
576+
return {
577+
offset: 0,
578+
power: 1.0,
579+
inputRange: 10000,
580+
outputRange: 1.0,
581+
};
582+
}
583+
break;
584+
case 'FF_LIMIT':
585+
case 'FEEDFORWARD_LIMIT':
586+
return {
587+
offset: 0,
588+
power: 1.0,
589+
inputRange: 300,
590+
outputRange: 1.0,
591+
};
538592
}
539593
}
540594
// if not found above then

0 commit comments

Comments
 (0)