Skip to content
Candas1 edited this page Apr 18, 2022 · 21 revisions

Parameters are used in config.h to configure the behavior of the firmware, by enabling/disabling features, or adjust value.

Battery Management

For parameters related to Battery Management, please visit following wiki section.

Input Calibration

For Parameters related to Input Calibration, please visit following wiki section.

Further Input processing

After the inputs have been mapped to the MIN, MID and MAX value that have been calibrated, following parameters can help adjust the behavior of the firmware.

Rate limiting

DEFAULT_RATE parameter is used to limit the rate of change of the inputs in the main loop between 2 loop iterations.
This helps smooth out the final ouput to the motor control model.
The default value is 480 in fixed-point, which corresponds to 30 value in single precision.

This means if the input goes from 0 to 300, the firmware will limit the increment to 30 for each loop iteration (5ms)

Iteration Time Input
Value
Limited
Value
0 0ms 0 0
1 5ms 300 30
2 10ms 300 60
3 15ms 300 90
4 20ms 300 120
5 25ms 300 150
6 30ms 300 180
7 35ms 300 210
8 40ms 300 240
9 45ms 300 270
10 50ms 300 300

A rate of 32767 in fixed-point means the value can increase/decrease by an increment of 2047, so basically there is no limiting.
Please don't change this parameter if you don't know what you are doing, this can lead to issues.
⚠ Don't set the RATE parameter higher than 32767, this corresponds to a Negative Rate in single precision value.

Filtering

DEFAULT_FILTER parameter is used to smooth out (low-pass filter) the output value to the motor control.
The default value is 6553 in fixed-point, which corresponds to a filter of 0.1 in single precision.
This means if the input goes from 0 to 300, the output value will be 90% of the previous value + 10% of the new value

Iteration Time Input
Value
Filtered
Value
0 0ms 0 0
1 5ms 300 90% of 0 + 10% of 300 = 30
2 10ms 300 90% of 30 + 10% of 300 = 57
3 15ms 300 90% of 57 + 10% of 300 = 81

A filter of 65535 in fixed-point, which corresponds to 1 in single precision, means no filter will be applied.
You can also define parameter FILTER for a specific variant, it will overwrite DEFAULT_FILTER parameter (e.g. NUNCHUK Variant is using a smoother filter of 3276->0.05 ).