From 7857a25caa50e3e19d8133005e97b2bcffde0780 Mon Sep 17 00:00:00 2001 From: Candas1 Date: Thu, 21 Apr 2022 09:55:52 +0200 Subject: [PATCH] Updated Variant USART (markdown) --- Variant-USART.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Variant-USART.md b/Variant-USART.md index 5d0a1c1..543caab 100644 --- a/Variant-USART.md +++ b/Variant-USART.md @@ -4,13 +4,13 @@ The example [Arduino sketch](https://github.com/EmanuelFeru/hoverboard-firmware- You can also test this variant with following [Web Tool](https://github.com/Candas1/Hoverboard-Web-Serial-Control), it let's you control the board and trace feedback values.
This [Python code](https://github.com/kosni68/HoverSerial) inspired by the code shared in this [issue](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/issues/157) can also be used to control the firmware. -## Configuration/Parameters +## :gear: Configuration/Parameters Use CONTROL_SERIAL_USART2 and FEEDBACK_SERIAL_USART2 for left sensor cable(default).
CONTROL_SERIAL_USART3 and FEEDBACK_SERIAL_USART3 for the right sensor cable(5v tolerant).
SIDEBOARD_SERIAL_USART2 or SIDEBOARD_SERIAL_USART3 parameters can be used instead of CONTROL_SERIAL_USART2 or CONTROL_SERIAL_USART3 to enable a different [protocol](https://github.com/EFeru/hoverboard-firmware-hack-FOC/issues/143) implemented on the [sideboard firmware](https://github.com/EFeru/hoverboard-sideboard-hack-GD). It can also be used with the [Web tool](https://github.com/Candas1/Hoverboard-Web-Serial-Control#protocol---hovercar) for testing the different control modes/types.
You can adjust USART2_BAUD or USART3_BAUD parameters if you need different baud speed. -## Wiring: +## :electric_plug: Wiring: * Connect blue wire to RX, green wire to TX and black wire to GND of Arduino on right sensor cable(shorter) * Only USART3(right sensor cable) is 5v tolerant @@ -20,7 +20,7 @@ You can adjust USART2_BAUD or USART3_BAUD parameters if you need different baud ## Usart configuration: By default, USART is configured with 115200 baud, 8 data bits, no parity, one stop bit. -## Input Command Structure: +## :joystick: Input Command Structure: Commands are send as binary frames with following structure:
- Start frame(unsigned int16) : 0xABCD - Steer(signed int16) : Steer with range -1000 to 1000 @@ -29,7 +29,7 @@ Commands are send as binary frames with following structure:
The least significant byte comes first (little endian).
-## Error rejection +## :no_entry: Error rejection The FOC firmware will discard frames if: - Command length is not correct @@ -39,11 +39,11 @@ The FOC firmware will discard frames if: 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).
-## Calibration: +## :control_knobs: Calibration: [Calibration](https://github.com/EFeru/hoverboard-firmware-hack-FOC/wiki/Input-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 calibrating center value and min/max range there. -## Feedback: +## :speech_balloon: Feedback: Following feedback is sent every 10ms: - Start frame(unsigned int16) : 0xABCD - Cmd1(signed int16) : Steer or Brake(hovercar) after normalizing and mixing @@ -57,7 +57,7 @@ Following feedback is sent every 10ms: The least significant byte comes first (little endian). -## Troubleshooting: +## :toolbox: Troubleshooting: If the board is [beeping](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/wiki/Diagnostics) * Make sure the baud rate is 115200