Nikusharoot / arducopter

Automatically exported from code.google.com/p/arducopter
0 stars 0 forks source link

Custom V Pitch Causes Yaw ... Need to change default numbers #592

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I came across this while editing the documentation for the How To Do Custom 
Code Wiki. 

What steps will reproduce the problem?

When pitch, roll, and yaw factors are set in the system, it is imperative in 
the software that a pitch command does not induce a roll or yaw, a roll command 
induce a pitch or yaw, and a yaw induce a pitch, or roll.  This is the case 
with all the designs, except one.

With a custom V, these factors are set using the Add_Motor_Raw function.  Use 
of the default values provided, a roll command will cause a yaw.  So in 
stabilize mode, when the copter makes a roll correction, it induces yaw.

What is the expected output?

Mathematically, when one takes the sum of the [roll factor vector] x [signs of 
the yaw vector] the sum should be zero (or no impact on yaw).

What do you see instead?

Add Motor Raw Default Values
Prop    Roll    Pitch    Yaw    Test
1    1.00    0.34    1.00   7
2   -1.00   -0.32    1.00   3
3    1.00   -0.32   (1.00)  6
4   -0.50   -1.00   (1.00)  4
5    1.00    1.00   (1.00)  8
6   -1.00    0.34   (1.00)  2
7   -1.00    1.00    1.00   1
8    0.50   -1.00    1.00   5

So when I checked the cross Impacts caused by the asymmetric V design                   

    Impact of Roll on   Impact of Pitch on  Impact of Yaw on        
Roll                                -                    -          
Pitch         -                                          -          
Yaw     -1.00                   -           

Note that the sums of the other five cross-products are zero.

What version of the product? On what operating system? Latest. N/A.

Please provide any additional information below.

This is an easy fix--only one file (in Libraries, AP_Motors, AP_MotorsOcta.cpp 
and is only eight lines of code.  For a 14 degree V (as shown in documentation) 
with an aspect ratio of 1 (default where the average pitch arm = the average 
roll arm), change the default V code pitch, roll, and yaw factors to the 
following.  All cross impacts are zero , the factors fit the documented 14 
degrees and default aspect ratio of 1, are optimize for lower yaw energies, and 
closer to most V variants:

        add_motor_raw(AP_MOTORS_MOT_1,  0.83, 0.33, 0.61, 7);
        add_motor_raw(AP_MOTORS_MOT_2, -0.50,-0.33, 0.61, 3);
        add_motor_raw(AP_MOTORS_MOT_3,  0.50,-0.33,-0.61, 6);
        add_motor_raw(AP_MOTORS_MOT_4, -0.50,-1.00,-1.00, 4);
        add_motor_raw(AP_MOTORS_MOT_5,  0.83, 1.00,-1.00, 8);
        add_motor_raw(AP_MOTORS_MOT_6, -0.83, 0.33,-0.61, 2);
        add_motor_raw(AP_MOTORS_MOT_7, -0.83, 1.00, 1.00, 1);
        add_motor_raw(AP_MOTORS_MOT_8,  0.50,-1.00, 1.00, 5);

If you would like, I'll be glad to join the development team to get this done.

Attached is the worksheet making the calculations.

Original issue reported on code.google.com by forrestf...@gmail.com on 30 Jun 2013 at 10:14

GoogleCodeExporter commented 8 years ago
Just went through the firmware a little and the new MP.  Nice work.  Now that 
the V is an option of all frame types (thanks for doing that), the code I or 
someone else writes should have standard code for all three V configurations 
(octa, hexa, and quad) so the pilot only has to custom code when there is a 
strong deviation from the standard.  For example, the standard V octa is two 14 
degree motor masts with an aspect ratio of 1.  Doing that appears to be 
relatively easy.

Original comment by forrestf...@gmail.com on 2 Jul 2013 at 2:09

Attachments:

GoogleCodeExporter commented 8 years ago
Closing all issues on the old issues list by marking them WontFix.

If this is still a valid issue please re-raise it on the new GitHub issues 
list: https://github.com/diydrones/ardupilot/issues

Thanks!

Original comment by rmackay...@gmail.com on 21 Jul 2013 at 2:16