Propeller im Quadrocopter

Alles was Du selbst gebaut hast, hier herein. Das Projekt muss allerdings mit einem oder mehreren Parallax Propeller µC realisiert worden sein.
Benutzeravatar
PIC18F2550
Beiträge: 2831
Registriert: Fr 30. Sep 2011, 13:08

Re: Propeller im Quadrocopter

Beitrag von PIC18F2550 »

Habe mal ein paar Teile ins WIKI geschoben.
Besser so :mrgreen:
Gruß
PIC18F2550

drone265/278
Barbarus hic ergo sum, quia non intellegor ulli.
Ein Barbar bin ich hier, da ich von keinem verstanden werde.
ʎɐqǝ ıǝq ɹnʇɐʇsɐʇ ǝuıǝ ɹǝpǝıʍ ǝıu ǝɟnɐʞ ɥɔı ´uuɐɯ ɥo
Benutzeravatar
PIC18F2550
Beiträge: 2831
Registriert: Fr 30. Sep 2011, 13:08

Re: Propeller im Quadrocopter

Beitrag von PIC18F2550 »

Als Ausgabe an die Motore will ich erst ein mal ein paar Servos nutzen.
Nicht das ich gleich alles wieder Schrotte.

Habe dazu eine interessante routine gefunden und auf 4 Servo's aufgebohrt.

Irgend wie sieht mir der umgang mit den nicht benutzten Pinns nicht gut aus.
Werd da wohl etwas ändern müssen.

Code: Alles auswählen

DAT

Servos        org                         'Assembles the next command to the first cell (cell 0) in the new cog's RAM
Loop          mov       dira,ServoPin1    'Set the direction of the "ServoPin1" to be an output (and all others to be inputs)
              rdlong    HighTime,p1       'Read the "position1" variable from Main RAM and store it as "HighTime"
              mov       counter,cnt       'Store the current system clock count in the "counter" cell's address
              mov       outa,AllOn        'Set all pins on this cog high (really only sets ServoPin1 high b/c rest are inputs)
              add       counter,HighTime  'Add "HighTime" value to "counter" value
              waitcnt   counter,0         'Wait until cnt matches counter (adds 0 to "counter" afterwards)
              mov       outa,#0           'Set all pins on this cog low (really only sets ServoPin1 low b/c rest are inputs)

              mov       dira,ServoPin2    'Set the direction of the "ServoPin2" to be an output (and all others to be inputs)
              rdlong    HighTime,p2       'Read the "position2" variable from Main RAM and store it as "HighTime"
              mov       counter,cnt       'Store the current system clock count in the "counter" cell's address
              mov       outa,AllOn        'Set all pins on this cog high (really only sets ServoPin2 high b/c rest are inputs)
              add       counter,HighTime  'Add "HighTime" value to "counter" value
              waitcnt   counter,0         'Wait until cnt matches counter (adds 0 to "counter" afterwards)
              mov       outa,#0           'Set all pins on this cog low (really only sets ServoPin2 low b/c rest are inputs)

              mov       dira,ServoPin3    'Set the direction of the "ServoPin3" to be an output (and all others to be inputs)
              rdlong    HighTime,p3       'Read the "position3" variable from Main RAM and store it as "HighTime"
              mov       counter,cnt       'Store the current system clock count in the "counter" cell's address
              mov       outa,AllOn        'Set all pins on this cog high (really only sets ServoPin3 high b/c rest are inputs)
              add       counter,HighTime  'Add "HighTime" value to "counter" value
              waitcnt   counter,0         'Wait until cnt matches counter (adds 0 to "counter" afterwards)
              mov       outa,#0           'Set all pins on this cog low (really only sets ServoPin3 low b/c rest are inputs)

              mov       dira,ServoPin4    'Set the direction of the "ServoPin4" to be an output (and all others to be inputs)
              rdlong    HighTime,p4       'Read the "position4" variable from Main RAM and store it as "HighTime"
              mov       counter,cnt       'Store the current system clock count in the "counter" cell's address
              mov       outa,AllOn        'Set all pins on this cog high (really only sets ServoPin3 high b/c rest are inputs)
              add       counter,HighTime  'Add "HighTime" value to "counter" value
              waitcnt   counter,LowTime   'Wait until "cnt" matches "counter" then add a 10ms delay to "counter" value
              mov       outa,#0           'Set all pins on this cog low (really only sets ServoPin4 low b/c rest are inputs)

              waitcnt   counter,0         'Wait until cnt matches counter (adds 0 to "counter" afterwards)
              jmp       #Loop             'Jump back up to the cell labled "Loop"

'Constants and Variables:
ServoPin1     long      |<      4 '<------- This sets the pin that outputs the first servo signal (which is sent to the white
                                          ' wire on most servomotors). Here, this "6" indicates Pin 6. Simply change the "6"
                                          ' to another number to specify another pin (0-31).
ServoPin2     long      |<      5 '<------- This sets the pin that outputs the second servo signal (could be 0-31).
ServoPin3     long      |<      6 '<------- This sets the pin that outputs the third servo signal (could be 0-31).
ServoPin4     long      |<      7 '<------- This sets the pin that outputs the third servo signal (could be 0-31).
p1            long      0                 'Used to store the address of the "position1" variable in the main RAM
p2            long      0                 'Used to store the address of the "position2" variable in the main RAM
p3            long      0                 'Used to store the address of the "position2" variable in the main RAM
p4            long      0                 'Used to store the address of the "position2" variable in the main RAM
AllOn         long      $FFFFFFFF         'This will be used to set all of the pins high (this number is 32 ones in binary)
LowTime       long      800_000           'This works out to be a 10ms pause time with an 80MHz system clock. If the
                                          ' servo behaves erratically, this value can be changed to 1_600_000 (20ms pause)
counter       res                         'Reserve one long of cog RAM for this "counter" variable
HighTime      res                         'Reserve one long of cog RAM for this "HighTime" variable
              fit                         'Makes sure the preceding code fits within cells 0-495 of the cog's RAM
Zuletzt geändert von PIC18F2550 am Fr 12. Okt 2012, 16:53, insgesamt 1-mal geändert.
Gruß
PIC18F2550

drone265/278
Barbarus hic ergo sum, quia non intellegor ulli.
Ein Barbar bin ich hier, da ich von keinem verstanden werde.
ʎɐqǝ ıǝq ɹnʇɐʇsɐʇ ǝuıǝ ɹǝpǝıʍ ǝıu ǝɟnɐʞ ɥɔı ´uuɐɯ ɥo
Benutzeravatar
PIC18F2550
Beiträge: 2831
Registriert: Fr 30. Sep 2011, 13:08

Re: Propeller im Quadrocopter

Beitrag von PIC18F2550 »

Habe jetzt meine Sensoren zum Turm zusammengelötet und siehe da es geht ohne Probleme.
WIKI korrigiert: http://hive-project.de/wiki/sen_beschl_adxl345:start
DSCI0219.JPG
DSCI0220.JPG
1. Servo am PROP :mrgreen:
DSCI0218.JPG
Gruß
PIC18F2550

drone265/278
Barbarus hic ergo sum, quia non intellegor ulli.
Ein Barbar bin ich hier, da ich von keinem verstanden werde.
ʎɐqǝ ıǝq ɹnʇɐʇsɐʇ ǝuıǝ ɹǝpǝıʍ ǝıu ǝɟnɐʞ ɥɔı ´uuɐɯ ɥo
Benutzeravatar
PIC18F2550
Beiträge: 2831
Registriert: Fr 30. Sep 2011, 13:08

Re: Propeller im Quadrocopter

Beitrag von PIC18F2550 »

komme irgendwie nicht weiter :oops:
Gruß
PIC18F2550

drone265/278
Barbarus hic ergo sum, quia non intellegor ulli.
Ein Barbar bin ich hier, da ich von keinem verstanden werde.
ʎɐqǝ ıǝq ɹnʇɐʇsɐʇ ǝuıǝ ɹǝpǝıʍ ǝıu ǝɟnɐʞ ɥɔı ´uuɐɯ ɥo
Benutzeravatar
PIC18F2550
Beiträge: 2831
Registriert: Fr 30. Sep 2011, 13:08

Re: Propeller im Quadrocopter

Beitrag von PIC18F2550 »

Hatte garnichts mit Programm zu tun.

Zwei der Conrad-Servos wahren einfach neu und schon fest. ÄRGERLICH :evil:
2012-10-14_00-13-37_685.jpg
an der Stelle wo die schraube ist fehlt jetzt ein Zahn. Der blockierte den Servo.

Den 2. konne ich als Ersatzteilspender missbrauchen für den 1.

Im Anhang das Servotestprogramm für 4 Servos
4servo_asm.spin
(5.97 KiB) 613-mal heruntergeladen
Gruß
PIC18F2550

drone265/278
Barbarus hic ergo sum, quia non intellegor ulli.
Ein Barbar bin ich hier, da ich von keinem verstanden werde.
ʎɐqǝ ıǝq ɹnʇɐʇsɐʇ ǝuıǝ ɹǝpǝıʍ ǝıu ǝɟnɐʞ ɥɔı ´uuɐɯ ɥo
Benutzeravatar
drohne235
Administrator
Beiträge: 2284
Registriert: So 24. Mai 2009, 10:35
Wohnort: Lutherstadt Wittenberg
Kontaktdaten:

Re: Propeller im Quadrocopter

Beitrag von drohne235 »

Bei beiden Servos der gleiche Fehler? Du bist ein echter Glückspilz... ;)
"Ob Sie denken, dass Sie es können, oder ob Sie denken, dass Sie es nicht können - in beiden Fällen haben Sie recht." Henry Ford
Benutzeravatar
PIC18F2550
Beiträge: 2831
Registriert: Fr 30. Sep 2011, 13:08

Re: Propeller im Quadrocopter

Beitrag von PIC18F2550 »

Nicht ganz beim andern war es der Motor :evil: der dreht sich nur ein stückchen hinn und zurück.

Servo Typ:VSD-6

:oops: wenn ich blos wüsste wo ich mein GPS-Empfänger verschlampt habe könnte ich jetzt weiter machen. :evil:
Gruß
PIC18F2550

drone265/278
Barbarus hic ergo sum, quia non intellegor ulli.
Ein Barbar bin ich hier, da ich von keinem verstanden werde.
ʎɐqǝ ıǝq ɹnʇɐʇsɐʇ ǝuıǝ ɹǝpǝıʍ ǝıu ǝɟnɐʞ ɥɔı ´uuɐɯ ɥo
Benutzeravatar
PIC18F2550
Beiträge: 2831
Registriert: Fr 30. Sep 2011, 13:08

Re: Propeller im Quadrocopter

Beitrag von PIC18F2550 »

Singende Servos :lol:
Zuletzt geändert von PIC18F2550 am Mo 15. Okt 2012, 12:38, insgesamt 1-mal geändert.
Gruß
PIC18F2550

drone265/278
Barbarus hic ergo sum, quia non intellegor ulli.
Ein Barbar bin ich hier, da ich von keinem verstanden werde.
ʎɐqǝ ıǝq ɹnʇɐʇsɐʇ ǝuıǝ ɹǝpǝıʍ ǝıu ǝɟnɐʞ ɥɔı ´uuɐɯ ɥo
Benutzeravatar
PIC18F2550
Beiträge: 2831
Registriert: Fr 30. Sep 2011, 13:08

Re: Propeller im Quadrocopter

Beitrag von PIC18F2550 »

Gruß
PIC18F2550

drone265/278
Barbarus hic ergo sum, quia non intellegor ulli.
Ein Barbar bin ich hier, da ich von keinem verstanden werde.
ʎɐqǝ ıǝq ɹnʇɐʇsɐʇ ǝuıǝ ɹǝpǝıʍ ǝıu ǝɟnɐʞ ɥɔı ´uuɐɯ ɥo
Benutzeravatar
PIC18F2550
Beiträge: 2831
Registriert: Fr 30. Sep 2011, 13:08

Re: Propeller im Quadrocopter

Beitrag von PIC18F2550 »

LP.png
Brushless Motor Controller ohne Spannungsversorgung & Stützkondensatoren.

z.Z denke ich über die Phasenerkennung nach die Variante mit den 3 Comparatoren gefällt mir nicht.

Warscheinlich läuft es darauf hinaus das ich einen schnellen AD-Wandler einsetze und nur eine Phase überwache.

Der Prop hat ja eine schöne Sinushalbwelle in Speicher damit lässt sich bestimmt bestimmen wo sich das Drehfeld befinden muß.
Gruß
PIC18F2550

drone265/278
Barbarus hic ergo sum, quia non intellegor ulli.
Ein Barbar bin ich hier, da ich von keinem verstanden werde.
ʎɐqǝ ıǝq ɹnʇɐʇsɐʇ ǝuıǝ ɹǝpǝıʍ ǝıu ǝɟnɐʞ ɥɔı ´uuɐɯ ɥo
Antworten