********************************************************************* GPS Implementation by Peter Muehlenbrock ("Salvo") for Mikrokopter/FlightCrtl As of December 28th, 2008 Please note the files Licensce_LPGL.txt and Licensce_GPL.txt This SW is based on Holgers V00.71h. ********************************************************************* Hardware-requirements: Calibrated compass of type CMPS03, horizontally adjusted GPS module of type ublox, The messages "NAV_STATUS", "NAV_POSUTM" and "NAV_VELNED" must be activated with 4 HZ update rate. All messages of type NMEA should be disabled. The TX port of the GPS module must be connected to the RX input of the Flight Crtl. Baudrate is 57600 (like Kopter Tool). UserParameter 4 tells the software the orientation for the compass. The difference between the "north" direction ( = Motor "vorne" or 1 as described in Holgers Flight Crtl manual) of the kopter and the north direction of the compass is represented as follows: 0...360 degree offset corresponds to a value of 0...180. (A userparameter ist only 1 byte long and therefore can not directly represent 0..360 degree). Please check the correct value via the Koptertool. The "Kompass" debug value has to show the correct orientation: kopter Motor vorne orientated to north => value approx 0 Degree) Other requirements: Please calibrate the ACC Sensor values (pitch full, yaw full right) in horizontal orientation of the kopter as exactly as possible. Parameters: The GPS Hold regulator is of type PID: GPS-P =P(proportional), GPS-I = I(ntegral), GPS-D = D(ifferential). Standardvalues for P,I and D are 60,8,100. GPS Gain is the overall gain and set to 100 as default The I-Part may be set to 0 if a small deviation from hold position is acceptable. The D-Part is important to avoid oscillating. Please find out the best values yourself. It might be useful to put the P and D Part on potis and test the behaviour in flight. Requirements for GPS_Hold: The gps module has do provide a 3D-fix. If succesfull, you can hear a longer beep when performing a gyro calibration. Without a succesfull position fix at calibration the GPS functionality ist completely disabled. The red led on the FlightCrtl flashes with a 4 Hz rate if the gps module delivers a position fix. The GPS flag and Compass flag in the setting must be enabled Enabling GPS_Hold in flight: GPS Hold is automatically activated if the sticks for roll and nick are in neutral position for about 400ms. Moving the stick immediately disables the Hold mode. The GPS Hold function doesn not change height, pitch or yaw. GPS Coming-Home function Enabled when the GPS and compass flag in the setting are enabled and the GPS Mode Control Switch is set to a value > 170 Other changes: - Output PC6 can be used to switch TX data between a Bluetooth and the GPS Module (further hardware required) to the RX input of the FlightCrtl - automatic Yaw gyro compensation if compass is available.