Posts: 5,315 Threads: 672 Likes Received: 3,155 in 1,743 posts Likes Given: 2,030 Joined: Jan 2016 Reputation: 139 19-Feb-2016, 12:35 AM (This post was last modified: 25-Oct-2016, 12:30 PM by Oscar.) 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. Posts: 918 Threads: 83 Likes Received: 533 in 271 posts Likes Given: 498 Joined: Jan 2016 Reputation: 30 19-Feb-2016, 05:50 AM (This post was last modified: 19-Feb-2016, 11:51 AM by Oscar.) Excellent tip • Posts: 2 Threads: 0 Likes Received: 0 in 0 posts Likes Given: 0 Joined: Jan 2016 Reputation: 0 Awesome Oscar, thanks. Too bad this isn't in the configurator and easy to do like it was in OP. • Posts: 1 Threads: 0 Likes Received: 0 in 0 posts Likes Given: 0 Joined: Mar 2016 Reputation: 0 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 • Posts: 69 Threads: 15 Likes Received: 1 in 1 posts Likes Given: 0 Joined: Jan 2016 Reputation: 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 • Posts: 21 Threads: 2 Likes Received: 4 in 2 posts Likes Given: 30 Joined: Sep 2016 Reputation: 0 dunno if i should stick either to 2.1 or 3.1 version ? >>O.o<< • Posts: 5,315 Threads: 672 Likes Received: 3,155 in 1,743 posts Likes Given: 2,030 Joined: Jan 2016 Reputation: 139 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. • Posts: 236 Threads: 2 Likes Received: 66 in 45 posts Likes Given: 27 Joined: Jan 2016 Reputation: 17 In BF 3.1 you'll be able to reassign IO channels using new resource command in the CLI. • Posts: 5,315 Threads: 672 Likes Received: 3,155 in 1,743 posts Likes Given: 2,030 Joined: Jan 2016 Reputation: 139 (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 simplifies things a lot ! • Posts: 114 Threads: 17 Likes Received: 68 in 28 posts Likes Given: 27 Joined: Jan 2016 Reputation: 12 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. • Posts: 3 Threads: 0 Likes Received: 1 in 1 posts Likes Given: 0 Joined: Jul 2016 Reputation: 0 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 • Posts: 634 Threads: 56 Likes Received: 335 in 196 posts Likes Given: 183 Joined: Mar 2016 Reputation: 15 24-Nov-2016, 08:19 AM (This post was last modified: 24-Nov-2016, 08:21 AM by Grisha0.) 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 • Posts: 3 Threads: 0 Likes Received: 1 in 1 posts Likes Given: 0 Joined: Jul 2016 Reputation: 0 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 • Posts: 3 Threads: 0 Likes Received: 1 in 1 posts Likes Given: 0 Joined: Jul 2016 Reputation: 0 24-Nov-2016, 03:01 PM (This post was last modified: 24-Nov-2016, 03:59 PM by Ringo42.) 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. Posts: 634 Threads: 56 Likes Received: 335 in 196 posts Likes Given: 183 Joined: Mar 2016 Reputation: 15 BUhahahahaha my kind of debugging, spending few hours/days on the problem which is in a different place, glad you got it sorted out now... VIDEO All the best Grzesiek (Grisha/ Greg) Curently flyable: Nox 5, Minimalist 112 Bench / in progres: fixing Nox 3, Scrap thinking about building: 450 • |