Extra inputs for Devo Tx's
- Cereal_Killer
- Offline
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/
Please Log in or Create an account to join the conversation.
- Cereal_Killer
- Offline
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/
Please Log in or Create an account to join the conversation.
- Deal57
- Offline
- Posts: 857
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.
- Cereal_Killer
- Offline
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.
- Arakon
- Offline
- Posts: 305
Please Log in or Create an account to join the conversation.
- Arakon
- Offline
- Posts: 305
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.
- Cereal_Killer
- Offline
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.
- Deal57
- Offline
- Posts: 857
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.
- Arakon
- Offline
- Posts: 305
Please Log in or Create an account to join the conversation.
- Cereal_Killer
- Offline
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/
Please Log in or Create an account to join the conversation.
- Arakon
- Offline
- Posts: 305
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.
Please Log in or Create an account to join the conversation.
- Cereal_Killer
- Offline
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.
- Arakon
- Offline
- Posts: 305
Please Log in or Create an account to join the conversation.
- Cereal_Killer
- Offline
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/
Please Log in or Create an account to join the conversation.
- Cereal_Killer
- Offline
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.
- Deal57
- Offline
- Posts: 857
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.
- Cereal_Killer
- Offline
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/
Please Log in or Create an account to join the conversation.
- Richard96816
- Offline
- Posts: 208
Please Log in or Create an account to join the conversation.
- robocog
- Offline
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.
- Cereal_Killer
- Offline
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.
- Home
- Forum
- Development
- Development
- Extra inputs for Devo Tx's