- Posts: 291
Extra inputs for Devo Tx's
- Epitaph
- Offline
Remember, when I was having more problems with the 2S and the pots direct from what I thought was 5V regulated then, the problem was actually having 8+V on the pots, and 4.8 on the PPM output.
From what I see, if the PPM out and the pots voltage are within a margin of each other there is no problem. If the voltage on the pots is too much higher than the PPM out, then it reaches the end before the pot does, and if the PPM out is too much higher than the pot voltage, then it doesn't even reach the end of the -100 to 100 scale.
From this, and what Deal57 has just said, I would elaborate that when you have your power from 4x NiMH batteries, then the PPM out is only 3.6V and therefore you need less voltage on the pots to make it work. On the other hand, when you're feeding the transmitter from a 2S, then the PPM out goes up to 4.8V, and the pots need to be such also for it to work. As long as you keep to either way there shouldn't be a problem. Wiring direct means that you can wire it for ONLY LiPo or ONLY NiMH... But if you're only going to stick to one type of power supply without switching from one or the other, then what's the point of worrying... a change would only have to be made if you decide to change from NiMH to LiPo for example.
I might make the change if I can find some decent 14500 Li-Ion batteries that actually have the capacity that is stated on them and not the fraction they usually hold, and in this case, I would have 8V going into the Arduino, 4.8 coming from the PPM out, and therefore I would need to either find a trusty 5V source on the transmitter, or use a pololu to feed the pots. But until then...
Please Log in or Create an account to join the conversation.
- Epitaph
- Offline
- Posts: 291
I have fully charged the battery, which is showing 5.75V on the screen, and now the pots are ranging from -100 to 76, they don't go all the way up to 100. I have just tried the PPM out voltage and it's registering as 4.29V
By the looks of it, the voltage out for this to work properly has to be 5V on the arduino constant, as if it is too high, the range shortens, and if it drops too much, it will just not reach the end of the pot travel. The voltage of the pots is constant via the gimbal pots, it's just the feed to the Arduino that needs to be regulated. So, either a 5V constant feed needs to be found on the board to solve the issue, or the Pololu regulator would be the only option...
Please Log in or Create an account to join the conversation.
- Epitaph
- Offline
- Posts: 291
So, I was thinking, I wouldn't need a regulator to keep it at 5V independently on if it's higher or lower, all I would need is a step up and wire it into a 3.24V point on the transmitter, which will always be such no matter what battery I use. So I was thinking about getting a step-up from Banggood (who give no problem shipping to my actual address), but I'm trying to find a regulated one... seems they all have USB ports which is all good and well, but they usually turn out to give 5.2V or something like that, never spot on 5V, so it would be too much...
I have found one in Ebay which is REALLY cheap and adjustable... I wonder what you guys think (yeah, I know, Pololu is quality and all that, but they don't want to sell me it, then I don't want it, and especially at their shipping prices!!)
Regulator
Please Log in or Create an account to join the conversation.
- Richard96816
- Offline
- Posts: 208
ams.com/eng/Products/Position-Sensors/Ma...ition-Sensors/AS5040
Please Log in or Create an account to join the conversation.
- Epyon
- Offline
- Posts: 57
I put one in my 8. The only thing I use it for so far is to select model config (for the Arduino).Richard96816 wrote: Been thinking about encoders lately. Thought something like this might be interesting/useful:
ams.com/eng/Products/Position-Sensors/Ma...ition-Sensors/AS5040
These are the cheapies I got, they work good so far.
www.aliexpress.com/item/Rotary-encoder-s...ndle/1545402448.html
Please Log in or Create an account to join the conversation.
- Cereal_Killer
- Offline
m.aliexpress.com/item/1476952050.html?pr...ail2mobilesitedetail
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.
- Epitaph
- Offline
- Posts: 291
My stepup finally arrived, and it was a total disaster... I got a dud!! No matter what I set it up with, the output is 0.2V lower than the input, and that is supposedly stepping UP!!
Anyway, rather than mess around with that, I decided to change the battery type on my transmitter to make it easier to solve the issue, as well as making the transmitter lighter, and also faster to charge, as well as freeing up 4 NiMH batteries that are pretty good (Turnigy LSD 2400mAh) for other applications like Rx packs on slopesoarers.
As I said before, I don't like the idea of having a huge battery just hanging on the back because it doesn't fit anywhere else, I am a bit of a neat freak when it comes to these things and I like a smart finish to everything. So, I've opted to go with removing the battery cage inside the transmitter, and putting a 2S Li-Ion battery inside which doesn't give any problems with charging if it's charged properly and slowly (like 2 or 3 hours charge, which is still a LOT faster than NiMH!!). I opted for a DSLR camera battery, specifically a 2100mAh Olympus spare battery that has good reviews, although we'll see as to the capacity being what it really says. The battery comes with 4 pins, which is the typical 3 like cellphone batteries have, plus the series pin, meaning I can just add a 2S balance wire to it and have that accessible via the battery flap on the bottom of the transmitter, and I wouldn't have to open the transmitter at all (something I wouldn't do with a LiPo, I don't like the idea of charging LiPo inside the transmitter). I can just fix it to the inside of the transmitter case with a little hot glue, and wire it directly into the JST inside.
After the battery is fitted, just add a UBEC to reduce down to 5V, which I found a nice small one which a friend of mine got one of and reduces down to 4.99V, which is perfect for feeding the Arduino with.
One question I was thinking about, not for this particular transmitter as I have it perfect with 2 POTs as is, but if I decide to use this application somewhere else, can you use digital pots with it, as in one button for up and one button for down?? Might be good for things like flaps and stuff with just 2 push buttons on the back of a transmitter you can control with a finger? Or, even better, can you add 2 push buttons straight into the Arduino and have a sketch that would output a PPM channel in the same way a digital pot would do? If so, then it could even be adapted to the user's use, like how many steps from minimum to maximum according to preference... something like what the trim buttons do.
Please Log in or Create an account to join the conversation.
- Epitaph
- Offline
- Posts: 291
I'm trying to figure out an Arduino code to add switches via PPM to a Devo F4... I have modified a code from here (can't remember what page or who wrote it) to add in two 2-way switches to the original sketch, giving a total of two pots, two 2-way switches and two 3-way switches... I have very little experience with writing Arduino, so I basically copied what was already on and adjusted as I thought it should be. Can someone check me on it to see if it's right?
Pin A1 = Pot 1 (channel 1)
Pin A2 = Pot 2 (channel 2)
Pin 2 = 3-way switch #1 position 1 (channel 3)
Pin 3 = 3-way switch #1 position 3 (channel 3)
Pin 4 = 3-way switch #2 position 1 (channel 4)
Pin 5 = 3 way switch #2 position 3 (channel 4)
Pin 6 = 2-way switch #1 position 1 (channel 5)
Pin 7 = 2-way switch #2 position 1 (channel 6)
Pin 10 = PPM out
// Devo 7e PPM input
// For use with Arduino Nano V3.0
// Based on sketch by Ian Johnston
// Analog pin assignments
int AI_Pin_A1 = 2; // potentiometer #1 pin
int AI_Pin_A2 = 3; // potentiometer #2 pin
int AI_Raw_A1; // Analog In raw var - 0->1023....
int AI_Raw_A2;
int A1_uS = 750; // potentiometer #1 us
int A2_uS = 750; // potentiometer #2 us
int sw1_uS = 750; // 3-way switch #1 us
int sw2_uS = 750; // 3-way switch #2 us
int sw3_uS = 750; // 2-way switch #1 us
int sw4_uS = 750; // 2-way switch #2 us
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
// Digital pin assignments
int outPinPPM = 10; // PPM out
int inPinD2 = 2; // 3-way switch #1 pin for position 1. Positions 1 and 3 combine for middle position.
int inPinD3 = 3; // 3-way switch #1 pin for position 3
int inPinD4 = 4; // 3-way switch #2 pin for position 1
int inPinD5 = 5; // 3-way switch #2 pin for position 3
int inPinD6 = 6; // 2-way switch #1 pin for position 1
int inPinD7 = 7; // 2-way switch #2 pin for position 1
ISR(TIMER1_COMPA_vect) {
ppmoutput(); // Jump to ppmoutput subroutine
}
void setup() {
pinMode(outPinPPM, OUTPUT); // sets the digital pin as output
pinMode(inPinD2, INPUT); // sets the digital pin as input
digitalWrite(inPinD2, HIGH); // turn on pull-up resistor
pinMode(inPinD3, INPUT);
digitalWrite(inPinD3, HIGH);
pinMode(inPinD4, INPUT);
digitalWrite(inPinD4, HIGH);
pinMode(inPinD5, INPUT);
digitalWrite(inPinD5, HIGH);
pinMode(inPinD6, INPUT);
digitalWrite(inPinD6, HIGH);
pinMode(inPinD7, INPUT);
digitalWrite(inPinD7, 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 routine
// 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 - 3-way switch #1
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(sw1_uS); // Hold for sw1_uS microseconds
// Channel 4 - 3-way switch #2
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(sw2_uS); // Hold for sw2_uS microseconds
// Channel 5 - 2-way switch #1
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(sw3_uS); // Hold for sw3_uS microseconds
// Channel 6 - 2-way switch #2
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(sw4_uS); // Hold for sw4_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;
// Potentiometer limits
if (A1_uS <= 750) A1_uS = 750; // Min
if (A1_uS >= 1625) A1_uS = 1625; // Max
if (A2_uS <= 750) A2_uS = 750;
if (A2_uS >= 1625) A2_uS = 1625;
// 3-way switch #1
if (digitalRead(inPinD2) == 0) {
sw1_uS = 750;
}
if ((digitalRead(inPinD2) == 1) && (digitalRead(inPinD3) == 1)) {
sw1_uS = 1190; // Center us, may need to adjust this
}
if (digitalRead(inPinD3) == 0) {
sw1_uS = 1625;
}
// 3-way switch #2
if (digitalRead(inPinD4) == 0) {
sw2_uS = 750;
}
if ((digitalRead(inPinD4) == 1) && (digitalRead(inPinD5) == 1)) {
sw2_uS = 1190; // Center us, may need to adjust this
}
if (digitalRead(inPinD5) == 0) {
sw2_uS = 1625;
}
// 2-way switch #1
if (digitalRead(inPinD6) == 0) {
sw2_uS = 750;
}
if ((digitalRead(inPinD6) == 1) && (digitalRead(inPinD6) == 1)) {
sw2_uS = 1625;
}
// 2-way switch #2
if (digitalRead(inPinD7) == 0) {
sw2_uS = 750;
}
if ((digitalRead(inPinD7) == 1) && (digitalRead(inPinD7) == 1)) {
sw2_uS = 1625;
}
}
The choice of pins aren't final, I might change them once I get to soldering... it's mainly the adjustments in the code I made for the 2-way switches I added to see if it's correct.
Thanks
Please Log in or Create an account to join the conversation.
- ursus69
- Offline
- Posts: 143
It's possible to add pots to Devo7e without arduino??...like 2x3 switch mod...?
Please Log in or Create an account to join the conversation.
- Epitaph
- Offline
- Posts: 291
Please Log in or Create an account to join the conversation.
- Cereal_Killer
- Offline
If you can code I think you may potentially be able to swap one of the original 2-way switches for a pot* but no one has ever done that so it'd literally be all on you (and not and all worth it when this is a tried and true method that just works and all for <$10 in parts).
*but even with the stock 2-way switches, those could also be digital pins, I just don't know if the little F103C8T6 has any more ADC's than the 4 for the sticks.
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
@Epitaph: the arduino code you listed is basically the code I used. So you should be good to go... you may need to tweak the PPM input delta and center. I also built a smaller version with 2 pots and 1 3-way switch on a Digispark if space is an issue.
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.
- Epitaph
- Offline
- Posts: 291
I don't have a problem with room with this particular application as it's for a Devo F4, which is half empty inside, so plenty of space!!
Please Log in or Create an account to join the conversation.
- ursus69
- Offline
- Posts: 143
Please Log in or Create an account to join the conversation.
- mwm
- Topic Author
- Offline
Deal57 wrote: @Ursus69: If you wish to solder directly to the processor, there are two pins that have been used for analog input. However it isn't part of the 7e build now and we don't know if it'll be too large. So the solution Epitaph is showing is the working alternative.
For those who haven't heard yet - once the release happens, the 7E will probably vanish from the nightly build. There's literally no space left in it at all, and it's holding back development. There are some things on my todo list that will get some room back, but if they don't free up enough space for the 7E to build again, it may not be in the release after that.
The button matrix stuff is particularly nasty. The extra switch inputs on the 6 are normal switches, so I can use one for a third extra module without changing the code. You can't even do that with the button matrix "switches".
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.
- Fernandez
- Offline
- Posts: 983
But we continue new builds for the ultimate 7e, everyone who likes to get most out, has to solder the new cpu in.
With some tutorial and youtube instruction, it is not rocket science, cpu cost only few bucks pretty sure that many of us will do the cpu mod.
7e is just so nice to carry and comfortable light controller, many love it!! And deviation is fantastic!
Please Log in or Create an account to join the conversation.
- HappyHarry
- Offline
- Posts: 1136
Please Log in or Create an account to join the conversation.
- Epitaph
- Offline
- Posts: 291
Really, if you want a transmitter that gives you so much more, then you shouldn't stop at just a cheap $60 one from some chinese online shop... why don't those people save their money from a couple of crappy RTFs and buy a Devo 10 for example, and that way be able to have the room to do so much more...
The whole getting more and more when you have so much on the 7E just really doesn't make any sense to me, especially with how great it is a transmitter now with Deviation and the available mods!! I love mine to take in a backpack on a walk with a small model, or especially for slopesoaring, as it's nice and light and takes up very little room, but for a more going out and travelling to fly transmitter, I would go for something bigger, and in fact I do already with my MPX
Please Log in or Create an account to join the conversation.
- ursus69
- Offline
- Posts: 143
Fernandez wrote: Why not freeze the latest nightly build or the new V5 deviation release for devo 7e as final build?
But we continue new builds for the ultimate 7e, everyone who likes to get most out, has to solder the new cpu in.
With some tutorial and youtube instruction, it is not rocket science, cpu cost only few bucks pretty sure that many of us will do the cpu mod.
7e is just so nice to carry and comfortable light controller, many love it!! And deviation is fantastic!
It would be great!!
Please Log in or Create an account to join the conversation.
- mwm
- Topic Author
- Offline
Fernandez wrote: Why not freeze the latest nightly build or the new V5 deviation release for devo 7e as final build?
Um, isn't that what "may vanish after the next release" means?
7e is just so nice to carry and comfortable light controller, many love it!! And deviation is fantastic!
But it's no smaller and far less capable than a 6S. Which makes me think that most people love it because it's cheap.
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.
- Home
- Forum
- Development
- Development
- Extra inputs for Devo Tx's