Jak widać chętnych do popełnienia tego projektu jest wielu.
Przyznam, że już kilka miesięcy czaiłem się ruszyć te zagadnienie.
Materiały są dostępne na forum MultiWii
przykładowy temat którym się dziś posiłkowałem: http://www.multiwii.com/forum/viewtopic.php?f=8&t=594
Podstawowy schemat połączeń:
Zmontowałem to tak jak tylko można było najprościej.
Arduino + graty Wii.
Z gratów Wii zrobiłem IMU (skleiłem dwie płytki i zapakowałem w koszulkę termokurczliwą), do płytki arduino bezpośrednio przewody (wejścia i wyjścia). Docelowo po udanych testach stołowych zrobię małą płytkę z odpowiednimi filtrami wejść i zasilania oraz złącza.
Tym razem do obsługi arduino dorwałem FTDI z wyprowadzonym DTR więc nie musze wciskać na czas resetu.
Dziś zrobiłem tylko przygotowanie do tematu.
Wgrałem wsad MultiWii_1_8_2Flyingwing - musiałem nieco pogrzebać.
To co ma na celu:
1) Stabilizacja skrzydła- przełącznik 3 pozycyjny AUX1, 1 pozycja to sam mikser bez stabilizacji, 2 pozycja to aktywacja samych żyroskopów, 3 aktywacja ACC. ---> ZROBIONE
2) AHI z OSD Remzibi- AHI aktywowane AUX2, bez uzbrajania czy innych zbednych kombinacji ----> OBECNIE
3) Uruchomienie 2-osiowej stabilizacji kamery ----> KOLEJNY ETAP
Aby otrzymać pierwszy punkt zrobiłem tak (zaznaczając trzeci kwadracik w AUX1 dla aktywacji ACC) :
Kod: Zaznacz cały
#ifdef FLYING_WING
if(abs(rcData[AUX1])>1650) { //Use aux1 to activate Passthru or MWii mode
int RX_ROLL = 1500-rcData[ROLL]; // Analog pin 1 output
int RX_PITCH = 1500-rcData[PITCH]; // Analog pin 0 output
int RX_YAW = 1500-rcData[YAW]; // Digital pin 3 output
//Passthru
servo[0] = constrain(1500 - RX_YAW, 1020, 2000); //YAW the direction of the servo can be changed here: invert the sign before RX_YAW
servo[1] = constrain(1500 - RX_PITCH + RX_ROLL, 1020, 2000); //LEFT the direction of the 2 servo can be changed here: invert the sign before RX_PITCH
servo[2] = constrain(1500 + RX_PITCH + RX_ROLL, 1020, 2000); //RIGHT
motor[0] = constrain( rcData[THROTTLE], 1020,2000); //MOTOR on pin 9 490hz ESC
}else{
//MultiWii
servo[0] = constrain(1500 - axisPID[YAW], 1020, 2000); //YAW the direction of the servo can be changed here: invert the sign before axisPID
servo[1] = constrain(1500 - axisPID[PITCH] - axisPID[ROLL], 1020, 2000); //LEFT the direction of the 2 servo can be changed here: invert the sign before axisPID
servo[2] = constrain(1500 + axisPID[PITCH] - axisPID[ROLL], 1020, 2000); //RIGHT
motor[0] = constrain( rcData[THROTTLE], 1020,2000); //MOTOR on pin 9 490hz ESC
}
#endif
EDIT:
Aby otrzymać pierwszy punkt zrobiłem tak (zaznaczając trzeci kwadracik w AUX1 dla aktywacji ACC) :
Kod: Zaznacz cały
#ifdef FLYING_WING
if(abs(rcData[AUX1])>1650) { //Use aux1 to activate Passthru or MWii mode
int RX_ROLL = 1500-rcData[ROLL]; // Analog pin 1 output
int RX_PITCH = 1500-rcData[PITCH]; // Analog pin 0 output
int RX_YAW = 1500-rcData[YAW]; // Digital pin 3 output
//Passthru
servo[0] = constrain(1500 - RX_YAW, 1020, 2000); //YAW the direction of the servo can be changed here: invert the sign before RX_YAW
servo[1] = constrain(1500 - RX_PITCH + RX_ROLL, 1020, 2000); //LEFT the direction of the 2 servo can be changed here: invert the sign before RX_PITCH
servo[2] = constrain(1500 + RX_PITCH + RX_ROLL, 1020, 2000); //RIGHT
motor[0] = constrain( rcData[THROTTLE], 1020,2000); //MOTOR on pin 9 490hz ESC
}else{
//MultiWii
servo[0] = constrain(1500 - axisPID[YAW], 1020, 2000); //YAW the direction of the servo can be changed here: invert the sign before axisPID
servo[1] = constrain(1500 - axisPID[PITCH] - axisPID[ROLL], 1020, 2000); //LEFT the direction of the 2 servo can be changed here: invert the sign before axisPID
servo[2] = constrain(1500 + axisPID[PITCH] - axisPID[ROLL], 1020, 2000); //RIGHT
motor[0] = constrain( rcData[THROTTLE], 1020,2000); //MOTOR on pin 9 490hz ESC
}
#endif
EDIT:
Zrobiłem tak odnośnie AHI, idę sprawdzić - to modyfikacja pirzola (specjalnie dolutowałem piezo aby słyszeć w czasie testów co się dzieje)
Kod: Zaznacz cały
// -----------------------------------------------------------------------------------------------
if (armed == 0 && rcData[ROLL] < MINCHECK && rcData[PITCH] > MAXCHECK) {
switch (telemetry) {
case 1:
BUZZERPIN_ON delay(250); BUZZERPIN_OFF;
delay(150);
BUZZERPIN_ON delay(250); BUZZERPIN_OFF;
delay(150);
BUZZERPIN_ON delay(250); BUZZERPIN_OFF;
telemetry = 0;
OSD_END();
rcData[ROLL] = 1300;
// wartość wieksza niz MINCHECK, bezpieczniej wstawic wartosc srednia=neutralna
break;
case 0:
BUZZERPIN_ON delay(250); BUZZERPIN_OFF;
delay(150);
BUZZERPIN_ON delay(250); BUZZERPIN_OFF;
delay(150);
BUZZERPIN_ON delay(250); BUZZERPIN_OFF;
delay(150);
BUZZERPIN_ON delay(250); BUZZERPIN_OFF;
delay(150);
BUZZERPIN_ON delay(250); BUZZERPIN_OFF;
telemetry = 1;
OSD_INIT();
rcData[ROLL] = 1300;
// wartość wieksza niz MINCHECK, bezpieczniej wstawic wartosc srednia=neutralna
break;
}
}