My Method for Iteratively Configuring Motor Ordering and Direction

This is for ordering the motors properly in Arducopter and then adjusting the directions of BLHeli32 ESCs.

Everytime I attach new motors to new ESCs and new FCs I think I’ve figured out, with my big fat brain, what the connections and ordering and direction is supposed to be, and never once have I got it right the first time.

So here is the “iterative” (read: trial and error) method that I now use with good success. Please feel free to let me know if you see any errors or flaws here.

First, wire up your motors to your ESCs however is most physically convenient for layout (ignore position and numbering) and then wire up your ESC signals to your FC however is most physically convenient with the connector. Yes, whatever ordering you want, both for motor wires and signal wires. As an added bonus your motor wires can lie nice an flat on your frame, all the way back to the ESC, without crossing over each other whatsoever.

Take care of all your basic motor configuration and settings in order to get your motors turning (check turning using next step below). By which I mean do your dshot protocol configuration, your motor battery voltage values, stuff like that. Don’t worry about the ordering or direction, just get them to the point where all four will turn during the motor test. Here’s the motor test:

Go into MP > Setup > Optional Hardware > Motor Test

Note, in the VERY VERY end, after everything is perfect, we want
Motor A = front right, turning CCW
Motor B = back right, turning CW
Motor C = back left, turning CCW
Motor D = front left, turning CW

Note that the ordering above, for “motor A through D” is not the same as the “motor 1 through 4” diagram. Motor A starts at the front left (for a quad) and then proceeds clockwise.

The odds are against you that you got it right by accident, and even more against getting the rotations correct as well.

Here’s how to fix it.

Click on motor A. Motor A is supposed to turn the front-right motor. You have a one-in-four chance of getting it right. Ignore the other three motors for now.

Note which motor turns when you chose Motor A. Ignore the direction for now. Let’s say for example that the back left motor turns.

Use this cheat sheet:
Front right motor = 33
Back left motor = 34
Front left motor = 35
Back right motor = 36

In our example, the back left motor turned. It is number 34.

Now go into the Config > Full Parameter Tree. Look at the SERVO1, SERVO2, SERVO3, etc settings. Find which one of those has SERVOx_FUNCTION set to 34. Let’s say for example that in our case, SERVO2_FUNCTION = 34. Servo 2 is assigned to turn the front right motor, but it’s actually turning the back left motor. So we are going to change the 34 (for “back left”) to 33 (for “front right”). But if we just change that servo from 34 to 33, then there will be two servos assigned to 33. Instead, let’s find which servo is assigned to 33, and we’ll swap them. Let’s say I see in the parameter tree that SERVO3_FUNCTION = 33. So now change SERVO2_FUNCTION = 33 and SERVO3_FUNCTION = 34.

Write those parameters.

Now go back to the Setup > Optional Hardware > Motor test and click on motor A. Now, the front right motor should turn.

Now, write down in your notes "SERVO2_FUNCTION = 33 = FRONT RIGHT "and DO NOT CHANGE IT ANYMORE. You’ve got one motor correct. Now repeat the whole process for motor B. One motor at a time. Don’t forget to write it down once you get it, and don’t change it.

Now, while you were doing all this, you were just ignoring direction because, well, one thing at a time. The following motor reversal instructions are for an ESC running Dshot (let me know if anyone knows how to reverse a Dshot motor through arducopter parameters). First you’ll need to turn on the DShot passthrough functionality if you haven’t already, so that you can talk straight to the ESCs through the FC. For me, that consisted of MOT_PWM_TYPE, 4 (for DShot150) and SERVO_BLH_AUTO, 1.

Then disconnect the FC from Mission Planner. Open up your BLHeliSuite32 software (you’ll have to get that installed on your own). Find the right serial port and connect. Now, before you go hog-wild reversing motor direction, you need to know that ESC 1, 2, 3, 4 are not related to the motor ordering you already dealt with. So you need to use the motor testing function in BLHeli to figure out which motor is which, all anew. There’s a “motors” tab that let’s you manually spin the motors. Best thing to do is drag each slider up slightly, one by one, and then back down. If you click on the slider it’s funky. The order that the motors are in doesn’t matter; what matters is that you right down which of the ESC’s need to be reversed. Once you check and note that for all four ESCs, then you go back to the main ESCs tab and click on “check” and get the ESCs loaded again. Now we’re going to switch one ESC at a time. So here’s the key: at the bottom, click on the number of all the ESCs that you DON’T want to affect, leaving only a single ESC number remaining that is the one you are reversing first. Now finally click on the “Reverse” slider to flip-flop the direction, and then make sure you “write” to the ESC. That one single ESC should have been flipped. Now you can go back to the motors tab and check, to make sure you did it right. And if you flipped that one motor successfully, then you can go back and repeat for any other motors (one at a time) that you need to reverse. Check it on the motors tab before you quit out, then re-connect to mission planner one last time and go do the motor test and everything should be copacetic.

3 Likes

A lot of good information here. Mapping your motor positions and manually identifying them a pretty reasonable ask of someone setting up Copter.

I have one one question though, have you tried to reverse a PWM ESC this way? I’ve never tried it, but any time I’ve had to change direction of a motor with a PWM ESC I’ve always had to do it through swapping two of the three wires between the ESC and the motor. It would sure be a lot easier to use SERVOx_REVERSED. I’ve got a feeling it won’t work, at least with “simpler” ESCs.

SERVO_REVERSED has nothing to do with the direction an ESC will drive a brushless motor.
It’s a convenient way to drive something low witle asking for maximum and high while asking for minimum. in the case of a brushless motor, RPM, not direction.

I stand corrected I will edit my post, I have never tried it with a PWM ESC I was just guessing.

1 Like

This is a fairly routine process for getting motor direction correct. Before changing anything 1st determine if there isn’t a FRAME_CLASS that doesn’t match what you have already. For example many 4in1 ESC are physically setup to match BetaFlight. That’s fine because there is is BetaFlightX motor order ready to go in Arducopter.

I just did this procedure on my Flywoo Explorer LR 4" (Goku745Nano) and the front and back motors seem reversed. Are you sure Motor A is front right?

It is indeed front right.

Ah ok. Got it sorted. I had radio pitch reversed. Annoying that some things are just backwards (ie throttle gimbal up, bar goes up, pitch gimbal up bar MUST go down).

Thanks for a great guide. Really helped!

Matt, thanks for the excellent post, but aren’t these contradictory statements (see quoted text below)?

(And OMG I wish arducopter would STOP using BOTH “1, 2, 3, 4” as well as “A, B, C, D” - that is SUPER confusing to me.)

1 Like

Think about the 2 Million users that use the current ordering and that is NOT 1234.
If we change it for you, we would break all others.

So the A B C D ordering is here to stay. We can not change it anymore.

@amilcarlucas I’m still not clear despite reading everything. Can you please clearly tell me for two cases:

  1. Quad
  2. Octaquad
    What is motor A, B, C, D, E, F, G, H? Whether they correspond to the convention in documentation for 1, 2, 3, 4, 5, 6, 7, 8 in both cases?

Thanks a million!

Kashyap

https://ardupilot.org/copter/docs/connect-escs-and-motors.html#quadcopter

https://ardupilot.org/copter/docs/connect-escs-and-motors.html#checking-the-motor-numbering-with-the-mission-planner-motor-test

No they don’t. A B C D is not 1 2 3 4

@Allister Thanks a lot!

Do you mind sharing info on Octaquad X ?

So what is the right way?

Follow the link to the motor test page.

The first motor to spin will be the one located directly forward in the case of + configuration, or the first motor to the right of straight forward in the case of X configuration. The motor test will then proceed in a clockwise rotation.

In the case of X8, it will spin the top front-right motor first, then the bottom front-right, and proceed around with the same pattern.

Thank you. Will try it this way.