Hardware Modification / Rotary Pot

More
06 Nov 2012 09:43 #2719 by flyguy
Hardware Modification / Rotary Pot was created by flyguy
Hi all,

is it generally possible to modify the hardware and add a rotary pot or something similar as input source? Maybe instead of one of the D/R switches?

Thanks for your replies!

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

More
06 Nov 2012 09:51 #2720 by FDR
Replied by FDR on topic Hardware Modification / Rotary Pot
Well, I think it is not that easy.

The switches are tied to a matrix drived and scanned by digital IOs, but a pot should be tied to the analogue input of the ADC, and supplied with some regulated voltage.
There might be unused ADC inputs, but they are probably grounded, so you probably have to seriously modify the PCB and solder to the MCU's pins...

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

More
06 Nov 2012 10:01 #2721 by flyguy
Replied by flyguy on topic Hardware Modification / Rotary Pot
that really sounds not easy, but i already expected something like this.

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

More
06 Nov 2012 10:14 #2722 by flyguy
Replied by flyguy on topic Hardware Modification / Rotary Pot
I'm looking for a way having a throttle limiter. Is it possible to set it up with the current mixer? It could also be controlled by some trim button, if a real hardware pot is too hard to get.

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

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
06 Nov 2012 11:58 - 06 Nov 2012 11:58 #2723 by rbe2012
Replied by rbe2012 on topic Hardware Modification / Rotary Pot
PB has shown a complex method to use trims (look at his post #2130 ).
Last edit: 06 Nov 2012 11:58 by rbe2012. Reason: (Typo)

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

More
06 Nov 2012 12:10 #2724 by FDR
Replied by FDR on topic Hardware Modification / Rotary Pot
Using trims as "analogue" input is easy, however using that value for limiting a channel value is challenging.
You could easily use it for scaling, but I haven't found out yet how to use it for limiting...

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

More
06 Nov 2012 12:39 #2725 by Gall
Replied by Gall on topic Hardware Modification / Rotary Pot
You may use an additional small MCU like ATtiny to convert the signal into digital form. Then connect it to the UART.

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

More
06 Nov 2012 13:03 #2727 by flyguy
Replied by flyguy on topic Hardware Modification / Rotary Pot
i already managed using the trims as input, but i also couldn't figure out, how i could use the mixer to achieve limiting.

Using a uC to transform the signal is a good idea, but i have no clue how it could be wired up to the devo electronics (depending on the devo mcu capabilities, it might even not necessary to use a separate uC or am I wrong?)

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

More
06 Nov 2012 13:58 #2729 by PhracturedBlue
Replied by PhracturedBlue on topic Hardware Modification / Rotary Pot
the switches are actually not part of the button matrix, but none of the switches are connected to pins that can be reconfigured for analog, so it isn't possible to replace them with dials. There are no pinned-out pins that would be capable of this, so adding a dial would involve some very delicate soldering work.

to be clear you want to take the input of a channel (say a virtual trim) and use it as the max value for another channel?

I can't think of a way to do that with the currently available curves, but I could probably add a new capability to support it. file an enhancement request on bitbucket and I'll give it some thought.

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

More
06 Nov 2012 14:03 #2731 by flyguy
Replied by flyguy on topic Hardware Modification / Rotary Pot

to be clear you want to take the input of a channel (say a virtual trim) and use it as the max value for another channel?


exactly! I will create an enhancement request. Thanks a lot!

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

More
06 Nov 2012 20:49 #2739 by PhracturedBlue
Replied by PhracturedBlue on topic Hardware Modification / Rotary Pot
I've spent some time looking at this, and I don't see an easy way to implement it with our current mixer as a curve. However, I was almost able to get it to work properly by chaining mixers together. Here's how:

we have a stick input: thr
we have a limit input : lim (which youcan define using trims for instance)

we want:
if (thr < lim) then output = thr
if (thr >= lim) then output = lim

We can achieve this with the existing capabilities as follows:
VirtCh1 = thr - lim
complex mix:
page1:src=thr
page2:src=lim,scale=-100,mux=add
OutputCh = VirtCh1 * (if VirtCh1 <= 0 then 1 else 0) + lim
complex mix:
page1:src=VirtCh1
page2:src=VirtCh1, curve = zero-max, scale=-100, offset=100, mux=mult
page3:src=lim, mux=add

This actually works well, except that the mixer applies a cutoff of -100 to 100 after each operation. so if lim = 80 and thr = -40, we end up with (thr-lim) < -100 and it gets truncated, making the code not work as expected

So we can fix it as follows:
VirtCh1 = 0.5*thr -0.5*lim
complex mix:
page1:src=thr, scale = 50
page2:src=lim,scale=-50,mux=add
OutputCh = VirtCh1 * (if VirtCh1 <= 0 then 1 else 0) + lim
complex mix:
page1:src=VirtCh1
page2:src=VirtCh1, curve = zero-max, scale=-100, offset=100, mux=mult
page3:src=lim, scale=50, mux=add
Then set a final scalar (on the limit page) for OutputCh to 200%

Here is a demonstration model.ini that sets THR as the input (Ch1), AIL as the limit (CH2) VirtCh=Ch3, OutputCh=Ch4.

I don't see an easy way to implement this as a push-button solution, but I may be able to build a template that will at least do an initial configuration.
I will also look into whether I should not truncate the intermediate stages when building a mixer. I have a feeling there is a reason I did that, but maybe not.
Attachments:

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

More
07 Nov 2012 11:29 #2744 by flyguy
Replied by flyguy on topic Hardware Modification / Rotary Pot
thanks a lot for that, i will try it out in the evening!

i also took a look at the STM32F103VCT6 datasheet and some pictures of the Devo 8S pcb (didn't open mine yet). Can you tell me to which are the pin used for analogue input?

According to the code, it's Port C, GPIO 0-3, so Pins 15-18? I think it should be possible to add some tiny wires to the uC and get access to some unused analogue pin?! I'm not so deep into hardware hacking, but i have some avr experience and did a lot of smd soldering during the last years and i really like voiding warranties :)

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

More
07 Nov 2012 13:22 - 07 Nov 2012 13:25 #2747 by HornetMaX
Replied by HornetMaX on topic Hardware Modification / Rotary Pot
Honestly I haven't played with Deviation mixer stuff at all hence I may just be talking garbage here, but from what I've read in the manual, wouldn't the easiest way to implement a limiter (i.e. an input limiting the max output of an output channel) be the following:

- Add a mux type MAX (or LIMIT) to the existing mux types (REPLACE, MULTIPLY, ADD).

Does not seem very complicate, neither to code nor to understand. Anything I'm missing ?

MaX ( :side: )
Last edit: 07 Nov 2012 13:25 by HornetMaX.

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

More
07 Nov 2012 17:22 #2761 by PhracturedBlue
Replied by PhracturedBlue on topic Hardware Modification / Rotary Pot

HornetMaX wrote: Honestly I haven't played with Deviation mixer stuff at all hence I may just be talking garbage here, but from what I've read in the manual, wouldn't the easiest way to implement a limiter (i.e. an input limiting the max output of an output channel) be the following:

- Add a mux type MAX (or LIMIT) to the existing mux types (REPLACE, MULTIPLY, ADD).

Does not seem very complicate, neither to code nor to understand. Anything I'm missing ?

MaX ( :side: )

The problem is that you need a input-controlled limit.
The mixer defines functions which are of the form:
f1(x) <+/*> f2(y) <+/*> f3(z) ...
but you need one that is
f(x,y)
As I've shown above, it is complicated but can be achieved.

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

More
08 Nov 2012 08:04 - 08 Nov 2012 15:04 #2775 by HornetMaX
Replied by HornetMaX on topic Hardware Modification / Rotary Pot

PhracturedBlue wrote: The problem is that you need a input-controlled limit.
The mixer defines functions which are of the form:
f1(x) <+/*> f2(y) <+/*> f3(z) ...
but you need one that is
f(x,y)


Well, if you think at the operator "min" or "max" just like another operator as "+" or *" (or "replace"), then you could write:


f1(x) <+/*/min/max> f2(y) <+/*/min/max> f3(z) ...

Simple example:

f1(x) min f2(y)

with more readable prefix notation for the "max" operator this would be just:

min(f1(x),f2(y))

In this case, input x limits input y (or viceversa).

More complex example:

f1(x) min f2(y) + f3(z)

which would mean (with some assumptions on the application order of the operators):

min(f1(x),f2(y)+f3(z))

In this case input x limits the sum of inputs y and z.

Where's the problem ?

There's some complexity to handle, for example you may want to have symmetrical limits for positive and negative values, so you may have 2 additional operators (e.g. maxsym and minsym), but still it's much much easier to understand than your (clever) solution.

MaX.
Last edit: 08 Nov 2012 15:04 by HornetMaX.

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

More
08 Nov 2012 13:07 #2781 by PhracturedBlue
Replied by PhracturedBlue on topic Hardware Modification / Rotary Pot
The complexity is in the guts of how the mixer works. you are right though, that one way to do this is to create new functions in addition to replace/add/mult, called 'min' and 'max', and that should work quite well.

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

Time to create page: 0.058 seconds
Powered by Kunena Forum