HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Aug 02, 2012, 03:56 PM
Registered User
Aberdeen, Scotland, UK
Joined Dec 2007
607 Posts
Discussion
RC Radio Tx - Re-inventing the wheel! - USB Version

INTRO:-
Back in 2010 I built an Arduino based RC Joystick here which has been great fun, and even more than 2 years later I'm still tweaking the code and making things better. However, that design has the Arduino interface directly to the pots and switches on the joystick itself, and thus makes construction a little less easy as it means butchering a joystick.

So, I decided to design a new Joystick that uses an Arduino once again, but interfaces via USB to to an off the shelf Joystick......no mods required!
The end result is a Joystick you can connect to a 3rd party RC Tx module like Thomas Scherrer's LRS system, or some other 2.4ghz module that uses a PPM input.

There's a 16x2 LCD which interfaces to the Arduino to facilitate setup and a whole host of functions just like a normal RC Tx, and it should be noted that it'll run just fine without the LCD and if say you wanted to tie the Joystick via the trainer/buddy connection on your existing RC Tx, however, I have designed the system so that it's main use would be as a complete standalone RC Tx.

ARDUINO CODE:-
Download the code over at my website:
http://www.ianjohnston.com/index.php...=article&id=79

FUNCTIONALITY (LCD):-
8-ch PPM output.
PPM Channel re-assignment.
Battery voltage display and usable capacity in %.
Model Select (4 Model memory).
Selectable High, Mid & Low rates.
Aeleron, Elevator & Rudder trim (for each of the Rates. On main panel & stick top hat).
Elevon Mode.
Exponential Aelerons.
Exponential Elevators.
Exponential Rudder.
Invert Aelerons.
Invert Elevators.
Invert Rudder.
Invert Throttle.
Aux Switch1 (main panel).
Aux Switch 2 (main panel).
Aux Pot 1 (additional ability to send to 0%, 50% or 100% via thumb switch.....handy for pan & tilt!).
Aux Pot 2 (additional ability to send to 0%, 50% or 100% via trigger switch.....handy for pan & tilt!).
Display RAW & PPM data.
Timer (with throttle inhibit at 1%).
Joystick Top Hat can be configured for AuxPot 1&2 (for camera Pan & Tilt perhaps!), or Trim functions.

PPM Channels:-
PPM Ch.1 - Aeleron - Elevon mix Aeleron 1 (averaged) (Invert mode) (Exponential mode)
PPM Ch.2 - Elevator - Elevon mix Aeleron 2 (averaged) (Invert mode) (Exponential mode)
PPM Ch.3 - Throttle - (averaged)
PPM Ch.4 - Rudder - (averaged) (Invert mode) (Exponential mode)
PPM Ch.5 - Aux switch 1
PPM Ch.6 - Aux switch 2
PPM Ch.7 - Aux potentiometer 2
PPM Ch.8 - Aux potentiometer 1
(Full channel re-assignment is possible via the Lcd).

Source code settings:
InvertPPM - 0 = Non-invert, 1 = Invert.
ReverseAuxpot - 0 = Non-invert, 1 = Inverted Aux Pot 1 output
ReverseAuxpot2 - 0 = Non-invert, 1 = Inverted Aux Pot 2 output

BASIC HARDWARE:-
Arduino MEGA 2560 (will not work on any other Arduino due to timer & memory requirements except possibly the Mega 1280)
USB Host Shield (P/N=DFRobot DFR0138 or Circuits@Home Rev 2.0)
Logitech Extreme 3D Pro
16x2 LCD (LiquidCrystal library)

ARDUINO I/O:-
Dig pin 12 = PPM output
Dig pin 13 = Buzzer
Ana pin 0 = Battery monitor
Dig Pin 2 = LCD D7
Dig Pin 3 = LCD D6
Dig Pin 4 = LCD D5
Dig Pin 5 = LCD D4
Dig Pin 6 = LCD RS
Dig Pin 7 = LCD ENABLE

STICK BUTTONS
Button 7 = FUNCTION LEFT
Button 8 = Trim - / OFF / DOWN / LEFT / TIMER START
Button 9 = FUNCTION RIGHT
Button 10 = TRIM+ / ON / UP / RIGHT / TIMER THR. INHIBIT
Button 11 = Aux Switch 1
Button 12 = Aux Switch 2
Button 5 = Aux Pot 1 UP
Button 3 = Aux Pot 1 DOWN
Button 6 = Aux Pot 2 UP
Button 4 = Aux Pot 2 DOWN
Top Hat = TRIM ADJUST / Aux Pot 1&2 UP/DOWN (mode dependant)

PHOTOS:-
Some random pics (not necessarily reflecting the latest mods to the code) from a few of the menu's, and also my scope showing the PPM output:-























PPM output:-


Finished Joystick:-










Ian.
IanJ is offline Find More Posts by IanJ
Last edited by IanJ; May 25, 2014 at 02:22 PM.
Reply With Quote
Sign up now
to remove ads between posts
Old Aug 02, 2012, 07:07 PM
The Fixer
Martin Y's Avatar
Canada, ON, Milton
Joined Jan 2009
3,730 Posts
Nice one Ian. I have 2 of those joysticks for my usage.
Martin Y is offline Find More Posts by Martin Y
RCG Plus Member
Latest blog entry: Flyfly Fox Glider
Reply With Quote
Old Aug 03, 2012, 09:51 AM
Registered User
Aberdeen, Scotland, UK
Joined Dec 2007
607 Posts
Hi all,

Latest version uploaded V8.1. See first post in this thread for download link.

Modified the code, now AUX Switch 1 (PPM Ch.5) & AUX Switch 2 (PP Ch.8) are now controlled from buttons 11 & 12 on the stick.
The LCD main screen displays the switch status.

With this in mind the only external controls will be the the 2 AUX pots..............unless I can make use of the other spare switches on the stick. Hmmmmm!

Ian.
IanJ is offline Find More Posts by IanJ
Last edited by IanJ; Aug 04, 2012 at 04:41 AM.
Reply With Quote
Old Aug 03, 2012, 02:02 PM
Registered User
Aberdeen, Scotland, UK
Joined Dec 2007
607 Posts
Hi all,

I have modified the main screen to display both the AUX SWITCHES and both the AUX POTS. The AUX POTS are controlled by 4 buttons on the top of the stick.

Pics updated in Post #1

Ian.
IanJ is offline Find More Posts by IanJ
Last edited by IanJ; Aug 06, 2012 at 02:39 PM.
Reply With Quote
Old Aug 04, 2012, 08:17 AM
Registered User
Aberdeen, Scotland, UK
Joined Dec 2007
607 Posts
Hi all,

Fed up of the Sparkfun Serial LCD......too easy to corrupt it which requires pulling wires for a special boot up in order to clear it. Also, it's not reliable enough at startup. What are these people thinking when they design these things!!!

Anyways, I have now adapted my code to use the good old parallel type LCD (4bit mode) and which uses the Arduno's built in LiquidCrystal library.

Ian.
IanJ is offline Find More Posts by IanJ
Last edited by IanJ; Aug 10, 2012 at 03:09 PM.
Reply With Quote
Old Aug 05, 2012, 03:42 AM
Registered User
Joined Sep 2010
2,411 Posts
Firstly nice work! You said you had another usb shield to test on the way - can you post a link to it?
msev is offline Find More Posts by msev
Reply With Quote
Old Aug 05, 2012, 08:14 AM
Registered User
Aberdeen, Scotland, UK
Joined Dec 2007
607 Posts
Quote:
Originally Posted by msev View Post
Firstly nice work! You said you had another usb shield to test on the way - can you post a link to it?
Both these seem to be the same design and work with the same library drivers.

Circuits@Home Rev 2.0

DFRobot DFR0138

However, I think the driver has a bug whereby it doesn't power up properly every time. I contacted the author and as yet the don't see any problem although I don't think they have hooked up their stick again......so fo now I have to live with powering down the arduino and back up again every time I load new code. It's all very random.

PS. Code updated, V8.5 now available, see first post for link.

Ian.
IanJ is offline Find More Posts by IanJ
Reply With Quote
Old Aug 05, 2012, 08:44 AM
Registered User
Joined Sep 2010
2,411 Posts
Can does cheap ebay 16x2 lcds be used?
msev is offline Find More Posts by msev
Reply With Quote
Old Aug 05, 2012, 10:56 AM
Registered User
Aberdeen, Scotland, UK
Joined Dec 2007
607 Posts
Quote:
Originally Posted by msev View Post
Can does cheap ebay 16x2 lcds be used?
Hi,

Yes, thats what I am using.

16 pin type.

Ian.
IanJ is offline Find More Posts by IanJ
Reply With Quote
Old Aug 06, 2012, 09:51 AM
Registered User
Aberdeen, Scotland, UK
Joined Dec 2007
607 Posts
Hi all,

Post #1 updated with lots more info.

New version uploaded, I have added the ability to send the Aux Pots (1 & 2) to min or max via the thumb & trigger).
The min or max are configured on the LCD and saved to EEProm. This mode is useful to Aeroquad users.

The next mod will possibly be the ability to re-assign the PPM channels from the LCD. This is neccessary sometimes for the AUX.SW & AUX.POT channels, and rather than tweak the source code it would probably be better to do this via the LCD.

The other mod I'd like to do if it's not too big a job is to provide say 5 configs for say 5 different planes.

Ian.
IanJ is offline Find More Posts by IanJ
Last edited by IanJ; Aug 07, 2012 at 05:47 AM.
Reply With Quote
Old Aug 07, 2012, 04:27 PM
Registered User
Aberdeen, Scotland, UK
Joined Dec 2007
607 Posts
Hi all,

New version uploaded, V8.63beta, see download link in Post #1.

This version has the ability for the user to re-assign the PPM channels.

You scroll along the bottom line (see cursor) and using another button change the function associated with that channel.

It looks a jumble of letters/numbers along the bottom till you realize they are in pairs under a particular Ch. number i.e.:
AE EL TH RU S1 P1 P2 S2

So, by extreme example!........you could make all 8 channels the Throttle, i.e.
TH TH TH TH TH TH TH TH

Settings are stored in EEprom.

Note: Still lots of testing for this beta version, I have virtually just completed the mods before uploading.
IanJ is offline Find More Posts by IanJ
Last edited by IanJ; Aug 10, 2012 at 03:11 PM.
Reply With Quote
Old Aug 08, 2012, 02:46 PM
Registered User
Aberdeen, Scotland, UK
Joined Dec 2007
607 Posts
Hi all,

New version uploaded, V8.64, see download link in Post #1.

1. Bug fix on the AuxSW 1&2 which was causing wierdness on the PPM output.

2. I have re-arranged the 4 panel buttons so that you can now scroll backwards & forwards through the menu. Kinda had to do that because there are now 17 main screens! This includes putting the TIMER on it's own function menu.

Next job: Start work on the enclosure to house the Arduino & Thomas LRS pcb etc.

Ian.
IanJ is offline Find More Posts by IanJ
Last edited by IanJ; Aug 08, 2012 at 03:06 PM.
Reply With Quote
Old Aug 09, 2012, 04:10 PM
We can rebuild it!
djdavies83's Avatar
United Kingdom, Wales, Swffryd
Joined Apr 2010
3,670 Posts
Looks sweet, I'm presuming that so long as the USB device is standard as far as windows/PS3 are concerned this will be happy with it too?

What's the build cost on one of these and could the mega 2560 be programmed with the USBASP thing that hobbyking sells?
djdavies83 is online now Find More Posts by djdavies83
Reply With Quote
Old Aug 09, 2012, 04:27 PM
Registered User
Aberdeen, Scotland, UK
Joined Dec 2007
607 Posts
Hi all,

New version uploaded, see download link in Post #1.

This version has the ability to save four different models.

All settings for each model, as well as the current model selected are stored in EEprom.

The current model selected will flash.

Note: Still lots of testing for this new version due to quite a lot of modes to get this new function working.
IanJ is offline Find More Posts by IanJ
Last edited by IanJ; Aug 10, 2012 at 03:11 PM.
Reply With Quote
Old Aug 09, 2012, 04:30 PM
Registered User
Aberdeen, Scotland, UK
Joined Dec 2007
607 Posts
Quote:
Originally Posted by djdavies83 View Post
Looks sweet, I'm presuming that so long as the USB device is standard as far as windows/PS3 are concerned this will be happy with it too?

What's the build cost on one of these and could the mega 2560 be programmed with the USBASP thing that hobbyking sells?
This project ONLY will work with a standard Logitech Extreme 3D Pro joystick.
You program the Arduino 2560 with a simple USB cable, no special programmer is required at all. Thats the beauty of Arduino!.......See www.arduino.cc

Ian.
IanJ is offline Find More Posts by IanJ
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion RC Radio Tx - Re-inventing the wheel! IanJ DIY Electronics 345 Mar 18, 2013 02:44 PM
Sold Immersion RC 600mW 5.8 TX Version 1 $50 shipped. nybeechpilot FPV Equipment (FS/W) 2 Jun 02, 2012 06:36 PM
Discussion Re inventing the internal combustion engine UlteriorModem Life, The Universe, and Politics 10 Apr 11, 2012 05:24 AM
Discussion Re-inventing the wheel philgib Blimps 5 May 25, 2006 06:42 PM
Wanted WTB AeroFly Professional Deluxe USB Interface Version RC Flight Simulator for futaba heliguy Aircraft - General - Radio Equipment (FS/W) 0 Oct 20, 2005 02:21 PM