Giter Site home page Giter Site logo

syrkinis / rcstick-f Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opiopan/rcstick-f

0.0 0.0 0.0 15.5 MB

Wireless RC simulator USB dongle for Futaba S-FHSS protocol

License: Apache License 2.0

Python 0.05% C 96.97% Assembly 1.95% C++ 0.99% Makefile 0.03% Shell 0.01%

rcstick-f's Introduction

rcstick-f

board image

rcstick-f is a USB HID device which has 8 analog axis. And this device is also a RF receiver which conplient with Futaba S-FHSS protocol.
This device is designed to be used to controll RC flight simulator by Futaba RC transmitter.

One of the most simple and common way to use RC transmitter as controller of RC flight simulator is handling PPM signal exported from the trainer port on a transmitter.
Some simulator software can recognize PPM signal through audio input, So in this case, you have to do is just connect cable between the trainer port on a transmitter and mic input port on a PC.
Or using USB dongle that convert PPM signal to USB HID device, such as these products, is also popular.
The advantages of these PPM signal based solution are inexpencive and compatibe with many transmitter products. The most disadvantages is that the cable between a transmitter and PC is very annoying.

On the other hand, in recent years, the products that behave wireless RF receiver and USB HID device have appeared in the world. For example, SPEKTRUM WS1000 for DSM2/DSMX protocol or FrSky XSR-SIM for FrSky protocol.
These products are designed for a specific protocol. So comatibility is lower than the PPM signal based solution. However, users can enjoy highly convenience due to wireless connection.
In addition, that is more responsive and higher precision than the PPM signale based solution since there is no unnecessary data conversion such as ADC data to PPM.

The reason why I determined to start this project is that I could'nt find a such kind of wireless device supported Futaba RC protocol.

demo

Futaba S-FHSS protocol

S-FHSS is a 2.4 GHz band based RC transceiver protocol designed by Futaba. It is not brand new protocol, However many Futaba transmitter suport this protolol. And this protocol is well analyzed. That's why I choose S-FHSS for my own receiver imprementation.

This commentary article and this C source code which impremens S-FHSS transmitter are very helpful to understand the protocol. I sincerely appreciate there effort.

PCB Design

I designed two types of PCB artworks for rcstick-f.
One is sufficiently small that QFP32 package of STM32 MCU is installed, the other one is very small that QFN32 package of MCU is installed.

Both artworks are optimized to enable hand soldering by using a soldering iron. You don't need a reflow oven or a hot air gun.
All pads and parts spaceing are designed to allow contacting soldering iron. grand pad located center of QFN package is also able to be soldered through a via from back side of PCB.

description

Design FIles

Board Type Eagle design files Gerber files
QFP32 MCU version pcb/small rcstick-f-gerber.zip
QFN32 MCU version pcb/tiny rcstick-f-tiny-gerber.zip

Schematic Diagram

PCB schema

BOM List

Components Value / Product Number Remarks
U1 STM32F042K6T6 or STM32F042K6U6
U2 TI CC2500
U3 MCP1703AT-3302E/CB SOT-23 LDO
J1 MOLEX 48037-0001 USB type A male connector
J2 MOLEX 53047-0410 OPTIONAL for debugging
Firmware downloading can be proceeded by using DFU mode
X1 16MHz Crystal (3225) load capacitance: 10pF
X2 26MHz Crystal (3225) load capacitance: 9pF
LED1 OSBL1608C1A
SW1 ALPS SKRPACE010
C1, C2, C9 1uF (1005)
C3, C4, C10, C11, C12, C15, C16 0.1uF (1005)
C5 4.7uF (1005)
C6, C7 15pF (1005) need to change value if X1's load capacitance is not 10pF
C8 10nF (1005)
C13, C14, C17 220pF (1005)
C18, C19 12pF (1005) need to change value if X2's load capacitance is not 9pF
C20, C21 100pF (1005)
C22, C23 1pF (1005)
C24 1.8pF (1005)
C25 1.5pF (1005)
R1 10k ohm (1005)
R2 56k ohm (1005)
R3 100 ohm (1005)
L1,L2,L3 1.2nH (1005)

Case Design

You can download STL data of case for tiny version of PCB. That is desined assuming that is printed by resin printer.
Note that PCB thickness should be 1.2mm if you apply this case design.

case structure

Building Firmware

  1. Requirements
    GNU Arm Embedded Toolchain must be installed in a directory indecateed by PATH environment variable.

  2. Downloading Source Codes

    $ git clone https://github.com/opiopan/rcstick-f.git
  3. Compiling

    $ cd rcstick-f/firmware
    $ make all

Downloading Firmware

You can choose two way to download firmware to rcstick-f board.
One is downloading firmware via SWD by using debugger. rcstick-f exports a SWD I/F at J2 connector.
The other one is downloading it via USB port in DFU mode. You can switch rcstick-f in DFU mode by inserting that to USB port with the button pressed.

Downloading via Debugger

  1. Preparing Debugger
    Make sure that a debugger is connected with rcstick-f J2 port and debugger controlling software which behave as GDB server such as OpenOCD is running.

  2. Downloading
    You can download a firmware by making flash target with DEBUGSERVER parameter. If debugger controlling software is running same PC, specify localhost for DEBUGSERVER parameter.

    $ make DEBUGSERVER=localhost flash

Downloading via USB

  1. Install required software
    Make sure that following software is installed.

  2. Switching rcstick-f in DFU mode
    Insert rcstick-f to USB port with the button (SW1) is pressed.

  3. Downloading
    You can download just by making dfuflash target.

    $ make dfuflash
  4. Exsiting from DFU mode
    Pull out rcstick-f from USB port, then re-insert that to USB port.

How to use rcstick-f

  1. Make sure that the settings of transmitter are appropriate as next section.

  2. Insert rcstick-f to USB port of your PC, and make sure that LED on rcstick-f flashes twice every two seconds.

  3. Turn on the power of RC transmitter, and make sure that transmitter protocol is S-FHSS.
    When rcstick-f detect that radio waves, LED flashing pattern is changed that flash once every one second.

  4. Wait until LED will light continuously that means rcstick-f is binded with RC transmitter.

  5. Now you can use your RC transmitter as a joystick on your PC.
    Each channel of S-FHSS transmitter is mapped to each USB HID axis as below.

    Channel USB HID usage
    CH 1 X
    CH 2 Y
    CH 3 Z
    CH 4 X rotation
    CH 5 Y rotation
    CH 6 Z rotation
    CH 7 Slider
    CH 8 Slider

Transmitter Settings

I recommend you to register a dedicated model for rcstick-f in your transmitter. That model should be satisfy following conditions.

  • Communication Protocol (REQUIRED)
    Choose S-FHSS for communication protocol since rcstick-f can recognize only S-FHSS protocol.

    protocol setting screen

  • End Point (RECOMMENDED)
    Set end point for each channl as that rx PWM output pulse width will be in range between 1009us and 2031us.
    In S-HFSS packet, each channel position is expressed as 12 bit number. And that values are equivalent of PWM pulse width output from rx in microsecond. So value of a channel which is on center position will be 1520.
    rcstick-f generates values for each axis of USB HID by subtracting 1520 from value in S-HFSS packet, and clips values in range of 10 bit 2's complement number, that is between -511 to 511.
    Therefore, the most efficient setting of end point is that each channel value will be in range between 1520 - 511 and 1520 + 511.

    In case of Futaba 10J, the end point settings satisfied above condition are 124% or 125% for channels 1 to 4 and 92% or 93% for channels 5 to 8.

    rcstick-f provides a helper function to determine proper endpoint ratio. Refer the next section for the details.

    end point setting screen

  • Servo Reverse (RECOMMENDED)
    In order to prevent runaway when flight simulate is started without a connection between rcstick-f and transmitter, rcstick-f set throttle axis value correspond to channel 3 as -511 that is minimum value in range of each axis.
    For Futaba transmitter, the more you raise the throttle stick, the more transmitter shorten the PWM pulse width. So to align default value the above, enable servo reversing of channel 3.

    reverse setting screen

Function to detect value clipping

As mentioned previous section, setting end point ratio as largest value within the range expressiblee by rcstick-f is important. To determine that appropriate end point ratio, rcstick-f has a mode to detect clipping value for channel.
Find the appropriate end point ratio as following steps.

  1. Preparing
    To ensure that movable area of servo exactly maches end point setting, make sure following settings for each channel.

    • Trim and Sub trim: should be reset
    • Dual Rate: should be 100%
    • No mixing with other channels
    • Throttle curve and Pitch curve: should start from 0% and end to 100%

    Then, make position of all sticks, slide levers, and switches associated with channels 1 to 8 center.
    If that is impossible due to association with 2 position switch, reduce end point ratio significantry for that channel.

  2. Binding rcstick-f and transmitter
    Bind transmitter with rcstick-f according to steps described in the section "How to use rcstick-f".

  3. Changing mode of rcstick-f
    Press a button on the rcstick-f in order to enable a function to detect value clipping. LED on the rcstick-f will flash three times in one second.
    If LED still light continuously, a channel vallue is larger than 1520 + 511 or less than 1520 - 511 at least. Make sure that all channel settings are satisfied conditions mentiond in step 1.

  4. Determining enb point ratio
    Choose any one channel, then move the stick, the slide bar, or the switch assosiated with taht channel to the maximum position or minimum position.
    If LED is still flashing, the value of cahnnel is in range and is not clipped. In this case, increase end point ratio by 1% until LED is flashing.
    If LED flashing pattern is changed that it light continuously, the value of channel is out of range and is clipped. In this case, decrease end point ratio by 1% by LED start to flash.

    Usually, you can apply same ratio determined above for all other channels. However you should be careful if your transmitter is entry model such as 10J.
    It's well known taht servo angle in 100% end point for channels 5 and later is wider than the servo angle for channels 1 to 4 in some Futaba transmitter. If you use that kind of transmitter, you need to determine for two channels at least.

rcstick-f's People

Contributors

opiopan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.