HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Oct 01, 2011, 02:19 PM
German Engineering.......
HugePanic's Avatar
Auxsburg
Joined Dec 2007
448 Posts
Discussion
Joystick to Transmitter: once more

Hello,

i would like to share some work i have done recently.

I have created a arduino-based interface, to connect a PC-Joystick to the trainer port of my transmitter.

I know that it's by far not the first time, that this problem has been solved, but maybe it's interesting some of you.

One, i think, unique feature is, that i only use a arduino, a senser-shield and four resistors. It's needs minimal soldering, everything is available on ebay with ease....

At the moment i transfer only four channels to the transmitter. I can go up to eight channels in the future.

I can read four joystick axes, four buttons and the 4-way-hat switch.
The code as it is right now uses a single-button trimming for elevator and aileron. (Hold stick in position and press button 2 for trimm to this position) But i think i will switch to use the 4-way-hat for trimming in the future.

I have used an old Microsoft 3D Pro joystick for the following reasons:
-It has no potentiometers, but optical sensors. --> no drift
-It is available very cheap on ebay
-It's mechanics is easy and robust, i have used it quite a lot in the past
-it has a twist-rudder, throttle and lot's of buttons i can use.
-it has a "compatible-mode", that allows to use it like a standard PC-joystick

I am reading four axes and four buttons. The four buttons are also used for the hat, means you can not press two buttons at the same time. The joystick sends multi-button-signal for the 4-way-switch)

I simply connect the axes to the analog input pins of the arduino (Uno), with the help of four 100K resistors. (i copied this from here.)

The buttons are connected to the digital-I/O pins.

I am using a 5€/$ sensor-shield, but it's not necessary. With some soldering this can be done without the sensor-shield.

On the video you can see that the USB cable is connected to the arduino. This is just to supply the 5V power for the arduino.

That's it on the hardware.

The code is very simple. I have used the PPM creation from Ian Johnston. I have found his code on arduino.cc.

I have added a expo-, and the one-button trim-function.

For the future i plan to add a PS2 mouse interface, to control two servos by the movement of a PC-mouse.

The great goal is, to use this interface for FPV flights. I like the interace of "IL2 Sturmovik" a lot. I really want to try this instead of goggles and head-tracker....

All the stuff is bench tested. I plan to do a real test flight in the next week. I hope everything works well.

Best regards
Me


joy_klein (0 min 51 sec)
HugePanic is offline Find More Posts by HugePanic
Reply With Quote
Sign up now
to remove ads between posts
Old Oct 04, 2011, 12:30 PM
Registered User
Aberdeen, Scotland, UK
Joined Dec 2007
607 Posts
Nice one!......and hope you have fun flying with the joystick......pls report back with your first flight.

Ian.
IanJ is offline Find More Posts by IanJ
Reply With Quote
Old Oct 29, 2011, 11:12 PM
Registered User
United States, NE, Omaha
Joined Oct 2006
16 Posts
I am very much interested in this as well. I just purchased realflight 5.5 and I want to use a joystick for combat. Would you have an idea if you can buddy box this with the real flight transmitter? Thank you
jollycub is offline Find More Posts by jollycub
Reply With Quote
Old Oct 30, 2011, 06:01 AM
German Engineering.......
HugePanic's Avatar
Auxsburg
Joined Dec 2007
448 Posts
Hi,

i assume you can use a standard USB joystick parallel to the real-flight device, without any hacks.

If not:
The question is, does the realflight device has an trainer (input) port. If yes, then it should work. The trainter ports seem to be more or less standard.
You might have to adjust the ranges and centers, but it should work....
HugePanic is offline Find More Posts by HugePanic
Reply With Quote
Old Oct 30, 2011, 06:35 AM
Registered User
CrashingDutchman's Avatar
The Netherlands, Utrecht, Amersfoort
Joined Oct 2004
2,192 Posts
Hey, this is interesting. It's the first time I see someone doing this with a non-usb joystick.

Another thing on my to-do list, I have an old flight yoke like this:
CrashingDutchman is offline Find More Posts by CrashingDutchman
Reply With Quote
Old Oct 30, 2011, 10:59 AM
Registered User
United States, NE, Omaha
Joined Oct 2006
16 Posts
Hugepanic, I have just started to get interested in PIC's. One of the ones that I am interested in is the PICAXE. It seems rather simple, uses basic, and is relativley cheap. It is programmed with a built in bootstamp and is pretty easily programmed. Could it be used instead of the Arduino? Also it looks like you are using a standard Arduino board. I etch my own boards, so could I etch a board and save space? Thanks again.

BTW, have you flown an airplane yet using it"
jollycub is offline Find More Posts by jollycub
Reply With Quote
Old Oct 30, 2011, 01:55 PM
German Engineering.......
HugePanic's Avatar
Auxsburg
Joined Dec 2007
448 Posts
no, no real test up to now......

i have to select a disposable aircraft first...

I have 0 point 0 experience with other micro-controlers than arduino.

I just love the arduino stuff, especially with the sensor-shield.
just provice power and you can plug-and-play receivers and servos. It just works....

For the joystick-interface, i guess you can use about any arduino, and save space and weight.
Then you can easily put all this stuff inside the joystick housing.

Hey Dutchman, that yoke is great. i just find itīs hard to get a yoke on the flight-field, since you really have to mount it on a table. i hope of putting my stick just on my feet when sitting on the ground or in the trunk of my car...

my ideal setup would be something like this. It canīt be se bad if they use it since years now to controll predators..
I donīt think a goggle will bring mutch benefit.
HugePanic is offline Find More Posts by HugePanic
Reply With Quote
Old Nov 16, 2011, 02:01 PM
German Engineering.......
HugePanic's Avatar
Auxsburg
Joined Dec 2007
448 Posts
Finally i had some time to spend to test the setup.


I did some small adjustments to the code. The trimming is now on the hat for elevator and aileron. One pushbutton (hold vor 800ms) for reseting.

I used my Raptorski as a test machine, so i had only throttle and elvons.

Since my transmitter does all the programming, i only had to adjust the directions of the stick to have it work.

The flying was really great. I used a 3s lipo batter to power the arduino board.

For the future i will just programm more expo on the elvons, since they are too aggressive. But this is done in the programming (switch to more expo when i switch to trainer port)

The throttle is also little aggressive, but itīs ok.

I will finish the code up the next days/weeks, and publish it here.
HugePanic is offline Find More Posts by HugePanic
Reply With Quote
Old Nov 17, 2011, 09:23 AM
Registered User
CrashingDutchman's Avatar
The Netherlands, Utrecht, Amersfoort
Joined Oct 2004
2,192 Posts
Really nice! Congratulations on a successful flight!
CrashingDutchman is offline Find More Posts by CrashingDutchman
Reply With Quote
Old Dec 02, 2011, 12:51 PM
Registered User
Joined Sep 2010
2,408 Posts
Great,..would you mind helping a noob like me make such a project? ....
Do I see correct that you have arduino connected to 15 pin connector, so if any joystick would have that connector it should work? I'm having a really hard time on a hunt for a joystick,...(I would like to hack the extreme 3d pro (Ian Johnston uses it),..but I can't find it cheap in my country..).. But maybe and older one with that 15 pin connector if it's easier to do I'm in for it..

Edit: I've found this one quite cheap: Joystick Logitech Wingman Extreme 3d ...Would it be useful?
msev is offline Find More Posts by msev
Last edited by msev; Dec 02, 2011 at 01:07 PM.
Reply With Quote
Old Dec 03, 2011, 01:43 AM
German Engineering.......
HugePanic's Avatar
Auxsburg
Joined Dec 2007
448 Posts
anything that is PC-Joystick with 15pin sub-D plug should work.
maybe you have to adjust some programming parameters, but thats no big deal.

It's just the question if the joystick needs trimming. But i expect that joysticks that need trimming, allready have a trimming feature included.

I bought that joystick used for 5€ at ebay. (to be honest: i bought two, since i dis-adjusted the first one, and i did not find a way to fix that)

so have it extremly simply, you just need 4 resistors, some wires and an old joystick.

i guess your joystick should just work perfectly. a joystick is more or less just some potentiometers + buttons.

you have:
joy1-X signal
joy1-y signal
joy1-button 1
joy1-button 2

joy2-X signal
joy2-y signal
joy2-button 1
joy2-button 2

+5 Volts power in
Ground

just put +5 volts cable on the power pin from the arduino
connect ground to arduino-ground
the put one of the signal cables into an analog-in-port and see what is happening...
HugePanic is offline Find More Posts by HugePanic
Reply With Quote
Old Dec 03, 2011, 08:12 AM
Registered User
Joined Sep 2010
2,408 Posts
How do I know which of those pins on that 15 pin connector goes to a analog input on the arduino? Do all 15 pin connectors have the same system? Is there any other way then connecting everything to the tx trainer port to visualize if everything works correctly..Because I probably would have to find what ppm signal would my turnigy 9x accept? Or is this ppm signal "standarized" among different tx?
msev is offline Find More Posts by msev
Reply With Quote
Old Dec 04, 2011, 03:44 AM
German Engineering.......
HugePanic's Avatar
Auxsburg
Joined Dec 2007
448 Posts
the SUB-D plug ist "standard"

the PPM signal is also "more or less" standard.

i also used "zelscope" to display the PPM stream and to find mistakes. (what was not necessary, since the programming was right, but i used my radio wrong )

you can send text very easy from the arduino to the PC it is connected.
you can for example do this: (copied from the analog-read example from arduino
Code:
void setup() {
  Serial.begin(9600);
}
void loop() {
  int sensorValue = analogRead(A0);
  Serial.println(sensorValue, DEC);
}
it simply saves the voltage at analog pin "0", and then sends this value over serial to your pc.

So you instantaniously see what signals you get.
Starting from this, you can go step by step...

I use the following pins for joystick axis:
x_in = analogRead(0);
y_in = analogRead(1);
r_in = analogRead(2);
t_in = analogRead(3);


and for buttons:
pinMode(4, INPUT); //b1
pinMode(5, INPUT); //b2
pinMode(6, INPUT); //b2
pinMode(7, INPUT); //b4
HugePanic is offline Find More Posts by HugePanic
Reply With Quote
Old Mar 08, 2012, 10:46 AM
Registered User
Joined Sep 2010
2,408 Posts
So I bought an old joystick with this d-sub plug (I believe its this connector: http://en.wikipedia.org/wiki/Game_port)...On this page there is also a pinout of the connector....

Can you maybe write it down for me how to connect the pins, (I know that pin 1 on the joystick connector to 5V power - probably vcc pin (or 5V pin like its marked on some boards) of arduino right? And the power ground to one of the grounds of the buttons (joystick connector pins 4,5 or 12)...How do I interface the pins on the connector to the arduino inputs,...can you write it down like this pin 2->A1 arduino...etc.

And where to connect audio cable which interfaces with the transmitter..

Edit: should I use this schematic for interfacing the gameport with the arduino: http://www.built-to-spec.com/blog/wp...ck-Dongle1.png

I attached a picture of an arduino nano that I'm planning to use, please use it as reference for pins.
msev is offline Find More Posts by msev
Last edited by msev; Mar 08, 2012 at 11:00 AM.
Reply With Quote
Old Mar 08, 2012, 10:17 PM
Registered User
flyboygaac's Avatar
Portugal, Lisbon, Sintra
Joined Jul 2011
502 Posts
I have a 6 channel radio.
Is it possible to use a joystick and add 2 or 4 new channels to my ppm stream of my radio Tx instead of replacing the existing ones?

This way with one 8ch receiver I could receive all of them
flyboygaac is offline Find More Posts by flyboygaac
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
For Sale ForceFly joystick feedback system, Immerson RC tracker system, Force 3D Pro joystick airmcn_3 FPV Equipment (FS/W) 10 Dec 08, 2013 05:05 AM
Discussion Controlling RC transmitter ... without joystick/s nickarsow DIY Electronics 7 Jul 31, 2011 01:37 PM
Transmitter to joystick interface - any ideas Malc C DIY Electronics 35 Sep 05, 2009 01:32 PM
Question Make a pc joystick out of an old transmitter?? Twiggi DIY Electronics 20 Mar 04, 2006 01:36 PM
RC Transmitter/Joystick Question MTS Radios 1 Jun 23, 2004 05:04 PM