Use sticks not for servo position but for servo speed

Programing help and example for all firmwares based on thus's th9 firmware.
Post Reply
martinJhenne
Posts: 7
Joined: Sun May 13, 2012 6:48 pm
Country: -

Use sticks not for servo position but for servo speed

Post by martinJhenne » Sun May 13, 2012 9:50 pm

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

User avatar
MikeB
9x Developer
Posts: 15571
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

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

Post by MikeB » Sun May 13, 2012 10:34 pm

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.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
Kilrah
Posts: 9497
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

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

Post by Kilrah » Sun May 13, 2012 10:52 pm

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)
Attachments
Slew.eepe
(4.84 KiB) Downloaded 145 times

martinJhenne
Posts: 7
Joined: Sun May 13, 2012 6:48 pm
Country: -

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

Post by martinJhenne » Sun May 13, 2012 11:22 pm

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.

daklein
Posts: 18
Joined: Sun Dec 30, 2012 9:52 pm
Country: -

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

Post by daklein » Sat Feb 09, 2013 4:24 am

Great concept, thanks!


PoppyAnn
Posts: 19
Joined: Sun Aug 04, 2013 6:58 pm
Country: -

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

Post by PoppyAnn » Tue Apr 08, 2014 11:31 am

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

nigelsheffield
Posts: 308
Joined: Fri Nov 08, 2013 9:56 pm
Country: -

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

Post by nigelsheffield » Fri Feb 20, 2015 1:59 pm

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

davx
Posts: 210
Joined: Sun Sep 15, 2013 7:01 am
Country: -

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

Post by davx » Mon Feb 23, 2015 11:08 pm

Hi,

@nigelsheffield,
Just try the Mike version joined ;)

Rudder moves channel 10.

Bye
Attachments
Slew_Mike.eepe
(77.03 KiB) Downloaded 72 times

nigelsheffield
Posts: 308
Joined: Fri Nov 08, 2013 9:56 pm
Country: -

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

Post by nigelsheffield » Tue Feb 24, 2015 8:26 am

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.

nigelsheffield
Posts: 308
Joined: Fri Nov 08, 2013 9:56 pm
Country: -

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

Post by nigelsheffield » Tue Feb 24, 2015 9:40 am

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 143 times

nigelsheffield
Posts: 308
Joined: Fri Nov 08, 2013 9:56 pm
Country: -

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

Post by nigelsheffield » Tue Feb 24, 2015 9:44 am

I bet a lua script could do this though........

User avatar
MikeB
9x Developer
Posts: 15571
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

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

Post by MikeB » Tue Feb 24, 2015 10:30 am

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.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

Helle
Posts: 570
Joined: Sat Jul 21, 2012 7:08 am
Country: -

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

Post by Helle » Tue Feb 24, 2015 12:04 pm

Hy,

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

User avatar
IdefixRC
Posts: 16
Joined: Sun Nov 23, 2014 2:00 pm
Country: -
Contact:

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

Post by IdefixRC » Sat Jun 20, 2015 4:41 am

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.
FPV, RC, 3D Printing and more..........
Link to my YouTube Channel: http://goo.gl/4HrjtR
Link to my Thingiverse Page: http://goo.gl/cayWH5

Almarza
Posts: 2
Joined: Sun Jan 28, 2018 11:16 am
Country: -

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

Post by Almarza » Sat Jun 02, 2018 10:48 pm

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.

User avatar
Kilrah
Posts: 9497
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

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

Post by Kilrah » Sun Jun 03, 2018 5:49 am

Yes.

User avatar
jhsa
Posts: 17728
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

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

Post by jhsa » Sun Jun 03, 2018 9:35 am

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
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
jhsa
Posts: 17728
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

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

Post by jhsa » Sun Jun 03, 2018 10:48 am

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
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

Almarza
Posts: 2
Joined: Sun Jan 28, 2018 11:16 am
Country: -

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

Post by Almarza » 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

User avatar
SR71
Posts: 109
Joined: Tue Feb 28, 2012 10:21 pm
Country: Italy
Location: Rome

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

Post by SR71 » Tue Jun 05, 2018 5:29 pm

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

Post Reply

Return to “er9x / gruvin9x / th9 based firmwares”