/branches/V0.68d Code Redesign killagreg/GPS.c |
---|
12,7 → 12,7 |
#define GPS_STICK_SENSE 20 // must be at least in a range where 90% of the trimming does not switch of the GPS function |
#define GPS_STICK_LIMIT 45 // limit of gps stick control to avoid critical flight attitudes |
#define GPS_D_LIMIT_DIST 500 // for position deviations grater than 500 cm (20m) the D-Part of the PD-Controller is limited |
#define GPS_D_LIMIT_DIST 500 // for position deviations greater than 500cm the D-Part of the PD-Controller is limited |
#define GPS_D_LIMIT 50 // PD-Controntroller D-Limit. |
int16_t GPS_Pitch = 0; |
/branches/V0.68d Code Redesign killagreg/cmps03.c |
---|
1,6 → 1,8 |
#include <avr/io.h> |
#include <stdlib.h> |
#include "fc.h" |
#include "timer0.h" |
#include "uart.h" |
int32_t PWMHeading = -1; |
uint8_t PWMTimeout = 0; |
37,6 → 39,13 |
// This counter is incremented by a periode of 102.4us, |
// i.e. the resoluton of pwm coded heading is approx. 1 deg. |
PWMCount++; |
// pwm overflow? |
if (PWMCount > 400) |
{ |
if(PWMTimeout ) PWMTimeout--; // decrement timeout |
PWMCount = 0; // reset PWM Counter |
} |
} |
else // PWM is low |
{ |
52,14 → 61,6 |
} |
PWMCount = 0; // reset pwm counter |
} |
// overflow without a low edge (nothing connected to PC4) |
if (PWMCount > 400) |
{ |
if(PWMTimeout ) PWMTimeout--; |
PWMCount = 0; |
} |
} |
69,6 → 70,9 |
int16_t CMPS03_Heading(void) |
{ |
int16_t heading, w, v; |
DebugOut.Analog[11] = PWMTimeout; |
if(PWMTimeout) |
{ |
w = abs(IntegralPitch / 512); |
82,14 → 86,14 |
if (heading < 0) heading += 360; |
heading = heading%360; |
} |
else // no date available from compass |
else // compass to much tilted |
{ |
if(!BeepTime) BeepTime = 100; // make noise to signal the compass problem |
heading = -1; |
} |
} |
else // no data from compass |
{ |
if(!BeepTime) BeepTime = 100; // make noise to signal the compass problem |
heading = -1; |
} |
return heading; |
/branches/V0.68d Code Redesign killagreg/makefile |
---|
1,7 → 1,7 |
#-------------------------------------------------------------------- |
# MCU name |
MCU = atmega644 |
#MCU = atmega644p |
#MCU = atmega644 |
MCU = atmega644p |
F_CPU = 20000000 |
#------------------------------------------------------------------- |
VERSION_MAJOR = 0 |
11,8 → 11,8 |
VERSION_COMPATIBLE = 7 # PC-Kompatibilität |
#------------------------------------------------------------------- |
#OPTIONS |
COMPASS = MM3 |
#COMPASS = CMPS03 |
#COMPASS = MM3 |
COMPASS = CMPS03 |
#EXT = WALTER |
#------------------------------------------------------------------- |
/branches/V0.68d Code Redesign killagreg/mm3.c |
---|
24,6 → 24,7 |
#include "timer0.h" |
#include "rc.h" |
#include "eeprom.h" |
#include "uart.h" |
#define MAX_AXIS_VALUE 500 |
329,6 → 330,8 |
uint16_t div_factor; |
int16_t heading; |
DebugOut.Analog[11] = MM3_Timeout; |
if (MM3_Timeout) |
{ |
// Offset correction and normalization (values of H are +/- 512) |
/branches/V0.68d Code Redesign killagreg/uart.c |
---|
62,7 → 62,7 |
"CompassHeading ", |
"Voltage ", |
"Receiver Level ", //10 |
"Analog11 ", |
"CompassTimeout ", |
"GPSDevNorth ", |
"GPSDevEast ", |
"GPS_Pitch ", |