Page 1 of 1

Wireless buddy box project

Posted: 09 Jun 2020, 22:39
by Martin
I began instructing a new student today, and in these socially distanced times, thought it better not to use the usual "hardware" buddy box lead.

Idea was to have an ordinary radio receiver mounted on (my) instructor's transmitter, and use an Arduino (I used a 5V Pro Mini) to take the outputs from that receiver and convert them into the usual buddy-box format (CPPM). The receiver is bound to the student's transmitter, and then you can stand as far apart as you like!

You can use any brand of radio you like, and use 27 MHz, 35 MHz, 2.4 GHz or a mixture - receiver outputs (for connection to servos) and buddy box signals (save for using different connectors) have always been the same, for about forty years now!

Some other guys in the club want Futaba-compatible buddy connectors, so even though this student used Spektrum, I dusted off my old Futaba FF9 and lashed up a system using an Orange transmitter module in the FF9 and an Orange receiver to receive the signal from the Student's DX7.
LesterBBfront.jpg
LesterBBback.jpg
That's a quick and dirty lash-up, of course, but I didn't have time to design and 3D-print a nice case to put the stuff in.

I could have used a CPPM receiver or an SBUS one, but using a plain dumb receiver has the advantage of making it easy to swap the received channels into the correct order, by simply swapping around the wires linking the receiver to the Arduino. This was definitely needed with the old FF9 transmitter. I didn't want to start swapping the servo connections around inside his plane, partly due to virus cares, but also so he won't have to swap them back again when he's ready to go solo. A bit of fiddling around with custom mixes allowed me to configure the Futaba transmitter to transmit in Spektrum channel order, but my old transmitter isn't smart enough to swap around the buddy box training lead channel order - so I did that by moving the wires where they plug into the receiver.

It all worked nicely, and we had a few successful flights.

For the Futaba project proper, I will use an SBUS receiver: for Futaba to Futaba there's no need to swap the channels around, and I expect the modern Futaba transmitters probably do have the option of trainer channel assignment anyway. The sbus-based system will be much smaller and neater because I can use a tiny SBUS only receiver and a smaller Arduino too. I'll post that project once I have it working.

Thanks to whichever admin/mod moved this to the correct Electronics Projects forum - I'd mistakenly posted it in the 3D printing projects forum. :oops:

Re: Wireless buddy box project

Posted: 10 Jun 2020, 10:45
by Mike_K
Hi Martin

A similar converter is available from Hobbyking, Banggood and other far-eastern sellers. The converter allows you to put in PWM (servo PPM), PPM or S-Bus and get out any of the formats. The un-adventurous types could use this in the place of your Arduino, and use the same method with the receiver connected to the PWM channels and the output from the CPPM to the bubby-box port.

https://hobbyking.com/en_us/signal-conv ... tore=en_us

But I like the idea of your Arduino solution as a Pro-Mini is a lot cheaper!

Mike

Re: Wireless buddy box project

Posted: 11 Jun 2020, 03:31
by bluejets
Any plans to show the complete project..?

Re: Wireless buddy box project

Posted: 11 Jun 2020, 10:07
by Martin
Here's a rough schematic. (Click for larger view).

wireless_bb.jpg

If you're using a Futaba transmitter, or a Hitec, with a training port (buddy connector) then you have access to the transmitter battery +ve on one of the pins. Futaba have used two different round DIN connectors in the past, and now use the 'square' connector. You will find plenty of diagrams of which pin is which with a quick internet search.

The square connectors are difficult to obtain. I robbed a connector from an old simulator lead - the back of the connector comes off by carefully inserting two small screwdrivers to push open two catches where the 'barbs' of the other connector part engage: then you have access to the solder pins and it's a tiny fiddly soldering job. Plug the connector into a transmitter if you can, while you solder, as this acts as a connector heat-sink and stops the plastic melting.

You won't harm anything by having the signal pin connected wrongly, but if you mix up the GND, and battery +ve with each other, or run the battery +ve into one of the signal pins, then you may damage your Arduino. In the worst case if you short the transmitter battery +ve to the transmitter signal pin(s) you may even damage your transmitter - so be careful!

Hobby King sell a small adapter lead that links the square plug to a servo-style plug (but beware that plug has the transmitter battery voltage on the middle pin, and not the usual servo or receiver 5V). I don't know if that adapter is intended for use with computer simulators (it probably is) in which case the 'signal' wire will be connected to the 'signal out' pin (3) and not the 'signal in' pin (6) which is what you need. So even if you buy that adapter, you'll perhaps still need to take it apart and move the signal wire over.

With JR or Spektrum transmitters it's more difficult - they use a 3.5 mm mono jack plug where the tip is the signal, and the sleeve is GND. If the transmitter has a USB port, you can pick up 5V from that (and connect to the Arduino 5V (VCC) rather than Vin / Raw as you would for a higher battery voltage. Failing that you can either use a separate external battery, or somehow modify your transmitter to allow the (switched) battery +ve to be routed the Arduino's Vin / Raw.

If you need more information, let me know, and I'll try to provide it.

Re: Wireless buddy box project

Posted: 11 Jun 2020, 10:37
by Martin
On Futaba computer radios like the Field Force 8 (possibly 7) and newer, this is the trick for reassigning the channel order if you want to link to a Spektrum or JR, or some other receiver. Of course, for 2.4GHz systems, or PCM on 35MHz, you'll need the appropriate RF module in the transmitter's module bay.

Beware that some RF modules swap some of the channels around internally - often to try to move throttle to where it should be. So the channels on the model receiver will probably be in a different order to what the transmitter thinks it's sending. I've found that often, the channel order is still wrong, and the best way to set up a transmitter is to bind the model to it, and see which controls move when you wiggle the sticks.

Let's say you've tried it (propeller on electric models removed for safety) and found that Aileron and Elevator need swapping over. Now you could just swap the leads inside the model where they plug into the receiver, but you may not want to do that - for one thing, you'll need to swap them back again when the model owner wants to fly without a buddy box system.

The trick is to use one mixer to mix a channel into itself at -100%, so that it cancels itself out, and then a second mixer to mix the channel to what you want it to operate, usually at +100%. So to swap aileron and elevator you need four mixers:

Code: Select all

PROG.MIX1 MIX:ON, MAS:AILE, SLV:AILE, LINK:OFF, TRIM:ON, SW:A, POSI:NULL -100% -100%, OFFSET: 0%
PROG.MIX2 MIX:ON, MAS:ELEV, SLV:ELEV, LINK:OFF, TRIM:ON, SW:A, POSI:NULL -100% -100%, OFFSET: 0%
PROG.MIX3 MIX:ON, MAS:AILE, SLV:ELEV, LINK:OFF, TRIM:ON, SW:A, POSI:NULL +100% +100%, OFFSET: 0%
PROG.MIX4 MIX:ON, MAS:ELEV, SLV:AILE, LINK:OFF, TRIM:ON, SW:A, POSI:NULL +100% +100%, OFFSET: 0%
You can use the same trick to move three channels (you need 6 mixers). That's the most you ever normally need, as most manufacturers have at least one channel in the same position - for example Futaba, JR, and Spektrum all have rudder on channel 4 by default.

Once you have everything working correctly on the master transmitter, you enable trainer mode and push/pull the trainer switch / button to hand control over to the student's transmitter (propeller still removed for safety!) If any channels are swapped for the student, you can swap around the wires that link the Arduino to the receiver until everything is working right.

You may find that some channels of the student's transmitter are working backwards (left/right, up/down) and if so just reverse those on the student's transmitter in the normal way. They'll need to be swapped back again when the student wants to go solo, but if the student has a computer radio, it's best to assign two model memories anyway - one for buddy and one for solo. That way there's no need to reverse servo directions once they're set up. The buddy memory is bound to the receiver on the instructor's transmitter, and the solo memory to the receiver in the plane.

You still have to rebind the plane's receiver each time you want to swap between buddy and solo flying, but with 2.4GHz systems it's very difficult to avoid that - and it's no different to what you'd do with a wired buddy box system.

Re: Wireless buddy box project

Posted: 12 Jun 2020, 01:02
by bluejets
Martin,
The futaba plug is available from Hobbyking for around AU $1.60....

https://hobbyking.com/en_us/futaba-6pin ... rh_pdp=6

Edit...slow brainwaves today......just saw your explanation..
Going by your diagram, the servo plug would be removed anyhow I'd imagine and the Tx voltage feeds RAW .

Just found one in my box of goodies and the power, Red is pin 5 , Gnd is pin 2 and White signal is pin 6.

Also have a query you'll more than likely be able to clear up..... given D0 is the Rx pin and D1 is the Tx pin on the Arduino pro mini at least, why would the signal from the Arduino to the master radio be connected to D0..?
or is D0 simply being used as a digital out pin..?

Re: Wireless buddy box project

Posted: 12 Jun 2020, 11:08
by Martin
I found one of those square plug to servo plug adapters in one of my boxes of assorted leads. I've no memory of where it came from and I don't remember ever using it. It's slightly more upmarket than the Hobby King one, in that it uses a posh three core cable instead of the flat servo cable.

I prised the back off (carefully) and this is what I found - as I expected it's designed for use with computer model flying simulators. Click photo for larger view.
plug.jpg

AS FOUND - NOT WHAT'S NEEDED FOR THIS PROJECT

The red lead is soldered to both pins 4 and 5. The first of these is a direct connection to the transmitter battery (unswitched) and the second powers up just the encoder part of the transmitter (but not the RF section). With the two pins soldered together like this, the parts of the transmitter needed for simulator work are powered up as soon as the plug is inserted - even when the transmitter power switch is in the off position. This is not really desirable for buddy box work because you'd have to unplug the connector after each flight to avoid running your transmitter battery down (and getting 'inactivity alarm' messages on newer sets).

Incidentally, the reason Futaba designed their connector like this, is that with a real hardware buddy lead the battery and switched encoder pins are cross-connected through the lead. This means that the slave transmitter doesn't need to have a battery fitted (the required parts of the transmitter being powered through the lead from the master transmitter), and more importantly, the RF transmitter part of the slave transmitter isn't powered up, so back in the days of 35MHz you didn't need to worry about getting a frequency peg for the slave transmitter, or the risk of the slave transmitter shooting down its own model if both slave and master transmitters were fitted with the same frequency crystal.

The yellow wire is soldered to GND. That's fine, though the yellow colour is confusing - with the Hobby King adapter the black wire would be soldered here.

The white wire is soldered to the 'transmitter signal out' pin. This is fine for simulator work, but for this buddy project, it needs to be moved to the 'transmitter signal in' pin.

HOW IT NEEDS TO BE WIRED FOR THIS PROJECT

Code: Select all

        Arduino 
          GND
         black
(3)       (2)       (1) 
 O         O         O

      O         O         O
     (6)       (5)       (4)
   Arduino   Arduino
  D0(or D9)  RAW(Vin)
    White      Red
Here are some photos of my lead after modification (click for larger view). Remember, your lead will most likely have a black wire in place of my yellow. Remove or disconnect the battery in your transmitter, and then plug the connector into your transmitter while soldering - that supports the connector pins, acts as a heat-sink, and stops the plastic melting. Use your best pair of eyes! Hobby King probably use the eyes of fourteen-year-old girls when making the original adapter leads! :lol:
modded.jpg

Re: Wireless buddy box project

Posted: 13 Jun 2020, 01:03
by bluejets
Martin,
Your "how to be wired " is exactly how the hobbyking plug is arranged.

Anywhere I can get info on why D0 is used as an output as per previous query..?

Re: Wireless buddy box project

Posted: 13 Jun 2020, 07:05
by Martin
Thanks for the info on the Hobby King adapter lead - that's good to know.

I'd coded the CPPM output section a few years ago, for a different project. Originally, I used D9 for output. I usually avoid using D0 and D1, because I often use the Serial port for initial testing / debugging, and the Serial port uses D0 and D1.

Phil made the helpful sugestion that, for many of the pro mini boards, D0 is present close to a ground and VCC, along the short edge of the board (where you'd normally plug on an FTDI interface) so if you want to have a three-wire ribbon cable carrying signal, VCC, GND, then using D0 for the signal makes the wiring neater. Phil also suggested that the signal output could be made to drive low but only float high - and that made the signal suitable for driving some older transmitter modules, where driving the signal high might damage the module. We used to put a Schottky diode in the line to the module to protect it, but with the drive/float option, the diode could be safely omitted.

So I altered the code to allow both options - by enabling or commenting out one #define you can choose the output pin to be either D0 or D9, and by enabling or commenting out a second #define you can choose the output to be driven both high and low, or just low. I put in a third #define option to allow the choice of positive-going or negative-going pulses.

If you look at the code, it's a little tricky to understand, but it's written that way to run as fast as possible - all the option choosing is done by the compiler at compile time. At run time the microcontroller doesn't have to make any decisions about which options are in use - the program in the microcontroller is identical to what it would be if the source code didn't have any options.

Of course, for this project we want RAW / Vin in the three wire cable to the transmitter rather than VCC, so using D0 doesn't make the wiring that much neater than using D9. Please change the #define commenting if you'd rather use D9. You could also edit the code to use any other pin for signal output, say D12 or A3 or whatever.

Re: Wireless buddy box project

Posted: 13 Jun 2020, 09:02
by bluejets
Ah..ok...got it.

Error on my part when reading the beginning comments.....skipped the comma and thought the D0 D9 alternatives were to do with signal pos or neg.

Cheers Jeff

You can easily alter the output pin from D0 to D9, swap to
// positive-going pulses, or alter from an active to an 'open collector' type drive by
// commenting or uncommenting some #define statements up near the top of ccpm_out.h