Extra inputs for Devo Tx's

More
14 Jul 2015 16:27 - 26 Jul 2015 04:03 #35445 by Cereal_Killer
Replied by Cereal_Killer on topic Extra inputs for Devo Tx's
I dont remember off the top of my head but next time I open my TX I'll verify which wire, in the mean time you can put your TX into student mode so it's outputting PPM and then probe each conductor with a logic analyzer...

Edit: The PPM data input is the black wire for sure!

Taranis X9E | DEVO 10 | Devo U7E | Taranis Q7

What I do in real life: rivergoequestrian.com/
Last edit: 26 Jul 2015 04:03 by Cereal_Killer.

Please Log in or Create an account to join the conversation.

More
26 Jul 2015 04:23 - 26 Jul 2015 05:36 #36006 by Cereal_Killer
Replied by Cereal_Killer on topic Extra inputs for Devo Tx's
Worked on this more, till I either get a logic analyzer or can get someone with one to help I'm about as far as I can get.

I don't know about PPM enough to get it all the way working without being able to see what's going on. I have lots of bills and a family vacation this month so I can't just run out and buy one, does anyone happen to have one I can borrow (or does anyone want to take over)?


Edit: one correction to something I said in the video, I believe the pot's were like $11-12 shipped normally but I'm cheap so first I left their page up and then in a different tab navigated around HK's site (once you load enough new pages then go back it'll give you a buck off in a little pop-up, note you can do this with almost any product) and on top of that I had $3 worth of points. Even at full retail you're looking $15 max!

Taranis X9E | DEVO 10 | Devo U7E | Taranis Q7

What I do in real life: rivergoequestrian.com/
Last edit: 26 Jul 2015 05:36 by Cereal_Killer.

Please Log in or Create an account to join the conversation.

More
26 Jul 2015 05:19 #36010 by Deal57
Replied by Deal57 on topic Extra inputs for Devo Tx's
Do you have a bill of materials? I'm not a designer, but I follow instructions pretty well and I have a logic analyzer. Let me know if I can help.

Deviation Devo7e 3way switch mod, A7105, NRF24L01
Devo6s 2x2 switch mod, trim mod, haptic, multimodule, A7105, NRF24L01, CC2500
Devo12e 4-in-1 with voice mod -- it speaks!!

Please Log in or Create an account to join the conversation.

More
26 Jul 2015 05:43 #36011 by Cereal_Killer
Replied by Cereal_Killer on topic Extra inputs for Devo Tx's
All you need is the two pots and an arduino. I can send you the arduino and detailed instructions if you're willing to help (it's really simple TBH, I doubt you'll need much detail). I just don't have are any spare pot's (well I have a bunch like that come on tx gimbals but that would probably be more trouble than it's worth messing with that).

For testing you should be able to use almost any pot's you have laying around...
Let me have a look around [in the morning] and see what I can come up with. I can prpbay just build a little test jig for you and send it all together, you can plug it into your TX (I'll put a 3.5mm stereo on it) and hook up your logic and it'll be all really easy for you.

Taranis X9E | DEVO 10 | Devo U7E | Taranis Q7

What I do in real life: rivergoequestrian.com/

Please Log in or Create an account to join the conversation.

More
26 Jul 2015 08:01 - 26 Jul 2015 11:06 #36019 by Arakon
Replied by Arakon on topic Extra inputs for Devo Tx's
I have some arduinos and pots laying around and can put something together if you'd like me to test it.. just no logic analyzer.
Last edit: 26 Jul 2015 11:06 by Arakon.

Please Log in or Create an account to join the conversation.

More
26 Jul 2015 13:25 #36037 by Arakon
Replied by Arakon on topic Extra inputs for Devo Tx's
I just decided to mess with this code:
www.ianjohnston.com/index.php?option=com...d=3:hobbies&Itemid=8
Arduino nano
GND/A6/5v to a 100 ohm potentiometer (since i had that on hand)
D10/GND to trainer port

Set up as PPM -> Extend
Set channel 5 to PPM 1

Works. Working Pot on my Devo 7e. In fact, I could now add up to 6 channels more, i.e. extra switches or more pots.

Please Log in or Create an account to join the conversation.

More
26 Jul 2015 14:08 #36042 by Cereal_Killer
Replied by Cereal_Killer on topic Extra inputs for Devo Tx's
Could you post the code changes you made?

That code looks very promising, man I'm glad I left the TTL pin header hanging out!

Taranis X9E | DEVO 10 | Devo U7E | Taranis Q7

What I do in real life: rivergoequestrian.com/

Please Log in or Create an account to join the conversation.

More
26 Jul 2015 14:18 #36045 by Deal57
Replied by Deal57 on topic Extra inputs for Devo Tx's
If you can send the parts I can put them together. I will PM you my address.

Deviation Devo7e 3way switch mod, A7105, NRF24L01
Devo6s 2x2 switch mod, trim mod, haptic, multimodule, A7105, NRF24L01, CC2500
Devo12e 4-in-1 with voice mod -- it speaks!!

Please Log in or Create an account to join the conversation.

More
26 Jul 2015 14:26 #36046 by Arakon
Replied by Arakon on topic Extra inputs for Devo Tx's
I actually had to make no changes to the code at all. It worked as-is.

Please Log in or Create an account to join the conversation.

More
26 Jul 2015 14:38 - 26 Jul 2015 23:21 #36047 by Cereal_Killer
Replied by Cereal_Killer on topic WORKING CODE!
Ok I've got it running about as well as the old code, well actually it's more accurate and is giving my full range of the first pot however once again I cant get the second channel working.

I switched it to output on D13 (so I didnt have to open my case back up) and changed the AIL pot (channel 1) to A0, that all works, but when I tell it to look on A1 for channel 2 (actually no matter what I tell it) nothing happens. I've tried PPM2-6 as the source and nothing. This is what I really need the logic for...


Code as I'm running it
{updated 20150726 17:13}
// PPM Encoder Joystick to Futaba Trainer Port
// For use with Arduino Nano V3.0
// Ian Johnston 29/04/2010
// Version 1.1 
//Low cost way to add extra POT's to any radio that accepts PPM input for <$15
//using an arduino nano and a few POT's, visit DeviationTX.com for info. 
//POT's on A1 and A2, PPM output on D13
//PPM inout to tip of 3.5 stereo, this is the black wire on your Devo 7E


int AI_Pin_AEL = 1;    // channel one analog in
int AI_Pin_ELE = 2;    // channel two analog in
int AI_Pin_THR = 3;    // channel three analog in
int AI_Pin_RUD = 4;    // channel four analog in
int AI_Pin_TIpot = 5;  // channel five analon in
int AI_Raw_AEL;        // Ana In raw var - 0->1023
int AI_Raw_ELE;        // Ana In raw var - 0->1023
int AI_Raw_THR;        // Ana In raw var - 0->1023
int AI_Raw_RUD;        // Ana In raw var - 0->1023
int AI_Raw_TIpot;        // Ana In raw var - 0->1023
int AI_AEL;           // Ana In var - 0->1023 compensated
int AI_ELE;           // Ana In var - 0->1023 compensated
int AI_THR;           // Ana In var - 0->1023 compensated
int AI_RUD;           // Ana In var - 0->1023 compensated
int AI_TIpot;           // Ana In var - 0->1023 compensated
int Aeleron_uS = 750;     // Ana In Ch.0 uS var - Aeleron
int Elevator_uS = 750;    // Ana In Ch.1 uS var - Elevator
int Throttle_uS = 750;    // Ana In Ch.2 uS var - Throttle
int Rudder_uS = 750;      // Ana In Ch.3 uS var - Rudder
int TI_uS = 750;          // Ana In Ch.4 uS var - TI
int TIsw_uS = 750;        // Ana In Ch.4 uS var - TI Switch
 
int Fixed_uS = 300;       // PPM frame fixed LOW phase
int pulseMin = 750;          // pulse minimum width minus start in uS
int pulseMax = 1700;      // pulse maximum width in uS
 
float DualrateMultAel = 0.9; // Dual rate mult
float DualrateMultEle = 0.9; // Dual rate mult
float DualrateMultThr = 0.9; // Dual rate mult
float DualrateMultRud = 0.9; // Dual rate mult
float DualrateMultTI = 0.9; // Dual rate mult
int DualrateAdjAel = 0;   // Dual rate mid adjustment
int DualrateAdjEle = 0;      // Dual rate mid adjustment
int DualrateAdjThr = 0;      // Dual rate mid adjustment
int DualrateAdjRud = 0;      // Dual rate mid adjustment
int DualrateAdjTI = 0;      // Dual rate mid adjustment
 
int outPinPPM = 13;       // digital pin 13
int outPinTEST = 8;       // digital pin 8
int inPinD6 = 6;          // digital pin 6
int inPinD11 = 11;        // digital pin 11
 
ISR(TIMER1_COMPA_vect) {
ppmoutput(); // Jump to ppmoutput subroutine
}
 
void setup() {
 
// Serial.begin(9600) ; // Test
 
pinMode(outPinPPM, OUTPUT);   // sets the digital pin as output
pinMode(inPinD6, INPUT);      // sets the digital pin as input
digitalWrite(inPinD6, HIGH);  // turn on pull-up resistor
pinMode(inPinD11, INPUT);     // sets the digital pin as input
digitalWrite(inPinD11, HIGH); // turn on pull-up resistor
 
// Setup timer
TCCR1A = B00110001; // Compare register B used in mode '3'
TCCR1B = B00010010; // WGM13 and CS11 set to 1
TCCR1C = B00000000; // All set to 0
TIMSK1 = B00000010; // Interrupt on compare B
TIFR1  = B00000010; // Interrupt on compare B
OCR1A = 22000; // 22mS PPM output refresh
OCR1B = 1000;
 
}
 
void ppmoutput() { // PPM output sub
 
// test pulse - used to trigger scope
// digitalWrite(outPinTEST, LOW);
// delayMicroseconds(100);    // Hold
// digitalWrite(outPinTEST, HIGH);
 
// Channel 1 - Aeleron
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS);    // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(Aeleron_uS);  // Hold for Aeleron_uS microseconds     
 
// Channel 2 - Elevator
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS);    // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(Elevator_uS); // Hold for Elevator_uS microseconds     
 
// Channel 3 - Throttle
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS);    // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(Throttle_uS); // Hold for Throttle_uS microseconds     
 
// Channel 4 - Rudder
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS);    // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(Rudder_uS);   // Hold for Rudder_uS microseconds
 
// Channel 5 - TI Switch
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS);    // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(TIsw_uS);     // Hold for TIsw_uS microseconds       
 
// Channel 6 - TI pot
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS);    // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(TI_uS);       // Hold for TI_uS microseconds 
 
// Synchro pulse
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS);    // Hold
digitalWrite(outPinPPM, HIGH);  // Start Synchro pulse
 
} 

void loop() { // Main loop
 
// Read analogue ports
AI_Raw_AEL = analogRead(AI_Pin_AEL);
AI_Raw_ELE = analogRead(AI_Pin_ELE);
AI_Raw_THR = analogRead(AI_Pin_THR);
AI_Raw_RUD = analogRead(AI_Pin_RUD);
AI_Raw_TIpot = analogRead(AI_Pin_TIpot);
 
// Compensate for discrepancy in pot inputs including centering offset.
// Also use this to invert inputs if necessary (swap x1 & y1)
// y=mx+c, x to y scales to x1 to y1
AI_AEL = map(AI_Raw_AEL, 0, 1023, 1200, 0) - 100; // Invert Aeleron pot and slight centre offset
AI_ELE = map(AI_Raw_ELE, 0, 1023, 1200, 0) - 120; // Invert Elevator pot and slight centre offset
AI_THR = map(AI_Raw_THR, 0, 1023, 0, 1023) + 0;  // Throttle
AI_RUD = map(AI_Raw_RUD, 0, 1023, 0, 1023) + 0;  // Rudder
AI_TIpot = map(AI_Raw_TIpot, 0, 1023, 1023, 0) + 0;  // Thermal Intelligence pot (TI)
 
// Map analogue inputs to PPM rates for each of the channels
Aeleron_uS = (AI_AEL * DualrateMultAel) + pulseMin + DualrateAdjAel;
Elevator_uS = (AI_ELE * DualrateMultEle) + pulseMin + DualrateAdjEle;
Throttle_uS = (AI_THR * DualrateMultThr) + pulseMin + DualrateAdjThr;
Rudder_uS = (AI_RUD * DualrateMultRud) + pulseMin + DualrateAdjRud;
TI_uS = (AI_TIpot * DualrateMultTI) + pulseMin + DualrateAdjTI;
 
// Check limits
if (Aeleron_uS <= 750) Aeleron_uS = 750;     // Min
if (Aeleron_uS >= 1700) Aeleron_uS = 1700;   // Max  
if (Elevator_uS <= 750) Elevator_uS = 750;   // Min
if (Elevator_uS >= 1700) Elevator_uS = 1700; // Max
if (Throttle_uS <= 750) Throttle_uS = 750;   // Min
if (Throttle_uS >= 1700) Throttle_uS = 1700; // Max
if (Rudder_uS <= 750) Rudder_uS = 750;       // Min
if (Rudder_uS >= 1700) Rudder_uS = 1700;     // Max  
if (TI_uS <= 750) TI_uS = 750;               // Min
if (TI_uS >= 1700) TI_uS = 1700;             // Max
 
if (digitalRead(inPinD6) == 0) { // Low rate
DualrateMultAel = 0.5;
DualrateMultEle = 0.5;
DualrateMultThr = 0.9;
DualrateMultRud = 0.7;
DualrateMultTI = 0.9;
DualrateAdjAel = 200;
DualrateAdjEle = 200;
DualrateAdjThr = 0;
DualrateAdjRud = 100;
DualrateAdjTI = 0;
}
 
if (digitalRead(inPinD6) == 1) { // Normal/high rate
DualrateMultAel = 0.9;
DualrateMultEle = 0.9;
DualrateMultThr = 0.9;
DualrateMultRud = 0.9;
DualrateMultTI = 0.9;
DualrateAdjAel = 0;
DualrateAdjEle = 0;
DualrateAdjThr = 0;
DualrateAdjRud = 0;
DualrateAdjTI = 0;
}
 
if (digitalRead(inPinD11) == 1) { // TI Switch   
TIsw_uS = 1700;
} else {
TIsw_uS = 750;
}
 
}

Taranis X9E | DEVO 10 | Devo U7E | Taranis Q7

What I do in real life: rivergoequestrian.com/
Last edit: 26 Jul 2015 23:21 by Cereal_Killer.

Please Log in or Create an account to join the conversation.

More
26 Jul 2015 15:22 - 26 Jul 2015 15:25 #36051 by Arakon
Replied by Arakon on topic Extra inputs for Devo Tx's
I just switched inputs on the pot.. for some reason, the pot actually controls all PPM channels at once for me.
Edit: Okay, weird.. something about the output signal length I think If I configure ch 5+6 as ppm 1+2, they're nearly identical. PPM 1+3 and the channels run in opposite directions with ~20% in between them.
Last edit: 26 Jul 2015 15:25 by Arakon.

Please Log in or Create an account to join the conversation.

More
26 Jul 2015 15:26 #36052 by Cereal_Killer
Replied by Cereal_Killer on topic Extra inputs for Devo Tx's
Ok are you using your POT hooked to A4? I believe he was using his POT not as a channel on it's own but as an adjustment (maybe I'm wrong).

What I've done is to tell the arduino the POT's are actually the AIL and ELE (channels 1 and 2). I also see a code comment that A0 was acting up, I'm taking my TX apart now and am changing the pinout to use A1 and A2.

What's really strange tho (and not promising for what I just said above) is that either pot functions perfectly on it's own. I dont seem to have an input problem, more of an output / PPM stream problem as my devo only see's data coming in on PPM channel 1.

I registered at his forum and posted about it...

Taranis X9E | DEVO 10 | Devo U7E | Taranis Q7

What I do in real life: rivergoequestrian.com/

Please Log in or Create an account to join the conversation.

More
26 Jul 2015 15:28 #36053 by Arakon
Replied by Arakon on topic Extra inputs for Devo Tx's
The pot just acts the same as his joystick (what it was originally written for). I tried A6, A2 and A3. They all control all channels it seems, but depending on which one I hook the pot to, in different ways.

Please Log in or Create an account to join the conversation.

More
26 Jul 2015 21:02 - 26 Jul 2015 21:06 #36081 by Cereal_Killer
Replied by Cereal_Killer on topic Extra inputs for Devo Tx's
Got it working!



After you set PPM IN to extend you have to click on it and set the number of channels.

Mine's working right, you can copy/ paste the code I posted a few up, it's setup for PPM out on D13 and the POT's on A1 and A2, they come in as Ch's PPM1 and 2, you can add up to 4 more POT's for 6 channels if you want. You MUST run it at 5V / 16mhz (or change the divider).

Woohoo, thanks for finding that (I'm guessing the first code worked too, I didn't know about the PPM channel setting)!

Taranis X9E | DEVO 10 | Devo U7E | Taranis Q7

What I do in real life: rivergoequestrian.com/
Last edit: 26 Jul 2015 21:06 by Cereal_Killer.

Please Log in or Create an account to join the conversation.

More
26 Jul 2015 22:05 #36089 by Cereal_Killer
Replied by Cereal_Killer on topic Extra inputs for Devo Tx's
How to add channels to your model file using this:


Taranis X9E | DEVO 10 | Devo U7E | Taranis Q7

What I do in real life: rivergoequestrian.com/

Please Log in or Create an account to join the conversation.

More
26 Jul 2015 22:14 #36090 by Deal57
Replied by Deal57 on topic Extra inputs for Devo Tx's
Nice work! My gimbals is gonna be rockin! :P

So what next? How does it interface to the PPM port? Can we just put a 4-pin f-m cable together so no additional soldering needed? Where do you get regulated power?

This is exciting, guys. I really should be getting a bigger TX but it's so cool to see what can be done with this one!

Deviation Devo7e 3way switch mod, A7105, NRF24L01
Devo6s 2x2 switch mod, trim mod, haptic, multimodule, A7105, NRF24L01, CC2500
Devo12e 4-in-1 with voice mod -- it speaks!!

Please Log in or Create an account to join the conversation.

More
26 Jul 2015 22:17 #36091 by Cereal_Killer
Replied by Cereal_Killer on topic Extra inputs for Devo Tx's
You can pull GND and PPM in from the 4-pin connector but not power :(.

Pull 5V from about anywhere you find it, you can see where I got it below.

Taranis X9E | DEVO 10 | Devo U7E | Taranis Q7

What I do in real life: rivergoequestrian.com/
Attachments:

Please Log in or Create an account to join the conversation.

More
26 Jul 2015 22:55 #36094 by Richard96816
Replied by Richard96816 on topic Extra inputs for Devo Tx's
I thought logic analyzers were $8 at banggood ... ?

Please Log in or Create an account to join the conversation.

More
26 Jul 2015 23:06 #36095 by robocog
Replied by robocog on topic Extra inputs for Devo Tx's
OMG! you guys are geniuses

So I need to get ordering...

Specifically the shopping list requires
Arduino 328p non onboard TTL?
2x Taranis plus pots (or a 3 pack)
Programmer for the arduino

I know its cheeky after you have done all this hard work
Do you have links to the items you got?

Looking at the following
Arduino: www.banggood.com/ATmega328P-Nano-V3-Cont...rduino-p-940937.html
Programmer: www.banggood.com/FT232RL-FTDI-USB-To-TTL...rduino-p-917226.html
Pots: www.hobbyking.co.uk/hobbyking/store/__55...de_Slider_2pcs_.html

Is this shopping list what I need to do the same?

Once again - Thanks for sharing this and making it happen
Regards
Rob

Please Log in or Create an account to join the conversation.

More
26 Jul 2015 23:18 #36097 by Cereal_Killer
Replied by Cereal_Killer on topic Extra inputs for Devo Tx's
The Nano V3 has an on board TTL converter so you wont need the programmer if you use it. I use the smaller (and ~$1 cheaper) pro mini, same MCU but no on board TTL. Turns out I used pot's from a 9X, not a taranis.

Pot's $4.50 shipped
www.hobbyking.com/hobbyking/store/__3951...ansmitter_3set_.html

Arduino pro mini $2.25 shipped
www.ebay.com/itm/Enhancement-Pro-Mini-3-...&hash=item33766cb5d8
(If you go with this one 9url=http://www.ebay.com/itm/Replace-FT232-6Pin-USB-2-0-to-TTL-UART-Module-Serial-Converter-CP2102-STC-/321546809495?pt=LH_DefaultDomain_0&hash=item4addaef097]you DO NEED the TTL converter[/url]


Each POT get's 5V and GND, the center pin's of them go to A1 and A2 (A0, A3, A4 and A5 can also be used for additional input's, the code posted above is setup so that you must start at A1...) D13 goes to the input (the black wire). Pull 5V and GND from anywhere convenient, that's it. Really couldnt be more simple!

Taranis X9E | DEVO 10 | Devo U7E | Taranis Q7

What I do in real life: rivergoequestrian.com/

Please Log in or Create an account to join the conversation.

Time to create page: 0.089 seconds
Powered by Kunena Forum