mirror of
https://github.com/EFeru/hoverboard-firmware-hack-FOC.git
synced 2025-08-04 18:14:28 +02:00
Updated Input Calibration (markdown)
@@ -9,23 +9,25 @@ You need to calibrate your inputs either manually or with the auto-calibration.<
|
|||||||
|
|
||||||
|
|
||||||
# Type of inputs
|
# Type of inputs
|
||||||
### (0) Disabled input
|
### :x: Disabled input(0)
|
||||||
This type of input has to be used if you don't need one of the inputs and want it to be ignored. The ouput will always be 0.<br>
|
This type of input has to be used if you don't need one of the inputs and want it to be ignored. The ouput will always be 0.<br>
|
||||||
The [skateboard](https://github.com/EFeru/hoverboard-firmware-hack-FOC/wiki/Variant-SKATEBOARD) variant for example is only using one input.
|
The [skateboard](https://github.com/EFeru/hoverboard-firmware-hack-FOC/wiki/Variant-SKATEBOARD) variant for example is only using one input.
|
||||||
|
|
||||||
### (1) Normal pot
|
### :arrow_right: Normal pot(1)
|
||||||
This type of input will be mapped to a positive ouput(voltage/speed/torque) only.<br>
|
This type of input will be mapped to a positive ouput(voltage/speed/torque) only.<br>
|
||||||
|
|
||||||
0----------> INPUT_MAX(1000)
|
0----------> INPUT_MAX(1000)
|
||||||
|
|
||||||
The [hovercar](https://github.com/EFeru/hoverboard-firmware-hack-FOC/wiki/Variant-HOVERCAR) variant for example is using such inputs (throttle/brake handles or pedals)
|
The [hovercar](https://github.com/EFeru/hoverboard-firmware-hack-FOC/wiki/Variant-HOVERCAR) variant for example is using such inputs (throttle/brake handles or pedals)
|
||||||
|
|
||||||
### (2) Mid-resting pot
|
### :left_right_arrow: Mid-resting pot(2)
|
||||||
This type of input will be mapped to a positive and negative ouput(voltage/speed/torque) on each side of the resting/middle position.<br>
|
This type of input will be mapped to a positive and negative ouput(voltage/speed/torque) on each side of the resting/middle position.<br>
|
||||||
|
|
||||||
INPUT_MIN(-1000) <----------0----------> INPUT_MAX(1000)
|
INPUT_MIN(-1000) <----------0----------> INPUT_MAX(1000)
|
||||||
|
|
||||||
The [Nunchuk](https://github.com/EFeru/hoverboard-firmware-hack-FOC/wiki/Variant-Nunchuk) variant is using such input types.
|
The [Nunchuk](https://github.com/EFeru/hoverboard-firmware-hack-FOC/wiki/Variant-Nunchuk) variant is using such input types.
|
||||||
|
|
||||||
### (3) Automatic
|
### :control_knobs: Automatic(3)
|
||||||
This type of input will be automatically be identified when you proceed with the [auto-calibration](https://github.com/EFeru/hoverboard-firmware-hack-FOC/wiki/Input-Calibration#auto-calibration).<br>
|
This type of input will be automatically be identified when you proceed with the [auto-calibration](https://github.com/EFeru/hoverboard-firmware-hack-FOC/wiki/Input-Calibration#auto-calibration).<br>
|
||||||
The [ADC](https://github.com/EFeru/hoverboard-firmware-hack-FOC/wiki/Variant-ADC) variant is using such input types.
|
The [ADC](https://github.com/EFeru/hoverboard-firmware-hack-FOC/wiki/Variant-ADC) variant is using such input types.
|
||||||
|
|
||||||
@@ -56,7 +58,7 @@ For Normal pots:
|
|||||||
For Mid-resting pots:
|
For Mid-resting pots:
|
||||||
* INPUT_MIN(-1000) <----------0< Deadband >0----------> INPUT_MAX(1000)<br>
|
* INPUT_MIN(-1000) <----------0< Deadband >0----------> INPUT_MAX(1000)<br>
|
||||||
|
|
||||||
This is for example used with [PWM](https://github.com/EFeru/hoverboard-firmware-hack-FOC/wiki/Variant-PWM) variant to prevent jitters at standstill due to signal noise.<br>
|
This is for example used with [PWM](https://github.com/EFeru/hoverboard-firmware-hack-FOC/wiki/Variant-PWM) variant to prevent jitters around 0 value due to signal noise.<br>
|
||||||
It can also help in addition to the auto-calibration if your joystick is not perfectly centered.<br>
|
It can also help in addition to the auto-calibration if your joystick is not perfectly centered.<br>
|
||||||
|
|
||||||
# Auto-calibration:
|
# Auto-calibration:
|
||||||
@@ -77,7 +79,7 @@ Otherwise the inputs will be identified as middle resting potis(type=2).<br />
|
|||||||
For inputs with type 3 (AUTO) in [config.h](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/blob/master/Inc/config.h), auto-calibration will automatically identify the right input type.
|
For inputs with type 3 (AUTO) in [config.h](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/blob/master/Inc/config.h), auto-calibration will automatically identify the right input type.
|
||||||
If input type 0,1,2 has been selected in [config.h](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/blob/master/Inc/config.h), auto-calibration will fail if identified input type is not matching and disable the input.
|
If input type 0,1,2 has been selected in [config.h](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/blob/master/Inc/config.h), auto-calibration will fail if identified input type is not matching and disable the input.
|
||||||
|
|
||||||
### Debug output
|
### :desktop_computer: Debug output
|
||||||
If you use [Debug Serial](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/wiki/Debug-Serial), you can see the results of auto-calibration procedure:
|
If you use [Debug Serial](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/wiki/Debug-Serial), you can see the results of auto-calibration procedure:
|
||||||
```
|
```
|
||||||
Input calibration started...
|
Input calibration started...
|
||||||
@@ -91,7 +93,7 @@ In this example:
|
|||||||
* Input1 was ignored as it was not connected or wasn't moved
|
* Input1 was ignored as it was not connected or wasn't moved
|
||||||
* Input2 was identified as a normal pot (pedal or throttle handle), and the minimum value is high enough to detect a floating input pulled to ground. If firmware reads a value below 915 ( MIN - ADC_PROTECT_THRESH ) for ADC_PROTECT_TIMEOUT time, it will trigger an ADC Timeout error.
|
* Input2 was identified as a normal pot (pedal or throttle handle), and the minimum value is high enough to detect a floating input pulled to ground. If firmware reads a value below 915 ( MIN - ADC_PROTECT_THRESH ) for ADC_PROTECT_TIMEOUT time, it will trigger an ADC Timeout error.
|
||||||
|
|
||||||
### Saving the calibration
|
### :floppy_disk: Saving the calibration
|
||||||
The limits will be saved/overwritten in flash memory when you turn the board off by pressing the button.
|
The limits will be saved/overwritten in flash memory when you turn the board off by pressing the button.
|
||||||
|
|
||||||
⚠The input limits (and maximum current and speed settings) will be persisted in flash memory even if you flash the firmware again, the only way to delete it is to fully erase the chip in st-utility before flashing.<br />
|
⚠The input limits (and maximum current and speed settings) will be persisted in flash memory even if you flash the firmware again, the only way to delete it is to fully erase the chip in st-utility before flashing.<br />
|
||||||
|
Reference in New Issue
Block a user