k_h_d

  • *
  • 26
Custom motor mix?
« on: March 15, 2016, 04:17:29 am »

How does the following cleanflight custom motor mix settings convert to the librepilot cust mix?

mmix 0 1.000 -0.698 0.580 -1.000
mmix 1 1.000 -1.000 -1.000 1.000
mmix 2 1.000 0.698 0.580 1.000
mmix 3 1.000 1.000 -1.000 -1.000

Which of these numbers input to where in the custom mix settings page within Librepilot?

lucas

  • **
  • 67
Re: Custom motor mix?
« Reply #1 on: March 15, 2016, 05:45:55 am »
LibrePilot mixer uses values from -64 to +64, the Pitch axis values have their sign opposite to Cleanflight, the motor order is different and the throttle value ranges from 0 to 127 (it's a bit more complicated as the throttle can be set in two different curves and you can set how much weight each has, anyway...)

Your custom mix should be something like

Motor 3  127  -45  -37  -64
Motor 2  127  -64  64   64
Motor 4  127  45  -37  64
Motor 1  127  64  64  -64

Please test carefully and read the following disclaimer:

I'm not responsible for any broken props resulting of this.  :)

k_h_d

  • *
  • 26
Re: Custom motor mix?
« Reply #2 on: March 16, 2016, 01:07:08 am »
So does this look correct?  Do the channels on the custom page correspond to the motors?

Also, on motor3 you have all the values of pitch/roll/yaw negative, while the values on channel 4 only has pitch negative.  I know nothing about the mixing currently, so I wanted to confirm that was not a typo.

Thanks!

Also, are there any documents explaining how librepilot does the custom mixing other than the simple but limited GUI for the sliders on pitch/roll under the vehicle -> multirotor tab?
« Last Edit: March 16, 2016, 01:13:33 am by k_h_d »

lucas

  • **
  • 67
Re: Custom motor mix?
« Reply #3 on: March 16, 2016, 02:08:12 am »
Yep, that seems correct.

Roll and Yaw should have opposite signs in motor 3 and 4.  Think of it:  If you Roll to the left, motor 3 should increase speed and motor 4 should decrease speed.  If you Yaw in any direction, motor 3 and 4 should react in opposite manner, one should increase speed, the other one should decrease speed.

On the other hand, if you Pitch forwards, Motor 3 and 4 both should have the same reaction, they should increase spin. That´s why Pitch has the same sign on both Motors 3 and 4.

In your screenshot I can´t see the Chanel types.  If you ran the Setup Wizzard and selected Quad X prior to going to the custom tab and editing the mixer your first 4 Chanel types should be "Motors"




Sadly I have no idea where you can find documentation on LPs custom mixer.



« Last Edit: March 16, 2016, 02:17:11 am by lucas »

liftbag

  • *****
  • 215
    • LibrePilot
Custom motor mix?
« Reply #4 on: March 16, 2016, 07:49:52 am »
Hi k_h_d.
Can you share an image of your quad? I suspect the cleanflight mixer table is a bit weird.
We often use a python script to determine a custom mixer.
If you want I can help you and explain the process.

Paolo

[EDIT]
Unless you have a V-Tail. If you have a V-Tail I can assume that the cf custom motor mixer is correct.
« Last Edit: March 16, 2016, 08:10:14 am by liftbag »

k_h_d

  • *
  • 26
Re: Custom motor mix?
« Reply #5 on: March 31, 2016, 02:51:14 am »
Was out of town.   I tried the custom mix given above.  It flew better which out random oscillations in high G maneuvers, however yaw would make the quad tilt very quickly.   It would not maintain a level full 360 yaw in either rate or attitude.

I am at the point where P&I tunning is not enough for this frame to get it tunes well.   On he basic stabilize page I am down to 11 for P and still getting random oscillations with a symmetrical mix.

The quad is a tiny 122mm quad by readymade rc called the hellbender 122.   I am running 1306/3100kv motors with 4S packs and 3x3x3 props.

lucas

  • **
  • 67
Re: Custom motor mix?
« Reply #6 on: March 31, 2016, 03:10:13 am »
Hi k_h_d  can you provide the motor to motor distances for the 122 hellbender?

Distance from motor 1 to 2
Distance from motor 2 to 3
Distance from motor 3 to 4

Thanks!

lucas

  • **
  • 67
Re: Custom motor mix?
« Reply #7 on: March 31, 2016, 03:31:47 am »
Found the distances I needed
Motor 1 to motor 2 = 113mm
Motor 3 to motor 4 = 77mm

Try this please:
Motor1  127,    64,   64,   -44
Motor2  127,   -64,   64,    44
Motor3  127,   -64,   -64,   -64
Motor4  127,     64,  -64,     64 

The value for yaw on motors 1 and 2 equals:

[(Distance from M3 to M4) divided by (Distance from M1 to M2)] times 64

(77/113)*64 = 43.614

k_h_d

  • *
  • 26
Re: Custom motor mix?
« Reply #8 on: March 31, 2016, 03:43:35 am »
Awesome, you found them faster than I could find them or find my ruler.

At some point after I get it dialed in I would love your help on understanding mixing so I can figure it out in my own.

It's dark and raining now so I'll try it tomorrow afternoon.

Why would roll and pitch still have symmetrical values when motor 2/3 and 1/4 are not in a straight line from each other.

Thanks!
« Last Edit: March 31, 2016, 04:01:24 am by k_h_d »

k_h_d

  • *
  • 26
Re: Custom motor mix?
« Reply #9 on: March 31, 2016, 04:04:18 am »


Okay, when trying to manually enter a value on the customs page is there some setting that needs to be set to be able to change the values?  I have done it before but for some reason now I can't change the values.  Only way to change the values is move the sliders, and that will not allow me to get what I need.

k_h_d

  • *
  • 26
Re: Custom motor mix?
« Reply #10 on: March 31, 2016, 04:10:56 am »

I can just edit them in the system --> mixer settings.

lucas

  • **
  • 67
Re: Custom motor mix?
« Reply #11 on: March 31, 2016, 06:36:24 am »
Noooo I had writen a loooong post with some explanations and seems like my login timed out

lucas

  • **
  • 67
Re: Custom motor mix?
« Reply #12 on: March 31, 2016, 06:44:58 am »
Long story short:

What happens when both rear (or front) motors on the Hellbender put out the same thrust?  The quad rotates perfectly on the pitch axis!

What happens when one of the rear (or front) motors outputs more thrust than the other one?  The quad rotates unevenly.

That's why they have the same value for Pitch.

For roll given that the rear motors are closer to the roll axis than the front motors there might be an issue.  But the typical weight distribution on a quad (along) the roll axis usually makes up for that.

Please give it a try.


k_h_d

  • *
  • 26
Re: Custom motor mix?
« Reply #13 on: April 01, 2016, 11:35:41 pm »
I had time to fly a pack on the custom mix you suggested.  Like before it has improved the forward and sideways banked flying without the occasionally osscilations, but it still wants to bank in the direction of the pirouette.

So if I try to yaw left a full 360 degrees it does not stay in one place, it banks to the left.  Its not as rapid as it was but still no controlled.  Without a custom mix and everything symmetrical, yaw is perfect but then I get the rapid osscilations in high banked maneuvers.  When it happens it will continue to rapidly osslicate even in level flight until I flip the switch to turn attitude mode back on.

So what seems to be happening is the right rear motor seems to be putting out more thrust than the left when I yaw Left.   And then the left rear motor more thrust when I yaw right.

What would putting the smaller value (44 and -44) on the rear motors instead of the front motors do?  Since those are the motors closer together...?


I appreciate your help.
« Last Edit: April 01, 2016, 11:39:58 pm by k_h_d »

lucas

  • **
  • 67
Re: Custom motor mix?
« Reply #14 on: April 02, 2016, 01:11:24 am »
k_h_d by all means give it a try!

And please share your results!

If you are willing to try different theories would you please try 51 and -51 on the rear motors yaw?

As you can see on the image attached: the front motors have to travel 429,17mm in order to achieve a full 360° turn.  The rear motors have to travel 342,28mm.  That would imply that the rear motors would have to travel at a .7975 rate of the front motors.

64*0,7975 = 51 (aprox.)

take a look at this other thread:

https://forum.librepilot.org/index.php?topic=338.0

As you can see there is no consensus on custom mixing!!