mirror of
https://github.com/EFeru/hoverboard-firmware-hack-FOC.git
synced 2025-08-08 12:04:27 +02:00
Created ADC Control (markdown)
44
ADC-Control.md
Normal file
44
ADC-Control.md
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
# Wiring:
|
||||||
|
* Use blue cable for steering and green cable for speed
|
||||||
|
* Use 3.3v from programming port or a voltage regulator
|
||||||
|
* If you don’t need steering, connect blue cable to ground, and set **STEERING_COEFFICIENT** to 0 in config.h
|
||||||
|
* 100k Pull down resistors connected to ground are recommended to prevent issues when inputs are floating (wire is cut or disconnected)
|
||||||
|
|
||||||
|
⚠ don’t use red wire it delivers 15v
|
||||||
|
|
||||||
|
|
||||||
|
# Configuration:
|
||||||
|
* If you use a joystick as input, enable **ADC1_MID_POT** and **ADC1_MID_POT** in config.h
|
||||||
|
|
||||||
|
# Manual Calibration:
|
||||||
|
* Connect FTDI to right sensor cable to read USART DEBUG values
|
||||||
|
* Turn the potis to minimum position, write value 1: to **ADC1_MIN** and value 2: to **ADC2_MIN** in config.h
|
||||||
|
* Turn the potis to maximum position, write value 1: to **ADC1_MAX** and value 2: to **ADC2_MAX** in config.h
|
||||||
|
* For middle resting potis, let the potis in the middle resting position, write value 1: to **ADC1_MID** and value 2: to **ADC2_MID**
|
||||||
|
|
||||||
|
Config.h values will be ignored if you have already used the auto-calibration procedure below.
|
||||||
|
|
||||||
|
# Auto-calibration:
|
||||||
|
Auto-calibration finds the minimum, middle and maximum values for ADC inputs.
|
||||||
|
* press the power button for more than 5 sec and release after the beep sound
|
||||||
|
* move the potentiometers freely to the min and max limits repeatedly
|
||||||
|
* release potentiometers to the resting position
|
||||||
|
* press the power button to confirm or wait for the 20 sec timeout
|
||||||
|
|
||||||
|
The limits will be stored in flash memory and will be erased only if you fully delete memory before flashing.<br />
|
||||||
|
An alternative to bypass those limits is to change **FLASH_WRITE_KEY** in config.h to a value different than 0x1234.
|
||||||
|
|
||||||
|
⚠ Auto-calibration only works if both ADC are connected/used.
|
||||||
|
|
||||||
|
|
||||||
|
# Extra Features
|
||||||
|
## Setup current and speed limit:
|
||||||
|
* press the power button for more than 5 sec and immediately after the beep sound press one more time shortly
|
||||||
|
* move and hold the pots to a desired limit position for Current and Speed
|
||||||
|
* press the power button to confirm or wait for the 10 sec timeout
|
||||||
|
|
||||||
|
## Support of extra buttons:
|
||||||
|
Uncomment #define **SUPPORT_BUTTONS_RIGHT** to use right sensor board cable for button inputs. Disable DEBUG_SERIAL_USART3!
|
||||||
|
Variables button1 and button2 can be later used to implement different behavior
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user