RC Transmitter Trainer Port Joystick
This is a hacked Logitech Extreme Pro joystick. Its pots are connected to an MCP3008 ADC. The Propeller samples the ADC and converts the values to PPM. The PPM signal is transmitted via 1/4" audio cable connected to the trainer port also known as the DSC port. This port is what allows two radios to control the same reciever, often used in training people to fly RC.
The guts of the joystick had already been removed. I put in the microcontroller and ADC. I didn't have a battery small enough to fit. Something around a 2S 500 mah pack would. I did this 4 years ago with XBee and it was cool, but using the trainer port allows for much more flexibility in what you can control.
I'm still working out some code issues but it flies this microcopter great! I'm also making a Raspberry Pi version, where you can use an unmodified USB joystick and audio cable to accomplish the same thing. Someone else beat me to it - https://github.com/jsa/flystick If you don't want to hack a joystick there's the solution.
You can also buy a joystick with PPM output - https://hobbyking.com/en_us/fpv-flight-simulator-joystick-fpv-1-5-interface-x-gyro-1500.html
Code attached below.
Demo:
Making it:
Admin: Changed links to urls (for test)
The guts of the joystick had already been removed. I put in the microcontroller and ADC. I didn't have a battery small enough to fit. Something around a 2S 500 mah pack would. I did this 4 years ago with XBee and it was cool, but using the trainer port allows for much more flexibility in what you can control.
I'm still working out some code issues but it flies this microcopter great! I'm also making a Raspberry Pi version, where you can use an unmodified USB joystick and audio cable to accomplish the same thing. Someone else beat me to it - https://github.com/jsa/flystick If you don't want to hack a joystick there's the solution.
You can also buy a joystick with PPM output - https://hobbyking.com/en_us/fpv-flight-simulator-joystick-fpv-1-5-interface-x-gyro-1500.html
Code attached below.
Demo:
Making it:
Admin: Changed links to urls (for test)
Comments
I will annotate the code and upload it later today with some more construction notes.
http://obex.parallax.com/object/705
I'm going to flight test the analog portion on Sunday. If it works out I'll consider adding more. The buttons at the top of the stick are nice. It would be tough to leave toggle switches for momentary push buttons.
My Phantom has a mode where you can gesture it around when it is looking at you. I've never used it, but I think that adapting these RC controls to gestures using sensors on the body would be fun. I guess the first part is to break free of the traditional RC controller. The PC flight stick is a safe choice, for now.
I have a Sidewinder Force Feedback joystick I've been meaning to convert for use with RC aircraft.
I think you can use those Orange transmitter modules independent from the transmitter. I'm not sure about the FrSky radios, but a lot of those module use PPM signals as the input. Of course, using the trainer port is an easy easier way to get this to work.
Have I ever mentioned my experiment using a Wii Nunchuck to fly a RC helicopter? I pulled a transmitter module from a Blade micro heli's remote and found the communication protocol on some German forum (thanks to Google Translate). The little "Blade" brand helicopters work with Spectrum gear so I was able to use the transmitter module with any of my Spektrum receivers. I ended up just using a micro heli since I was too chicken to fly my TRex 600 with a Nunchuck.
I used the Nunchuck's accelerometer to control the yaw and throttle (pointing the Nunchuck up or down controlled the throttle and rolling the Nunchuck side to side, controlled the yaw). I thought it was pretty cool to fly a helicopter one handed. It sure didn't make flying the thing any easier.
How do you like the yaw control? I imagine twisting the joystick for yaw control takes some getting used to. Hopefully you have good throttle control. IMO, the touchiest channel when flying quadcopters and helicopters is the throttle channel.
If you decide you like twisting the joystick for yaw control you might want to consider adding a joystick with a knob to your normal remote. HobbyKing sells this cool joystick (I have one but I haven't used it much).
Another joystick with a knob option is this thing (I also have one of these).
I've seen one of these added to a transmitter. As I looked around YouTube to find this link, I see there have been several other 3-axis joystick projects added to YouTube since the last time I checked.
Thanks for sharing your work with us. It's a lot of fun to follow along.
Duane do you have drivers you can share for what you just described?
Yes, but I wrote this code back in 2011. I was pretty new to the Propeller.
The code does not properly bind the transmitter module with a Spektrum receiver. I would plug the module into the original transmitter to bind the module to the helicopter and then connect the module to the Propeller board. I have a feeling the baud setting I'm using is not exactly correct (though it worked). I'm not sure how I came up with 131147 bps but I think I measured the original communication between the transmitter and module using an oscilloscope.
The Orange module is what started this project. I had an extra. Then I searched for a PPM driver and saw your post about using the nunchuck and JM's PPM object. Very cool! I decided to use the trainer port because I didn't want to be locked into DSMxx. I have FrSky and Walkera/Devo stuff I want to be able to fly.
I'm twisting the stick for yaw. I had to use a lot of negative expo. It works great on the microcopter. Sunday's flight test is using a flying wing with elevons so I don't have to worry about yaw quite yet.
The throttle is great. I fly with thumbs only on the standard RC controller. With the flight stick I can pinch the throttle with two fingers giving me a lot smoother control. The little Inductrix micro-quad I'm flying is EDF, so you have to punch the throttle pretty hard. I can't wait to see what the wing is like.
I added my code to the first post. I started to make a nice presentation of the joystick hack and my oscope died. Not sure what to do about that yet...
Things are looking good. I'll be going 90+ mph with a cheap PC flight stick.
Just did a class for more than 10 kids introducing them to robotics using this joystick, XBEE, and ActivityBot etc.
So many uses for this!
Working on FPV?
The FPV part should be good. I put an LC filter inline with the video gear. I usually run everything for 20 minutes, no smoke and we're good.
Here's a shot of the OSD. It has a barometric altimeter You'll also notice 6 sat lock indoors. I'm pretty confident we can test Horizon Hobby's 90+ mph claims.
Jim
Flying like this feels natural and much like a video game. It made the Rookie feel like a new airplane all over again. I knew it would be a lot of fun for an easy to fly aircraft. Next we need to flight test it with the Theory FPV Wing and go fast. Then use a different joystick for multirotor, one with an external stick tension adjustment.
The tight stick is great for airplanes, and the little micro-drone. I don't think it will work well for multirotor acro. We'll get there eventually.
Next time I come down I want to come out and watch you fly.
I think I'm going to do an Instructable on this project.
I need a better choice for an ADC. Here are my options -
#1. Pay a lot - http://www.robotshop.com/ca/en/12-bit-analog-digital-converter-click-board.html
#2. Make a smaller board with the MCP3204
#3. Use something not in OBEX- https://www.adafruit.com/product/1083
Thoughts?
I'm guessing the DIP version and soldering will only reach a small portion of the people who would want to do this. It would be great to fill that gap with an off the shelf part. I also have a few friends that want an assembled version, which I would sell them at cost, but I need to cut down my production time.
Adafruit has an ADS1015 12 bit 4 channel ADC board for $10 - https://www.adafruit.com/product/1083 It would be nice to use that but it would require a code change.
Maybe I should start making my own board. I've made a couple of PCBs for fun, nothing substantial.
I can use the trim on the RC transmitter. There are some joysticks with trim controls on them as well. If it's built into the software it would be redundant and require more stick modification. I had to switch everything over to another airplane in the field so some things were skipped.
Those plates had to come out to make room for the components. I used a spacer in their place. The spacer is a pain to adjust so I'm going to have to find a thickness somewhere in the middle, or use a stick with an external adjustment.
When you used the Wii Nunchuck, was there a lot of drift? I see it is gyros only, and I've only controlled the buttons of the Wii Nunchuck. Was the hard part getting used to it, or was the hard part that it's missing accelerometers?
Does the top come off that HK joystick? It seems like a decent price for hall effect. I would need to attach a longer shaft/handle to it.
Thanks.
The Nunchuck uses a 3-axis accelerometer. It was mainly just hard to get used to. I imagine one could tune the sensitivity of the Nunchuck to make it feel more natural.
As I'm sure you're aware, the problem with flying helicopters and quadcopters is your brain has to be able to make the movements without conscious thought. I don't think there's any way to get around for the need to practice a whole lot with a new control interface in order to get "good at it". I think it should be possible to control RC devices well with a Nunchuck once one had a lot of practice.
I'm working on a new Nunchuck driver with a PASM I2C interface. I think this new driver has the possibility of being useful in these sorts of projects.
It's been awhile since I've looked at the HK joystick. I have the impression it's relatively hackable. I've been meaning to make a video showing it off. I'll try to do this in the next few days.
If you could see if there is a setscrew on the knurled knob that would allow its removal that would be awesome. I've watched a few youtube vids and looked at pics and it's hard to tell.
There's not a setscrew but the knob is removable. It uses a two piece knob like many adjustable height joysticks. Normal joysticks (at least the one I just checked) use a 3 mm threaded rod to hold the knob. This HK joystick uses a 5 mm threaded rod (only threaded on one end) to attach knob.
You know I salvaged one of the Logitech gaming joysticks for parts a few years ago,
Nothing really interesting inside. I had used it for awhile in 2010 and it was nice, if I would have only known. And it's funny when you get the urge to take something apart.
I hacked one around 2012 and it was pretty discouraging. This stick had bad pots, and felt really loose in the center. The delay between the stick movement and the robot was an XBEE code issue. I think this joystick was around $80 at the time.