Turnigy RC for Hex/Quad robots

I thought I would split this off from Kåre’s thread about the Lynxmotion A-Pod as to not totally hijack it.

While I prefer XBees, I knew there are several people up here who would like to use RC radios to control their hex or quads. Also I know a few other people who are interested in these radios, so a few days ago I ordered a Turnigy 9x radio from Hobbyking, which has been packed but I have not seen if it has shipped yet.

I probably should have waited, as after I ordered this, I found out that they are about to release a new version(9XR): forum.flitetest.com/showthread.p … he-Unoffic
The new version is supposed to have on it a bunch of stuff on it that I want, like: the connector to allow you to flash new software, back lit led… Maybe I got lucky and they are silently updating the orders and I will be shipped the new one. But I would not bet on it. So assuming that I get the old one and the new one is out soon, may have to order it…

Not sure yet where this will take me. Could simply use it as is on one of my robots, to get it up and running. Or may start off hacking the receiver and use the SPI interface as described in: instructables.com/id/I2C-int … urnigy-9x/ (yes the name says I2C but it appears to be SPI).

While the transmitter board is not an Arduino but it is instead an Atmega64, which is a nice processor (64K program space, 2 usarts, 8 AtoD…) and there are several open code bases for this, such as: code.google.com/p/th9x/ and there as schematics showing the design of the board, it looks like a nice system to hack. Who knows it may be easy to do a hardware hack and replace the RC radio with an XBee…

Or depending on what I find, maybe will play around and build my own DIY board… This could be a good starting point for a DIY as you get a case, 2 gimbals, 3 more analog knobs, several switches and an 128x64 display, which aint bad. It would be great to find out that most of these components simply plug into the main board, such that I could simply add connectors to new board. Better yet, would be great if I could simply use their board and add some daughter board that added the XBee support.

Or maybe I will just punt :laughing: :confused:

Kurt

Sounds like a nice update for the 9x but I wouldn’t worry to much as the back lid EL panel or firmware update are quite easy to do.
I haven’t yet flashed my 9x but I have installed the EL panel.

This topic has reminded me of what myself and Eric have been planning to do with the 9x. We panned to integrated Arduino to the controller directly.

Would be nice if we didn’t have to hack the receivers and just have a minipro board that can read the PPM signal directly then send it to the SSC.

I’m sure Eric will find time to add to this thread… :wink:

As I said I am torn here. Personally I want to end up with bidirectional communications as it is nice for the robot to be able to tell the remote things like: what it’s current Gait is, battery voltage on the robot… So I am hoping that this will turn out to be simple, maybe like unplug receiver, plug in new daughter board with XBEE and update the software… Then I don’t even have to worry about the receiver side.

But back in the RC world, as you said one very valid option would be to connect it directly up to an Arduino such as the Pro Mini, which can process the signals directly. Not sure of any native PPM. I have seen that there are mods to use the FRSKY mods to get PPM, but not sure… The question is would the Pro Mini be used only to receive all of the signals and was that information to a 2nd processor that does the Hex/Quad code work or does the ProMini do it all… If we go this route, it should would be nice if someone simply built a receiver that all of this internally and simply had a simple output, which could be (SPI, I2C or even a serial stream). Sort of like what Orion Robotics (Basic Micro) is doing with their new PS2 receiver (orionrobotics.com/PS2-Remote … p_300.html).

Kurt

There are modules from frsky that remplace the transmitter module to be able to have telemetry… so i guess… some bidirectional comm…

Hi guys, sorry if this is a bit random but I found this webpage which you guys might find interesting - apparently you can use this RC control app on an iPhone to act as a remote control for your circuit board.

diydrones.com/profiles/blogs/rc-control-via-wifi-and-iphone

iphly.org/

Our first plan was to hack the transmitter directly by swapping in an Arduino connected to xbee, doing away with the receiver altogether. And by doing so, having the ability for bidirectional comms.

The other idea is to hack the receiver somehow and connect it to an Arduino. Yes the option here I guess would be to use two promini. One for the hex code and the other to handle the rc transmissions. Bluetooth or xbee could be used for bidirectional comms but maybe not directly to the transmitter but another device such as a smart phone or pc.
Could even use peer to peer WiFi.

Yep I remember seeing maybe a year (or was that two) ago that someone was selling a setup to control I believe their quadcopter with either an IPAD or IPhone…

Jonny, Sounds like we are on the same paths…

First hacking the transmitter: Not sure yet if we would need to replace the actual board, or looking at er9x sources and documents, some of the hardware hacks were to add the frsky, which has bidirectional communications, although that looked like you need to cut traces on the main board to get to the right IO pins… Likewise there is a hack to add a GPS… Autopilot… I did order a smartyparts to make it easier to program. This costs just as much as a new Arduino… But may help…

If that turns out to be not sufficient, can hack the receiver like I mentioned in the first posting. But it would be nicer to simply replace it. Will see where this leads.

Kurt

Edit: Forgot to mention, I wonder about using the smartyparts smartieparts.com/shop/index. … cts_id=337
as a way to maybe easily hack the transmitter. Sent email to them to see what they think

Thought id just drop this in here…
I have talked very briefly to Eric (been waiting for his end of the world to wake up, lol) to see if he will cnc me a new case for my 9x.
My plan is to simply port over the guts along with swapping out the J/Sticks and replacing them with these…
Utilising two of the pots and switches already on the 9x into the J/Sticks. :wink:
servocity.com/html/4_function_joystick.html

Yep, Lynxmotion sells those as well: lynxmotion.com/p-848-4d-gimbal.aspx and I think for less.

As for the guts? Are you talking about taking over the main board or replace? The reason I ask, is their main board Atmega64 has 8 Analog inputs, which currently are used for:
4 - Joysticks, 3 - Posts, 1 - Voltage. So would need to do something to allow 2 more Analogs.

My 9x arrived, I am waiting for my Smartieparts to arrive. (I ordered their 2nd board as well)… The 9x is interesting that it arrives with The transmitter and the receiver and absolutely nothing else. No batteries, No manual… Will be fun to hack on, probably a good form factor, that is easy to hold and do some good manipulations of the robots.

Will be nice especially if we can get it to support bi-directional communications. But there are features of our DIY that so far I still prefer. Things like a better screen. A easier/quicker way to choose more options (Keypad and/or Touch…). So we will see if this turns out to be my end all or one in a series :laughing:

Kurt

Hi peeps, “not those crappy Easter candies”

I have always enjoyed RC control for everything. And I do own two of those Turnigy transmitters with different receivers that have PPM output for 9 channels.
We need ppm --> serial string or i2c and let the basic micro or an additional micro controller to query this board for channel information when the device is ready to read channel data.

I did however write some simple arduino code to read 9 ppm channels and send that out a single line as a 9600 baud serial string
1500,1500,1500,1500,1500,1500,1500,1500,1500
1500,1500,1500,1500,1500,1500,1500,1500,1500
1500,1500,1500,1500,1500,1500,1500,1500,1500

Example of output.

If anyone wants that “as simple as it is” I can provide that to anyone.

Kurt let me know if you have any questions about it, I did do the er9x hack a couple months ago, I could give you photos or chat with you on skype :slight_smile:
I however used the BusPirate to program the atmega.

–Aaron

Innerbreed – I would imagine you can most defiantly replace the guts with new gimbals and simply run the calibration routine to calibrate the different sticks since the max/min resistance values are different from the stock sticks.

Hi Aaron, What firmware are you using on yours? Which ER9x Hack? Are you using the Turnigy receiver or some other one?

Right now have my case open and have the SmartyParts programmer installed, will probably install their 2nd board later today. I think this board multiplexes some of the IO lines that go to the ATmega64. I think they wanted to use the IO pins that are USARTS pins on it as a USART instead of simple IO pins, so they connected what was connected to those to some other inputs to their board and have custom firmware hacks to handle the differences… Could be a model for my own board that has an XBee…

If I go the PPM route, I wonder how much of the processing power of the Arduino is eaten up by the reading in of the PPM and if it is more or less than reading in the serial string, especially if we then need to convert string back to values: Rough best guess for reading those strings in is:
45characters * 10 bits per character /9600 or about 47ms which is almost 2 servo cycles. Obviously this could be sped up if you went to 38400 baud rate and output binary data. Assuming you wish still for 16 bit resolution and maybe 1 byte checksum: might be 19 bytes so 190/38400*1000 is about 5ms which is getting better. Again could cut this down if we only output one byte per channel…

How are you reading the PPM? Are you using interrupts or hard looping? Just wondering.

Also wondering about what signals are coming up to the transmitter board things that plugs into the back? Wondering if enough stuff there that I could simply build my own board and intercept there. My guess is not sufficient as the FrySky telemetry would have gone that route if they could have.

Now back to other distractions.
Kurt

I hacked mine with ER9X without the Smarties… :stuck_out_tongue:

Hi Kurt,

I’m running the ER9X firmware. I can’t remember but there was another firmware I tried that actually was quite crappy! one or two of the channels did not work. As for the Receivers… when we talked last I used the bundled receivers that came with the transmitters “I own two of them” I spent time making a 9 channel using 9 IO pins on the arduino Pulsin() to read the channels then I used softwareserial to output a serial string to another pin.

As for the receivers I have now, I have two each of
D8RSP “this has PPM out” and D8R-IIPlus both of these support sending data back to the transmitter module, I think* these send back serial data… Very cool for two way communication if you want something like that.

They are identical hardware with the exception of code differences. The D8RSP has PPM out on the last channel. These are the receivers I would like to use, I have one on my quad copter “which also does not work yet” Ill have to get with Eric here to poke around with it some more.

The Idea was I wanted to use your C++ code on the phoenix with two Teensy 2.0’s for RC control. However that’s about as far as I got, Its been sitting a while… I need motivation.

The goal now that I have 3 Teensy 3.0’s is possibly see if someone “HINT HINT” could take the Phoenix 2.0 code and implement PPM reading.

Kurt, Write some sample code and at the end of the code have a pin toggle state and measure it on your oscope for how much time it takes for a cycle, then optimize from there. You could also strip out the code that reads PPM from the quadcopter “MultiWII” code… If you do this, please let me know as I can test this with you… Honestly I want to button up my Phoenix and play around with it, its been sitting on a desk.

I hope I answered all your questions.

–Aaron

I’m just wondering how easy is it to convert two of the pots on the standard 9x (no electronics conversion) into another J/Stick?, so I can effectively control another set of axis from one input? Being that I recase the 9x guts.

As for moving the guts to a new case, that is sort-of opposite of the direction I was thinking for me… (potentially modify/replacing the guts, but be able to use the case and controls… ), but then again I am probably still aiming towards XBee… But…

Should not be hard to replace two pots with a Joystick. For example the two pots on the top of the case plug into a secondary board with their wires each going into 5 pin connectors (other switches uses the two other wires on both these connectors). The only question will be how much resistance do these pots have versus the ones in the joystick.

AAron: So you replaced the transmitter/receivers to use the D8RSP. From what I have read, yes it does have some bidirectional communications, that I believe can send back 2 Analog values, plus a serial stream. That 2ndary smartyparts board (that I have not installed yet) is setup to handle that. The main processor (Atmega64) on the remote has a USART, but the IO pins associated with it are used for two switches. Sounds like without this board people would cut the etch and solder wires in to connect up to the serial stream and then try to jumper those switches in to some other IO pins… What this board does is to intercept these signals by catching them at the connector where these switches plug into the main board. It then has a small Attiny processor with 2 usarts. On USART goes to the main processor board through the two IO pins, the 2nd goes out to the Serial port of the FRSKY transmitter. The setup a small communication protocol on the small processor that forwards data that it receives from the FRSKY to the main board. In addition it inserts packets with the state of the two switches…

But I keep coming back to trying to find a reasonable bidirectional setup, both cost and performance wise that more people could do reasonably easily. Not sure yet if this is the right route: $55 for Turnigy, Plus $50 to buy Frsky, Plus either soldering to the main processor board and cutting etches or $55 for SmartyParts. So again not sure, now when the updated 9x comes out some of these costs may go down. Otherwise I wonder if I would be better off simply replacing the main board… Not sure yet.

Yep, I know you would like to work with Teensy, which is great. However I am probably not going to go that direction as you still need somewhere to plug in your 18 servos, which includes a power buss and the like… I am much more likely to go bigger… :mrgreen: :smiling_imp: I am hoping to get my hands on an Arduino Due and then use a new version of my Mega shield that is being fabricated this week to try it out…
DipTrace-PCB---Arduino-Mega.jpg

As for PPM input, should not be difficult. I am not sure how much different it would be than my RC hack I did awhile ago in the thread (viewtopic.php?f=21&t=6629)
Could use the Pin change interrupt like I did for the Standard RC version, or could try the Timer 1 input capture. Someday may get back to that.

That’s all for now.
Kurt

Kurt,

Don’t worry about the resistance of the POTS , There is a calibration routine you can access it might honestly “just work” when you calibrate the new sticks… If you are at all hesitate to try it, just measure the oem ones and try and find pots around that value… I’m betting on it will just work after you calibrate them.

I want to use the teensy 3.0 or 2.0 with the ssc32 “Just to be clear”, I understand without it you would have to use another chip.
That other chip is a code.google.com/p/tlc5940arduino/ “hardware PWM” … martha stewart “its a good thing” :slight_smile:

You could make a shield , I have a couple of these chips for an RGB LED project im poking around with, although you can drive 16 servos with less then 5 digital IO and these chips are cascade’able.

–Aaron

code.google.com/p/tlc5940arduino/ <-- Imagine an SSC 32 that’s much smaller, or even an SSC16 with a couple chips and all surface mount.

By the way if you have skype it would be fun to chit chat, I did that with the quadcopter guy here Eric.