Blackout Mini Spider Hexa (mini bouwverslag + naze32 HOWTO)

Zijn toch spiders genoeg op dit forum, gents please test de settings en laat het weten, ben zeer benieuwd of dit ook voor de andere setups werkt.

Script in post 254, getallen bepalen in post 272
 
@Richardoe
Ik heb de script wat dynamischer gemaakt.
Ik heb er een option parser aan toegevoegd.
Je kan nu dmv arguments meteen de goede waarde krijgen en de script handelt de rest. Uiteraard kan het nog verfijnd worden.


Code:
#!/usr/bin/python
# Python script for naze32 multirotor mixers
# 
######################################################################################################
import getopt
from optparse import OptionParser
import numpy as np

parser = OptionParser()
parser.add_option("--A",  dest="A",   default=0, help = "A")
parser.add_option('--B', dest="B", default=0, help="B")
parser.add_option('--C', dest="C",  default=0, help="C")
parser.add_option('--D', dest="D",  default=0, help="D")
parser.add_option('--E', dest="E",  default=0, help="E")


opts, args = parser.parse_args()

A = float(opts.A)
B = float(opts.B)
C = float(opts.C)
D = float(opts.D)
E = float(opts.E)
Aneg = 0 - A
Bneg = 0 - B
Cneg = 0 - C
Dneg = 0 - D
Eneg = 0 - E

 
# The first two lines of the A matrix represent the coordinates of each rotor in the X,Y plane,
# and the third line the direction in which they spin.

# Settings Dynamic through Option parser
A = np.array([[B,  Aneg,   B,   Aneg,    0,   0],      # Y axis
             [ Eneg,  Cneg,   E,   C, Dneg,  D],       # X axis
             [   1,   1,   -1,    -1,  -1,   1]])     # Motor cw/ccw


# Settings Super Hex
#A = np.array([[15,  -14,   15,   -14,   0,   0],      # Y axis
#             [ -8,  -11,    8,    11, -17,  17],       # X axis
#             [   1,   1,   -1,    -1,  -1,   1]])     # Motor cw/ccw

# Moore-Penrose pseudoinverse of A
B = np.linalg.pinv(A)
# normalizing columns of B and transpose
B_normalized = (B.T / B.max(axis=0)[:, np.newaxis])
 
# scale and round to 1 to return final coefficients
coeffs = np.around(1*B_normalized,2)
 
import string
print('')
print ('Custom mix voor naze')
print ('---------------------------------------------')
print('Motor:   1     2     3    4    5    6')
rows = ['PITCH  ', 'ROLL ', 'YAW   ']
for i, r in enumerate(rows):
    print(r + '{' + ','.join([format(c) for c in coeffs[i]]) + '}')

    x=0
    for c in coeffs[1]:
        #print(format(c))
        x += 1
        if x==1:
            roll1=format(c)
        if x==2:
            roll2=format(c)
        if x==3:
            roll3=format(c)
        if x==4:
            roll4=format(c)
        if x==5:
            roll5=format(c)
        if x==6:
            roll6=format(c)

    x=0
    for c in coeffs[0]:     
        #print(format(c))
        x += 1
        if x==1:
            pitch1=format(c)
        if x==2:
            pitch2=format(c)
        if x==3:
            pitch3=format(c)
        if x==4:
            pitch4=format(c)
        if x==5:
            pitch5=format(c)
        if x==6:
            pitch6=format(c)

    x=0
    for c in coeffs[2]:
        #print(format(c))
        x += 1
        if x==1:
            yaw1=format(c)
        if x==2:
            yaw2=format(c)
        if x==3:
            yaw3=format(c)
        if x==4:
            yaw4=format(c)
        if x==5:
            yaw5=format(c)
        if x==6:
            yaw6=format(c)
# nicely output result as defines for copy-pasting
print ('---------------------------------------------')
print ('')
print ('mixer custom')
print ('cmix 1 1 ' + roll1 + ' ' + pitch1 + ' ' + yaw1)
print ('cmix 2 1 ' + roll2 + ' ' + pitch2 + ' ' + yaw2)
print ('cmix 3 1 ' + roll3 + ' ' + pitch3 + ' ' + yaw3)
print ('cmix 4 1 ' + roll4 + ' ' + pitch4 + ' ' + yaw4)
print('cmix 5 1 ' + roll5 + ' ' + pitch5 + ' ' + yaw5)
print('cmix 6 1 ' + roll6 + ' ' + pitch6 + ' ' + yaw6)

Hoe gebruiken (command):
Code:
./mixer_naze.py --A=14 --B=15 --C=11 --D=17 --E=8

en je krijgt de juiste output!

Notitie:
B en A moeten toch omgedraaid worden. Het klopt niet dat je zulke waardes krijgt. Y as is positief omhoog en niet naar beneden

Dus mini hex
Code:
mixer custom
cmix 1 1 -0.42 1.0 0.87
cmix 2 1 -0.58 -0.86 0.85
cmix 3 1 0.42 1.0 -0.87
cmix 4 1 0.58 -0.86 -0.85
cmix 5 1 -1.0 -0.0 -1.0
cmix 6 1 1.0 0.0 1.0

Het was totaal onlogisch dat de voorste motoren hogere pitch vector hadden, dus vandaar dat ik verder ging denken.
Verwarring was ontstaan omdat bij mij die 2 getallen bijna hetzelfde waren.
 
Laatst bewerkt:
Dan heb je nu voor motor 1 (A en -E) dat kan toch niet? dat is namelijk altijd een voormotor, had je niet alleen de - en de + moeten omdraaien van a en b?

Of bedoel je dat de a en de b op de foto omgekeerd moeten worden?
 
A en B kun je op beide plekken omdraaien met hetzelfde effect ;).

Ik heb de A en B in de array omgedraaid. Probeer de script eens uit. Dan zul je zien dat het klopt.

Ik bleef mijn hersenen kraken om het feit dat op de mini hexa de voorarmen meer pitch zouden geven, terwijl het me niet zo kun zijn en de hex wen natuurlijke neiging had om naar voren te duiken bij te weinig I gain.
Verwarring ontstond bij mij om het feit dat deze waardes dicht op elkaar liggen, maar ik had het de eerste keer goed ingevuld.

Als je frame hebt zoals bij jou op de foto is boven Y positief en X rechts positief.
 
:-) ik kan jouw waarden er wel uitkrijgen. Is makkelijk zo met die parameters, top.

Ik blijf alleen mijn hersenen kraken over het feit dat nu M1 op basis van deze instelling niet meer klopt, A is de afstand naar voormotor en dat vul je nu bij M1 in, dat begrijp ik niet.
 
Hmmm....ik heb inderdaad A aan E gekoppeld voor motor 1. Moet fout zijn. Kijk het zo even na.
Wellicht dat ik hiet niet de juiste versie op heb gezet, want anders had ik een hele andere uitkomst voor roll gehad.
 
Ja want dan kom je weer op mijn waarden uit :-(

Misterie opgelost! De waardes waren goed alleen alle polariteiten waren omgedraaid (van beneden gezien)
Nu X en Y correct zoals gezegd! De verhoudingen veranderen niet, maar nu is het logisch!

Jouw waardes kloppen bij deze inderdaad! De voorste motoren moeten meer pitch hebben dus eigenlijk. Nu snap ik hem, Die hebben de grootste afstand (paarse kruising)

De grootste verwarring is dan ontstaan bij het verschuiven van de pitch afstand bij mij waardoor het even onlogisch werd.

Code:
# Settings Dynamic through Option parser
A = np.array([[B,  Aneg,   B,   Aneg,    0,   0],      # Y axis
             [ Eneg,  Cneg,   E,   C, Dneg,  D],       # X axis
             [   1,   1,   -1,    -1,  -1,   1]])     # Motor cw/ccw
 
Gelukkig, dan nu met de juiste foto (formule aanpassing)

Uitkomst check
Code:
mixer custom
cmix 1 1 -0.42 1.0 0.87
cmix 2 1 -0.58 -1.16 0.85
cmix 3 1 0.42 1.0 -0.87
cmix 4 1 0.58 -1.16 -0.85
cmix 5 1 -1.0 0.0 -1.0
cmix 6 1 1.0 0.0 1.0

Roll. Motor 1,2,5 rechts zelfde polariteit. KLOPT
Pitch Motor 2,4, zelfde polariteit. KLOPT

Hoe verder van COT af hoe meer invloed:
Roll Motor 5 meeste invloed, dan motor 2, dan motor 1. KLOPT
Pitch Motor 5/6 geen inlvoed, Motor 2 en 4 meeste invloed en motor 1 en 3 minder. KLOPT.


1f45456594.jpg
 
en nieuwe versie script met aangepaste formule en checks die de naze ook doet en nog een paar extra checks erin en je mag nu ook geen - waardes meer invoeren voor a,b,c,d,e,

Code:
#!/usr/bin/python
# Python script for naze32 multirotor mixers
# 
# BorisB 
# Version 0.31
#
######################################################################################################

import getopt
from optparse import OptionParser
import numpy as np

parser = OptionParser()
parser.add_option("--A", dest="A",  default=0, help="A=Y Distance from COG to front motors")
parser.add_option('--B', dest="B",  default=0, help="B=Y Distance from COG to back motors")
parser.add_option('--C', dest="C",  default=0, help="C=X Distance from COG to front motors")
parser.add_option('--D', dest="D",  default=0, help="D=X Distance from COG to side motors")
parser.add_option('--E', dest="E",  default=0, help="E=X Distance from COG to back motors")


opts, args = parser.parse_args()



A = float(opts.A)
B = float(opts.B)
C = float(opts.C)
D = float(opts.D)
E = float(opts.E)
Aneg = 0 - A
Bneg = 0 - B
Cneg = 0 - C
Dneg = 0 - D
Eneg = 0 - E

if A<0 or B<0 or C<0 or D<0 or E<0:
    print('ERROR: Only use positive values as input')
    print('--h for help')
    quit()


 
# The first two lines of the A matrix represent the coordinates of each rotor in the X,Y plane,
# and the third line the direction in which they spin.

# Settings Dynamic through Option parser
A = np.array([[B,  Aneg,   B,   Aneg,    0,   0],      # Y axis
             [ Eneg,  Cneg,   E,   C, Dneg,  D],       # X axis
             [   1,   1,   -1,    -1,  -1,   1]])     # Motor cw/ccw

# Moore-Penrose pseudoinverse of A
B = np.linalg.pinv(A)
# normalizing columns of B and transpose
B_normalized = (B.T / B.max(axis=0)[:, np.newaxis])
 
# scale and round to 1 to return final coefficients
coeffs = np.around(1*B_normalized,2)
 
import string
print('')
print ('Custom mix voor naze')
print ('---------------------------------------------')
print('Motor:   1     2     3    4    5    6')
rows = ['PITCH  ', 'ROLL ', 'YAW   ']
for i, r in enumerate(rows):
    print(r + '{' + ','.join([format(c) for c in coeffs[i]]) + '}')

    x=0
    for c in coeffs[1]:
        #print(format(c))
        x += 1
        if x==1:
            roll1=format(c)
        if x==2:
            roll2=format(c)
        if x==3:
            roll3=format(c)
        if x==4:
            roll4=format(c)
        if x==5:
            roll5=format(c)
        if x==6:
            roll6=format(c)

    x=0
    for c in coeffs[0]:     
        #print(format(c))
        x += 1
        if x==1:
            pitch1=format(c)
        if x==2:
            pitch2=format(c)
        if x==3:
            pitch3=format(c)
        if x==4:
            pitch4=format(c)
        if x==5:
            pitch5=format(c)
        if x==6:
            pitch6=format(c)

    x=0
    for c in coeffs[2]:
        #print(format(c))
        x += 1
        if x==1:
            yaw1=format(c)
        if x==2:
            yaw2=format(c)
        if x==3:
            yaw3=format(c)
        if x==4:
            yaw4=format(c)
        if x==5:
            yaw5=format(c)
        if x==6:
            yaw6=format(c)
# nicely output result as defines for copy-pasting
print ('---------------------------------------------')
print ('')
print ('mixer custom')
print ('cmix 1 1 ' + roll1 + ' ' + pitch1 + ' ' + yaw1)
print ('cmix 2 1 ' + roll2 + ' ' + pitch2 + ' ' + yaw2)
print ('cmix 3 1 ' + roll3 + ' ' + pitch3 + ' ' + yaw3)
print ('cmix 4 1 ' + roll4 + ' ' + pitch4 + ' ' + yaw4)
print ('cmix 5 1 ' + roll5 + ' ' + pitch5 + ' ' + yaw5)
print ('cmix 6 1 ' + roll6 + ' ' + pitch6 + ' ' + yaw6)

#checkpoints
rollcheck = float(roll1) + float(roll2) + float(roll3) + float(roll4) +float(roll5) + float(roll6)
pitchcheck = float(pitch1) + float(pitch2) + float(pitch3) + float(pitch4) +float(pitch5) + float(pitch6)
yawcheck = float(yaw1) + float(yaw2) + float(yaw3) + float(yaw4) +float(yaw5) + float(yaw6)

 

print('')
print ('---------------------------------------------')
print('for spider a symetrical roll and yaw is expected, pitch will be asymetrical')
if rollcheck==0:
    print('sum of roll should be zero: ' + format(rollcheck) + '  OK')
else:
    print('sum of roll should be zero: '+ format(rollcheck) + '  NOT OK')


if pitchcheck==0:
    print('sum of pitch no zero value expected: '+ format(pitchcheck) + '  NOT OK')
else:
    print('sum of pitch no zero value expected: '+ format(pitchcheck) + '  OK')


if yawcheck==0:
    print('sum of yaw should be zero: '+ format(yawcheck) + '  OK')
else:
    print('sum of yaw should be zero: '+ format(yawcheck) + '  NOT OK')

if float(roll1)<0 and float(roll2)<0 and float(roll5)<0:
    print('Motors 1,2,5 same roll polarity expected: OK')
else:
    print('Motors 1,2,5 same roll polarity expected: NOT OK')

if float(pitch2)<0 and float(pitch4)<0:
    print('Motors 2,4 same pitch polarity expected: OK')
else:
    print('Motors 2,4 same pitch polarity expected: NOT OK')
 
Laatst bewerkt:
Yup.....it all makes sense!

Een ander aspect wat bepalend is je daadwerkelijke CG, want pitch control vereist daar ook balans in en daar kun je een beetje mee experimenteren.
Voor mij is het irritant om de lipo helemaal naar de "gele" kruis te doen, dus daar kun je een beetje mee vals spelen in de mix en dus lipo tikkeltje naar voren doen.
 
zoals het nu ligt qua lipo dan zou a 3 cm langer worden en b 3 cm korter. dat zou wel heel extreem worden. voomotoren gaan dan vrijwel 2 keer zoveel doen als achter:-)\

dus daartussen ligt ergens de waarheid qua optimum. want naze ligt natuurlijk nog wel verder naar voren.

Code:
mixer custom
cmix 1 1 -0.42 1.0 0.87
cmix 2 1 -0.58 -1.98 0.85
cmix 3 1 0.42 1.0 -0.87
cmix 4 1 0.58 -1.98 -0.85
cmix 5 1 -1.0 -0.0 -1.0
cmix 6 1 1.0 0.0 1.0
 
Naze is hier niet relevant, want de hoek is altijd hetzelfde (voor de gyro in ieder geval)

Dit is eigenlijk hoe je pitch control zou moeten bekijken. In plaats van driehoek zou je eigenlijk iedere axis los moeten op delen voor de reele verhoudingen. Zijwaartse motoren hebben daar geen invloed op. Verhouding tussen A en B is bepalend voor de pitch vershil in de mixer

Pitch%20Control.jpg
 
Op basis van de nieuwe pitch geometrie kom ik hierop uit.
Graag testen iemand en laten weten of het beter is!

EDIT:
Super Spider Hex
Code:
mixer custom
cmix 1 1 -0.42 1.0 0.9
cmix 2 1 -0.58 -1.33 0.89
cmix 3 1 0.42 1.0 -0.9
cmix 4 1 0.58 -1.33 -0.89
cmix 5 1 -1.0 -0.0 -1.0
cmix 6 1 1.0 0.0 1.0
 
Laatst bewerkt:
Ga mee in de theorie dat dat beter is dan is dit het voor de mini hex :-)

5 mm correctie (a langer, b korter)

ik zou dan invoeren --A=133 --B=105 --C=96.5 --D=145 --E=72

Code:
mixer custom
cmix 1 1 -0.42 1.0 0.87
cmix 2 1 -0.58 -1.27 0.85
cmix 3 1 0.42 1.0 -0.87
cmix 4 1 0.58 -1.27 -0.85
cmix 5 1 -1.0 -0.0 -1.0
cmix 6 1 1.0 0.0 1.0
 
Heb exacte afmetingen nogmaals gedaan volgens het True COT voor pitch. Net hover gedaan. Hoop snel toch te testen. Dit zou dan het ideaal plaatje zijn.

--A=16 --B=12 --C=11 --D=17 --E=8

Super Spider Hex
Code:
mixer custom
cmix 1 1 -0.42 1.0 0.9
cmix 2 1 -0.58 -1.33 0.89
cmix 3 1 0.42 1.0 -0.9
cmix 4 1 0.58 -1.33 -0.89
cmix 5 1 -1.0 -0.0 -1.0
cmix 6 1 1.0 0.0 1.0
 
Scheelt dan niet heel veel meer met de normale mini, ben ook beniewd wat de anderen hier en op rcgroups ervan vinden qua vliegen.
 
heb ook weer me uber hex in mekaar gezet
ga morgen FPV testen met de Mixer Custom

los vloog ie raar op LOOPTIME 2800
raar geluid erin .. Stotteren / pingel van een gitaar ??
terug na looptime 2500 en weer smooth sound erin

laat morgen wat weten
 
Back
Top