Hi,
geilles Video Willa, die wohnungsnummer traue ich mich auch, sobaldich größere Räume habe

Amigo, ich weiss garnicht was Du hast, Willa hat auch Moby schon wieder zurück auf meinen MP3 Player geholt mit seinem letzten Video .

@All:
Pan und tilt funktioniert jetzt, der Erstflug kommt morgen, da ich gleich zum Sport muss:

Folgenden Code habe ich implementiert:
Code:
If Portb.2 = 0 Then


'(
'möglichkeit 2 über PID korrekturwerte servo wird am anfang initialisiert und es werden jeweils die abweichungen hinzugerechnet


  Servo_pan_pidd = Servo_pan_pidd + P_set_roll_int
  Servo_pan_pidd = Servo_pan_pidd + I_set_roll_int
  Servo_pan_pidd = Servo_pan_pidd + D_set_roll_int
  Servo_pan_pidd = Servo_pan_pidd + Dd_set_roll_int
  Servo_pan_pidd = Servo_pan_pidd / 21540
  Servo_pan_pidd = Dd_set_roll_int * 1000
  Servo_pan_pidd = Dd_set_roll_int + 32535

 'Klappt aus irgend einem Grund nicht, der servo driftet sofort ab ->überdenken
')

  Servo_pan = Meas_angle_roll / 21540                       'divide by value for 1g
  Servo_pan = Servo_pan * 1000                              'multiply with 1000 to get the servo format
  Servo_pan = Servo_pan + 32535                             'Mittelstellung addieren
  If Servo_pan > 33534 Then                                 'Overflow Protection
   Servo_pan = 33534
   End If
   If Servo_pan < 31536 Then                                'Overflow Protection
    Servo_pan = 31536
   End If
    Servo_pan = Servo_pan + 30000                           'add the remaining 30000 for neutral position
   If Camservo_bo = 1 Then
    Servo_pan_pwm = Servo_tilt
   Else
    Servo_pan_pwm = 62535                                   'center Position
   End If
End If

If Portb.3 = 0 Then
  Servo_tilt = Meas_angle_nick / 21540                      'divide by value for 1g
  Servo_tilt = Servo_tilt * 1000                            'multiply with 1000 to get the servo format  #
  'Wenn ich selber noch kippen will, dann muss ich hierzu noch die werte meines Potis auf Kanal 6 Adden
'(
   Manual_tilt = Empf(6) / Endwert                          'Poti auslesen und auf verhältnis umrechnen
   Manual_tilt = Manual_tilt * 1000                         'Auf Servowerte skalieren
  Servo_tilt = Servo_tilt + Manual_tilt                     'zum Tiltausgleich addieren/subtrahieren

')
  Servo_tilt = Servo_tilt + 32535                           'Mittelstellung addieren
  If Servo_tilt > 33534 Then                                'Overflow Protection
   Servo_tilt = 33534
   End If
   If Servo_tilt < 31536 Then                               'Overflow Protection
    Servo_tilt = 31536
   End If
    Servo_tilt = Servo_tilt + 30000                         'add the remaining 30000 for neutral position
   If Camservo_bo = 1 Then
    Servo_tilt_pwm = Servo_tilt
   Else
    Servo_tilt_pwm = 62535                                  'center Position
   End If

End If
und

Code:
Servoirq:                                                   'generate servo PWM pulse
If Servo_nr_by = 0 Then
   If Portd.6 = 0 Then                                      'wenn port low
      Timer1 = Servopwm                                     'dann timer auf entsprechende verzögerung
      Portd.6 = 1                                           'und port anschalten
   Else                                                     'das hier passiert erst bei dem darauf folgenden interrupt
      Portd.6 = 0                                           'dann port wieder ausschalten
      Incr Servo_nr_by                                      'und den nächsten kanal bearbeiten
   End If
End If
If Servo_nr_by = 1 Then
   If Portb.2 = 0 Then
      Timer1 = Servo_pan_pwm
      Portb.2 = 1
   Else
      Portb.2 = 0
      Incr Servo_nr_by
   End If
End If
If Servo_nr_by = 2 Then
   If Portb.3 = 0 Then
      Timer1 = Servo_tilt_pwm
      Portb.3 = 1
   Else
      Portb.3 = 0
      Incr Servo_nr_by
   End If
End If

If Servo_nr_by = 3 Then
  Timer1 = 40000                                            'eine pause von ca. 12ms bis zum nächsten interrupt. Bei guten Servos oder Brushlessreglern kann man hier bis auf 65530 gehen ==> ansteuerfrequenz von ~ 200Hz
  Servo_nr_by = 0
End If

Return
Das zweite Codestück ist von Willa's Artikel im RN Wissen übernommen (Willa, wie sollte ichd a die Zeit für Timer1 einstellen, bin mir da mit 40000 nicht sicher)

Im Trockendock geht das schon ganz gut, mir fehlt nur noch die Mechanik für den Kamerarm..

Bild hier  

Diese Schaltung entstand mit Hilfe von Ssellere, der mir die Lösung mit dem Spannungswandler erklärt hat.

Gruß
Nils
ps.: den fertigen Code gibts dann im Blog


Die elektronik ist auch fertig,
sollte sichd as bewähren, wird das natürlich noch aufgehübscht