I've been looking at my unused twist grip joystick for a while now thinking about hooking it up to a transmitter via the PPM trainer port.

I might go a step beyond this and get a new 2.4GHz Tx module and add that to the joystick to make it a transmitter.

Fly-Dream make an affordable and reliable 2.4GHz DIY module with three pins for GND,+,PPM in.

I've been able to generate PPM from an Arduino in the past so now it's a matter of hooking the pots in the joystick to the analog pins and the buttons to the digital pins.  The pots move over a portion of the total travel in a joystick so my Vref will need to be a bit above the max voltage the pot will register.  So if the pot only travels between 0 to half way and I feed the pot +5v then the max output voltage will be 2.5V.  

I've also ordered an 8ch 12bit ADC I2C breakout which samples at about 12KHz.  This will give me more leg room at reading resolution of 4095.  The high resolution reading then goes through expo / trim / end point / sample filtering maths and comes out at a resolution of 1024 per channel.  As far as I can tell the PPM output resolution does not need to be any higher than that, nor do I think the timing in an Arduino can get any better than that.

The hat switch can be coded to move the camera tilt servo.  Might even pop out the digital hat switch and put a Wii joystick in there for tilt rate control.  

With the 8 or more buttons on the joystick I should be able to code it to give me all the PWM levels needed for channel 6 modes on the Arducopter.

Views: 4650


Developer
Comment by Rob_Lefebvre on July 7, 2012 at 5:10am

Very cool, keep it up.

Comment by John Grouse on July 8, 2012 at 10:48pm

Building the PCB this week.  Have traced the outline of the original Logitec PCB and will print the tracks onto magazine paper via a laser printer, iron on the toner side of the printout and dissolve the paper in water.  Seems to be the most effective, no fuss method of getting high resolution tracks onto the copper board, ready to etch without mucking around with photo reactive chemicals.  Initial tests will involve feeding the PPM into the trainer port of my existing Tx with the Fly-Dream module.

Comment by John Grouse on July 19, 2012 at 5:08pm

Still waiting for my I2C ADC board to arrive. Keen to see how well it performs against the Arduino's ADC.

Below is the prototype board which will replace the original board in my Logitec Freedom 2.4 joystick

First attempt at using laser printer toner transferred via an iron to the PCB surface. The process needs some perfecting as too much pressure squashes the tracks out and too little stops the toner from sticking. Had to use a permanent pen to finish it off before etching. Might also leave thermals on in Eagle for the ground tracks so that the solder does not flow out over the ground copper as it has here.

Comment by John Grouse on July 22, 2012 at 10:58pm

Board fits perfectly in the enclosure of the joystick.  All buttons function perfectly.  Tested joystick's own throttle control which is wired to the Arduino ADC.  PPM out using TimerOne library worked perfectly.  All channel duration processing is slotted in during the PPM frame timing cycle just after the 8th channel (roughly 5-12ms per PPM frame).  Also sampled PPM "sound" to GoldWave on the PC at 96K sample rate and could not see any PPM oddities (missing channels and the like).  Ran the PPM through the Spektrum Tx for 10min out to one of my planes and did not spot any glitches.  Not sure what impact introducing the code to read the I2C ADC will have on the PPM code.  The Timer should kick in each time it goes off so it should be ok, provided the code for setting the channel values (in the main loop) does not get interrupted.  

4 line I2C LCD panel arrived (Daventec LCD03).  Deciding on the best menu layout for the TX settings will be a challenge.  Might base it off the Spektrum Tx menu.  Might even put another Ardunio in the LCD enclosure and mod the ArduStation code to work with it.  Just have a switch to flick between the TX menu and the ArduStation menu.  Would be nice to integrate the Ardustation into the Tx box and have antenna tracking with telemetry.

Also have an additional potentiometer connection on the board for an external throttle.  The external throttle will go through the 12bit ADC (when the thing arrives) and will allow me to set up the throttle like a collective pitch control to the left of the seat.  More precise level of control and 12bit accurate processing.

Comment by John Grouse on July 29, 2012 at 5:11pm

OK, I2C 12bit ADC turned up and had no problems soldering it up and coding the Nano to read the joystick pots.  Output is very smooth on the digital servo I connected to each channel to test.  Coded from scratch the endpoints, trim and expo and I'm in the middle of coding the filtering on the source ADC values so that the filtering is increased around mid-stick where it is needed the most.  So far the 7 sample filtering does not seem to show much lag at all.  If I could get my head around how a Kalman filter works I would apply that instead.

Also need to build the external box to house the 1800mAh 2cell lipo and the I2C LCD panel.

Changing the trim, endpoints and expo is currently coded via button presses and stick positions so I'm not reliant on using an LCD to set it all up.  I've also coded the eeprom read/write to allocate settings for up to 5 craft.  Have not decided if the aircraft selection should be reliant on using the LCD or button presses.  

Really need to hook up a buzzer to give me some feedback on setting changes.  Perhaps holding down one of five of the buttons when I power it up defines which profile to load?  Holding down button 1 and 2 for more than 5 seconds can commit any changes to that profile slot in eeprom.

Comment by John Grouse on August 2, 2012 at 5:48pm

LCD03 in I2C is now working after much mucking around with pull up resistors.  MultiWii code used to test and then I grabbed the appropriate bits of code out of MultiWii 2.1 to concentrate on using the LCD03.

Comment by james sowell on August 24, 2012 at 12:06pm

any progress

Comment by John Grouse on August 30, 2012 at 8:39pm

Hi James,

All I have left to do is finish coding the menu's and their options, finish mounting the LCD into the external enclosure, wiring up the 8pin mini-din connector and placing the TX module into the external enclosure.

I've tested the PPM stream to my TX trainer port and I get smooth movement on all axis plus the 6 modes changing on the button presses.  I could take it as it is now and go for a fly but I just want to finish the external enclosure before I do that.  12bit ADC works well and can run at 400k I2C speeds, however I'm capped by the LCD03 max I2C speed of 100k.

Once I have all the menu's designed I'll post the code here.

Comment by John Grouse on August 30, 2012 at 8:40pm

Also would like to design an external throttle control set up the same way as a heli collective which I can attach to the side of a chair.

Comment by John Grouse on January 10, 2013 at 4:54pm

Starting to look at the price of LRS options plummeting.  Might be a good time to incorporate the HobbyKing OpenLRS TX/RX into this project.  Extended range would be nice. 

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2014   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service