Current AHRS_Orientation = 4 - Attitude shows correctly
Frame Class = 1, Frame_Type = 12
Below are the correct Servo Assignments
Servo1_Function = 36
Servo2_Function = 33
Below are the incorrect servo assignments and are swtiched. Test Motor C rund Motor D, and Test Motor D runs Motor C.
Servo4_Function = 34
Servo3_Function = 35
When I switch Servo4 and Servo3_Function parameters, Test Motor A runs Motor D, Test Motor B runs Motor B, Test MotorC runs Motor A, Tets Motor D runs C
I have no idea what exactly you are complaining about, and I have doubts about whether you use the word “correct” correctly.
This wiki page (Flywoo GOKU GN 745 AIO with 40A ESC/45A ESC/ Nano — Copter documentation) tells to set AHRS_ORIENTATION = 5 for V3 if one installs the flight controller in the way consistent with the arrow depicted on the flight controller. In this case, the motor numbers match the standard Betaflight order, and FRAME_TYPE = 12 would result in a straightforward mapping:
SERVO1_FUNCTION = 33
SERVO2_FUNCTION = 34
SERVO3_FUNCTION = 35
SERVO4_FUNCTION = 36
which is also the default.
I have such a quad, it is set up in exactly this way (except I use FRAME_TYPE = 18 to invert propeller rotation), and it flies perfectly. I have performed numerous motor tests with it, and they also work as expected. This means that the documentation reflects the reality.
So your issues stem from something else. Based on how the frame looks like (it does not support diamond-like mounting) and on your reported AHRS_ORIENTATION = 4, the flight controller should look like this from above:
where red numbers indicate the motor pin labels on the FC and the black numbers indicate the servo function corresponding to the motor pins, assuming FRAME_TYPE = 12.
There is no natural way to solder the motors onto the motor pins, and I have no idea what exactly happens in your setup. So the best thing you can do is to double-check your actual wiring against the diagrams.
Thank you so much for taking the time to reply with such clarity — your detailed explanations, diagrams, and patience are truly appreciated. Such clear penmanship and helpful guidance is rare these days.
I’m an older hobbyist (not nearly as analytical or prolific as most of the great contributors on the Ardupilot forum). I wrote my original post late last night while getting completely dumbfounded by this motor assignment issue. I was able to resolve a similar problem on a SpeedyBee F405 AIO with the community’s help quite easily, so I was hoping for something straightforward here too.
You rightly picked up on my wrong usage of the word “correct”. By “correct” I meant that Motors A and B spin the expected physical motors in Mission Planner’s Motor Test for a Quad (BetaflightX) setup, as shown on the official page:
For Motors C and D, I can’t get the right order.
With Servo4_FUNCTION = 34 and Servo3_FUNCTION = 35, pressing Test Motor C runs physical Motor D, and Test Motor D runs physical Motor C (they are swapped).
When I switch those two (Servo4=35 / Servo3=34), the mapping gets messed up more (A runs D, etc.).
My current setup:
AHRS_ORIENTATION = 4 (Yaw 180) — attitude shows correctly in all orientations (see the attached screenshots: right side down, left side down, nose down, nose up).
I was considering keeping Servo3_FUNCTION = 35 and Servo4_FUNCTION = 34 (so C and D are swapped in software) and then simply swapping the physical motor wires for the two rear motors (C and D) on the ESC pads. This feels simpler to me than more complex remapping.
What are your thoughts on this approach? Is it safe/recommended, or is there a cleaner software-only solution I’m missing due to my mounting orientation?
Thank you again for your help — I really appreciate it!
Could you please tell us which of the physical motors is soldered to which set of motor pins? A correct servo mapping would result from that. I cannot infer what is soldered to what from your reports, so I think I just need a direct answer.
The logic behind (simplified for a quadcopter) is as follows: in an expression SERVOx_FUNCTION = y, x is the number of the physical output (the red number), and y is 32 + the motor number according to the chosen frame, which in the case of FRAME_TYPE = 12 is: B = 1, A = 2, C = 3, D = 4. So, if motor A (where y = 32 + 2 = 34) is connected to output 4, then SERVO4_FUNCTION = 34.
Note that this is independent of AHRS_ORIENTATION. I am still not sure whether AHRS_ORIENTATION=4 matches my picture or your picture, but again - if motor tests do what they are expected to do, then the wiring is correct regardless of the orientation.
Voila, you fixed it!! Thanks ever so kindly!! I need to review the the logic that you kindly took the time to write for me (at family BBQ). I was keen to test your solution, so snuck in for a sec :-). I used AHRS_Orientation = 4 which matches my picture that I created by adaptiong your kindly provided picture. I did that to get the attitude correct, as I posted above in the pictures.
Just to add here, you can also set motor assignment in mission planner setup page.
Go to SETUP > MANDATORY HARDWARE > SERVO OUTPUT
Assuming your wiring is just like what @MaxBuzz drew, and you actually use FRAME_TYPE = 12 (BetaflightX) then we can set:
SERVO1 = MOTOR3
SERVO2 = MOTOR1
SERVO3 = MOTOR4
SERVO4 = MOTOR2