TBS discovery - custom motor MIX

Post Reply
krtek2k
Posts: 25
Joined: Mon Jul 15, 2013 10:57 am
Location: Decin , Czech Republic

TBS discovery - custom motor MIX

Post by krtek2k »

Hi boys , i am not ingeneer , and dont have my discovery at home yet (on its way now).
So i wanna ask if someone have counted custom motor mix for TBS discovery.
Or if someone wanna do it by this manual:
http://polakiumengineering.org/?p=1612
thank You

EDIT : Now i have found nice motor mix for TBS Discovery with these numbers :

Code: Select all

motor[0] = PIDMIX(-1.27,+1,-1); //REAR_R
motor[1] = PIDMIX(-1.54,-1,+1.12); //FRONT_R
motor[2] = PIDMIX(+1.27,+1,+1); //REAR_L
motor[3] = PIDMIX(+1.54,-1,-1.12); //FRONT_L
Last edited by krtek2k on Tue Aug 06, 2013 8:42 am, edited 1 time in total.

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: TBS discovery - custom motor MIX

Post by haydent »

check out my multiwii custom motor mix video on this "dead cat" layout. it may make it easy for you: http://www.youtube.com/watch?v=il6SoU8Hnak

krtek2k
Posts: 25
Joined: Mon Jul 15, 2013 10:57 am
Location: Decin , Czech Republic

Re: TBS discovery - custom motor MIX

Post by krtek2k »

I know about this video , i am using now your numbers. But i am not so good at math , or something.
So i am asking to help , i found these inputs about discovery frame.
Image
http://krtek2k.mysteria.cz/tbs_frame.xlsx
Can you modify your , to get right numbers for DISCOVERY? Please.

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: TBS discovery - custom motor MIX

Post by haydent »

sure, too busy tonight but i can do it this weekend.

test
Posts: 25
Joined: Sat Jul 27, 2013 12:16 am

Re: TBS discovery - custom motor MIX

Post by test »

hi, haydent here, having trouble logging in away from home, and the email system isnt working on this forum so cant recover password.

i started trying to calculate it but i need the length from the center point to a motor, ie the arm length as shown in your diagram

if you can get that, i suspect it can be worked out even with the angles given but i might try that later, here is my workings so far:

Triangle1:
A1 = sqr(C1^2 - B1^2)

B1 = M3 to M1 / 2

C1 = FC to M3


Triangle2:
A2 = sqr(C2^2 - B2^2)

B2 = M2 to M0 / 2

C2 = FC to M0

Motor Mix:
M0 = B2, -A2

M1 = B1, A1

M2 = -B2, -A2

M3 = -B1, A1

krtek2k
Posts: 25
Joined: Mon Jul 15, 2013 10:57 am
Location: Decin , Czech Republic

Re: TBS discovery - custom motor MIX

Post by krtek2k »

Oh nice :)
Thank You for working on it , i measure lenght u need , and it is something around 23.6-23.8cm .
I am now using :

Code: Select all

#ifdef QUADX
      motor[0] = PIDMIX(-1,+1.08,-1); //REAR_R
      motor[1] = PIDMIX(-1.31,-0.56,+1.31); //FRONT_R
      motor[2] = PIDMIX(+1,+1.08,+1); //REAR_L
      motor[3] = PIDMIX(+1.31,-0.56,-1.31); //FRONT_L
    #endif

If you can modify it to be perfect for discovery , i will be happy :)
Sorry for my english :)

User avatar
Hamburger
Posts: 2559
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: TBS discovery - custom motor MIX

Post by Hamburger »

no need to edit the mixing in output.cpp or output.ino.
You can use MY_PRIVATE_MIXING from config.h for that. It does what you want.

test
Posts: 25
Joined: Sat Jul 27, 2013 12:16 am

Re: TBS discovery - custom motor MIX

Post by test »

i also need the distance between the rear two motors

thanks hamburger for pointing that out

krtek2k
Posts: 25
Joined: Mon Jul 15, 2013 10:57 am
Location: Decin , Czech Republic

Re: TBS discovery - custom motor MIX

Post by krtek2k »

I will look what is my private mixing...
Image
this picture is in that excel which i posted under viewable scheme.

test
Posts: 25
Joined: Sat Jul 27, 2013 12:16 am

Re: TBS discovery - custom motor MIX

Post by test »

sorry i could not open that excel doc, it just errored. ill have the calculations in a few mins

test
Posts: 25
Joined: Sat Jul 27, 2013 12:16 am

Re: TBS discovery - custom motor MIX

Post by test »

Here you go :idea:

Triangle1:
A1 = sqr(C1^2 - B1^2)
A1 = sqr(23.7^2 - 21^2)
A1 = sqr(561.69 - 441)
A1 = sqr(120.69)
A1 = 10.98

B1 = M3 to M1 /2
B1 = 42 /2
B1 = 21

C1 = FC to M3
C1 = 23.7

Triangle2:
A2 = sqr(C2^2 - B2^2)
A2 = sqr(23.7^2 - 17.35^2)
A2 = sqr(561.69 - 301.02)
A2 = sqr(260.66)
A2 = 16.14

B2 = M2 to M0 /2
B2 = 34.7 /2
B2 = 17.35

C2 = FC to M0
C2 = 23.7

Motor Mix: (Divide all by largest length, to make them relative to 1, in this case 21)
M0 = B2, -A2
M0 = 17.35, -16.14
M0 = 0.83, -0.77

M1 = B1, A1
M1 = 21, 10.98
M1 = 1, 0.52

M2 = -B2, -A2
M2 = -17.35, -16.14
M2 = -0.83, -0.77

M3 = -B1, A1
M3 = -21, 10.98
M3 = -1, 0.52

test
Posts: 25
Joined: Sat Jul 27, 2013 12:16 am

Re: TBS discovery - custom motor MIX

Post by test »

the only thing is i get a different value to your diagram for the bit marked and x1 & x2 , what i call A1 and A2, i dont calculate them as double...

krtek2k
Posts: 25
Joined: Mon Jul 15, 2013 10:57 am
Location: Decin , Czech Republic

Re: TBS discovery - custom motor MIX

Post by krtek2k »

Oh nice :)
I can understand , that you are doing all of this simpliest as possible , and i am glad you done it, but i am so dumb as possible , can you translate to this language?

Code: Select all

      motor[0] = PIDMIX(-1,+1.08,-1); //REAR_R
      motor[1] = PIDMIX(-1.31,-0.56,+1.31); //FRONT_R
      motor[2] = PIDMIX(+1,+1.08,+1); //REAR_L
      motor[3] = PIDMIX(+1.31,-0.56,-1.31); //FRONT_L

thank You

test
Posts: 25
Joined: Sat Jul 27, 2013 12:16 am

Re: TBS discovery - custom motor MIX

Post by test »

try this carefully:


Code: Select all

      motor[0] = PIDMIX(-0.83,+0.77,-0.83); //REAR_R
      motor[1] = PIDMIX(-1,-0.52,+1); //FRONT_R
      motor[2] = PIDMIX(+0.83,+0.77,+0.83); //REAR_L
      motor[3] = PIDMIX(+1,-0.52,-1); //FRONT_L
Last edited by test on Tue Jul 30, 2013 5:13 am, edited 1 time in total.

krtek2k
Posts: 25
Joined: Mon Jul 15, 2013 10:57 am
Location: Decin , Czech Republic

Re: TBS discovery - custom motor MIX

Post by krtek2k »

Oh , thank You.
When i use (reversed all signs) :

Code: Select all

motor[0] = PIDMIX(+0.83,-0.77,+0.83); //REAR_R
      motor[1] = PIDMIX(+1,+0.52,-1); //FRONT_R
      motor[2] = PIDMIX(-0.83,-0.77,-0.83); //REAR_L
      motor[3] = PIDMIX(-1,+0.52,+1); //FRONT_L

armed holded in my hand , it compensate badly every movements.

When i use :

Code: Select all

motor[0] = PIDMIX(-0.83,+0.77,-0.83); //REAR_R
      motor[1] = PIDMIX(-1,-0.52,+1); //FRONT_R
      motor[2] = PIDMIX(+0.83,+0.77,+0.83); //REAR_L
      motor[3] = PIDMIX(+1,-0.52,-1); //FRONT_L

armed holded in my hand , it compensate good every movements.
So i placed it to ground , armed motors and start in angle mode , flied well .
When off angle mode , it not hear my sticks well , i think it hear oposites.
Light crash and break one arm , two props :)
No apologies please , i done it everything in my own risk.
So i am done with all new custom mixes...
When i am using :

Code: Select all

motor[0] = PIDMIX(-1,+1.08,-1); //REAR_R
      motor[1] = PIDMIX(-1.31,-0.56,+1.31); //FRONT_R
      motor[2] = PIDMIX(+1,+1.08,+1); //REAR_L
      motor[3] = PIDMIX(+1.31,-0.56,-1.31); //FRONT_L

it flying nice.

test
Posts: 25
Joined: Sat Jul 27, 2013 12:16 am

Re: TBS discovery - custom motor MIX

Post by test »

sorry i didnt mean for you to reverse it, more that i had. ive edited out that bit.

to the last one you say is flying nice is ok with angle on too ?

krtek2k
Posts: 25
Joined: Mon Jul 15, 2013 10:57 am
Location: Decin , Czech Republic

Re: TBS discovery - custom motor MIX

Post by krtek2k »

Yes it is numbers from your video , and it working for me.

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: TBS discovery - custom motor MIX

Post by haydent »

ok, well i suspect the measurement we used may have been out. when you measured the "arm length" did you measure the distance between the motor and the fc ? as due to the dead cat layout it should not be the same for all as you suggested

krtek2k
Posts: 25
Joined: Mon Jul 15, 2013 10:57 am
Location: Decin , Czech Republic

Re: TBS discovery - custom motor MIX

Post by krtek2k »

I double checked , that this picture is right , every measurement.
Image

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: TBS discovery - custom motor MIX

Post by haydent »

i put in just you measurements, instead of using formula, (as you provided all needed) and got all but identical numbers. so not sure...

Code: Select all

M0 = B2, -A2
M0 = 17.35, -16.2
M0 = 0.83, -0.77

M1 = B1, A1
M1 = 21, 11.06
M1 = 1, 0.53

M2 = -B2, -A2
M2 = -17.35, -16.2
M2 = -0.83, -0.77

M3 = -B1, A1
M3 = -21, 11.06
M3 = -1, 0.53

      motor[0] = PIDMIX(-0.83,+0.77,-0.83); //REAR_R
      motor[1] = PIDMIX(-1,-0.53,+1); //FRONT_R
      motor[2] = PIDMIX(+0.83,+0.77,+0.83); //REAR_L
      motor[3] = PIDMIX(+1,-0.53,-1); //FRONT_L

krtek2k
Posts: 25
Joined: Mon Jul 15, 2013 10:57 am
Location: Decin , Czech Republic

Re: TBS discovery - custom motor MIX

Post by krtek2k »

He he , i dont have enough big balls now to try it again. Also quadx template working well for me now :)
Thx for your work haydent , i will slow down for now. (waiting for afros ESCs , and AIO PRO V2 board. I will also mount BLS gimbal to my discovery soon)=lots of fun waiting for me :)

krtek2k
Posts: 25
Joined: Mon Jul 15, 2013 10:57 am
Location: Decin , Czech Republic

Re: TBS discovery - custom motor MIX

Post by krtek2k »

So i found main mistake. Center of circle on that picture is not center of gravity.
CG is more down :) Is here some right way , to find where real CG have to be?

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: TBS discovery - custom motor MIX

Post by haydent »

not sure

krtek2k
Posts: 25
Joined: Mon Jul 15, 2013 10:57 am
Location: Decin , Czech Republic

Re: TBS discovery - custom motor MIX

Post by krtek2k »

So we can ask ourself , why not have CG right in the middle of "C" line by my last picture? Why not? For this axis , no matter how far from this axis motors are , just two front , two rear. CG in the middle...

krtek2k
Posts: 25
Joined: Mon Jul 15, 2013 10:57 am
Location: Decin , Czech Republic

Re: TBS discovery - custom motor MIX

Post by krtek2k »

Something like that , if i set 13,63cm = 1
Image
u can teach me something :)

Code: Select all

     motor[0] = PIDMIX(-1.27,+1,-1.65); //REAR_R
      motor[1] = PIDMIX(-1.54,-1,+1.85); //FRONT_R
      motor[2] = PIDMIX(+1.27,+1,+1.65); //REAR_L
      motor[3] = PIDMIX(+1.54,-1,-1.85); //FRONT_L

krtek2k
Posts: 25
Joined: Mon Jul 15, 2013 10:57 am
Location: Decin , Czech Republic

Re: TBS discovery - custom motor MIX

Post by krtek2k »

Oh !
Just tested it , and it flies so nice! In acro and also in level mode :)

Code: Select all

motor[0] = PIDMIX(-1.27,+1,-1.65); //REAR_R
motor[1] = PIDMIX(-1.54,-1,+1.85); //FRONT_R
motor[2] = PIDMIX(+1.27,+1,+1.65); //REAR_L
motor[3] = PIDMIX(+1.54,-1,-1.85); //FRONT_L
Attachments
discovery-realCG.jpg

krtek2k
Posts: 25
Joined: Mon Jul 15, 2013 10:57 am
Location: Decin , Czech Republic

Re: TBS discovery - custom motor MIX

Post by krtek2k »

Code: Select all

motor[0] = PIDMIX(-1.27,+1,-1); //REAR_R
motor[1] = PIDMIX(-1.54,-1,+1.12); //FRONT_R
motor[2] = PIDMIX(+1.27,+1,+1); //REAR_L
motor[3] = PIDMIX(+1.54,-1,-1.12); //FRONT_L

I found this is much better , i lowered power for YAW to 1 and 1.12 , was a little much when i pushed YAW stick hurry to max. Now it is good.

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: TBS discovery - custom motor MIX

Post by haydent »

great to hear that

aamorin
Posts: 21
Joined: Tue Jun 07, 2011 8:49 pm

Re: TBS discovery - custom motor MIX

Post by aamorin »

Hi everybody !
First of all, thanks a lot for all of you testing/supporting and helping us all with this great software! I have a TBS Discovery frame since a few days ago, tested it with default settings (Quadx defined, default PID's) and it flew pretty well but I've noticed some strange behavior at turns and fast forward flight, so I started my search and found this.. going to try it this weekend and a question has come to my mind:

I understand that if MY_PRIVATE_MIXING is defined in config.h there is no need to declare a frame at the beginning of it as it includes it automatically (according to line 817 in Output.ino, Multiwii 2.2), but what about the motor numbers definition in def.h (line 135) and Multitype declaration for the GUI's ad line 1053 (on the same file) ? do I have to include something? how does Multiwii knows the amount of motors if I don't tell him?..

Cheers !

aamorin
Posts: 21
Joined: Tue Jun 07, 2011 8:49 pm

Re: TBS discovery - custom motor MIX

Post by aamorin »

aamorin wrote:Hi everybody !
First of all, thanks a lot for all of you testing/supporting and helping us all with this great software! I have a TBS Discovery frame since a few days ago, tested it with default settings (Quadx defined, default PID's) and it flew pretty well but I've noticed some strange behavior at turns and fast forward flight, so I started my search and found this.. going to try it this weekend and a question has come to my mind:

I understand that if MY_PRIVATE_MIXING is defined in config.h there is no need to declare a frame at the beginning of it as it includes it automatically (according to line 817 in Output.ino, Multiwii 2.2), but what about the motor numbers definition in def.h (line 135) and Multitype declaration for the GUI's ad line 1053 (on the same file) ? do I have to include something? how does Multiwii knows the amount of motors if I don't tell him?..

Cheers !


One more thing.. I did read this, but I was wondering, if the purpose of MY_PRIVATE_MIXING is not to edit files again and again.. could I declare the Multitype and motor numbers on my XXX.h ? or do I have to do what I'm not supposed to? (edit def.h again and again)..

User avatar
Hamburger
Posts: 2559
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: TBS discovery - custom motor MIX

Post by Hamburger »

My.private.mixing has a howto description in the official wiki. The link may even be written in config.h. Read it it should answer your question how to use this.
Idea is to not edit def.h ever.
Define quadx or whatever suits your number motors and servos(ignore geometry aspects) - if none of the existing coptertypes fits then my.private.mixing does not help you.
Then put the code resembling your motors and servos mixing suitable for your geometry into your new private file as defined via my.private.mixing.(as starting point you can copy over something from the output file)

aamorin
Posts: 21
Joined: Tue Jun 07, 2011 8:49 pm

Re: TBS discovery - custom motor MIX

Post by aamorin »

Hamburger wrote:My.private.mixing has a howto description in the official wiki. The link may even be written in config.h. Read it it should answer your question how to use this.
Idea is to not edit def.h ever.
Define quadx or whatever suits your number motors and servos(ignore geometry aspects) - if none of the existing coptertypes fits then my.private.mixing does not help you.
Then put the code resembling your motors and servos mixing suitable for your geometry into your new private file as defined via my.private.mixing.(as starting point you can copy over something from the output file)


Thanks a lot for your answer Hamburger, now I understood it. I'll make some test with the latest values from krtek2k and report later

Cheers!

aamorin
Posts: 21
Joined: Tue Jun 07, 2011 8:49 pm

Re: TBS discovery - custom motor MIX

Post by aamorin »

Ok, I flew it last weekend, but I'm afraid I can't tell you exactly how good it fly.. All I can say until now is that it does fly..
Maybe it's because I have to raise a lot my pid's but it seems to be pretty tail heavy.. doing a fast forward flight (flying only with gyro) it starts to "fall from tail".. like if someone was pulling it from behind. It was a windy day.

I have my esc's flashed with blheli (they are SILABS based Turnigy Plush so can't use SimonK firmware), so perhaps I can raise my pids by 2 or 3; now on I have the default ones.

rallie_86
Posts: 2
Joined: Fri Apr 18, 2014 9:23 pm

Re: TBS discovery - custom motor MIX

Post by rallie_86 »

krtek2k wrote:

Code: Select all

motor[0] = PIDMIX(-1.27,+1,-1); //REAR_R
motor[1] = PIDMIX(-1.54,-1,+1.12); //FRONT_R
motor[2] = PIDMIX(+1.27,+1,+1); //REAR_L
motor[3] = PIDMIX(+1.54,-1,-1.12); //FRONT_L

I found this is much better , i lowered power for YAW to 1 and 1.12 , was a little much when i pushed YAW stick hurry to max. Now it is good.


Hi! Is there anyone else who tried this that can conform it works good?
I got naza on my disco now, but its terrible boring to fly :)
Just about to get my flip 1.5 in it instead and would love some locked in settings :)

acessford
Posts: 14
Joined: Sun Oct 13, 2013 11:18 pm

Re: TBS discovery - custom motor MIX

Post by acessford »

I'd love to know if anyone has tried this mix and what pids there running. I've has a tough time with this frame.

GUSHELFER
Posts: 14
Joined: Mon Apr 07, 2014 5:31 pm

Re: TBS discovery - custom motor MIX

Post by GUSHELFER »

tal vez lo mejor sea la mezcla de 2 frames, la de quadx y octoflat x, usamos los valores de quadx solo para los motores traseros, y para los motores delanteros usamos la configuracion de octoflat x ( motor 0 = MIDFRONT L ) Y ( MOTOR 5 = MIDFRONT R) tendria q funcionar !!! cambiar sentido yaw ??? (+,-) supongo........

Post Reply