-
Notifications
You must be signed in to change notification settings - Fork 974
Parameters
Parameters are used in config.h to configure the behavior of the firmware, by enabling/disabling features, or adjust value.
For parameters related to Battery Management, please visit following wiki section.
For Parameters related to Input Calibration, please visit following wiki section.
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.
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.
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 ).