mirror of
https://github.com/EFeru/hoverboard-firmware-hack-FOC.git
synced 2025-08-04 18:14:28 +02:00
Updated Debug Serial (markdown)
@@ -5,13 +5,16 @@ Debug Serial can be enabled with DEBUG_SERIAL_USART parameter and will allow you
|
||||
* Debug
|
||||
* Plot the results
|
||||
|
||||
Connect a [FTDI Serial adapter](https://s.click.aliexpress.com/e/_AqPOBr) or a [Bluetooth module](https://s.click.aliexpress.com/e/_A4gkMD) (eg. AT-09, HM-10, HC-06,...) to the DEBUG_SERIAL cable (Left or Right) and monitor the output data using the [Hoverboard Web Serial Control](https://candas1.github.io/Hoverboard-Web-Serial-Control/) tool developed by [Candas](https://github.com/Candas1/) or any serial monitor.
|
||||
Use a [FTDI adapter](https://s.click.aliexpress.com/e/_AqPOBr) or a [Bluetooth module](https://s.click.aliexpress.com/e/_A4gkMD) (eg. AT-09, HM-10, HC-06,...) and monitor the output data using the [Web Tool](https://github.com/Candas1/Hoverboard-Web-Serial-Control) tool or any serial monitor.
|
||||
|
||||
[HC-06](https://www.aliexpress.com/af/HC-06.html) works, connected to USART2 at 9600 bauds (define DEBUG_SERIAL_USART2 and USART2_BAUD=9600).
|
||||
For a more detailed troubleshooting you can use
|
||||
|
||||
## Configuration:
|
||||
Use DEBUG_SERIAL_USART2 for the left cable or DEBUG_SERIAL_USART3 for the right cable.<br>
|
||||
Different variants can have it already enabled on a different cable depending on which cable is use by this variant by default.
|
||||
|
||||
## Wiring:
|
||||
* Connect GND and RX of a 3.3v uart-usb/FTDI adapter to the left (DEBUG_SERIAL_USART2) or right sensor board cable (DEBUG_SERIAL_USART3) depending on config.h settings
|
||||
* Connect GND and RX of a 3.3v FTDI adapter/Bluetooth module to the blue wire on left (DEBUG_SERIAL_USART2) or right sensor board cable (DEBUG_SERIAL_USART3) depending on config.h settings
|
||||
|
||||
⚠ Red wire from sensor cable delivers 15v !!!
|
||||
|
||||
@@ -36,9 +39,6 @@ The above is done in `main.c`, see [lines 440](https://github.com/EFeru/hoverboa
|
||||
|
||||
## Debug Protocol:
|
||||
If enabled with parameter DEBUG_SERIAL_PROTOCOL in [config.h](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/blob/master/Inc/config.h), debug protocol lets you send Ascii commands.<br>
|
||||
All commands can be used for parameters.<br>
|
||||
Variables cannot be Set,Initialized or Saved.<br>
|
||||
Values are being translated to external<>internal format automatically.
|
||||
|
||||
### Commands
|
||||
|Command|Usage|Description|
|
||||
@@ -52,6 +52,9 @@ Values are being translated to external<>internal format automatically.
|
||||
|
||||
|
||||
### Parameters/Variables
|
||||
All commands can be used for parameters, but variables cannot be Set,Initialized or Saved.<br>
|
||||
Values are being translated to external<>internal format automatically.
|
||||
|
||||
|Type|Name|Description|Can be Set|Can be saved to EEPROM|
|
||||
|----|----|----|----|----|
|
||||
|Parameter|CTRL_MOD|Ctrl mode 1:Voltage 2:Speed 3:Torque|Yes|No|
|
||||
@@ -89,5 +92,10 @@ Values are being translated to external<>internal format automatically.
|
||||
|Variable|BATV|Calibrated Battery Voltage *100|No|No|
|
||||
|Variable|TEMP|Calibrated Temperature °C *10|No|No|
|
||||
|
||||
|
||||
## Troubleshooting:
|
||||
* Make sure the baud rate is 115200
|
||||
* Make sure you are using the sensor cable(left=DEBUG_SERIAL_USART2 or right=DEBUG_SERIAL_USART3) selected in config.h
|
||||
* TX can be defective on your mainboard, you can switch to other sensor cable if not used already in config.h
|
||||
* On some boards the wire colors might differ, try switching the green wire
|
||||
* Make sure the RX on your FTDI is working. You can connect the RX and TX on the FTDI and check if you received the commands you send in the [Web Tool](https://github.com/Candas1/Hoverboard-Web-Serial-Control) tool or any serial monitor
|
||||
|
||||
|
Reference in New Issue
Block a user