Skip to content

wang32/iA6B_two_PWM

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
RTE
February 16, 2024 06:55
February 16, 2024 06:55
February 16, 2024 06:55
bk
February 16, 2024 06:55
March 12, 2024 11:33
March 12, 2024 11:33
February 16, 2024 06:55
February 16, 2024 06:55
March 12, 2024 11:42
February 16, 2024 06:55
February 16, 2024 06:55
February 16, 2024 06:55
February 16, 2024 06:55
March 12, 2024 11:33
February 16, 2024 06:55
March 12, 2024 11:33
February 16, 2024 06:55
February 16, 2024 06:55
February 16, 2024 06:55
February 16, 2024 06:55

TI EK-TM4C123GXL Launchpad, reading IBUS signal from FS-iA6B receiver, converts to UART1 U1 TxD to control trolling engine speed/forward-backward, and direction servo actuator.

PB0 - U1RxD : Flysky receiver IBUS through 5 - 3.3V level shifter PB1 - U1Txd : RC UART1 output, 0x00 - 0xFF to RC manually control trolling motor speed PB4 - PWM : RC PWM output, trolling direction servo actuator

Brief

ibus is a Flysky RC receiver protocol

___KEYWORD - i-bus, FLYSKY, UART, TM4C123GXL , PWM

Library Feature

  • Receive RC data in UART1 RxD
    • 1000 - 2000
  • Software fail-safe

Dev environment

  • Keil MDK 5.32
  • Keil MDK Legacy
  • TivaWare
  • FLYSKY Transmitter & Receiver
    • FS-i6, FS-iA6B, FS-A8S (fail-safe X)

FLYSKY ibus protocol

  • The ibus protocol is one of RX protocols developed by Flysky
  • half-duplex
  • Control multiple servos and motors using a single digital line.
  • Support 14 channels
  • New value can be read every 7ms
  • The values received for each channel are between 1000 and 2000, 1-2ms pulse width
  • The ibus requires a dedicated hardware serial (UART) port on microcontroller
    • UART RX required
    • 115200 baud
    • 8N1
  • Data frame
    • 32 bytes
    • Structure
      • Example set of 32 bytes
        20 40 DB 5 DC 5 54 5 DC 5 E8 3 D0 7 D2 5 E8 3 DC 5 DC 5 DC 5 DC 5 DC 5 DC 5 DA F3
        
      • Section
        Protocol length Command code CH1 CH2 CH3 ... CH14 Checksum
        0x20 0x40 0xDB 0x05 0xDC 0x05 0x54 0x05 ... 0xDC 0x05 0xDA 0xF3
    • Little Endian
      ibus data HEX DEC
      CH1 0x05DB 1499
      CH2 0x05DC 1500
      CH3 0x0554 1364
      ... ... ...
      CH14 0x05DC 1500
      Checksum 0xF3DA
    • Checksum calculation
      • 0xFFFF - (sum of previous 30 bytes)

Example

ibus.h

  • UART1 Channels
/* User configuration */

#define IBUS_USER_CHANNELS		6		// Use 6 channels

lpvdebug.h

#define DEBUG true // change it to false for deployment, UART1 is used

main.c

  • Only contain ibus things
#include "ibus.h"

// variables to store ibus data
uint16_t ibus_data[IBUS_USER_CHANNELS];

U1RX - PC4 U1TX - PC5

Us PC4 as IBUS inputs

Do not use pins PB0, PB1 as U1RX, U1TX as they are NOT 5V tolerant.

TI EK-123GXL launchpad +5V, 23mA to 323 mA output FS-iA6B 4-6.5V DC, current??

Channel 1 - right up/down joystick - forward full speed and backward full speed (0xFF to 0x00) Channel 2 - right left/right jystick - left/right duty cycle 1% left most to 99% right most

-- program using state machine for receiver 0x20, 0x40 ..... (rest 30 bytes)

==================================================

Date 1/13/2024 FS-i66B iBUS for Sensor iBUS, using software UART, TivaWare SoftUART utilities is used. PC6 (half-duplex, PC6 is connected to Sensor iBUS)

Pins used: UART0 PA0-U0RX, PA1-U1TX; PC4-U1RX, PC5-U1TX; PC6-U3RX, (PC7-U3TX) PC7 is not used for U3TX, therefor, for testing purpose, PC7 is used to program as softURT TX

1/13/2024 8:56pm tested, softUART is working

====================================================== 1/14/2024 FS-i6AB iBUS Sensor RX

hardware connection: +5V, Gnd,
Servo iBUS Signal - TI launnchpad PC4 - U11RX Sensor iBUS signal - TI launchpad PC6 - U3RX - half duplex

SoftUART Tivaware Utilieis

SWA - UP 1000, down 2000 - UP: mission selection; DOWN - Color selection SWB - UP 1000, middle: 1500: Down 2000 SWC - UP 1000, Middle: 1500; Down 2000 SWD - UP: 1000 - Manual Driving LPV; DOWN: 2000 - Automatic KEYB - not pressed 1000; pressed: 2000: confirm of mission/color selection

They are programmed in i-FS6S RC transmitter as: SWA - Channel 5 SWB - Channel 6 SWC - Channel 7 SWD - Channel 8 KEY 1 - channel 9 KEY 2 - channel 10

=========================================== PA2, PA3, PA4, PA5, PA6, PA7 available to Jetson Nano

PA7 - auto or manual PA7 = '1': Auto; '0':Manual PA6, PA5, PA4: mission selection; 000 - 111 (mission 1 to 8); 000 - mission 1; 111 - mission 8 PA3, PA2: mission 4: Color chosen PD6 - Confirm pressed and released

UART PC4 - U1RxD : Flysky receiver IBUS through 5 - 3.3V level shifter (not needed) DO NOT USE PB0, PB0 is not +5V tolerant PC5 U1Txd : RC UART1 output, 0x00 - 0xFF to RC manually control trolling motor speed PB4 - PWM : RC PWM output, trolling direction servo actuator

UART3 PC6 - Sensor IBUS signal

UART3 PC7 - Jetson RxD interrupt

pins: (PA2-PA7, PD6) to Jetson, PC4 - Servo IBUS Signal,PC5 - Motor control ,PC6 - Sensor ibus Signal, PB4 - left/right linear servo actuator

A binary containing mission/auto-manual/color is also sent to Jetson Nano through a serial port: A/M MMM CC 6 bits, bit 7 (A/M) bits 6-4 (mission selectin), bit 3-2 (color selection) PD7 cannot be used as GPIO unless it is unlocked first before it is programmmed (datasheet page 218).

=========================================== Flysky iA6S transmitter display message:

format: // encoded rpm; 1xxxx/2xxxx - manua/auto; xx M xx mission number 1-8; xxxx C - color 0-3 xxxx K x K=0 Key 2 not pressed K=1 Key 2 pressed This is for confirm the selection of mission sand color

=========================================================== Wire connections:

iA6B Receiver Jetson Nano Ti Launchpad 74LS 157 Multiplexer iBUS Servo Signal ====> PC4 - U1RXD

iBUS Sensor Signal <====> PC6 - U3RxD - half duplex SoftUART

                             U1RxD - pin 10      <=====     PC7 - U3TxD - mission/color/LPV Mode
			 
							PB4 - PWM1                                          1I0 - pin 4    Motor Left/Right
							PB5 - PWM2                                          2I0 - Pin 7    Motor forward/backward

======================================================== Left Joystick: Channel 2 - Forward/backward motor driver control Right Joystick: Channel 0 - Left/Right Rotational servo motor

Schematic

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages