Custom Uneven Motor Mixing

I need help please. I have made a couple of custom hexacopters. My favorite frame shape is the U-shaped Hexacopter. Unfortunatley I am not arduino gifted. Fortunately I do have the DJI wookong. They have a nice custom motor mixing table which makes any custom frame design easy to program, all you need to do is to write in the motor percentages.So my question is how can I change the motor power percentages in Arduino code to do this?

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –


  • MR60

    did you have the quad, hex, or octa worksheet. the hex worksheet need more optimization. the other two are good.

    • The CustomHexaCAD spreadsheet. I am using the U Hexa tab.

      Are there issues or just improvements you are noting for optimization?

      The motor matrix values corresponded to my calcs very closely so I think these are good.

      Working on compiling now but running into some issues with errors = but first time on this computer so I guess to be expected.

      • MR60

        the motor factors were my best quick guess versus optimal thought given the prop directions:

        CW     CCW

        CCW   CW

        CCW   CW

        but, prop rotation does not alternate (CW to CCW to CW to CCW) as on other ships. i'm not sure if this matters in terms of noise or effienciency.

        is there a solution if the props alternate is in the following?

        CW     CCW

        CCW   CW

        CW     CCW

        if there is, then all the props move the same direction when passing each other.

        what are your thoughts on this?

        • I have mine setup with alternating prop rotation. as in your second case. Vertical thrust factors would be the same in both cases.  Torque factors for yaw might vary but I am not sure the code accounts for varying arm length.  My assumption was that keeping sets of arms of equal length from COG to opposite rotation would produce the best balance.

          I am not seeing any ill effect of this setup.  Seems to fly well.

          I would think this would be best for efficiency since prop tips and airflow would be moving in the same direction.  I would expect this to be secondary to the overall effects of prop size and RPM etc particularly if these is a significant distance between prop tips. Also any turbulence due to props moving in opposite direction would seem to be minimized and these could be somewhat quieter although I am not sure if this is a big effect.

          • MR60

            pitch and roll motor factors are affected by arm length (radius to CG axis).

            yaw is only affected by rotation direction and the radius of it's rotating mass around itself. thus yaw motor factors can be altered to remove coupling between roll and yaw and pitch and yaw.

            you may have minor coupling between roll and yaw where yaw will also impart a bit of roll and roll will impart a bit of yaw.

            i don't understand how a U can can each arm the same distance from CG.  can you send me two things:

            1) the x/y coordinates for the left arms

            2) the roll, pitch, and yaw motor factors for each motor (this will tell me if there is coupling

            • Forrest,

              I have worked on the the calculations a bit and done some cross checks.

              I have added a Excel add in to allow me to use the Moore-Penrose Pseudo Inverse method to calculate the motor command factors for non symmetrical copters (also works for standard symmetrical configurations).

              And redone the coupling check calculations and verified with standard HES X configuration.

              There alternating motor rotation has a solution.  Form my config it shows the minor pitch lift coupling I expected but for the case where the middle motors are on pitch COG it shows no coupling on any axis

              Torquw factors

              Rotor Roll Pitch Yaw
              1 0.772 -0.899 -1.000
              2 -0.772 -0.899 1.000
              3 1.000 0.074 1.000
              4 -1.000 0.074 -1.000
              5 0.488 0.899 -1.000
              6 -0.488 0.899


              Motor Command factors

              Motor Roll Pitch Yaw
              1 -0.631 -0.924 -0.501
              2 0.631 -0.924 0.501
              3 -1.000 0.076 0.643
              4 1.000 0.076 -0.643
              5 -0.369 0.924 -0.524
              6 0.369 0.924 0.524

              Coupling Check

                Impact of Roll on Impact of Pitch on Impact of Yaw on
              Lift 0.000 0.152 0.000
              Roll   0.000 0.000
              Pitch 0.000   0.000
              Yaw 0.000 0.000  
              • MR60


                • I have added an octocopter sheet and it is working well. I need to add code generator for 2 added motors.

                  Matrix calculations now happen automatically once add in is loaded in Excel.

                  Made some changes to the graphic copter display to dynamically update motor number and prop rotation on graph.

                  Doing quad sheet next.

                  • Latest rendition with labels added to all three sheets. 

                    Some corrections to coupling checks that I somehow messed up 

                    I am trying to figure out whether the yaw should be normalized to the highest yaw value or the highest overall value.  I think probably the highest yaw but currently is normalized to highest value in output matrix.

                    I believe this would limit yaw authority.

                    JSG ModCustomHexaCAD2.xlsm

                  • Use this file   Found same reversal of sign in Oct and Hex sheets.

                    Now changed.

                    Also put the S octo input into sheet and comes out with no coupling solution.

This reply was deleted.


Mike Whitney liked Mike Whitney's profile
Jul 19
DIY Robocars via Twitter
Jul 2
DIY Robocars via Twitter
Jun 26
Abdulatif Tlaib liked Ryan's profile
Jun 24
DIY Robocars via Twitter
RT @SmallpixelCar: First time at @wsraceways. After tuning @HokuyoUsa lidar signal and camera sensor on @NVIDIAEmbedded, my car was able to…
Jun 20
DIY Robocars via Twitter
RT @breadcentric: The handy bit about racing with self-driving cars is that one can type while the car is racing. Report from #AWSDeepRacer…
Jun 18
DIY Robocars via Twitter
RT @chr1sa: Our Bay Area @DIYRobocars meetup is now at 2,700 members. Next in-person events (in Oakland) are training day on July 17 and…
Jun 18
DIY Robocars via Twitter
Videos from the ICRA autonomous racing workshop are now available:
Jun 10
DIY Robocars via Twitter
RT @SmallpixelCar: Prepared race track for Warm Spring Raceways @wsraceways and looking forward to test my new car at RAMS RC @ramsaicar fa…
Jun 6
DIY Robocars via Twitter
RT @f1tenth: Trying out some nasty blocking maneuvers 🏎️🤖 #f1tenth #autonomousracing
Jun 5
DIY Robocars via Twitter
May 27
DIY Robocars via Twitter
RT @araffin2: I will talk this Saturday from 18:00 to 19:00 Paris time for the @diyrobocars community about learning to race in hours using…
May 27
DIY Robocars via Twitter
RT @a1k0n: Luckily the infeasible hairpin problem was easily reproducible in simulation and I could test the fix before bringing the car ba…
May 26
DIY Robocars via Twitter
RT @a1k0n: Another problem was that I was over-constraining the car's allowed accelerations, so it didn't think it could turn as tight as i…
May 26
DIY Robocars via Twitter
RT @a1k0n: Breaking the map up into two halves worked, but I had to be more careful about separating the inner track from outer. There's se…
May 26
DIY Robocars via Twitter
RT @a1k0n: Here's a datalog for my fastest lap of the day. Lap timer is tiny window lower-left.
May 26