Coder Social home page Coder Social logo

ppmcontrol's Introduction

PPMControl

Controlling RC-transmitter with PPM (pulse-position modulation) trainer input using just sound card.

This library allow you to control RC-models via PC through standart transmitter. It is using trainer PPM input port to send commands from PC to transmitter. PPM signal is generating by sound card, so you don't need any microcontroller or any other device to generate PPM.

PPM principles and settings

In PPM (Pulse Position Modulation) the analogue sample values determine the position of a narrow pulse relative to the clocking time. It is very close to PWM (pulse width modulation) where analogue signal is encoding with duty ratio. At the diagram below PPM signal with It's properties is shown.

It's very important to use same properties as at your RC-transmitter. Otherwise It won't able to decode signal.

Usage

This repository contains AudioPPM library and ControlGUI test project.

  1. Connect linear output of your sound card to the PPM-in and GND of your transmitter.
  2. Set up trainer mode on your transmitter and enable It.
  3. Run ControlGUI project
  4. Select output device and press Start
  5. Try to move trackars (sticks) and watch the result. Some transmitters (such as FlySky fs-i6) allow you to watch sticks positions on a display. If your transmitter doesn't allow this, just add servos to receiver.
  6. Write your own programs using AudioPPM library
  7. ???
  8. PROFIT!!!

Example

Library is so easy, so I don't provide API documentation, little example will cover all of the functionality.

// Get list of avaliable output sound devices and simple get first device.
var outputDevice = PpmGenerator.GetDevices().First();

// Create PpmGenerator to generate PPM signal for FlySky fs-i6 transmitter (6 channels)
// NOTE: StandartProfiles contains settings for common PPM profiles, but now there is only one - FlySky
var generator = new PpmGenerator(6, StandartProfiles.FlySky, outputDevice);

// Set some initial values. Every channel value is in range [0; 255]
// Aileron, Elevator, Throttle, Rudder but it's just convention
byte[] controlgValues = new byte[]{128, 128, 0, 128, 0, 0});
generator.SetValues(controlgValues);

// Start PPM. Generation will work in other thread
generator.Start();

// Change values - throttle up
controlValues[2] = 128;
generator.SetValues(controlgValues);

// Stop PPM
generator.Stop();

Connecting to transmitter

That may be a little tricky. You should know pinout of trainer port of your transmitter. FlySky fs-i6 pinout is shown below.

  • GND - to the sound card linear output GND
  • PPM-in - to the sound card linear output channel (no matter, left or right).

Amplifier

In my case amplitude of the signal is about 1-2v. Transmitter required about 5v. So, I designed simply amplifier. It amplifies signal and also make it perferct rectangular form without any noise.

Schematics:

PCB overview:

You can download PCB ready-to-print image

ppmcontrol's People

Contributors

aemarkov avatar tarasradio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  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.