Open Source USB2PPM converter hub (WORKING!!!) - RC Groups
Shop our Airplanes Products Drone Products Sales
Thread Tools
Jan 12, 2010, 09:10 AM
Registered User
dathird313's Avatar
New Product

Open Source USB2PPM converter hub (WORKING!!!)

usb2ppm (2 min 8 sec)

I just wanted to show a demo of what I've been working on. I wasn't going to post anything until I had some demo of me flying it, but with current work in the field I wanted to make sure I was the first one to show this working. Because what you are dealing with is in fact a small computer, the possibilities are endless. For example, I have personally tested using a force feedback joystick through the device. Other applications include plugging in the Trimersion headset and using its built in headtracker.

I'm hoping to use this thread to build some interest in the project. As I mentioned in the post, this project is completely open source and as I have run my own business before, I know the money is in the execution of a business, so I have no interest in making any money here (too much a niche market)

The microcontroller is programmed using the open source arduino platform. This makes upgrades as easy as unplugging the arduino, plugging it into the computer, copying and pasting the code and uploading.

The platform is a Linksys WRTSL54GS running OpenWRT, with a few settings turned on during the kernel compilation process.

I can probably finish the project on my own in about two months. If I can get anyone that knows arduino (C code) to contribute their time I can finish much faster.

The version I demo'd in the video is an older version. The serial port is actually soldered directly to the router. Information is unidirectional from the router to the arduino to avoid the need for a level shifter 3.3v<->5v. This avoids having to pass through the usb stack as in the case of a usb->serial cable. This is why I can say that there is 0 lag between joystick movements and the expected output. 20 ms is more than enough time to receive an update from the joystick and send the information to the microcontroller.

The current version demo'd d requires the usb joystick to be plugged in and left in from startup. I have a new version working that allows you to plug in the joystick any point in time during the process. And I'm working on a new version that allows you to configuring mixing, expo, and joystick mapping directly from the microcontroller (need help with this one).

Feel free to post suggestions here. If I get enough interest in the current state of the project I'll get a sourceforge account and post everything there.

Also current cost of project
Linksys WRTSL54GS 72.99

BBB Kit, BUB and Mini Cable 27.95

There is also the possibility of using the bifferboard
bifferboard 56.47

The bifferboard would require a usb stick to boot, so throw in another $10

So the product comes in ~100. However this gets you quality reuseable components.
Sign up now
to remove ads between posts
Jan 12, 2010, 10:32 AM
Registered User
Awesome!! So no PC needed at he field?

Wish I had the technical know-how for this!
Jan 12, 2010, 11:21 AM
Registered User
dathird313's Avatar
Nope, the WRTSL54GS is a full fledged computer running a Linux OS. (OPENWRT). This gives the system great flexibility for future updates. Another thing I have tested on the system, is running a camera. So you could add IR lights such as the FreeTrack project and have head tracking without any drift, at minimal cost
Jan 12, 2010, 12:03 PM
Resistance is Futile
camship's Avatar

Does the WRT54GS have the same or similar enough hardware to run this? Or would it be a memory issue?

Thanks, this interesting indeed.

Have a good one,

Jan 12, 2010, 12:29 PM
MelihK's Avatar
Linksys WRTSL54GS is a linux machine?
Have any link for developement over this?
Jan 12, 2010, 01:51 PM
define("BEASTMODE", "1");
Bonafidepirate's Avatar
The WRTSL54GS has a 266MHz CPU, 8MB flash, and 32MB RAM. Not sure about the WRT54GS though.

Edit, looks like the WRT54GS has varying amounts of flash based on which revision it is, 32MB of Ram, and a 200MHz CPU. So it is a bit less powerful, though I have no idea if it can run dathird313's software... (version 4.0 had 4MB of flash, all before it had 8)
Jan 12, 2010, 02:13 PM
Shikra's Avatar
Dathird313 - awesome. Keep us up to date - I think quite a few are interested evenif they do not post.
Jan 12, 2010, 04:40 PM
Registered User
dathird313's Avatar
Unfortunately the WRT54GS will not run it. Its not a matter of hardware. The code I made will run on pretty much any machine made after 1985, its a matter of having a USB compliant hub built into the device. I originally looked at the ADM5120 as a possible platform, however even though it has a USB port and costs an equivalent of $25 for some reason their USB hub is not compliant with HID devices. Spent quite a bit of time on that problem.

As far as development is concerned. I'll be glad to post links and detailed instructions on how to get this working as time goes along. I want to get some of the linux code more cemented. I want to make it so all the cool stuff is done onboard the arduino, as that is much easier to update. I want the linux box to do nothing more than respond to standardized queries and send info to the arduino every 20ms or so.

If you are interested on development on the platform right now, I'll be glad to send you links to the proper sites for both OpenWRT and Arduino, and post code in due course, however everything is strictly open source, so if you make any improvements you have to make the code publicly available. I'm also planning on building a front-end for the joystick code in C# for windows users if they just want to use their own laptop. The arduino code is serial port based, so it will work with ANY OS.

MelihK, if you are interested I'll make the front end available to you to use (as soon as I finish it) with your board. As long as the code remains open I would be happy if it helped you with your endeavours.
Jan 12, 2010, 07:27 PM
Registered User
curious, what makes the arduino thing required?
can't you just communicate to the trainer port using serial or audio signals instead?

I could see a similar thing to the bifferboard you link, capture usb, translate to serial or PPM signals (yeah, bifferboard doesnt seem to have an audio chip but some must have it).

i'm even wondering if fmkit could just hack in a module that translate movements into PPM, bypassing usb ;P
Jan 12, 2010, 07:59 PM
fmkit's Avatar
Originally Posted by jimbob00
curious, what makes the arduino thing required?
can't you just communicate to the trainer port using serial or audio signals instead?

I could see a similar thing to the bifferboard you link, capture usb, translate to serial or PPM signals (yeah, bifferboard doesnt seem to have an audio chip but some must have it).

i'm even wondering if fmkit could just hack in a module that translate movements into PPM, bypassing usb ;P
did you know to read Nunchuck I used 4MIPS 8-bit chip, Aileron/Elevator ADC sampled just before PPM pulsed out, that is about 2-3ms latency and frames are only 4ch long, rest of channels transmitted normal rate 100Hz for 1s only when there is change and 8Hz when static. RX also is fast to decode so overal it's hard to tell difference when comparing to wideband DSM systems.
USB to PPM conversion has to be slow (>20ms latency?) , OK for FPV , not so good for regular flying.
Jan 12, 2010, 08:47 PM
Registered User
usb input is rather quick.
audio usually has latency, but in linux you can tweak it to be rather low as well (see RT kernels), you get under 3ms latency. let's say USB has also a few ms, plus the conversion, it makes like 5-8ms latency added depending on the hardware. Kinda decent.
On Windows audio latency is a problem. But no Windows here anyway.

certainly i think the nunchuck is a good idea (a regular joystick for non-fpv flying sucks) and referring to the chip to implement because of this nunchuck. however these joysticks dont have such a firmware that has been reversed like the nunchuck so its unpractical.

Heck, don't wanna go too much off topic but I should get one of your nunchuck some day to see how it feels.
Jan 12, 2010, 09:07 PM
five by five
sonicj's Avatar
very nice work dathird313! i've had loads of fun and learned a ton from playing with wrt's!

do you have any closeups of your joystick gimbal?

i too would like to try fmkit's nunchuck at some point. insanely cool!
Jan 12, 2010, 09:28 PM
five by five
sonicj's Avatar
does cpu clock speed affect usb throughput?
Jan 12, 2010, 11:28 PM
Registered User
dathird313's Avatar
Without getting too into the code right now. I'll explain how it works.

I started thinking about fmkit's response and technically there is moving latency. Avg 10 ms

So on the CPU we spin off an independent pthread that reads each joystick. This is an event driven interface so we are talking about miniscule latencies, and the linux version I'm using has all the latest real time features aka tick-less kernel, so latencies are reduced.

Anyways I have the main WRT loop update the arduino every 20ms. I found on my particular JR controller, the protocol came in around 22ms(checked with o-scope) I purposefully made it so that they were not in sync. If they are not in sync, the worst you have is if you send out the info and the arduino just sent the last train, so you have 22 ms to wait, and the best is if the arduino is about to send the next train and it just finishes receiving the information from you.

The arduino uses interrupts to send out the pulse train. The main loop reads the serial port and places the data in an array.

If you wanted to get into the 1 ~ 5 ms latency category. You simply increase the speed at which the main thread is updating.

The current baud rate is 56kbps, I'm using bit compression so you have at minimum 10 bytes to send. 10 bits per channel, and 8 channels = 80 bits. so around 1.4 ms to transmit the packet. So a theoretical least latency of around 2 ms if we were to constantly bombard the arduino with data. Both the arduino and router are capable of this. New Arduino supports data rates up to 2Mbps, but thats untested from my end.

But there is no noticeable delay. An average delay of 10 ms is just fine for flying, and I plan on using this to fly a helicopter. We'll see how it goes, I think I'll work my way up to that after some FPV flights with my EZ*. Only have a handful of those down, I just love fiddling with new ideas too much and its too cold right now, well cold for NC.

As far as the nunchuck is concerned, I'm not sure what you're talking about. If you are talking about the wii-mote nunchuck then you are in luck, because a library already exists for the arduino to read the nunchuck using i2c. You wouldn't even need the router, and you could have delay < 1 ms with that approach.

fmkit, I'm going to look through your threads to try and get a better idea of what you are working on. I'll give you a more definitive answer when I know.
Jan 13, 2010, 12:48 AM
Registered User
dathird313's Avatar
As promised, this is an open source project so, as Linus mentioned
Linus was treating his users as co-developers in the most effective possible way:

7. Release early. Release often. And listen to your customers.

So here is my code. If you actually svn the code you can compile it on a regular linux machine and run it without cross compiling for the router. Here is the router code

Notice the gratuitous use of 1996-1999 Vojtech Pavlik's work
Another reason for the project having to be open source.

And here is the link to the arduino code


I have a lot of stuff going on this week, so I may not make much more progress soon. Next on the list is to do a demo of the trimersion headset working with it, but no promises.

Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Open source Airframe for UAV sarel.wagner UAV - Unmanned Aerial Vehicles 19 Jul 06, 2012 06:07 AM
Discussion PowerPROview Open Source mahbouni Medusa Research 3 Oct 19, 2009 10:57 AM
Discussion Open source diversity switch mylittlepony FPV Talk 10 Oct 03, 2009 05:35 AM
Discussion Compy 300 CP Center Hub Source? stuka Micro Helis 3 Mar 18, 2008 01:09 PM