Devo 8s Modifications - Adding AUX4 and AUX5

More
27 Feb 2013 12:51 - 27 Feb 2013 14:08 #7138 by RandMental
Hi

After being tempted by the Devo12 for a while, I decided why not upgrade my Devo8s hardware as we did to the Devo7e?

Thus the 2nd Devo8s arrived yesterday and first on the list is adding AUX4 and AUX5. Comparing the Devo 8 and Dev10 hardware there are only minimal differences and two analogue ports seems to be available:

GPIOA:
1: Buzzer
2: output to 0 to shut off Tx???
3: power-switch in 'off' position (goes high on 'off')
4: (ADC_IN_4) Not Used in Devo 8 (DEVO10 - AUX5)
5: (SPI1_SCK): SPI Flash, TSC2008
6: (SPI1_MISO): SPI Flash, TSC2008
7: (SPI1_MOSI): SPI Flash, TSC2008

GPIOC:
0: (ADC_IN_10): Elevator Stick
1: (ADC_IN_11): Rudder Stick
2: (ADC_IN_12): Aileron Stick
3: (ADC_IN_13): Throttle Stick
4: (ADC_IN_14): Battery Voltage
5: (ADC_IN_15): Not Used in Devo 8s (Devo10 - Left Vertical Stick, AUX4 is on GPIOC-0

I don't have Devo10, anyone willing to measure the resistance of the AUX4 and AUX5 potentiometers used in the Devo10? I guess it would be a linear type between 10k and 100kohm.

Any reason why I cannot uses these two inputs to add AUX4 and AUX5 to the Devo 8s or any other ideas for a Devo 8s "upgrade"?
Last edit: 27 Feb 2013 14:08 by RandMental.

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

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
27 Feb 2013 15:52 #7141 by rbe2012
Replied by rbe2012 on topic Devo 8s Modifications - Adding AUX4 and AUX5
I recently added a vibration motor at gpio PD2 (same location as in Devo10). Works perfect, only enabled vibration HAS_VIBRATING_MOTOR (and build some on/off-switching in deviation).
Soldering is a challenge.

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

More
27 Feb 2013 19:47 #7146 by -=Hubi-Dirk=-
Replied by -=Hubi-Dirk=- on topic Devo 8s Modifications - Adding AUX4 and AUX5
Hi rbe,

can you please give me more informations about build in a vibration motor at the 8s?

Thanks in advance,
Dirk

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

More
11 Apr 2013 23:08 #8876 by Felixrising
Replied by Felixrising on topic Devo 8s Modifications - Adding AUX4 and AUX5
+1 Please post pictures and descriptions for both the vibration motor mod and the Aux4 and Aux5 mods...

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

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
12 Apr 2013 05:25 - 12 Apr 2013 05:29 #8885 by rbe2012
Replied by rbe2012 on topic Devo 8s Modifications - Adding AUX4 and AUX5
Felix,
you can see pictures and some background infos for the vibrating motor here: devo-8-adding-a-vibration-motor .
The build for deviation 3.0.0 is here: updated-for-deviation-3-0 .
I do not know if RandMental has realized the AUX4/5. From the technical point of view it should be possible to use these ports (transferring the signal without interference could be a little challenge) and the programming seems mostly similar to the vibration mod.
Last edit: 12 Apr 2013 05:29 by rbe2012.

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

More
12 Apr 2013 11:39 - 12 Apr 2013 11:40 #8891 by RandMental
Replied by RandMental on topic Devo 8s Modifications - Adding AUX4 and AUX5

rbe2012 wrote: I do not know if RandMental has realized the AUX4/5. From the technical point of view it should be possible to use these ports


Hi guys, not yet, but it is on the list. I have done the module and power mods on the 7e. Over the next week or so it is the 8s due for surgery. How do they say: "real soon now"

When I do get to it, I'll do a photo instruction for the forum at the same time.
Last edit: 12 Apr 2013 11:40 by RandMental.

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

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
12 Apr 2013 12:34 - 12 Apr 2013 12:35 #8895 by rbe2012
Replied by rbe2012 on topic Devo 8s Modifications - Adding AUX4 and AUX5
That will be fine, I am also interested in this mod. Do you have special analog inputs you will use (potentiometers, sliders or whatever)?

EDIT: If necessary I could assist you in adapting the code.
Last edit: 12 Apr 2013 12:35 by rbe2012.

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

More
12 Apr 2013 12:53 #8896 by Gall
Where do you want to install these potentiometers physically?

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

More
12 Apr 2013 13:08 - 12 Apr 2013 13:12 #8897 by RandMental
Replied by RandMental on topic Devo 8s Modifications - Adding AUX4 and AUX5
Assistance with the code would be much appreciated - I have the embedded programming background and build Deviation from source, but I have not yet run changes on my TXs.

I hope to finalise the hardware Aux4/5 mod this weekend with the XL7105 installation - I shall confirm the final hardware definition as soon as finished, but it should be as indicated earlier in this topic.

Regarding the actual analogue input devices - I prefer normal rotary potentiometers, they are easy to adjust without looking, and hope for the Devo10 locations. I also need to trace the existing analogue design to ensure we use similar voltage/current levels, but also to ensure we do not increase the noise levels inside the TX. So twisted pair screened wired with the screen solder to ground on the PCB will be used.

(For interest my RF Module wiring are also shielded and not lose single wires as most photo's on the forum shows. I hate to think what those square wave SPI pulses trains do to the Devo analogue and stick values)
Last edit: 12 Apr 2013 13:12 by RandMental.

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

More
13 Apr 2013 22:54 - 15 Apr 2013 18:41 #8920 by RandMental
Replied by RandMental on topic Devo 8s Modifications - Adding AUX4 and AUX5
Potentiometers for Aux4 and Aux5 on the Devo8s

The existing potentiometers for the sticks are 1.2k ohm linear types.
They are fed with 3.3Volt, sliders go to the CPU pins via 100ohm resistor with a 100nF capacitor to ground as protections and a 16kHz RC lowpass filter.

To fit into the Devo8s enclosure in the same place where Aux4 and Aux5 are located on the Devo10, panelmount versions with maximum diameter of 18mm are required.

Aux4: Connect to CPU pin 34
Aux5: Connect to CPU pin 29







For the Devo8S hardware definition and upgrades on one document, see pdf attached.
Attachments:
Last edit: 15 Apr 2013 18:41 by RandMental.

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

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
15 Apr 2013 06:32 #8948 by rbe2012
Replied by rbe2012 on topic Devo 8s Modifications - Adding AUX4 and AUX5
Nice. For the code we would have to define two new input channels. This is done in capabilities.h. The input itself is initialized and read in channels.c.
We would have a deeper look into the gui to see where changes for the number of inputs should be made.

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

More
15 Apr 2013 15:23 - 15 Apr 2013 15:24 #8959 by RandMental
Replied by RandMental on topic Devo 8s Modifications - Adding AUX4 and AUX5
I have looked at the Devo10 code to see how it handles the 2 extra channels, but thinking about it now, the Devo12 would be a better start point. I stopped last night when I could not figure out why there is an analogue channel 16 at the end of the channel sequence array. With no channel 16 on the hardwareI guess it is an EOF type magic number. I'll do some more research tonight from the Devo12 side.
Last edit: 15 Apr 2013 15:24 by RandMental.

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

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
15 Apr 2013 16:46 #8961 by rbe2012
Replied by rbe2012 on topic Devo 8s Modifications - Adding AUX4 and AUX5
I have identified so far three positions where we have to modify the code. I have made a clone of your repo. This is my actual diff:
diff --git a/src/target/common_emu/fltk.cpp b/src/target/common_emu/fltk.cpp
--- a/src/target/common_emu/fltk.cpp
+++ b/src/target/common_emu/fltk.cpp
@@ -248,6 +248,8 @@
     gui.elevator = 5;
     gui.aileron  = 5;
     gui.rudder   = 5;
+    gui.aux4     = 5;
+    gui.aux5     = 5;
     switch(Transmitter.mode) {
     case MODE_1:
     case MODE_3:
diff --git a/src/target/devo8/capabilities.h b/src/target/devo8/capabilities.h
--- a/src/target/devo8/capabilities.h
+++ b/src/target/devo8/capabilities.h
@@ -3,6 +3,8 @@
   CHANDEF(ELEVATOR)
   CHANDEF(THROTTLE)
   CHANDEF(RUDDER)
+  CHANDEF(AUX4)
+  CHANDEF(AUX5)
   CHANDEF(RUD_DR0)
   CHANDEF(RUD_DR1)
   CHANDEF(ELE_DR0)
diff --git a/src/target/devo8/channels.c b/src/target/devo8/channels.c
--- a/src/target/devo8/channels.c
+++ b/src/target/devo8/channels.c
@@ -19,7 +19,7 @@
 #include "config/tx.h"
 #include "../common_devo/devo.h"
 
-const u8 adc_chan_sel[NUM_ADC_CHANNELS] = {13, 11, 10, 12, 16, 14};
+const u8 adc_chan_sel[NUM_ADC_CHANNELS] = {13, 11, 10, 12, 4, 15, 16, 14};
 
 void CHAN_Init()
 {
@@ -31,6 +31,8 @@
     gpio_set_mode(GPIOC, GPIO_MODE_INPUT, GPIO_CNF_INPUT_ANALOG, GPIO1);
     gpio_set_mode(GPIOC, GPIO_MODE_INPUT, GPIO_CNF_INPUT_ANALOG, GPIO2);
     gpio_set_mode(GPIOC, GPIO_MODE_INPUT, GPIO_CNF_INPUT_ANALOG, GPIO3);
+    gpio_set_mode(GPIOC, GPIO_MODE_INPUT, GPIO_CNF_INPUT_ANALOG, GPIO5); // AUX4 = C5
+    gpio_set_mode(GPIOA, GPIO_MODE_INPUT, GPIO_CNF_INPUT_ANALOG, GPIO4); // AUX5 = A4
     /* Enable Voltage measurement */
     gpio_set_mode(GPIOC, GPIO_MODE_INPUT, GPIO_CNF_INPUT_ANALOG, GPIO4);
 
@@ -53,6 +55,9 @@
     case INP_ELEVATOR: value = adc_array_raw[2]; break;
     case INP_AILERON:  value = adc_array_raw[3]; break;
 
+    case INP_AUX4:     value = adc_array_raw[4]; break;
+    case INP_AUX5:     value = adc_array_raw[5]; break;
+
     case INP_RUD_DR0:  value = gpio_get(GPIOC, GPIO8); break;
     case INP_RUD_DR1:  value = ! gpio_get(GPIOC, GPIO8); break;
 
diff --git a/src/target/devo8/target_defs.h b/src/target/devo8/target_defs.h
--- a/src/target/devo8/target_defs.h
+++ b/src/target/devo8/target_defs.h
@@ -22,7 +22,7 @@
 #define MAX_POINTS 13
 #define NUM_MIXERS ((NUM_OUT_CHANNELS + NUM_VIRT_CHANNELS) * 4)
 
-#define INP_HAS_CALIBRATION 4
+#define INP_HAS_CALIBRATION 6
 
 /* Compute voltage from y = 0.0021x + 0.3026 */
 #define VOLTAGE_NUMERATOR 210
diff --git a/src/target/emu_devo8/channels.c b/src/target/emu_devo8/channels.c
--- a/src/target/emu_devo8/channels.c
+++ b/src/target/emu_devo8/channels.c
@@ -25,6 +25,9 @@
         case INP_ELEVATOR: return CHAN_MIN_VALUE + step * gui.elevator;
         case INP_AILERON:  return CHAN_MIN_VALUE + step * gui.aileron;
 
+        case INP_AUX4:     return CHAN_MIN_VALUE + step * gui.aux4;
+        case INP_AUX5:     return CHAN_MIN_VALUE + step * gui.aux5;
+
         case INP_RUD_DR0:  return gui.rud_dr ? CHAN_MIN_VALUE : CHAN_MAX_VALUE;
         case INP_RUD_DR1:  return gui.rud_dr ? CHAN_MAX_VALUE : CHAN_MIN_VALUE;
With these changes in the emulator AUX4 and AUX5 can be chosen as mixer input and they are shown in the input monitor.
For modifying the values in the emulator some changes are necessary in fltk.cpp. You can use 't' and 'g' for AUX4 and 'y' and 'h' for aux5.

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

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
15 Apr 2013 16:50 #8962 by rbe2012
Replied by rbe2012 on topic Devo 8s Modifications - Adding AUX4 and AUX5

RandMental wrote: ...figure out why there is an analogue channel 16 at the end of the channel sequence array...


Forgot to mention: ADC channel 16 is the internal channel for measuring chip temperature. It has no pin for input.

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

More
15 Apr 2013 19:27 - 15 Apr 2013 19:54 #8968 by RandMental
Replied by RandMental on topic Devo 8s Modifications - Adding AUX4 and AUX5

rbe2012 wrote: Forgot to mention: ADC channel 16 is the internal channel for measuring chip temperature. It has no pin for input.


Thanks, one more thing I learned...

I applied the patch, but you are a bit quick for me, I still need to do the fine soldering to actually test on the Devo8. The Emulator however seems to work correct as far as I could see.

If you agree, I think we should make (and maintain) a single Dev08s patch file for both the Vibration motor and the AUX4/AUX5 mods. We would need two versions: one for the latest PB code and one for the latest official release. In tx.ini users they can then enable the mods they made.

What do you think?
Last edit: 15 Apr 2013 19:54 by RandMental.

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

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
20 Apr 2013 08:01 #9070 by rbe2012
Replied by rbe2012 on topic Devo 8s Modifications - Adding AUX4 and AUX5
I'm sorry; I forgot this post...

For the vibration motor I see no problem. I have still some hope that PB will integrate this in the main code because it doesn't cost much.
AUX4/5 can take more effort to integrate. I am not ready looking through the code. I am afraid I will have to do the mod by myself to make sure my programming will be correct... will search for the necessary hardware...
If it is done, maintaining and offering patches will be quite similar to the vibrating thing (but getting it into the main code is doubtful).

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

More
20 Apr 2013 08:56 #9071 by RandMental
Replied by RandMental on topic Devo 8s Modifications - Adding AUX4 and AUX5
I agree, I did notice you have already a pull request for the vibration motor, lets leave the AUX4/5 patch for later and proper testing.

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

More
31 Jan 2014 06:55 #19470 by PatrickN
Replied by PatrickN on topic Devo 8s Modifications - Adding AUX4 and AUX5
Hey there,

is there any progress in adding AUX4/5?
I got a Devo8s and would like to add an analog Channel.
Soldering is no Problem, but how about the Code?

Greetings

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

More
01 Feb 2014 18:27 - 01 Feb 2014 18:57 #19607 by RandMental
Replied by RandMental on topic Devo 8s Modifications - Adding AUX4 and AUX5
I/O (Pin) Mapping update for the Devo8 to include vibration and AUX4 and AUX5

Edit - I see the PDF file did not load - renaming it


File Attachment:

File Name: Devo8s-Har....pdf.txt
File Size:231 KB
Attachments:
Last edit: 01 Feb 2014 18:57 by RandMental.

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

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
01 Feb 2014 19:26 - 01 Feb 2014 19:27 #19612 by rbe2012
Replied by rbe2012 on topic Devo 8s Modifications - Adding AUX4 and AUX5
No eBay APP ID défined in Kunena configurationVibrating is included in the actual code base, but the additional analog channels are not. If there are enough interests PB might consider to integrate it.
For me it could be an interesting thing to add a video game joystick like this one:

at the back of the tx to control a camera gimbal without taking my fingers off the sticks.
Last edit: 01 Feb 2014 19:27 by rbe2012.

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

Time to create page: 0.089 seconds
Powered by Kunena Forum