Cheap 6 channel transmitter? Let's rip it apart and hack it!

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Cheap 6 channel transmitter? Let's rip it apart and hack it!

Post by Tommie »

I bought myself a cheap FlySky 6 channel transmitter for controlling my quadrocopter. While the TX worked fine so far, I was not satiesfied by some aspects of it: It is powered by 8 (eight!) batteries, yielding 12 volts, but after removing some screws and peeking under the hood I noticed that those prescious 12V were sent into a linear regulator - to be capped to 5V, wasting more than half of the energy put into the transmitter.

Enraged by this treason, I ripped the entire electronics board out of the transmitting, leaving only the radio transmitter in place. I then soldered my own board, utilizing a good old ATMega8. To counter the battery consumption, I added a switching power supply based on the trusty MC34063 regulator, which uses an inductor to step down the voltage delivered to handy 5V - without wasting the excess power to keep your hands warm.

Using my own controller also opened new possibilites: instead of the mostly useless potentiometers, I connected two 3 way switches to the controller for the 2 AUX channels. But 2 AUX channels is not enough: I used the ATMega8 to implement serial protocol using one radio channel to transmit data frames of up to 7 bytes to the multiwii copter; these "Datenschlag" frames are decoded and turned into direct instructions for various copter systems (enable Headhold mode, set AUX3 to value foo, etc.) and can also carry variable parameters (set flash sequence to 01001010, set new altitude to 12m) - something an ordinary AUX channel is unable to provide.

Plans for the near future:

* add an I²C bus interface to connect a Wii Nunchuck: control your copter by waving your hand
* add a magnetometer to the transmitter: transit the TX orientation on demand or permanently to the copter to adjust headfree orientation; very nice for taking pictures while moving with the copter

If you posess such a cheap TX, feel free to participate. The necessary sourcecode is available on github, and I also created a schematic of the used electronic circuits:

https://github.com/wertarbyte/funkenschlag
http://stefans.datenbruch.de/avr/funken ... latine.jpg
http://stefans.datenbruch.de/avr/funken ... ematic.png

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by copterrichie »

Awesome Job, something I would like to consider doing one day. You may also like to take a look at this build.

http://www.rcgroups.com/forums/showthread.php?t=1631369

User avatar
Rob
Posts: 77
Joined: Sun Apr 03, 2011 4:40 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Rob »

d1 is placed upsidedown, anode to the ground, Now you have a shortcircuit.

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Tommie »

Rob wrote:d1 is placed upsidedown, anode to the ground, Now you have a shortcircuit.


Oh, thanks. It was late and Eagle is...strange :-)

Fixed the schematic.

Katch
Posts: 280
Joined: Thu Aug 04, 2011 1:44 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Katch »

nice idea - I have one of these transmitters.

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Tommie »

Katch wrote:nice idea - I have one of these transmitters.

Already got your screwdriver and soldering iron? :-)

msev
Posts: 186
Joined: Thu Apr 14, 2011 11:49 am

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by msev »

I have a few noob questions,..just how many pots/switches/gimbals could be interfaced to these kind of dip atmegas (lets say for example atmega168 dip)? I see it has 5 analog inputs and 13 digital ones...Could I use all?

Would it be possible to implement some mixes, expo, dual rates etc.? Looking forward to seeing advancement of this project :D..very cool stuff!

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Tommie »

Actually, the ATMega8 (as well as the pin compatible cousins ATmega88, ATmega168, ATMega328) as DIP package has 6 ADC inputs; two of them however are used as I²C lines, so I wouldn't use them as input lines. You can connect switches to nearly every input pin, and you can multiplex them to support even more switches than that (look at the schematic, I am using 4 switches with 3 positions each using only 4 input pins).
More inputs can be added by using the I²C bus: I have two potentiometers in the TX that aren't in use right now, but I'll add an ATTiny84 chip to query them. The chip will act as an cheap I²C ADC and report back to the main ATMega, making it possible to add another 8 analog inputs; I'll probably use that for camera servo control. Since MWC only supports 4 AUX channels, this will be done using the integrated data transfer framework that can send dedicated messages to software components inside the quadrocopter.

ynojal
Posts: 10
Joined: Fri Apr 15, 2011 8:01 am
Contact:

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by ynojal »

Hi

Can this powering board be use to power more efficiently en Turnigy/Flyski .... ER9x Transmitter ?

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Tommie »

Sure, why not? I don't know what the ER9x uses to power its electronics, but if it is using a linear regulator like the 7805, replacing it with a switching supply will increase efficiency.

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Tommie »

Thanks for your replies through various channels; looks like quite few people started tinkering with their TXs. For further questions, I'd like to point to the IRC channel #multiwii at Freenode where some of us are hanging around, if you have questions, feel free to come around and ask :-)

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Tommie »

Fun fact: I just paired the 6Ch transmitter (FS-CT6B) with an 8 channel receiver (FS-R8B); I wonder whether I can just push in more pulses into the transmitter to use all 8 channels.

Katch
Posts: 280
Joined: Thu Aug 04, 2011 1:44 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Katch »

@ Tommie - I like your projects and approach to MultiWii. Gives me a great excuse to warm up the Metcal.

msev
Posts: 186
Joined: Thu Apr 14, 2011 11:49 am

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by msev »

I can smell it, this could make a great opensource transmitter project :D...I'll soon have some 9x tx modules..I'll probably use atmega328 dip to have some more memory to spare for features..

Here are my ideas and wishes, hope Tommie could help me achieve them :) :

- I have a joystick with a gameport connector at home, it would be neat to plug it in and use it...So for example there would be 3 options of input devices-> normal gimbals, nunchuck like Tommie mentioned and a old gameport joystick

- that the tx would have functions like normal tx's (like expo, dualrates, etc.) / maybe storing models also somewhere.

-it would have to have a lcd to display the info

-if used on a multiwii plane it should have some more switches for traditional plane stuff like flaps, spoilers, crow etc.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by copterrichie »

I think it is very possible to increase the number of channels using an existing radio gears with a new encryption coding scheme to send information in binary verse PWM.

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Tommie »

Tommie wrote:Fun fact: I just paired the 6Ch transmitter (FS-CT6B) with an 8 channel receiver (FS-R8B); I wonder whether I can just push in more pulses into the transmitter to use all 8 channels.

It works, I was able to push 8 channels through :-)
But I'm running into timing trouble, so I have to shrink the time spent in ISRs and/or add a 16MHz oscillator crystal to the schematic.
But for the time being, 6 channels is enough :-)

msev
Posts: 186
Joined: Thu Apr 14, 2011 11:49 am

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by msev »

Tommie are you willing to code the add-on features that i wrote in my above post :D

Katch
Posts: 280
Joined: Thu Aug 04, 2011 1:44 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Katch »

I'll source the parts for this as soon as I have finished my OptFlow sensor and rebuilt my test quad.

I'd definitely include an LCD on my wishlist - I wonder if we could do something with the Nokia screen + joystick that Nuelectronics sells;

Image

bartwaw
Posts: 18
Joined: Thu May 05, 2011 9:43 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by bartwaw »

Hi, nice idea.
heres good&cheap source of thumb joysticks:
http://www.ebay.com/itm/Wired-Game-Pad- ... 27c47e512d
or
http://www.ebay.com/itm/Game-Controller ... 4d022ea348

and as i know Wii uses I2C. For PS2 controlers we already have library - http://www.billporter.info/playstation- ... rary-v1-0/.

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Tommie »

Update: With the updated code (see github), I'm able to use an FS-R8B receiver with my hacked transmitter - including all 8 channels.

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Tommie »

I've successfully fitted an HMC5883 to my TX, so now I'm able to measure the pilots compass bearing and transmit it to the copter, adjusting the reference heading of the headfree mode accordingly. I'm still waiting for an ACC though to implement tilt compensation.

On the other hand, I also added a Wii nunchuk connector to the TX, so optionally, the copter can be controlled by a flick of the wrist.

Pyrofer
Posts: 180
Joined: Sat Apr 14, 2012 2:55 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Pyrofer »

This is awesome.
I can't wait to add the nunchuk :) Would be great to use that for camera pan/tilt.

My from scratch TX using your code is nearly finished. I have the ps2 pad stripped with a 328p inside, the 4 shoulder buttons hook up to high for aux channels 1 to 4. You have to hold them at the moment but I am looking for latching buttons.

I will probably rip the guts on my old TX and put the 328p in that too just to get datenschlag in it :)
If I use the toggle switchs for 2 channels I can then use the pots for 2 more, giving me 4 aux channels instead of the 2 it has and the stupid mix modes...

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Tommie »

You can just add more switches, like I have done. At the moement, I am using 4 three-way-switches and two pots (yes, that requires patching of Multiwii), one pot regulates the pitch axis of my camera gimbal (yet another patch).

msev
Posts: 186
Joined: Thu Apr 14, 2011 11:49 am

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by msev »

Pyrofer show some pics of your diy transmitter...which transmitting module do you use?

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by copterrichie »

Tommy, what would be the possibilities of hacking away at the Eurgle/FlySky/Imax/Turnigy 9x r/c Transmitters to incorporate your customs software(firmware).

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Tommie »

Feel free to do so. Datenschlag isn't that complicated, so it should be possible to fit the code into existing 9x firmwares.

Pyrofer
Posts: 180
Joined: Sat Apr 14, 2012 2:55 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Pyrofer »

msev> Its a th9x TX module, fs-tm002.
A standard PS2 pad with the cable cut off and the chip and vibration motors removed.
I put the avr 328p in one side (large vibration motor side) and am trying to fit a lipo and step-up in the other side.

The buttons in the pad are analogue and no use for the digital inputs on the AVR so I added some tiny push buttons I salvaged from PC reset buttons.
I have to mod the TX module a tiny bit as it has a 7805 inside it, which I don't want as I will feed regulated 5v in. It will just hot glue onto the back of the PS2 pad and looks like a good fit.
The step-up converter has a low voltage light built in which I will connect to the led in the middle of the pad above the analogue mode button.


I will take some pics and upload them in the pictures section.

Biggest issue is the auto-centering on throttle channel. You can apparently remove this but that requires unsoldering the stick and opening it up from the bottom.

Here is an image of inside the PS2 pad.
The TX is not in shot, the LiPo has been put inside the TX module.
Image

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Tommie »

I'm still waiting for my accelerometer, but in the meantime I was able to fit an LCD to the transmitter:

Image

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by copterrichie »

I have one of these CT6B transmitter collecting dust. I really should give this a try.

tovrin
Posts: 705
Joined: Tue Sep 20, 2011 4:08 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by tovrin »

I love these builds and as soon as i find a spare TX i am going to try this, though i would love to order one of these when/if they come available!
http://www.kickstarter.com/projects/175 ... controller

Pyrofer
Posts: 180
Joined: Sat Apr 14, 2012 2:55 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Pyrofer »

You can easily build a TX with Tommies code and a TX module (cheap on ebay).

Pretty much make it from anything you want!

Image

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Tommie »

Here's a short video of my TX with the new LCD:
http://stefans.datenbruch.de/avr/funken ... 143104.m4v

The top row shows the state of the 8 traditional channels, why the second row alternates between the state of digitally transmitted switch states (^-v--^), the compass orientation of the TX (180°) and a clock indicating the time since switching on the transmitter.

Pyrofer
Posts: 180
Joined: Sat Apr 14, 2012 2:55 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by Pyrofer »

That's pretty darn sweet :)

Thanks again for all your work on Funkenschlag, it's great.
Saved me the trouble of doing it from scratch on a PIC :p

Should I do an Xbox360 pad next ? hehe.

tovrin
Posts: 705
Joined: Tue Sep 20, 2011 4:08 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by tovrin »

nice write up on hackaday.com Pyrofer!
http://hackaday.com/2012/07/16/need-a-q ... ontroller/

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by copterrichie »

any updates on this project? Strongly considering building one using one of these for the transmitter/Receiver.

Serial TTL RS232 to 802.11 b/g/n Converter Embedded WiFi Module CE FCC

http://cgi.ebay.com/ws/eBayISAPI.dll?Vi ... SS:US:1123

gompf-2
Posts: 136
Joined: Sun Jun 05, 2011 11:46 am

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by gompf-2 »

Hi,

anybody using the library from http://www.billporter.info/playstation-2-controller-arduino-library-v1-0/? I realised that it´s very hungry for RAM as the ps2x controller class fills it after init but with cut down/removed debug code it seems to work fine. I build a simple TX without mixing/display for my sons car with a FrSky DHT.
BTW: The DHT has a 2 stage power supply, a switching step down pre regulator to 4.75V and a second 3,3v linear fine regulation to power the HF/STM. If you skip the 1. and apply 5v to the input cap of the 3,3v linear regulator it´s fine on 5V.
I use a pro mini, PS2 DS controller and a DHT powered by a Pololu NCP1402 5V step up converter from 3xAA. Didn´t want to go for LiPo as my son doesn´t always switch everything of and I didn´t want to bother with lipo protection circuites. Current drain is near limit with ~180mA @5V but works up to now. Due to the use of the lib you have full buttons without opening/modding the controller (4 analog/pressure sensitive) and the code is very simple. You just have to use a very simple PPM out routine (delays, no irs) as it will otherwise collide with the ps2x lib routines but polling the pad costs ~2ms iirc so there is enoug time in the sync pulse. I just wait then and poll micros() while time<last_frame_time+PPM_framelength. Normal serial library works fine with the ps2x lib. Flash usage is also OK, my sketch brings up 7356 bytes with serial debug message code so 168 woud be Ok but as written, be aware of RAM issues.

Regards,
gompf

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by copterrichie »

copterrichie wrote:any updates on this project? Strongly considering building one using one of these for the transmitter/Receiver.

Serial TTL RS232 to 802.11 b/g/n Converter Embedded WiFi Module CE FCC

http://cgi.ebay.com/ws/eBayISAPI.dll?Vi ... SS:US:1123


I pulled the trigger on one of these for testing and development.

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by kataventos »

Hi,

can this be used for this porpose? It is better than XBee, 915Mhz only though.

http://www.rctimer.com/index.php?gOo=go ... oductname=

Cheers,
H

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by copterrichie »

If we can hack the SPEKTRUM protocol, I think we are in for one hell of a ride.

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by kataventos »

copterrichie wrote:If we can hack the SPEKTRUM protocol, I think we are in for one hell of a ride.


Did you saw this guy work on that?

http://www.cgsy.com.au/archives/215

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by copterrichie »

kataventos wrote:
Did you saw this guy work on that?

http://www.cgsy.com.au/archives/215



I have now!!!! Wow!, lets get busy; :D :idea: :idea: :idea: :idea: :idea:

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by copterrichie »

I have a problem because I don't own a DX8 (I guess I can check ebay) but the MWC already support the SPEKTRUM protocol. So what we have to do is change the output from Tommy's Code to match the existing code for the MWC. From there, we can start to build the bidirectional communication.
Last edited by copterrichie on Thu Oct 18, 2012 2:58 am, edited 1 time in total.

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by kataventos »

I don´t have Spektrum either, but I can try to borrow one for some testing (superficial hacking) if you understand what I mean! ;)

You are right, let´s get busy on this.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by copterrichie »

I need to learn more about PWM, I believe Tommy's code already does this. Hmmm.

Where are you Tommy?

http://www.dogfight.no/2011/01/spectrum ... duino.html

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by copterrichie »

The Protocol
The protocol transmitts data in frames of 16 bytes. The first 2 bytes are header bytes used for syncing the communication. Then the channels are transmitted one by one. Where one channel consist of two bytes.


[Header][Aileron][Flaps][Elevator][Rudder][Throttle][Gear][Ch7]



(The channel order might change depending on 6 vs 7 channel transmitter and Mode 1 vs Mode 2 Stick setup on the transmitter, use serial monitor to find the right order of the channels)


Header
always consist of
byte 0x03 followed by 0x01.


Aileron
Range: 1024 - 2046
Center: 1535


Flap
Range: 5120 - 6142
Center: 5631


Elevator
Range: 2048 - 3070
Center: 3582


Rudder
Range: 3072 - 4094
Center: 3582


Throttle
Range: 0 - 1022
Center: 511


Gear
Range: 4096 - 5118
Center: 4607 (Theoretic)


Channel 7
Range: 6144 - 7166
Center: 6144


NOTICE: You will normaly newer reach the endpoints of the ranges. For example the throttle channel will normaly go from aproximately 150 to 850. The rest of the range is avilable for trim and travel adjustment. Setting the travel adjustment to 125% and subtrim all the way in one direction will let jet you reache the end points.
http://www.dogfight.no/2011/01/spectrum-receiver-satellite-to-arduino.html

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by kataventos »

@Copterrichie

Question: What´s wrong with SPI protocol? do we need to hack into spektrum? SPI can give you 20 or more channels!? And iqual or better resolution or not?

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by copterrichie »

kataventos wrote:@Copterrichie

Question: What´s wrong with SPI protocol? do we need to hack into spektrum? SPI can give you 20 or more channels!? And iqual or better resolution or not?


I was not aware of that. Will have to research it. The reason for using serial I though was to be able to use Wifi to serial in my situation and other RF to serial devices directly connected to the MWC.

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by kataventos »

This project is using SPI protocol and in this case 22 Channels!

I love the concept/design of this "radio" ! years ago I did something near this design to support my 35mhz Futaba. Anyway just take a look to:

http://www.youtube.com/watch?feature=pl ... DIv5VXHKPQ

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by copterrichie »

kataventos wrote:This project is using SPI protocol and in this case 22 Channels!

I love the concept/design of this "radio" ! years ago I did something near this design to support my 35mhz Futaba. Anyway just take a look to:

http://www.youtube.com/watch?feature=pl ... DIv5VXHKPQ


All that I can state is, this is WAY over my head. :shock:

But I am in with the best I know how.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Cheap 6 channel transmitter? Let's rip it apart and hack

Post by copterrichie »

This should make Tommy happy with the additional channels. :D

Post Reply