Extra inputs for Devo Tx's

More
26 Jul 2015 23:21 #36098 by Deal57
Replied by Deal57 on topic Extra inputs for Devo Tx's
OK, I see where the power comes from. For data we can pretty easily build a m-f 4-pin cable so you don't have to cut the existing PPM cable. For power it seems soldering is the only way. I guess I'd like to test it with the power from the CYRF... Seems there was a thread some time ago about power demands, and in any case we need to get an idea how much impact it has on overall battery life. My preference would be to construct a cable that could just plug into a (90 degree) header on the board and reduce solder errors. I have most of the parts here, and I can send a pic when I get it together.

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.

More
26 Jul 2015 23:29 #36099 by Cereal_Killer
Replied by Cereal_Killer on topic Extra inputs for Devo Tx's
At this point my next goal is two sliders, I've briefly looked for proper sized sliders before but didnt find anything I was willing to spend money on at that time. Anyone got any sources for good [small] sliders that can go on the shoulders?

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.

More
27 Jul 2015 00:26 #36105 by Deal57
Replied by Deal57 on topic Extra inputs for Devo Tx's
Well, we're also running out of feature space on the 7e Deviation code, so how bout just three pots (since that's what's in the HK pack) and two sliders (presuming we find them)? Set it up that way and anyone who wants it different can always make their own changes. I'm thinking another three-way switch might be good, so I'll try that when I have the parts.

How much can we cram into this little beast? B)

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
27 Jul 2015 00:30 #36106 by Cereal_Killer
Replied by Cereal_Killer on topic Extra inputs for Devo Tx's
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!

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
27 Jul 2015 01:11 #36110 by Arakon
Replied by Arakon on topic Extra inputs for Devo Tx's

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.

More
27 Jul 2015 01:15 - 27 Jul 2015 01:19 #36111 by Cereal_Killer
Replied by Cereal_Killer on topic Extra inputs for Devo Tx's
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?

Taranis X9E | DEVO 10 | Devo U7E | Taranis Q7

What I do in real life: rivergoequestrian.com/
Last edit: 27 Jul 2015 01:19 by Cereal_Killer.

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

More
27 Jul 2015 03:56 - 27 Jul 2015 03:58 #36118 by Epyon
Replied by Epyon on topic Extra inputs for Devo Tx's
Here's my lil' Frankenstein........

File Attachment:



// 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;
 } 
}
Last edit: 27 Jul 2015 03:58 by Epyon.

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

More
27 Jul 2015 07:50 #36130 by robocog
Replied by robocog on topic Extra inputs for Devo Tx's
All parts ordered :woohoo:
- went with the exact same ones you linked to
should save any head scratching extra debugging - thanks so much for this
You guys rock :silly:

Regards
Rob

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

More
27 Jul 2015 14:07 #36145 by Cereal_Killer
Replied by Cereal_Killer on topic Extra inputs for Devo Tx's
Just want to make sure if you guy's dont know, the arduino I posted on the last post of page 2 DOES NOT have an on board TTL converter, if you buy it you'll need something like a CP2102 or a FDTI to program 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
27 Jul 2015 14:40 #36148 by aMax
Replied by aMax on topic Extra inputs for Devo Tx's
Anyway, a TTL converter is a must for everyone tinkering with fpv and drones
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.

More
27 Jul 2015 15:25 #36154 by mwm
Replied by mwm on topic Extra inputs for Devo Tx's

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 :cheer: ?

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.

More
27 Jul 2015 15:45 - 27 Jul 2015 15:50 #36163 by Cereal_Killer
Replied by Cereal_Killer on topic Extra inputs for Devo Tx's
Ok that's good to hear.

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/
Last edit: 27 Jul 2015 15:50 by Cereal_Killer.

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

More
27 Jul 2015 16:31 - 27 Jul 2015 16:31 #36167 by Epyon
Replied by Epyon on topic Extra inputs for Devo Tx's

mwm wrote: Could you wire up a multi-position dial for use as a "rate" switch? Or better yet, a flight mode switch :cheer: ?


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.
Last edit: 27 Jul 2015 16:31 by Epyon.

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

More
27 Jul 2015 17:24 #36171 by robocog
Replied by robocog on topic Extra inputs for Devo Tx's
Yep I did order the TTL USB programmer thingy

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 :D

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.

More
27 Jul 2015 17:48 - 27 Jul 2015 17:49 #36172 by Deal57
Replied by Deal57 on topic Extra inputs for Devo Tx's
I have some Molex 2mm 4 position connectors so I've been trying to see what needs to be done to keep the DSC port usable while using this add-on. The jack uses two wires to detect when a plug is inserted (the outside two white wires are shorted).

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!!
Last edit: 27 Jul 2015 17:49 by Deal57.

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

More
28 Jul 2015 04:28 #36221 by Arakon
Replied by Arakon on topic Extra inputs for Devo Tx's

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.

More
28 Jul 2015 21:27 - 28 Jul 2015 21:44 #36271 by robocog
Replied by robocog on topic Extra inputs for Devo Tx's
The parts I ordered have all shipped so I'm potentially a couple of weeks away from turning the soldering iron and having a go

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 :D

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
Last edit: 28 Jul 2015 21:44 by robocog.

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

More
28 Jul 2015 22:20 #36275 by Deal57
Replied by Deal57 on topic Extra inputs for Devo Tx's
Your question is a better way to put my first one. You'll need to insert a plug to use the 7e as a controller for a sim. So when the plug is inserted, we can tell by checking whether the outside two white wires (I call them pins 3 and 4; black is 1 and the other, 2, isn't used) are shorted. What will happen with this board? I am pretty sure you'll still be able to set PPM out for your model in Devo, but you cannot have PPM as the protocol and use PPM In at the same time (as near as I can tell), so the new extra switches won't be available. In Cereal_Killer's photos the black is cut, so how do we get that connected?

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.

More
29 Jul 2015 04:04 - 29 Jul 2015 04:05 #36285 by Arakon
Replied by Arakon on topic Extra inputs for Devo Tx's
The USB converter's port won't show up on arduino until you actually plug it in and restart the software.
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.
Last edit: 29 Jul 2015 04:05 by Arakon.

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

More
01 Aug 2015 16:56 #36437 by Deal57
Replied by Deal57 on topic Extra inputs for Devo Tx's
Got the parts! :P

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.

Time to create page: 0.083 seconds
Powered by Kunena Forum