Added iBUS schematic

This commit is contained in:
EmanuelFeru 2020-12-07 20:20:08 +01:00
parent ff9a135344
commit 46d10a045d
9 changed files with 24 additions and 13 deletions

View File

@ -16,6 +16,7 @@ Table of Contents
* [Example Variants ](#example-variants) * [Example Variants ](#example-variants)
* [Flashing](#flashing) * [Flashing](#flashing)
* [3D Visualization Demo](#3d-visualization-demo) * [3D Visualization Demo](#3d-visualization-demo)
* [Wiring iBUS Receiver](#wiring-ibus-receiver)
* [Contributions](#contributions) * [Contributions](#contributions)
--- ---
@ -49,8 +50,9 @@ For more details see the [MPU-6050 datasheet](/docs/1_MPU-6000-Datasheet.pdf) an
## Example Variants ## Example Variants
This firmware offers currently these variants (selectable in [platformio.ini](/platformio.ini) or [config.h](/Inc/config.h)): This firmware offers currently these variants (selectable in [platformio.ini](/platformio.ini) or [config.h](/Inc/config.h)):
- **VARIANT_DEBUG**: In this variant the user can interact with sideboard by sending commands via a Serial Monitor to observe and check the capabilities of the sideboard. - **VARIANT_DEBUG**: In this variant the user can interact with sideboard by sending commands via a Serial Monitor to observe and check the capabilities of the sideboard
- **VARIANT_HOVERBOARD**: In this variant the sideboard is communicating with the mainboard of a hoverboard using the [FOC firmware repository](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC). - **VARIANT_HOVERCAR**: This variant can be used for Hovercar build. An RC receiver with iBUS protocol can be connected to the AUX serial Rx pin (see [schematic](#wiring-ibus-receiver))
- **VARIANT_HOVERBOARD**: In this variant the sideboard is communicating with the mainboard of a hoverboard using the [FOC firmware repository](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC)
Of course the firmware can be further customized for other needs or projects. Of course the firmware can be further customized for other needs or projects.
@ -103,6 +105,14 @@ By [converting Quaternions to Euler angles](https://en.wikipedia.org/wiki/Conver
![sketch_pic](/docs/pictures/sketch_processing_pic.png) ![sketch_pic](/docs/pictures/sketch_processing_pic.png)
---
## Wiring iBUS Receiver
An RC transmitter (Flysky [FS-i6S](https://www.banggood.com/custlink/3KvdPnfDPc) or [FS-i6X](https://www.banggood.com/custlink/KmDy5swKPD)) can be connected to the sideboard using an [FS-iA6B](https://www.banggood.com/custlink/KD3RFswKcT) receiver as shown in the following schematic:
![wiring_iBUS_pic](/docs/pictures/wiring_ibus_rc.png)
--- ---
## Contributions ## Contributions

View File

@ -3720,19 +3720,19 @@ void mpu_print_to_console(void)
{ {
#ifdef SERIAL_DEBUG #ifdef SERIAL_DEBUG
if (hal.report & PRINT_ACCEL) { if (hal.report & PRINT_ACCEL) {
log_i( "Accel[XYZ]: %d %d %d\r\n", mpu.accel.x, mpu.accel.y, mpu.accel.z); log_i( "accX:%d accY:%d accZ:%d\r\n", mpu.accel.x, mpu.accel.y, mpu.accel.z);
} }
if (hal.report & PRINT_GYRO) { if (hal.report & PRINT_GYRO) {
log_i( "Gyro[XYZ]: %d %d %d\r\n", mpu.gyro.x, mpu.gyro.y, mpu.gyro.z); log_i( "gyrX:%d gyrY:%d gyrZ:%d\r\n", mpu.gyro.x, mpu.gyro.y, mpu.gyro.z);
} }
if (hal.report & PRINT_QUAT) { if (hal.report & PRINT_QUAT) {
log_i( "Quat[WXYZ]: %ld %ld %ld %ld\r\n", (long)mpu.quat.w, (long)mpu.quat.x, (long)mpu.quat.y, (long)mpu.quat.z); log_i( "qW:%ld qX:%ld qY:%ld qZ:%ld\r\n", (long)mpu.quat.w, (long)mpu.quat.x, (long)mpu.quat.y, (long)mpu.quat.z);
} }
if (hal.report & PRINT_EULER) { if (hal.report & PRINT_EULER) {
log_i( "Euler[RPY]: %d %d %d\r\n", mpu.euler.roll, mpu.euler.pitch, mpu.euler.yaw); log_i( "Roll:%d Pitch:%d Yaw:%d\r\n", mpu.euler.roll, mpu.euler.pitch, mpu.euler.yaw);
} }
if (hal.report & PRINT_TEMP) { if (hal.report & PRINT_TEMP) {
log_i( "Temp: %d\r\n", mpu.temp); log_i( "Temp:%d\r\n", mpu.temp);
} }
if (hal.report & PRINT_PEDO) { if (hal.report & PRINT_PEDO) {
unsigned long timestamp; unsigned long timestamp;

View File

@ -110,6 +110,7 @@ volatile int8_t i2c_aux_nRABytes;
#endif #endif
/* =========================== General Functions =========================== */ /* =========================== General Functions =========================== */
void consoleLog(char *message) void consoleLog(char *message)
@ -182,10 +183,10 @@ void intro_demo_led(uint32_t tDelay)
uint8_t switch_check(uint16_t ch, uint8_t type) { uint8_t switch_check(uint16_t ch, uint8_t type) {
if (type) { // 3 position switch if (type) { // 3 positions switch
if (ch > 850) return 2; // switch in position 2 if (ch < 250) return 0; // switch in position 0
else if (ch > 250) return 1; // switch in position 1 else if (ch < 850) return 1; // switch in position 1
else return 0; // switch in position 0 else return 2; // switch in position 2
} else { // 2 positions switch } else { // 2 positions switch
return (ch > 850); return (ch > 850);
} }
@ -376,7 +377,7 @@ void handle_usart(void) {
/* /*
* Handle of the sideboard LEDs * Handle of the sideboard LEDs
*/ */
void handle_leds(void){ void handle_leds(void) {
#ifdef SERIAL_FEEDBACK #ifdef SERIAL_FEEDBACK
if (!timeoutFlagSerial1) { if (!timeoutFlagSerial1) {
if (Feedback.cmdLed & LED1_SET) { gpio_bit_set(LED1_GPIO_Port, LED1_Pin); } else { gpio_bit_reset(LED1_GPIO_Port, LED1_Pin); } if (Feedback.cmdLed & LED1_SET) { gpio_bit_set(LED1_GPIO_Port, LED1_Pin); } else { gpio_bit_reset(LED1_GPIO_Port, LED1_Pin); }

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB