How to mix the input from two sticks to control 2 motors

er9x is the best known firmware. It has a superb range of features and is well supported by the community. Well worth trying out.
Post Reply
pstimpel
Posts: 10
Joined: Sat Oct 26, 2019 11:02 am
Country: -

How to mix the input from two sticks to control 2 motors

Post by pstimpel »

Hi,

I am sorry if I am using the wrong terms, but I am brand new to RC control hobby. Due this I do not even know what terms to search for.

I have two motors, two ESC, one FRSky x8r, and a turnigy 9x pro flashed with Er9x I got from a friend - using Mode 2. I am able to setup simple things like an RC car having one motor and one servo.

However, right I am doing a new project on my 3d printer, I want to build a bulldozer. The 3d modeling is going well, but I am struggling to setup the RC part. What I want:

left stick left/right: steering
right stick up down: throttle, forward/backwards

Each of the tracks of my bulldozer is run by its own motor, each motor has its own ESC.

Goal: if I push the right stick forward, both motors should turn "forward" the same speed. But if I use the left stick left/right, the motor of the inner side of the desired driving curve should go slower.

To make it more clear:
left stick / right stick / desired result

full left / up / drive forward, only the right motor, 100%
half left / up / drive forward, left motor 50%, right motor 100%
middle / up / drive forward, both motors 100%
half right / up / drive forward, left motor 100%, right motor 50%
full right / up / drive forward, only the left motor, 100%

Edit:this part is working adding the left stick in the mixer to both motor channels, and reverse the outcome on the second. However, it works forward this way, but not backwards.

I would need:
full left / down / drive backward, only the right motor, 100%
half left / down / drive backward, left motor 50%, right motor 100%
middle / down / drive backward, both motors 100%
half right / down / drive backward, left motor 100%, right motor 50%
full right / down / drive backward, only the left motor, 100%

The way using the added channel to the mixer of both motors is resulting in:
full left / down / drive backward, only the LEFT motor, 100%
...
full right / down / drive backward, only the RIGHT motor, 100%

Which is the wrong way. :(



I hope you get what I mean and can help me.

I appreciate any pointer to the right terms, or to manuals how to setup this using my hardware/software listed at the top of the posting.

Regards,
Peter

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

Re: How to mix the input from two sticks to control 2 motors

Post by jhsa »

Hi, welcome to the forum.
If you have the 9XR-PRO radio, then you have ErskyTX installed not Er9x.
ErskyTX is a more powerful version of Er9x. But there is only an Er9x manual at the moment.
The basic stuff, like the mixer is basically the same.

viewtopic.php?f=5&t=6473

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
pstimpel
Posts: 10
Joined: Sat Oct 26, 2019 11:02 am
Country: -

Re: How to mix the input from two sticks to control 2 motors

Post by pstimpel »

Thanks a lot, Joao. This is the manual I was aware of. However, I cannot figure out how to fix my problem. I wastrying curves. I am a software developer, and in a programming language I would just invert the added value if the original input was negative. I have no idea how to make that in ErskyTX.

I would have thought anyone running a tank as example, should run into this problem. Is this the wrong subforum? The one you linked to seems to be firmware development specific.

Regards
Peter
ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: How to mix the input from two sticks to control 2 motors

Post by ReSt »

one first trial could be:load the V-tail template.

Reinhard

Reversing a direction is either done in the limits menu (NOR/INV) or in a mix by changing the sign of an amount e.g. +100% => -100%
pstimpel
Posts: 10
Joined: Sat Oct 26, 2019 11:02 am
Country: -

Re: How to mix the input from two sticks to control 2 motors

Post by pstimpel »

Hi Reinhard,

That's not working as desired, unfortunately. It inverts the whole action. In pseudo code Im looking for something like this


if right stick > 0 then
outcome = rightstick + leftstick
else
outcome = rightstick - leftstick
endif

Regards
Peter

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

Re: How to mix the input from two sticks to control 2 motors

Post by jhsa »

That doesn't work that way :)

you could try only with one stick for now, and use the "Elevon" template. that will kinda work. but you are asking for some functionality that might require a little bit more effort :) Which is the positions you required, like full left/Up, right motor full and left stoped.. this together with the other requirements, and also backwards :)

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
pstimpel
Posts: 10
Joined: Sat Oct 26, 2019 11:02 am
Country: -

Re: How to mix the input from two sticks to control 2 motors

Post by pstimpel »

OK, so this is simply not available (yet). I was under assumption people driving tanks and bulldozers could have use for that. The mix you are mentioning is basically what I was setting up in the first place. It works for driving forward, and does the steering. But as soon as you go backwards, the steering is the wrong way, aka wrong direction.

Maybe I will push the values through something like an arduino to make such more complicated calculations then.

Another would be to use 2 sticks, left for left motor, and right for right motor But this means I would have to change the hardware setup of my controller each time I switch vehicles :)

Thanks, Joao.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: How to mix the input from two sticks to control 2 motors

Post by jhsa »

The radio can do that and much more. You have to learn how to do it.. :)
I have been looking at it, but did't have much time yet.
I never said that the radio couldn't do it.. :)

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
pstimpel
Posts: 10
Joined: Sat Oct 26, 2019 11:02 am
Country: -

Re: How to mix the input from two sticks to control 2 motors

Post by pstimpel »

I am glad I made it so far - by reading the manual and some try and error. But I cannot figure out what step is needed to complete the desired setup. Now, if someone has an idea and could share it with a poor soul, please.

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

Re: How to mix the input from two sticks to control 2 motors

Post by jhsa »

Try this. I am a bit rusty as I have been busy with other stuff :)

left motor on Ch 2, and right motor on Ch 4

Ch2 +100% Ele
+100% Rud Offset (-50%)

Ch4 +100% Ele
-100% Rud Offset (50%).

Like this it will probably work the way you want, at least forward :)
And if you give full left and full right with the throttle at center, it will spin like a io-io. :mrgreen:

João

EDIT: I think backwards it is turning the wrong direction, right?
Let me see
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
pstimpel
Posts: 10
Joined: Sat Oct 26, 2019 11:02 am
Country: -

Re: How to mix the input from two sticks to control 2 motors

Post by pstimpel »

Exactly, The forward part works fine, as expected. It is the backwards part that puzzles me, since it turns into the wrong direction.

Thanks for looking into it.

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

Re: How to mix the input from two sticks to control 2 motors

Post by jhsa »

Try some curves..

I will look into it again.. But am busy with other things as well :)

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
ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: How to mix the input from two sticks to control 2 motors

Post by ReSt »

Try the following:
CH01 -100% RUD
* +100% THR (This is a multiply mix!!)
+100% THR Curve(c9)

CH02 +100% RUD
* +100% THR (This is a multiply mix!!)
+100% THR Curve(c9)

Curve C9
100, 67, 33, 0,0,0,-33, -67, -100

The curve is not required, but gives you a wide dead zone around neutral, so that both motors can be stopped safely.

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

Re: How to mix the input from two sticks to control 2 motors

Post by jhsa »

Reinhard, that works, but he will have to invert both channels in the "Limits menu" otherwise the motors will run the opposite way.

Channel 1 is left motor, and channel 2 connects to the right motor.

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
pstimpel
Posts: 10
Joined: Sat Oct 26, 2019 11:02 am
Country: -

Re: How to mix the input from two sticks to control 2 motors

Post by pstimpel »

Oh, that was GOLD!

Cheers, Reinhard and Joao for coming up with a solution.

My final setup

CH1 left motor, CH2 right motor, ELE is the throttle stick, and RUD the steering stick

CH1 100 RUD
* 100 ELE
+ 100 ELE
CH2 -100 RUD
* 100 ELE
+ 100 ELE

Curves can be applied if needed, no INVERT needed.

Cheers, guys.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: How to mix the input from two sticks to control 2 motors

Post by jhsa »

Great.. :)
Now try to understand why it ts working.
And don't you ever dare to say again that there is something your radio can't do [emoji14] :mrgreen:

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: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: How to mix the input from two sticks to control 2 motors

Post by jhsa »

By the way, do you have "Eepskye" installed on your computer? If not, you should. You can program and simulate your models with it.

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
bob195558
Posts: 2376
Joined: Sun Dec 16, 2012 7:24 pm
Country: United States
Location: New England, Vermont
Contact:

Re: How to mix the input from two sticks to control 2 motors

Post by bob195558 »

If you do not, you can find it here: (http://www.er9x.com/).
You will have both eepe and eepSkye installed and just select eepSkye.
You will like it a lot. :)
Er9x on 9x radio, with Smartieparts Programmer and TelemetrEZ Board.
ErSky9x on Taranis, Sky9x, 9Xtreme radios.
3D-Printing: (https://openrcforums.com/forum/viewforum.php?f=129).
pstimpel
Posts: 10
Joined: Sat Oct 26, 2019 11:02 am
Country: -

Re: How to mix the input from two sticks to control 2 motors

Post by pstimpel »

OK, my radio can do it all :)

Giving the software a try, but have to finish the 3d model of my bulldozer first.
ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: How to mix the input from two sticks to control 2 motors

Post by ReSt »

@pstimpel:

The solution given above can slow the inner motor down to 0.

Here comes a more advanced setup that can drive the inner motor to full reverse speed.

This is what I have for a 2 motor ship, but in the endeffect does the same for a bagger or a tank. But in the moment this setup is for a mode 1 transmitter, that is throttlestick is on the right. But the left stick is used as throttle due to neutral in the middle and not at the end of the stickrange.

THR switch activates the motor,
RUD switch activates steering with left horizontal stick (inner motor slow down to 0),
AIL switch adds the right stick to enlarge the inner motor speed change down to full reverse speed. The effect of the right stick right/left depends on its up/down position. Fully down, the left/right effect is zero, fully up the left/right effect is 100%.


The effect of the two sticks is added,so both horizontal sticks fully in the same direction increase the effect of slowing down the inner motor so that the inner motor runs 100% backward, both sticks in opposite direction compensate the effect.

remove the curve and/or the slow/up/down from the mixes if you dont need them (slow and curve delay the reaction of the output channels. Was needed by my ESC's)

Code: Select all

Mixers
CH01 +100%CH15 Switch(THR) Curve(c9)
CH02 +100%CH16 Switch(THR) Curve(c9)
CH10 +50%Ail Switch(AIL) noTrim
* -100%Thr noTrim Offset(100%)
-100%Rud Switch(RUD) noTrim
* +100%Ele
CH12 -50%Ail Switch(AIL) noTrim
* -100%Thr noTrim Offset(100%)
+100%Rud Switch(RUD) noTrim
* +100%Ele
CH15 +100%Ele Slow(u2:d2)
+100%CH10 Slow(u2:d2)
CH16 +100%Ele Slow(u2:d2)
+100%CH12 Slow(u2:d2)
pt 1 pt 2 pt 3 pt 4 pt 5 pt 6 pt 7 pt 8 pt 9
Curve 9 100 67 33 0 0 0 -33 -67 -100
Reinhard
pstimpel
Posts: 10
Joined: Sat Oct 26, 2019 11:02 am
Country: -

Re: How to mix the input from two sticks to control 2 motors

Post by pstimpel »

Hey Reinhard,

This looks...crazy :) Thanks a lot, I will give it a try once the bulldozers gearbox and basic tracks are ready for a first test. :)

I was under the assumption I would start understand mixers :D
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: How to mix the input from two sticks to control 2 motors

Post by jhsa »

It is not that difficult if you understand the concept.. wait until you start using Logical switches :)

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
pstimpel
Posts: 10
Joined: Sat Oct 26, 2019 11:02 am
Country: -

Re: How to mix the input from two sticks to control 2 motors

Post by pstimpel »

Yep, I guess it would just need some more time. A basic understanding is there, already. Amazing, what one can do with this software. Well done, guys
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: How to mix the input from two sticks to control 2 motors

Post by jhsa »

Blame Mike for that :) :mrgreen:

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

Post Reply

Return to “er9x”