If you enjoy our forum, why not join us? :) Click here to register in a few simple steps

Login to remove this ad | Register Here
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.



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.
A better FPV'er than LOS'er :) -- My Fleet
[-] The following 1 user Likes Oscar's post:
  • Kerni_fpv
#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
Login to remove this ad | Register Here
#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
Login to remove this ad | Register Here
#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.
A better FPV'er than LOS'er :) -- My Fleet
Reply
#8
In BF 3.1 you'll be able to reassign IO channels using new resource command in the CLI.
Reply
#9
(10-26-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 !
A better FPV'er than LOS'er :) -- My Fleet
Reply
Login to remove this ad | Register Here
#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, Nox 3
Bench / in progres: ZMRX(scrap build)
thinking about building: 450
Reply
Login to remove this ad | Register Here
#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, Nox 3
Bench / in progres: ZMRX(scrap build)
thinking about building: 450
Reply
Login to remove this ad | Register Here


Possibly Related Threads...
Thread Author Replies Views Last Post
  FC Custom Right-angle Header Pins sloscotty 5 496 08-18-2016, 02:33 PM
Last Post: Grisha0
  FC Low profile Naze32 motor pins soldering fpvmonkey 3 817 01-23-2016, 10:22 AM
Last Post: dougroundup