Custom motor mix - Special H octa layout


I’m having doubts about custom motor mix. I have this layout and motor numbers:

Which gives me this output:
mmix 0 1 -0.767 -1 -1
mmix 1 1 0.767 1 -1
mmix 2 1 -0.531 -0.345 1
mmix 3 1 -0.767 1 1
mmix 4 1 0.767 -1 1
mmix 5 1 0.531 0.345 1
mmix 6 1 0.531 -0.345 -1
mmix 7 1 -0.531 0.345 -1

I want to edit libraries/AP_Motors/AP_MotorsMatrix.cpp

add_motor_raw(AP_MOTORS_MOT_1, 1.0f, 0.34f, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 7);
add_motor_raw(AP_MOTORS_MOT_2, -1.0f, -0.32f, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 3);
add_motor_raw(AP_MOTORS_MOT_3, 1.0f, -0.32f, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 6);
add_motor_raw(AP_MOTORS_MOT_4, -0.5f, -1.0f, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 4);
add_motor_raw(AP_MOTORS_MOT_5, 1.0f, 1.0f, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 8);
add_motor_raw(AP_MOTORS_MOT_6, -1.0f, 0.34f, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 2);
add_motor_raw(AP_MOTORS_MOT_7, -1.0f, 1.0f, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 1);
add_motor_raw(AP_MOTORS_MOT_8, 0.5f, -1.0f, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 5);
success = true;

But I don’t really know how to combine upper “format” with this “format” in the library. The motor numbers, direction and everything else must match and there are a bit too many options to try and also too much to risk if this is not set correctly.

Could someone help me out by making correct adjustments in MOTOR_FRAME_TYPE_V or explain me the format.

Thank you very much!
Best regards,

I have updated the mixercalc to show values for Arducopter. However let me stress that it has not been tested. If there is money riding on this I would be inclined to make a smaller scale test first.

Note also that the motor numbering for “testing order” is simply the same as the actual motor numbering, so the “motor test” page in Mission Planner will not make the motors spin in clockwise order as the docs indicate.

Regarding your constraints shown in the screenshot, ideally you would also have some relation specified to connect your inner and outer ‘rings’, to be sure you’re getting the right result. I added a preset, note that the numbering is not the same as your screenshot.

It’s unfortunate that customizations like this require compiling and flashing a custom firmware, but can’t be helped right now I guess.