Hello guest, if you read this it means you are not registered. Click here to register in a few simple steps, you will enjoy all features of our Forum.
This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Remap motor outputs - use spare motor output pins
#1
I get asked quite often:

1. One of the motor output pins isn't working on my flight controller, how can I use a spare motor output pin instead?
2. I need to rotate my FC 180 degree, but the ESC signal pads on at the 4 corners, and I don't want to redo my soldering...

MMIX comes to your rescue!



How to Remap motor output pins

The answer is to use custom motor mixer, I explained how it works before:
https://oscarliang.com/custom-motor-outp...uadcopter/

Custom motor mixer is mainly used for adjusting the motor output power level, depends on the geometric location of the motors.
However you can use this tool to re-map your motors as well, whether it's because your motor pins is not working, or simply because your ESC cable is not long enough to reach the designated motor pins, you can remap the motor output and use any spare motor pins available on the board.



Go into CLI in Cleanflight, type in "mmix load quadx", you will get the motor mixer for a quadcopter X configuration.

[Image: UxkHEAJl.png]

The motor pins are in this order:
number 0 = motor pin 1
number 1 = motor pin 2
number 2 = motor pin 3 
number 3 = motor pin 4

For example, if your motor pin 1 is faulty, you can remap it to a spare motor pin such as 5 or 6... let's say you want to use pin 5, you should type in

mmix 4 1 -1 1 -1

(it's 4 because for motor pin 5 you need to go down 1 digit)

Using motor pin 6

If you want to use pin 6, the number in mmix should be 5.

mmix 5 1 -1 1 -1

BUT!!! That's won't work because you are not allowed to skip numbers in motor mix in cleanflight. You must also define mmix 4 if you wish to use mmix 5.

so really you should be typing in 

mmix 4 1 0 0 0
mmix 5 1 -1 1 -1

Cleanup
Not necessary, but I always do, is to clear the unused motor pin we have remapped from, in which case, it's motor pin 1 in our above example.

mmix 0 1 0 0 0

And Finally, enter save and press enter.
Don't be a LOS'er, be an FPV'er :)  My Gear - Facebook - Instagram - Twitter
[-] The following 1 user Likes Oscar's post:
  • Kerni_fpv
Reply
Login to remove this ad | Register Here
#2
Excellent tip  Smile
Reply
#3
Awesome Oscar, thanks. Too bad this isn't in the configurator and easy to do like it was in OP.
Reply
#4
Hello....

Kinda related...

Been trying to use mmix to change the direction of my motors, tried changing Yaw but they always spin in the same direction (in the motor tab on cleanflight & when armed). Mixer is definately set to custom. Ive tried re-calibrating the ESC's after making changes to mmix, and before you ask I am saving any changes in CLI. Any ideas?

Using:
Naze32
Dys XM20A ESCs
EMAX 2204 II motors (2CW & 2 CCW)

Just to add.... my motor rotations are fine with the built in quadx mix, and can also easily change the wiring to the motors as they're using 2mm bullets, but I just wanted to experiment changing the motor directions within cleanflight

Thanks
Reply
#5
Matty,

Changing the mmix in cleanflight/betaflight doesn't change the direction in which the motor spins.
What it does is tell the FC in what direction that motor is expected to spin.

Motor rotation mus be set either by swapping wires OR setting rotation in the ESC software like blheli suite.

Remember, MMIX is for telling the FC where the motors are, what power should be applied and on what rotational plane that power is expected to act upon or if it even has any effect on a certain axis (yaw, roll, pitch).

For example: I have a spider hex on which i have a custom mix as follows
# mixer
mixer CUSTOM
mmix reset
mmix 0 1.000 -0.590 0.746 -0.590
mmix 1 1.000 -0.785 -0.811 -0.785
mmix 2 1.000 0.590 0.746 0.590
mmix 3 1.000 0.785 -0.811 0.785
mmix 4 1.000 -1.000 0.000 1.000
mmix 5 1.000 1.000 0.000 -1.000

If you notice, Motors 4 & 5 have a value for Pitch of 0. Thats because thos motors are directly on the pitch axix and have no effect whatsoever. This value is telling the FC to not apply any power to these motors in any change of direction involving Pitch.

Same goes for Yaw: If you set yaw in the mmix wrong for a certain motor, you will see it still spins in the same direction BUT the copter will not be able to fly properly (most likely it would spin in one direction) because it thinks the yaw is going in a direction that is not real, so when it tries to compensate, it only makes things worse.

I'm no expert, anyone please correct me if i'm wrong.

Happy flying!

-Wolken
Reply
#6
dunno if i should stick either to 2.1 or 3.1 version ? >>O.o<<
Reply
#7
I asked myself LOL

Quote:I have to rotate my FC 180 degree around Yaw, But the ESC signal pads are at the 4 corners... so I might have to somehow swap ESC1 with ESC4, ESC2 to ESC3 ... I don't think that's even possible... right?

Or can I just leave the ESC numbering as it is, and just change the motor mixer (mmix), swapping motor output 1 with 4, and 2 with 3?

And yes, using mmix to swap the motor outputs of 1, 4 and 2, 3 does the trick.
Don't be a LOS'er, be an FPV'er :)  My Gear - Facebook - Instagram - Twitter
Reply
#8
In BF 3.1 you'll be able to reassign IO channels using new resource command in the CLI.
Reply
#9
(26-Oct-2016, 03:56 PM)AndreyM Wrote: In BF 3.1 you'll be able to reassign IO channels using new resource command in the CLI.

that's great news Smile
simplifies things a lot !
Don't be a LOS'er, be an FPV'er :)  My Gear - Facebook - Instagram - Twitter
Reply
#10
Wish there was a similar trick on KISS FC. PWM1 went dead a week ago practically grounding the quad, while 5 and 6 are perfectly fine.
The next build will be perfect! | Fleet and build info | YouTube Channel |
Reply
#11
I killed an esc and apparently output to motor#3. I tried to change it over to motor #5 but it doesn't appear to work.
I moved the wire then set it up this way
mmix 0 1.000 -1.000 1.000 -1.000
mmix 1 1.000 -1.000 -1.000 1.000
mmix 2 1.000 0.000 0.000 0.000
mmix 3 1.000 1.000 -1.000 -1.000
mmix 4 1.000 1.000 1.000 1.000

What did I miss?
Using an F303 and BetaFlight/X_RACERSPI 3.0.0 Sep 11 2016 / 00:45:14 (a21694b)

I don't get an error, but in betaflight configurator I now get 5 motors instead of 4, and 1,2,and 4 work but 3 and 5 don't

Any thoughts?
Thanks
Ringo
Reply
#12
Have you loaded the correct profile before changing and hit save afterwards?
All the best
Grzesiek (Grisha/ Greg)

Curently flyable: Nox 5, Minimalist 112
Bench / in progres: fixing Nox 3,  Scrap
thinking about building: 450


Reply
#13
Yes, this is what I did
mmix load quadx
mmix 4 1 1 1 1
mmix 2 1 0 0 0
save

and the result in CLI was
mmix 0 1.000 -1.000 1.000 -1.000
mmix 1 1.000 -1.000 -1.000 1.000
mmix 2 1.000 0.000 0.000 0.000
mmix 3 1.000 1.000 -1.000 -1.000
mmix 4 1.000 1.000 1.000 1.000
Reply
#14
I just watched a video that said you must do a "mixer custom" after the last mmix command. I tried that too and still nothing.


********NEVERMIND*******************
I'm an idot
The new ESC Didn't have multishot on it, that is why it was not working. I flashed it and now it works.
[-] The following 1 user Likes Ringo42's post:
  • Grisha0
Reply
#15
BUhahahahaha Smile
my kind of debugging, spending few hours/days on the problem which is in a different place, glad you got it sorted out Smile
now... VIDEO Smile
All the best
Grzesiek (Grisha/ Greg)

Curently flyable: Nox 5, Minimalist 112
Bench / in progres: fixing Nox 3,  Scrap
thinking about building: 450


Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Camera How to switch between digital (hdmi) and analog (av) outputs on camera TAIMOS 4 661 20-Oct-2023, 12:26 AM
Last Post: SnowLeopardFPV
  An easy way to solder to motor pads with slots Rob3ddd 5 721 08-Jan-2023, 02:54 PM
Last Post: iFly4rotors
  Is there an easy way to use a stepper motor instead of a servo? (via taranis or FC) salukikev 1 3,236 01-Feb-2021, 06:19 PM
Last Post: EVILsteve
  Motor What to do with motor with stripped mounting hole? Oscar 1 2,261 14-Mar-2019, 01:48 AM
Last Post: Jonosg
  Motor Brushless motor winding and rewinding DzikuVx 8 6,838 11-Feb-2018, 10:48 PM
Last Post: Dronenut


Login to remove this ad | Register Here