Custom Motor config for Quad V-Frame need help to configure AP_MotorQuad.cpp


I hope someone will be able to help me here :-) i have postet this yesterday in the airframe design, maybe wrong categorie..

Since i'm not happy with the Stock frame setup (doesn't fit to my frame) i decided to start making my own Motor Layout.

here the frame

The Box in the middle is the APM and the CG.

here the defaults for the V-Frame

}else if( _frame_orientation == AP_MOTORS_V_FRAME ) {
add_motor(AP_MOTORS_MOT_1, 45, 0.7981, 1);
add_motor(AP_MOTORS_MOT_2, -135, 1.0000, 3);
add_motor(AP_MOTORS_MOT_3, -45, -0.7981, 4);
add_motor(AP_MOTORS_MOT_4, 135, -1.0000, 2);

here my suggestion

}else if( _frame_orientation == AP_MOTORS_V_FRAME ) {
add_motor(AP_MOTORS_MOT_1, 61, 0.9272, 1);
add_motor(AP_MOTORS_MOT_2, -144, 1.0000, 3);
add_motor(AP_MOTORS_MOT_3, -61, -0.9272, 4);
add_motor(AP_MOTORS_MOT_4, 144, -1.0000, 2);

is this correct ?

Thanks in advance !


Views: 2903

Reply to This

Replies to This Discussion

nobody :-(

just tested it 


How did it fly?  It looks like you did all of the math correctly.  

Hi Josh,

flying ok, but i needs some fine tuning, best mode until now is the acro mode :-) stabilize is a bit strange after a sharp turn it rolls to the different direction too much ... ? RTL and loiter works but gps is a bit weak (cheap Crius ublox) i will change to smaller props (Hover is at 30% of throttle.



Good to hear.  It will require tuning regardless if it was a pure X or not.  You should notice that the angles are set correct in this shape by how it responds to input commands.

yes, i just figured out that my ublox was in NMEA mode :-)

changed it and now it's raining outside :-(

Instead of changing the angles in the AP_Motors library you can just change the Roll and Pitch Rate PID values.  That will actually have the same effect.

As for the yaw factors, I'm less sure.  If you get the number right then you won't notice any roll or pitch effect when you yaw.  I actually don't know exactly how that yaw factor was calculated for the V.  For that you'd need to ask Leonard Hall.

}else if( _frame_orientation == AP_MOTORS_V_FRAME ) {
add_motor(AP_MOTORS_MOT_1, 45, 0.72391, 1);
add_motor(AP_MOTORS_MOT_2, -135, 1.0000, 3);
add_motor(AP_MOTORS_MOT_3, -45, -0.72391, 4);
add_motor(AP_MOTORS_MOT_4, 135, -1.0000, 2);


}else if( _frame_orientation == AP_MOTORS_V_FRAME ) {
add_motor(AP_MOTORS_MOT_1, 61, 0.72391, 1);
add_motor(AP_MOTORS_MOT_2, -144, 1.0000, 3);
add_motor(AP_MOTORS_MOT_3, -61, -0.72391, 4);
add_motor(AP_MOTORS_MOT_4, 144, -1.0000, 2);

the motor angles has more to do with the inertial of the frame in each direction versus the toque of the roll and pitch axis.

The most important thing you must do is make sure the CG is at the center of lift CL. Currently the code assumes this and it can't be adjusted. In this case it is 80mm further back than you have drawn your origin.

Leonard, doesn't the octo V code allow you to get around this since you manually set the values for pitch and roll for each motor?  Or are still assuming the CG is the center of lift?

ok please have a look again :-)

here the calculation (hope it is fine now)
Arm 1 + 3 lenght to CG = 456,47 mm / 100 = 4,6547
Arm 2 + 4 lenght to CG = 382,84 mm / 4,6547 = 82,2480 % of Arm lenght 1 + 3

}else if( _frame_orientation == AP_MOTORS_V_FRAME ) {
add_motor(AP_MOTORS_MOT_1,    52,   1.0000,    1);
add_motor(AP_MOTORS_MOT_2, -137,    0.82248,  3);
add_motor(AP_MOTORS_MOT_3,   -52,  -1.0000,    4);
add_motor(AP_MOTORS_MOT_4,  137,  -0.82248,   2);


It looks like you are getting your CG and CL right but how are you calculating your Yaw coefficients?

I calculated 0.72391 and 1.

Other than that it all looks fine.

Hi Josh, this still assumes that the CG is at the center of lift. You can visualize this by picturing a 2 prop copter where one is directly above the CG and one is behind it. When applying throttle only the main prop should increase because if the second (behind the CL) increases it will pitch the copter forward.

Because the arducopter code does not have a throttle coefficient for each motor, (only roll, pitch and yaw) we have to ensure that all throttle coefficients are 1. (1 is assumed by the code) We do this by making the copter symmetrical in roll, pitch and yaw and the CG is on the CL.

Having said that the roll and pitch controllers will do a good job of correcting for CG placement errors and you only notice it when applying aggressive inputs (mainly throttle and yaw). The reason throttle and yaw show the CG error is because the required correction from the roll and pitch controller changes if you change the throttle or yaw command. Because it takes a short time for the rate It terms to build up we see a little dip in pitch or roll.

Hope that makes sense.

Hi Leonardt,

how do i calculate the Yaw coeffient correctly ?




Reply to Discussion


© 2020   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service