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 –


                  • I have added  the Rotor Layout for the quad to the workbook I have been modifying.

                    I made a change to the torque factors as the pitch and roll were inverted in sign and for the calculation I needed them to reflect normalized motor coordinates.

                    The matrix calculation has been added and this sheet will generate the motor factors automatically once Matrix add-in is opened. 

                    Changing the input parameters in line A flows all the way to generated APM motor matrix code..

                    I put one of your Octo designs into the motor location coordinates on the Oct tab.  It has a solution that gives no coupling effects.  Any motor layout can be inputted and it will generate the solution but some may have coupling depending on the design. So one sheet for each design type Quad, Hex, Octo would be sufficient to generate motor factors and generate code. Coaxial designs can be input as well - the octo sheet will calculate matrix for a Octo. quad

                    I tend to just input motor coordinates since other design work I do on a CAD program

                    The dynamic labels have been added to the graph


                  • MR60

                    I should probably show you these. Can't wait to see your improvements.

                    Custom Octa CAD.xlsm

                    Custom Quad CAD.xlsm

            • 3702887336?profile=original


              Here are a couple of pics of the copter.  The  Excel file has the coordinates in the U tab.

              I may not have been clear in what I meant by equal length arms in opposite rotation.  Each set of arms front, middle and rear arms are equidistant from the COG and therefore the counter toque forces for each set would balance out for equal changes in motor RPM.   I think this would mean no lift coupling with yaw or yaw on lift.

              In this design roll would also have no impact on other axis or lift due to right to left symmetry. But pitch has some minor coupling on lift due to the center arms being lightly behind COG. For this configuration this is what your sheet shows as well. The sum rotational effect of the front and rear motors would be rotation around COG and the impact of the middle motors would be a rotational center slightly behind COG.  This was a design trade off due to layout and component interferences.  

              Since actuation on roll pitch and lift use the torque factor in the matrix if there are not pairs of equal and opposite there will most likely be more severe couplings between axis.  I am sure there are solutions in design with unequal arm length pairs where this could be accounted for but KISS.

              Looking at the results motor rotation options you have seems to agree with this.  All other combinations ended withsevere couplings.



              • MR60

                great. this gives me the motor locations.

                so if i read correctly in an e-mail, you have changed the center motors to the pitch axis to eliminate coupling, so their x/y coordinates are:

                -418.17, 0

                 418.17, 0

                i'll try to look at your motor factors tonight.

  • MR60

    First, define a U hexa. Is it like the U in the attached Excel file?

    Custom Hexa CAD.xlsm
    • Forrest,

      Great job on the spreadsheet.  The auto generation of the code for the motor matrix is very helpful and time saving.

      The incoporation of the drawing tied tot he design input and the analysis of coupling factors make this great for initial design work.  Thanks for posting the updated sheet.

    • My layout is in the PDF attached.  It is close to the configuration in your file.

      Measurements are from center of gravity of the copter.

      The middle motors are just behind COG.

      I have done calculations on the factors but when I look at the code I am seeing degrees rather that the matrix used as I have seen noted in the past.undefined

      • File attached

        Custom Hex Layout2.pdf
  • Forrest,

    I was wondering what the status is on custom motor mixing for copters.  I see you were lobbying for this but I don't think this has made it into the mainstream code.  I need to set up custom mix but I think this means I will need to modify and compile code.  Is this correct?

  • MR60

    did you ever figure out how to change the motor mixing for pitch, roll, and yaw?

    i'm in the final setup of a custom octa-H and need to figure this out also.

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