er9X: How to use gimbal/pot to control servo speed?

Programing help and example for all firmwares based on thus's th9 firmware.
Post Reply
Iksbob
Posts: 121
Joined: Wed Dec 28, 2011 1:06 pm
Country: -

er9X: How to use gimbal/pot to control servo speed?

Post by Iksbob »

Hey folks. I recently installed a PSP joystick on the back of my '9X with the intention of using it for pan/tilt camera control. Rather than have the stick position directly control servo position, I would like it to control how fast the servo is moving in a particular direction. With the stick at center, the servo holds its current position (whatever that may be) rather than return to center as typical mixing would have it do. Moving the stick up or down a little starts the servo moving slowly up or down. Moving the stick to an extreme starts the servo moving quickly in that direction.
So I guess I'm looking for a mix that will add the current stick position value to the servo value. If the stick is positive, it progressively increases the servo value. If the stick is negative, it progressively decreases the servo value. If the stick is center (zero), the servo value stays constant.
Wait... that sounds like calculus. Rassafrackin identities. -_-;

User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: er9X: How to use gimbal/pot to control servo speed?

Post by Rob Thomson »

Pretty sure this has already been asked - and template for it in the templates section?

Sent from my GT-I9300 using Tapatalk 2
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
Iksbob
Posts: 121
Joined: Wed Dec 28, 2011 1:06 pm
Country: -

Re: er9X: How to use gimbal/pot to control servo speed?

Post by Iksbob »

Pretty sure? I'm not seeing anything that stands out as a solution or related topic.
Perhaps you could point me at the appropriate thread?
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: er9X: How to use gimbal/pot to control servo speed?

Post by Rob Thomson »

This help?

http://openrcforums.com/forum/viewtopic ... eed#p11442

Found it on page one of the search results when searching for "servo speed"

But not in templates.

If you get yours working - do you mind uploading a template?

Rob
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: er9X: How to use gimbal/pot to control servo speed?

Post by ReSt »

This is what you probably are looking for. Found in my repository of tips:
Try the following mixes on your camera channel (CH16 in this 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.
Use sticks not for servo position but for servo speed
by Kilrah » Sun May 13, 2012 11: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)

Reinhard

Iksbob
Posts: 121
Joined: Wed Dec 28, 2011 1:06 pm
Country: -

Re: er9X: How to use gimbal/pot to control servo speed?

Post by Iksbob »

That did the trick. I never thought of setting a channel as its own source. It makes perfect sense from a programmer's perspective, but I guess I had the impression that the values were more abstracted somehow.
The value associated with SW1 even acts as a dead band at the center of the stick - the PSP stick has a lot of slop as far as its center point goes, so that's a big plus.

Post Reply

Return to “er9x / gruvin9x / th9 based firmwares”