Page 1 of 1

Use sticks not for servo position but for servo speed

Posted: Sun May 13, 2012 9:50 pm
by martinJhenne
Hi Folks,

normaly the stick position represents a servo position. For camera control i need something different:
The more you push the stick, the faster the servo should change its position. If the stick is back in neutral, the servo should keep its last position.

Is this possible with the firmware?


Thanks,
Martin

Re: Use sticks not for servo position but for servo speed

Posted: Sun May 13, 2012 10:34 pm
by MikeB
Try the following mixes on your camera channel (CH16 in thsi example)
+100% CH16
+2% RUD Switch SW1
R +100% FULL Switch SW2
R -100% FULL Switch SW3

SW1: |v|>ofs RUD 1
SW2: v>ofs CH16 100
SW3 v<ofs CH16 -100

First mix holds the channel
2nd mix adds a bit of the rudder stick in, more stick quicker moving.
3rd and 4th mixes stop the channel value going past 100%, otherwise it would and then would not move back immediately. (Limits stop the servo output, not the channel value)

SW1: detects when RUDder stick not centre
SW2 and SW3 detect the camera channel reaching full movement.

Play with the 2% in the second mix for different speed of movement. If it is too much, you will need to use another channel, e.g.
CH15: +20% RUD
then use CH15 instead of RUD in the 2nd mix. 2% of 20% is 0.4%.

Mike.

Re: Use sticks not for servo position but for servo speed

Posted: Sun May 13, 2012 10:52 pm
by Kilrah
Awesome question!

I use that regularly for my gimbals, but since no radio could do that I designed a receiver-side module for it long ago... never thought about trying on the 9x now!

And yes it works! Here's my solution on open9x, assuming camera channel is CH1 and controlled by rudder stick:

Code: Select all

Custom Switches:
SW1: |v|>ofs RUD 1
SW2: |v|<ofs CH16 100

Mixers:
CH1:   +100%CH16
          +2%RUD Switch(SW1)
CH16: +100% CH1 Switch(SW2) Slow(u1:d1)

Re: Use sticks not for servo position but for servo speed

Posted: Sun May 13, 2012 11:22 pm
by martinJhenne
Thank you so much Mike and Kilrah.
Such a quick reply an such amazing result - I'm impressed :-)

I knew the firmware could handle this ;-) EPIC.

Re: Use sticks not for servo position but for servo speed

Posted: Sat Feb 09, 2013 4:24 am
by daklein
Great concept, thanks!

Re: Use sticks not for servo position but for servo speed

Posted: Tue Apr 08, 2014 11:31 am
by PoppyAnn
Again many thanks Mike and Kilrah i am going to try the same mix for a bulldozer i have built out of lego.

regards Poppy Ann

Re: Use sticks not for servo position but for servo speed

Posted: Fri Feb 20, 2015 1:59 pm
by nigelsheffield
I just tried this on taranis, it works but at either end it bounces back and forth to 84 and 100 if I hold the stick at end and any time I let go it can be at anything from 84 to 99.
This was using kilrah s version

Re: Use sticks not for servo position but for servo speed

Posted: Mon Feb 23, 2015 11:08 pm
by davx
Hi,

@nigelsheffield,
Just try the Mike version joined ;)

Rudder moves channel 10.

Bye

Re: Use sticks not for servo position but for servo speed

Posted: Tue Feb 24, 2015 8:26 am
by nigelsheffield
Thanks, that worked fine in opentx.
on the taranis it is too fast, only the slightest of touches on the stick sends the servo to full deflection quite quickly and so very small movements are needed.
I will play about and see if I can make it work better.
Kirah version works at a nice pace.

Re: Use sticks not for servo position but for servo speed

Posted: Tue Feb 24, 2015 9:40 am
by nigelsheffield
OK ,
I figured out a better version, based on Mikes,
this works much better on tx, looks very slow on opentx but where it matters on tx it is fine.
It does bounce a little at either end but only by .1% or so.
It uses another channel utulising 500 travel and mixing it down with 20%.
Slew.eepe
(76.03 KiB) Downloaded 539 times

Re: Use sticks not for servo position but for servo speed

Posted: Tue Feb 24, 2015 9:44 am
by nigelsheffield
I bet a lua script could do this though........

Re: Use sticks not for servo position but for servo speed

Posted: Tue Feb 24, 2015 10:30 am
by MikeB
I just tried this on eepe.

CH16:
+100% CH16
+2% RUD Switch SW1
R +100% FULL Switch SW2
R -100% FULL Switch SW3

CH15: +100% FULL Switch SW4 slow(u0:d1)


SW1: |v|>ofs RUD 1 AND SW4
SW2: v>ofs CH16 100
SW3 v<ofs CH16 -100
SW4 v<val CH15 98

Channel 15 and SW4 provide timing to limit the response on the Taranis.

Mike.

Re: Use sticks not for servo position but for servo speed

Posted: Tue Feb 24, 2015 12:04 pm
by Helle
Hy,

you can combine it with a expo curve too for smoother reaction

Re: Use sticks not for servo position but for servo speed

Posted: Sat Jun 20, 2015 4:41 am
by IdefixRC
Hi,

wanted to quickly post my configuration which is based on the ones above.

Background:
CH6 controls my Gimbal (Gimbal FW is set to position mode = gimbal will tilt and stop based on the position of the stick/side lever).
As this makes filming flyovers rather difficult due to the need to smoothly move the stick in accordance with the speed of the vehicle, I was looking for an option to toggle between both modes.

Thanks guys for providing the solution above (Mike, the last solution you posted above did not work for me as the movement is not smooth - it jumps in accordance with the steps due to the delay I believe).

Here is what I did:

CH6 = Gimbal Channel
SE Switch = Toggle between position and speed mode
LS Slider = used to tilt the camera

Mixes:

CH6 (CamTil)
LS Weight(+100%) Switch(!SE↓) NoTrim
CH16 Weight(+20%) Switch(SE↓) NoTrim

CH15
LS Weight(+30%) NoTrim

CH16
CH16 Weight(+100%)
CH15 Weight(+2%) Switch(L10)
R MAX Weight(+500%) Switch(L11)
R MAX Weight(-500%) Switch(L12)

Logical Switches
L10: |a|>x LS 1
L11: a>x CH6 100
L12: a<x CH6 -100

Change the weight in the CH15 mix to adjust the speed of the movement.

I hope this helps someone.

Re: Use sticks not for servo position but for servo speed

Posted: Sat Jun 02, 2018 10:48 pm
by Almarza
Hello, can I program something like this direct on a taranis X9E with the original firmware?
I have some 1/87 scale models rc conversions, and this way to control a servo is perfect for cranes and excavators. Thanks in advance.

Re: Use sticks not for servo position but for servo speed

Posted: Sun Jun 03, 2018 5:49 am
by Kilrah
Yes.

Re: Use sticks not for servo position but for servo speed

Posted: Sun Jun 03, 2018 9:35 am
by jhsa
I think he was asking how to do it as well? :)
I don't remenber how to, but I think Mike made an example a few years ago, but is was for Er9x/ErSky9x.. I think it should work the same in OpenTX.
I will look at some examples I have been gathering all over the years to see if I have this one. Unless Mike post it before of course.. :)

João

Re: Use sticks not for servo position but for servo speed

Posted: Sun Jun 03, 2018 10:48 am
by jhsa
Ha,ha, ha :mrgreen: i didn't realize we are already in the right thread where Mike explained how to do it.. :D
I did a search, and it brought me exactly to this same thread :) ;)

João

Re: Use sticks not for servo position but for servo speed

Posted: Tue Jun 05, 2018 4:22 pm
by Almarza
Thank you very much, I have a very very limited space in my models. Normally I use planetary gear motors for almost all the movements I need, but this motors are very expensive and requires an extra ESC for motor(more space). Many times a cheap micro servo can do the work, but my problem is control that like a real machine. Here you can see my last crane truck over my X9E...
https://youtu.be/4j5C2Bn8CAw

Re: Use sticks not for servo position but for servo speed

Posted: Tue Jun 05, 2018 5:29 pm
by SR71
Almarza wrote:
Tue Jun 05, 2018 4:22 pm
Thank you very much, I have a very very limited space in my models. Normally I use planetary gear motors for almost all the movements I need, but this motors are very expensive and requires an extra ESC for motor(more space). Many times a cheap micro servo can do the work, but my problem is control that like a real machine. Here you can see my last crane truck over my X9E...
https://youtu.be/4j5C2Bn8CAw
OFF TOPIC
Almarza, let me say your truck is simply great !
/OFF TOPIC

Re: Use sticks not for servo position but for servo speed

Posted: Thu Jun 13, 2019 5:59 am
by mclags
Hi all, I'm using this for pan tilt turret control on a build in doing.
Using the ail stick for pan and ele for tilt.

Basically I've just set it up as Mikes first post only in opentx.

Problem is that when the servo hits the end of its travel it goes nuts.

Setup as follows
Ch1 is ail stick for pan
(duplicate setup for ch2 on tilt but with logic switches 4,5,6)

Ch1 100
+= 1 Ail L01
+= 100 Ail L02
+= -100 Ail L03

L01 lal>x Ail 1
L02 a>x Ch1 100
L03 a<x Ch1 -100

What did I miss here?

Re: Use sticks not for servo position but for servo speed

Posted: Thu Jun 13, 2019 7:49 am
by ReSt
These two mixes must be of type "Replace", not "ADD"
+= 100 Ail L02
+= -100 Ail L03

Reinhard

Re: Use sticks not for servo position but for servo speed

Posted: Thu Jun 13, 2019 7:52 am
by mclags
Awesome!
How do I change that?

Re: Use sticks not for servo position but for servo speed

Posted: Thu Jun 13, 2019 8:03 am
by ReSt
In the mixer setup there is the "Multiplex" selection with "ADD", "Multiply" and "Replace"

Select "Replace" and it will show the line with ":=" instead of "+="

Reinhard

Re: Use sticks not for servo position but for servo speed

Posted: Thu Jun 13, 2019 8:06 am
by mclags
Brilliant! Thanks a bunch!

Re: Use sticks not for servo position but for servo speed

Posted: Thu Jun 13, 2019 10:32 pm
by mclags
Just changed the the adds to replaces.
Servo no longer goes crazy, but, now when it hits 100 either end it shoots back to centre ish. +-15

Re: Use sticks not for servo position but for servo speed

Posted: Fri Jun 14, 2019 6:41 am
by Kilrah
The replace mixes need to have MAX as source, you used Ail...

Re: Use sticks not for servo position but for servo speed

Posted: Fri Jun 14, 2019 6:45 am
by mclags
Righto, I'll give that a bash shortly
Cheers