mirror of
https://github.com/EFeru/hoverboard-firmware-hack-FOC.git
synced 2025-08-04 10:04:28 +02:00
Created Parameters (markdown)
51
Parameters.md
Normal file
51
Parameters.md
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
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](https://github.com/EFeru/hoverboard-firmware-hack-FOC/wiki/Battery).
|
||||||
|
|
||||||
|
### Input Calibration
|
||||||
|
For Parameters related to Input Calibration, please visit following [wiki section](https://github.com/EFeru/hoverboard-firmware-hack-FOC/wiki/Input-Calibration).
|
||||||
|
|
||||||
|
## 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.<br>
|
||||||
|
This helps smooth out the final ouput to the motor control model.<br>
|
||||||
|
The default value is 480 in fixed-point, which corresponds to 30 value in single precision.<br>
|
||||||
|
|
||||||
|
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<br>Value| Limited<br>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.<br>
|
||||||
|
Please don't change this parameter if you don't know what you are doing, this can lead to issues.<br>
|
||||||
|
⚠ 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.<br>
|
||||||
|
The default value is 6553 in fixed-point, which corresponds to a filter of 0.1 in single precision.<br>
|
||||||
|
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<br>Value| Filtered<br>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.<br>
|
||||||
|
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 ).
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user