DataField: Advanced Grade (6 clones)

Advanced Grade is an app that eliminates grade (slope) jumps in Garmin Edge devices. It has many settings for flexible custom setup of the filtering of the grade. In addition it can display the max/min elevation and max/min pressure. All of the selected variables can be displayed with one decimal place. The default settings are chosen to ensure a balance between accuracy and fast response.

View on Connect IQ Store

In stage 1 the raw grade is calculated from the "Grade source" and the elapsed "Distance", then it's rejected if it's higher than the maximum allowable value. In stage 2, moving average and 2-nd order Bessel filters are applied to the remaining grade from stage 1, the one whose output is smaller in absolute value is chosen. The filtered grade accel is then calculated from its latched value 1 second ago. If the accel is less than "Max accel", then counter of valid grade accel increments and the current grade is latched for the next computation. If the accel is more than "Max accel", then counter of invalid grade accel increments and the current grade is latched only if the counter reaches "Wait accel". Each of the two counters is reset when the other reaches "Wait accel" or one counter has not reached "Wait accel" and the other is incremented.

Configuration screens on Garmin Express:

Features:

Label
- the title of the datafield, maximum 20 characters.
Decimal point
- when switched on, the selected variables are displayed with one decimal place.
Separator
- the separator between the selected variables.
Grade (%)
- display the output grade from stage 2.
Minimum grade (%)
- display the minimum of the output grade from stage 2.
Maximum grade (%)
- display the maximum of the output grade from stage 2.
Elevation (m)
- display the altitude above mean sea level.
Min elevation (m)
- display the minimum altitude.
Max elevation (m)
- display the maximum altitude.
Pressure (hPa)
- display the ambient (local) barometric pressure, it's smoothed by a two-stage filter.
Min pressure (hPa)
- display the minimum pressure.
Max pressure (hPa)
- display the maximum pressure.

Minmax - Minmax values processing
Settling time (s) [1 - 20]
- min/max values settling time.
- default value is 3s.
Reset on Lap
- whose min/max values to reset when "Lap" button is pressed.
- default value is "Grade".
Grade auto reset
- which grade min/max values to auto reset.
- default value is "None".
Grade res time (min) [1 - 120]
- grade min/max values auto reset time.
- default value is 10.

Stage 1 - Grade calculation
Grade source
- grade calculation source, where "Min (Press, Alti)" means the one whose output is smaller in absolute value.
- default value is "Pressure".
Distance (m) [1 - 100]
- traveled distance, based on which the grade is calculated.
- default value is 40, my advise is to not set it below 10.
Max limit (%) [1 - 100]
- if the grade is higher than this value, it's rejected.
- default value is 30, you can change it depending on the maximum grade you will be climbing.

Stage 2 - Grade filtering and rejecting
Settling time (s) [1 - 20]
- this parameter defines the settling time of the filters.
- default value is 8, my advise is to not set it below 4.
Rejecting mode
- default value is "Max accel".
Max accel (%/s) [0.1 - 10.0]
- the maximum allowable grade increase in 1 second.
- note that if you change the settling time of the filters, the accel may change.
- default value is 1.0.
Wait accel
- time to wait for valid or invalid grade accel.
- default value is 4.

Debug - Additional parameters for debugging
S2 input (%)
- display the input grade of stage 2.
S2 filtered (%)
- display the filtered grade in stage 2.
S2 accel (%/s)
- display the grade accel in stage 2.
S2 cntr valid accel
- display the counter of valid grade accel in stage 2.
S2 cntr invalid accel
- display the counter of invalid grade accel in stage 2.

Changelog:

Version 2.3
Some parameter names in the minmax section are changed.
The default value of "Grade auto reset" is changed to None.
The unit of "Grade res time" is changed to minutes.
The range of "Grade res time" is changed to 1 - 120.
The default value of "Grade res time" is changed to 10.
---
Version 2.2
Added "Minmax" section
Added grade min/max values auto reset
Some parameter positions are changed.
---
Version 2.1
The default value of "Distance" is changed to 40
---
Version 2.0
The rejecting algorithm in second stage is changed.
The debug section is changed.
The app is compiled with Connect IQ SDK version 8.2.3.
All Garmin devices are now compatible.
---
Version 1.7
In stage 1 is added option for grade calculation source.
In the debug section, the grade values can be written to the FIT file.
---
Version 1.6
Fixed issue with elevation not showing in some cases.
---
Version 1.5
Added settling time for max/min values.
Added new filter, which is combination of moving average and 2-nd order Bessel.
In the debug section is added option to save grade values in the FIT file.
Raw pressure is removed from the debug section.
---
Version 1.4
The three stages are combined into two.
The filtering algorithm is changed to exponential moving average.
The default settling time of the filter in stage 1 is decreased to 4s.
Some parameter names and ranges are changed.
- - -
Version 1.3
The history buffer for calculation of the raw grade is increased.
- - -
Version 1.2
Now max/min elevation is calculated only during activity.
- - -
Version 1.1 is the first official release.