Updated Input Calibration (markdown)

Candas1
2022-05-02 09:43:28 +02:00
parent b42c0474db
commit a524d723bc

@@ -32,6 +32,23 @@ The [Nunchuk](https://github.com/EFeru/hoverboard-firmware-hack-FOC/wiki/Variant
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.
# ADC Protection
ADC Protection helps identify if wires are disconnected when using ADC control(ADC and HOVERCAR variants).<br>
It identifies when the measured ADC value is below MIN - ADC_PROTECT_THRESH or above MAX + ADC_PROTECT_THRESH.<br>
If detected, the board will enter the ADC timeout state and generate 2 beeps(low pitch).<br>
Prerequisites are:
* using pull down resistors so the input is pulled to ground/0V when the wire is disconnected
* your input should have enough gap between 0 and MIN
0ADC/0V<--->MIN<---MID--->MAX<--->4095ADC/3.3V<br>
The auto-calibration will let you know with a high pitch beep if the inputs can be protected, you can also see it in the debug output.<br>
This is usually not the case with potentiometer that use the full 0-3.3v range.
Those are the parameters to adjust the ADC protection:
* ADC_PROTECT_THRESH : to adjust the threshold below/above the MIN/MAX ADC values that will trigger ADC protection
* ADC_PROTECT_TIMEOUT : number of wrong / missing input commands before safety state is taken
# Manual Calibration:
Manual Calibration has to be done in [config.h](https://github.com/EFeru/hoverboard-firmware-hack-FOC/blob/master/Inc/config.h) in the section related to the variant you have selected.<br>