From 94f9457ddc71fb8086645ce20d98662c9b40c636 Mon Sep 17 00:00:00 2001 From: Candas1 Date: Wed, 3 Mar 2021 14:20:57 +0100 Subject: [PATCH] Updated Variant USART (markdown) --- Variant-USART.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Variant-USART.md b/Variant-USART.md index 179aa8b..3a9fe58 100644 --- a/Variant-USART.md +++ b/Variant-USART.md @@ -1,5 +1,13 @@ This variant can be used to control the board from another board(e.g. Arduino, ESP32, ESP8266,RASPBERRY PI) or a computer via a serial protocol.
-The example [Arduino sketch](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/tree/master/Arduino/hoverserial) will send commands and process the feedback. +The example [Arduino sketch](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/blob/master/Arduino/hoverserial/hoverserial.ino) will send commands and process the feedback.
+Those commands are send as binary frames with following structure:
+- Start frame : 0XABCD as unsigned int16 +- Steer : -1000 to 1000 as signed int16 +- Speed : -1000 to 1000 as signed int16 +- Checksum : XOR checksum as unsigned int16 + +The FOC firmware will discard frames that are not starting with proper start frame and not ending with correct checksum.
+A timeout will be triggered if no correct frame is received during the time specified with parameter SERIAL_TIMEOUT in config.h (160ms by default).
## Wiring: * Connect blue wire to RX, green wire to TX and black wire to GND of Arduino on right sensor cable(shorter) @@ -7,8 +15,7 @@ The example [Arduino sketch](https://github.com/EmanuelFeru/hoverboard-firmware- ⚠ Red wire from sensor cable delivers 15v !!! ## Calibration: -Proceed with [calibration](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/wiki/Calibration) for better control if you use input devices(e.g. Joystick or Throttle handle) on the Arduino. - +[Calibration](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/wiki/Calibration) is not required with USART control, but can be done if you use an input devices(e.g. Joystick or Throttle handle) on the Arduino and are not taking care of calibration center value and min/max range there. ## Troubleshooting: If the board is beeping