- Posts: 857
Extra inputs for Devo Tx's
- Deal57
- Offline
A few more questions to cogitate over: what is the source and spec for the various parts? I looked at pots on Mouser and Digikey and there are a lot of choices. I know it's a bit early, but is it more efficient to have code that allows just two pots OR four OR six, rather than code that allows whatever is installed? Would it make sense to decide on maybe 2 pots, 2 sliders and two switches (3-way?) as a standard?
You've done nice work!
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
I'm not sure switches will be included in the 6 add-on limit since they could be hooked to digital input's, they dont require an ADC. 6 POT's or sliders is only the limit because of the arduino's ADC pin's. I think for switches we'll be limited only by PPM in general, how many channels can standard PPM transmit before you start risking loosing resolution (not from the add-on to the TX but from the TX to the RX will be the limiting factor). I think I've read standard CPPM only does well up to 12 or 14 channels.
I posted the only two things you need in my last post on page 2, just the arduino and pot's, total cost eight bucks.
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
How much can we cram into this little beast?
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
Can you use the PPM data from a pot / slider you are using this method to add and use it to change trim and or rates of a stick? That would really be awesome!
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
Cereal_Killer wrote: 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)!
I did set the number of channels of course.. but the one pot moves all of them for me, at different rates and directions.
Maybe it's down to the pot I am using, it's only 100 ohm (but still goes the whole range from -100 to +100).
Please Log in or Create an account to join the conversation.
- Cereal_Killer
- Offline
Sorry to ask simple questions but you are running it at 5V and have 5V to the POT's right? And the arduino / pot's share a common ground with the Devo?
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.
- Epyon
- Offline
- Posts: 57
// Devo 7e PPM input
// For use with Arduino Nano V3.0
// Based on sketch by Ian Johnston
int AI_Pin_A1 = 1; // Analog In 1
int AI_Pin_A2 = 2; // Analog In 2
int AI_Raw_A1; // Analog In raw var - 0->1023
int AI_Raw_A2; // Analog In raw var - 0->1023
int A1_uS = 750; // Analog 1 uS var
int A2_uS = 750; // Analog 2 uS var
int sw1_uS = 750; // Switch 1
int sw2_uS = 750; // Switch 2
int sw3_uS = 750; // Switch 3
int sw4_uS = 750; // Switch 4
int sw5_uS = 750; // Switch 5
int sw6_uS = 750; // Switch 6
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
int outPinPPM = 10; // digital pin 10
int inPinD1 = 2; // digital pin 2
int inPinD2 = 3; // digital pin 3
int inPinD3 = 4; // digital pin 4
int inPinD4 = 5; // digital pin 5
int inPinD5 = 6; // digital pin 6
int inPinD6 = 7; // digital pin 7
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(inPinD1, INPUT); // sets the digital pin as input
digitalWrite(inPinD1, HIGH); // turn on pull-up resistor
pinMode(inPinD2, INPUT);
digitalWrite(inPinD2, HIGH);
pinMode(inPinD3, INPUT);
digitalWrite(inPinD3, HIGH);
pinMode(inPinD4, INPUT);
digitalWrite(inPinD4, HIGH);
pinMode(inPinD5, INPUT);
digitalWrite(inPinD5, HIGH);
pinMode(inPinD6, INPUT);
digitalWrite(inPinD6, HIGH);
// 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
// Channel 1 - Analog 1
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(A1_uS); // Hold for A1_uS microseconds
// Channel 2 - Analog 2
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(A2_uS); // Hold for A2_uS microseconds
// Channel 3 - Switch 1
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(sw1_uS); // Hold for sw1_uS microseconds
// Channel 4 - Switch 2
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(sw2_uS); // Hold for sw2_uS microseconds
// Channel 5 - Switch 3
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(sw3_uS); // Hold for sw3_uS microseconds
// Channel 6 - Switch 4
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(sw4_uS); // Hold for sw4_uS microseconds
// Channel 7 - Switch 5
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(sw5_uS); // Hold for sw5_uS microseconds
// Channel 8 - Switch 6
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(sw6_uS); // Hold for sw6_uS microseconds
// Synchro pulse
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH); // Start Synchro pulse
}
void loop() { // Main loop
// Read analog pins
AI_Raw_A1 = analogRead(AI_Pin_A1);
AI_Raw_A2 = analogRead(AI_Pin_A2);
// Map analog inputs to PPM rates for each of the channels
A1_uS = AI_Raw_A1 + pulseMin;
A2_uS = AI_Raw_A2 + pulseMin;
// Check limits
if (A1_uS <= 750) A1_uS = 750; // Min
if (A1_uS >= 1700) A1_uS = 1700; // Max
if (A2_uS <= 750) A2_uS = 750; // Min
if (A2_uS >= 1700) A2_uS = 1700; // Max
if (digitalRead(inPinD1) == 1) { // Switch 1
sw1_uS = 1700;
} else {
sw1_uS = 750;
}
if (digitalRead(inPinD2) == 1) { // Switch 2
sw2_uS = 1700;
} else {
sw2_uS = 750;
}
if (digitalRead(inPinD3) == 1) { // Switch 3
sw3_uS = 1700;
} else {
sw3_uS = 750;
}
if (digitalRead(inPinD4) == 1) { // Switch 4
sw4_uS = 1700;
} else {
sw4_uS = 750;
}
if (digitalRead(inPinD5) == 1) { // Switch 5
sw5_uS = 1700;
} else {
sw5_uS = 750;
}
if (digitalRead(inPinD6) == 1) { // Switch 5
sw6_uS = 1700;
} else {
sw6_uS = 750;
}
}
Please Log in or Create an account to join the conversation.
- robocog
- Offline
- went with the exact same ones you linked to
should save any head scratching extra debugging - thanks so much for this
You guys rock
Regards
Rob
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.
- aMax
- Offline
- Posts: 776
I would prefer the FTDI, because it is programmable and you could even updated the Frsky rx with this.
No need for a special programming tool.
Devo7e, TaranisQ X7, R9M , 4in1 MM, Futaba FC18plusV3.2 & DFT/FLD-02
Please Log in or Create an account to join the conversation.
- mwm
- Topic Author
- Offline
Cereal_Killer wrote: Ok here's a question for MWM or someone else really versed at setting up MUX's...
Can you use the PPM data from a pot / slider you are using this method to add and use it to change trim and or rates of a stick? That would really be awesome!
Yes. Well, sort of. This works on the 10 & 12 with the AUX inputs.
What you want is a mixer in a complex mix that uses one of your extra inputs as a source. For a trim, set the MUX to add, and the scale to something like 10. This will let you adjust the output by +/- 10 based on that input. There's an issue open to add a "center beep" for AUX inputs. That's probably my first-after-PB-does-a-release project, and we ought to be able to make it work on PPM inputs as well.
For a rate, set the MUX to mult, and then adjust the scale and offset to get the range you want. For instance, going from 20 to 100 would let you get rates from 20 to 100%, which seem popular with the toy quads.
Could you wire up a multi-position dial for use as a "rate" switch? Or better yet, a flight mode switch ?
Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.
My remotely piloted vehicle ("drone") is a yacht.
Please Log in or Create an account to join the conversation.
- Cereal_Killer
- Offline
Update, my next main goal is finding properly size / shape shoulder sliders (real sliders, not the "sliders" like from a Taranis) but I also want to make it work with head tracking (and then eventually buddy box as well). All that'll require is an extra PPM input on the arduino and then have it combine any channels coming in with it's own ADC data before sending it out. It could easily be done to even use the built in 3.5mm jack with some interesting wiring.
And yes, you could easily wire up a multi-position switch like that using digital pin's, it wouldnt even take up one of the 6 available analog in's. Code compiles to 97bites (just 4%) so there's PLENTY of room to grow with this. I'm not going to but it could be taken as far as a wireless buddy box using another radio module or somethin (yes a wireless solution already exists but not WITH 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.
- Epyon
- Offline
- Posts: 57
mwm wrote: Could you wire up a multi-position dial for use as a "rate" switch? Or better yet, a flight mode switch ?
Yep, I've got a 6-way switch in my abomination posted above.
Best part, since it basically works like six 2-way switches, I can get around the toggle icon limitations. I'll be working on my model.ini tonight after work.
If it all works as expected, I'm going to reposition/remove some switches so I can mount the pots & 6-way inside the radio.
Please Log in or Create an account to join the conversation.
- robocog
- Offline
I have done a quick sketch of what I can gather so far from your description, hope I'm on the right tracks
Not a clue on the wiring of the TTL USB to Arduino yet or what software I need to get the code onto it
That will be tonight's Googling
I guess slow boat from China will give me enough time to get up to speed by the time it gets here
Regards
Rob
Please Log in or Create an account to join the conversation.
- Deal57
- Offline
- Posts: 857
When a plug is inserted:
1. user needs PPM out - can this board function two ways? Even more, can Deviation use PPM In and PPM protocol at the same time? I tried to set up a model in the emulator to use PPM In and PPM protocol at the same time, and it appears to ignore PPM In.
2. user needs PPM in for head tracking, buddy box, whatever. Can you decode the inbound PPM stream and insert these controls?
I would think if the board can't support these functions that you'd want to either disable the jack or alternatively switch off the board when a plug is inserted.
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
Cereal_Killer wrote: How do you have it all wired then? Pic's?
Sorry to ask simple questions but you are running it at 5V and have 5V to the POT's right? And the arduino / pot's share a common ground with the Devo?
Yep. Although the 5V came from USB on the nano. I'm guessing its either the pot or the fact that the entire thing is dangling loosely around outside the transmitter.. was just a quick test build. I got the 9x pot set on the way from hobbyking (3 pots with knobs for ~$1.50, can't complain about that) and will be putting it together prettily before I try again.
Please Log in or Create an account to join the conversation.
- robocog
- Offline
Have downloaded the Arduino for Windows software and have run it and set the following
Board: "Arduino Pro or Pro Mini"
Processor "ATmega 328 5V 16mhz"
Can't go much further till I get the TTL programmer in I guess?
(I only have the option of com1 port)
Not a clue what to set the Programmer to - maybe the TTL USB wont show in the list of options till its plugged in?
I guess once this is done I copy and paste the code you have kindly shared into the textbox and click "burn bootloader" and it will do its stuff?
I have done another wiring diagram - can someone please confirm it looks correct ?
Sorry about all the newbie questions that may seem very obvious to the more experienced, but this is new ground for me
Also - last question for tonight I promise!
I do currently use the TX on a sim (Phoenix mainly) religiously every night for 15 mins at least
Will I have to have a switch to break the connection to the arduino (power or the PPM to TX) for when I use it on the sim or will it do no harm staying powered up and inline?
(my phoenix.ini on the TX will not use the pots if this makes any difference - eg will not be using PPM in and PPM out simultaneously)
Regards
Rob
Please Log in or Create an account to join the conversation.
- Deal57
- Offline
- Posts: 857
Does this require us to connect the jack's Tip wire (black) to one of the analog in and pass it to the PPM wire (13 on your illustration)? Could we use the relationship of the existing pins 3 and 4 to mitigate this?
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
You don't click burn bootloader, you click on the arrow icon ("Compile and upload").
As for using a sim, unless you absolutely need to use the dongle for DRM purposes, you can simply set the protocol to USB-HID and the devo 7e will work over the USB port as a standard game controller.
Please Log in or Create an account to join the conversation.
- Deal57
- Offline
- Posts: 857
I also found a way to use the existing DSC port; well, actually two ways, but I don't know which works best. If I pull the signal from the middle white wire high, then we'll know a plug is inserted when it goes low. So after family time this weekend I'll get that together.
Wow, love programming the Arduino! I can see a few of these in my future...
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.
- Home
- Forum
- Development
- Development
- Extra inputs for Devo Tx's