Swapping The Roll and Pitch Axis on Octocopter H Frame

For the octocopter h-frame setup, is there a way to swap the roll and pitch axis whereby motors 1,3,8 and 4 becomes pitch front and motors 5,7,6,2 becomes pitch rear?

Octo H frame

1 Like

You’d need to add it as a new mixer, either in the flight code (https://ardupilot.org/dev/docs/code-overview-copter-motors-library.html) or as a lua script

1 Like

We do have a I frame class that should work.

case MOTOR_FRAME_TYPE_I:
_frame_type_string = "I";
add_motor_raw(AP_MOTORS_MOT_1, 0.333f, -1.0f, AP_MOTORS_MATRIX_YAW_FACTOR_CW,  1);
add_motor_raw(AP_MOTORS_MOT_2, -0.333f,  1.0f, AP_MOTORS_MATRIX_YAW_FACTOR_CW,  5);
add_motor_raw(AP_MOTORS_MOT_3,    1.0f, -1.0f, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 2);
add_motor_raw(AP_MOTORS_MOT_4,  0.333f,  1.0f, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 4);
add_motor_raw(AP_MOTORS_MOT_5, -0.333f, -1.0f, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 8);
add_motor_raw(AP_MOTORS_MOT_6,   -1.0f,  1.0f, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 6);
add_motor_raw(AP_MOTORS_MOT_7,   -1.0f, -1.0f, AP_MOTORS_MATRIX_YAW_FACTOR_CW,  7);
add_motor_raw(AP_MOTORS_MOT_8,    1.0f,  1.0f, AP_MOTORS_MATRIX_YAW_FACTOR_CW,  3);

We don’t have a diagram for it tho. FRAME_TYPE = 15

1 Like

Thanks for the help, I’ll read through it and attempt to make the changes.

Thanks for the help. Its been 5 long years since I’ve done coding on this platform again. A lot of rust to shake off, I’ll update again on progress.

Just to clarify: looks like I’m behind the times too, and as Pete pointed out this configuration is now supported as per his post. So no coding required.

1 Like

Hi, how does the motor numbering work though?

Sorry, no diagram, you should be able to work it out from the code snip-it above. Looks like the testing order is wrong tho.

From the roll factors, the first number, we can tell that 1,2, 4 and 5 are the inner motors. Positive on the left of the frame and negative on the right. The next number is pitch factor, positive at the front.

So that gives
8 - 4 - 2 - 6
3 - 1 - 5 - 7

Yaw directions are given in the next column, either CW or CCW

So the testing order (the last column) should be 2 > 6 > 7 > 5 > 1 > 3 > 8 > 4

But it looks like it is 1 > 3 > 8 > 4 > 2 > 6 > 7 > 5. So the testing order is backwards in pitch.

There is a comment about the pitch being reversed in the original PR, I wonder if the pitch was fixed but the testing order overlooked.

Certainly worth testing this with no props on and making sure the motors spin up as expected when you move the vehicle about.

If you can confirm the issue with the testing order we can fix it for the next release. (and maybe even get a diagram!)

2 Likes

Thanks a lot for the help. I did go through the code earlier and I got a little confused too about the motor order because it appeared reversed as you mentioned. I’ll test it and see how it goes

Just tested it and it works, the motor order is as you’ve said:

8 - 4 - 2 - 6
3 - 1 - 5 - 7

1 Like