Friday, December 30, 2016

R/C Radio Hack: Adding Head Tracking to 3 Channel Surface Transmitter

When building a SCX10 R/C rock crawler, I purchased a FS-GT3B transmitter from FlyKsy because it was cheap ($38) and I had seen this hack for controlling up to 8 channels.  I wanted to have extra channels to transmit head-tracking for a camera gimbal. At the time there were no surface radios (steering wheel and gun throttle) that could send more than 3 channels that I could find.

1. Axial SCX10 Rock Crawler
As it turns out, the above mentioned hack did not actually explain how to add more channels, so I decided to add the channels by mixing PPM signals.  The FS-GT3B radio normally transmits 3 channels by PPM, which is normally high (3.3V).  The head tracker I used, a Fat Shark Trinity External, transmits 8 channels by PPM, also normally high (3.3V). Only channels 5, 6, and 7 carry the tracking data. See diagram below. I bought a Turnigy 9X8C v2 eight channel receiver, so there is room for extra data. The Trinity came with an 1/8" cable so I added a new jack to my radio:
2. FS-GT3B with Added 1/8" Jack
Here's how the Fat Shark tracker works:

3. Fat Shark Trinity External Tracker Pinout and Cable Diagram
4. Tracker PPM Output

I tried the HKPPM-Mix but did not find it to work. Maybe it requires normally low PPM? This forum mentions a similar setup working, but the tracker is different.

So then I added a Teensy 3.2 and found the totally awesome PulsePosition library by Paul Stroffregen at PJRC, which makes the mixing code very simple:

#include "PulsePosition.h" // blogger won't let me show carats so using quotes

PulsePositionInput RadioIn(FALLING);
PulsePositionInput TrackerIn(FALLING);
PulsePositionOutput MixOut(FALLING);

// Library allowable inputs are pins 5,6,9,10,20,21,22,23

const uint8_t  RADIO_INPUT_PIN   = 22;
const uint8_t  TRACKER_INPUT_PIN = 23;
const uint8_t  MIX_OUT_PIN       = 20;

void setup() {
  RadioIn.begin(RADIO_INPUT_PIN);
  TrackerIn.begin(TRACKER_INPUT_PIN);
  MixOut.begin(MIX_OUT_PIN);
}

void loop() {
  int i, num;
  int j = 0;

  // Check if Radio signals need updating
  num = RadioIn.available();
  if (num > 0) {
    for (i=1; i >= num; i++) {
      float val = RadioIn.read(i);
      MixOut.write(i, val);
    }
  }
  
  // Check if Tracker signals need updating and Map 5,6,7 to 4,5,6
  num = TrackerIn.available();    
  if (num > 0) {
    for (i=1; i >= num; i++) {
      float val = TrackerIn.read(i);
      switch (i) {
        case 5:
          j = 4;
          break;
        case 6:
          j = 5;
          break;
        case 7:
          j = 6;
          break;
        case 8:
          j = 0;
          break;
        default:
          break;
      }
      if (j != 0) {
        MixOut.write(j, val);
      }
    }
  }
}

The RF transmitter inside the FS-GT3B radio is nicely labeled with GND, +5V, and PPM, so it was easy to connect the microcontroller. There is just enough room on the radio PCB to cut the PPM trace, so that it can re-route into the mixer.

5. Schematic for FS-GT3B to Teensy 3.2 with Fat Shark Trinity External Tracker

6. RF Transmitter Connections and Test Point Connection (see schematic)

7. PPM Trace Cut on PCB Top Side

8. Teensy Installed Under Main PCB Near Power Switch

Here's a video of the finished setup working:



I tried using a Teensy LC for lower cost, but wasn't getting any output yet. To be continued...

And up next, build the camera gimbal...

17 comments:

  1. Delightful web blog. Almost everything here's superb. The facts usually are completely mind-blowing! My partner and I would like to examine this information again tomorrow. And also I most certainly will examine it. Laser Engraver

    ReplyDelete
  2. Hey there just wanted to give you a quick heads up. The words in your post seem to be running off the screen in Chrome. I'm not sure if this is a format issue or something to do with browser compatibility but I figured I'd post to let you know. The layout look great though! Where to Buy Real Human Skulls

    ReplyDelete
  3. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own Blog Engine blog now. Marijuana edibles Canada

    ReplyDelete
  4. Used to do unkind hook this kind of in relation to some sort of idiosyncrasy book. Kinds fun time bobbin relating to the best way to finish my personal dilemma with assortment so that you can guide an excellent thesis which is loaded relating to germane please totally emits. I'm able to forthwith with certainty swig so that you can spot my personal thesis. Engineering Drawing

    ReplyDelete
  5. We ensure the best products and service levels to meet the particular requirements of every customer site. We understand that 'one size' simply. target identification and validation

    ReplyDelete
  6. Wow this good but ,I like your post and good pics may be any peoples not like because def-rent mind all people. hospital sign

    ReplyDelete
  7. Thank you for information. Got few questions:

    What tool can check trinity which will output the channel 5-7? I am using skyzone 03o goggle w head tracking function.

    How to load the code into teensy board?

    Is there any special procedure to bind the gt3b n 8 channels receiver?

    Thanks for help

    ReplyDelete
  8. Was looking for your humble design entry. You willing to send a list of parts and how you built it? Love the lean out feature! Hoping now that doing this is much easier with today’s tech.

    ReplyDelete
  9. I can made it finally. Thank you for your sharing

    ReplyDelete
  10. This can be the high quality principles specially so that you can men and women calming so that you can blog site world, quick plus precise information… Relation created for supplying that one. Definitely essential recognize publish. Australia License Plate embossed with custom number or text

    ReplyDelete
  11. Would you be able to modify the code : insted of the 3ch ppm from the remote to use 4 hall sensors (custom build joystick for airplane)
    X= Roll
    Y= Pitch
    Yaw
    Throttle


    ReplyDelete
  12. I was very impressed by this post, this site has always been pleasant news Thank you very much for such an interesting post, and I meet them more often then I visited this site. Bahamas License Plate embossed with custom number or text

    ReplyDelete
  13. There are a lot of blogs and articles out there on this topic, but you have acquired another side of the subject. This is reliable content thank you for sharing it. best for men hair growth

    ReplyDelete
  14. This is a great article thanks for sharing this informative information. I will visit your blog regularly for some latest post. I will visit your blog regularly for Some latest post. Dental Clinic In Bhopal

    ReplyDelete
  15. Wonderful blog. If you want promote your business just check sms gateway price india, we provide entire service related bulk sms, Ratsms is the top leading promotional sms provider.
    Check out sms api pricing, we provides different kind of Bulk SMS services Without DLT | Free SMS API | Free Registration


    sms api pricing
    cheapest sms gateway india
    sms gateway price india
    promotional sms provider
    bulk sms provider hyderabad

    ReplyDelete