Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 676 → Rev 677

/branches/salvo_gps/Basis_v0067g/trunk/GPS.c
434,8 → 434,8
}
else if ((d1 < GPS_G2T_FAST_TOL) && (d2 < GPS_G2T_FAST_TOL)) //nur weiter wenn Lage innerhalb der Toleranz
{
if (gps_g2t_act_v > GPS_G2T_V_MAX/2) gps_g2t_act_v -= 1; //Geschwindigkeit auf Haaelte runter oder rauffahren
else if (gps_g2t_act_v < GPS_G2T_V_MAX/2) gps_g2t_act_v += 1; //Geschwindigkeit erhoehen
if (gps_g2t_act_v > GPS_G2T_V_MAX/2) gps_g2t_act_v -= 1; //Geschwindigkeit auf Haeflte runter oder rauffahren
else if (gps_g2t_act_v < GPS_G2T_V_MAX/2) gps_g2t_act_v += 1;
dist_flown +=gps_g2t_act_v; // Vorgabe der Strecke anhand der Geschwindigkeit
gps_sub_state = GPS_HOME_FAST_IN_TOL;
}
445,7 → 445,7
// dist_flown++; //Auch ausserhalb der Toleranz langsam erhoehen
gps_sub_state = GPS_HOME_FAST_OUTOF_TOL;
}
hold_reset_int = 0; // Integrator einsschalten
hold_reset_int = 1; // Integrator aussschalten
hold_fast = 1; // Regler fuer schnellen Flug
dist_frm_start_east = (int)(((long)dist_flown * (long)sin_i(hdng_2home))/1000);
dist_frm_start_north = (int)(((long)dist_flown * (long)cos_i(hdng_2home))/1000);
519,26 → 519,39
dist_north = (int)delta_north;
 
#define GPSINT_MAX 3000 // Neues Verfahren ab 30.12.2007 bei Integratoroverflow
if ((abs(int_east) > GPSINT_MAX) || (abs(int_north)> GPSINT_MAX))
// #define GPSINT_MAX 3000 // Neues Verfahren ab 30.12.2007 bei Integratoroverflow
long int gpsintmax;
if (Parameter_UserParam2 > 0)
{
if (int_ovfl_cnt < 40) int_ovfl_cnt += 1; // Zahl der Overflows zaehlen
gpsintmax = (GPS_NICKROLL_MAX * GPS_V * GPS_USR_PAR_FKT * ((32*4)/10))/(long)Parameter_UserParam2; //auf ungefeahren Maximalwert begrenzen
if ((abs(int_east) > (int)gpsintmax) || (abs(int_north)> (int)gpsintmax))
{
int_ovfl_cnt += 1; // Zahl der Overflows zaehlen
}
if (int_ovfl_cnt > 0) //bei Overflow Wert Integratorwert reduzieren
{
int_ovfl_cnt -= 1;
int_east = (int_east*7)/8; // Wert reduzieren
int_north = (int_north*7)/8;
}
 
if (hold_reset_int > 0) //Im Schnellen Mode Integrator abschalten
{
int_east = 0;
int_north = 0;
}
}
if (int_ovfl_cnt > 0) //bei Overflow Wert Integratorwert reduzieren
else // Integrator deaktiviert
{
int_ovfl_cnt -= 1;
int_east = (int_east*7)/8; // Wert reduzieren
int_north = (int_north*7)/8;
int_east = 0;
int_north = 0;
}
 
if (hold_reset_int > 0) //Im Schnellen Mode Integrator abschalten
{
int_east = 0;
int_north = 0;
}
debug_gp_4 = (int)int_east; // zum Debuggen
debug_gp_5 = (int)int_north; // zum Debuggen
 
//I Werte begrenzen
#define INT1_MAX (GPS_NICKROLL_MAX * GPS_V*5)/10// auf 40 Prozent des maximalen Nick/Rollwert begrenzen
#define INT1_MAX (GPS_NICKROLL_MAX * GPS_V*2)/10// auf 20 Prozent des maximalen Nick/Rollwert begrenzen
int_east1 = ((((long)int_east) * Parameter_UserParam2)/32)/GPS_USR_PAR_FKT;
int_north1 = ((((long)int_north) * Parameter_UserParam2)/32)/GPS_USR_PAR_FKT;
if (int_east1 > INT1_MAX) int_east1 = INT1_MAX; //begrenzen
552,8 → 565,8
amplfy_speed_north = DIFF_Y_F_MAX;
amplfy_speed_east *= (Parameter_UserParam3/GPS_USR_PAR_FKT);
amplfy_speed_north *= (Parameter_UserParam3/GPS_USR_PAR_FKT);
speed_east = (speed_east * (long)amplfy_speed_east) /100;
speed_north = (speed_north * (long)amplfy_speed_north)/100;
speed_east = (speed_east * (long)amplfy_speed_east) /50;
speed_north = (speed_north * (long)amplfy_speed_north)/50;
// D Werte begrenzen
#define D_F_MAX (GPS_NICKROLL_MAX * GPS_V*7)/10 // auf 70 Prozent des Maximalen Nick/Rollwert begrenzen
if (speed_east > D_F_MAX) speed_east = D_F_MAX;
/branches/salvo_gps/Basis_v0067g/trunk/fc.c
388,12 → 388,12
if(MotorTest[2]) Motor_Links = MotorTest[2];
if(MotorTest[3]) Motor_Rechts = MotorTest[3];
}
 
/*
DebugOut.Analog[12] = Motor_Vorne;
DebugOut.Analog[13] = Motor_Hinten;
DebugOut.Analog[14] = Motor_Links;
DebugOut.Analog[15] = Motor_Rechts;
 
*/
//Start I2C Interrupt Mode
twi_state = 0;
motor = 0;
1209,11 → 1209,11
DebugOut.Analog[29] = gps_state + (gps_sub_state*10)+(50*gps_cmd);
DebugOut.Analog[30] = debug_gp_0;
DebugOut.Analog[31] = debug_gp_1;
/* DebugOut.Analog[12] = debug_gp_2;
DebugOut.Analog[12] = debug_gp_2;
DebugOut.Analog[13] = debug_gp_3;
DebugOut.Analog[14] = debug_gp_4;
DebugOut.Analog[15] = debug_gp_5;
*/
 
// DebugOut.Analog[30] = dist_flown;
// DebugOut.Analog[31] = (int) dist_2home;
// DebugOut.Analog[31] = (int) GPS_hdng_abs_2trgt;
/branches/salvo_gps/Basis_v0067g/trunk/flightctrl.aws
1,0 → 0,0
<AVRWorkspace><IOSettings><CurrentRegisters/></IOSettings><part name="ATMEGA644"/><Files><File00000 Name="G:\Mikrokopter\Flight_Crtl\v0067g\timer0.c" Position="268 103 1184 712" LineCol="164 0"/><File00001 Name="G:\Mikrokopter\Flight_Crtl\v0067g\analog.h" Position="290 132 1220 740" LineCol="0 0"/><File00002 Name="G:\Mikrokopter\Flight_Crtl\v0067g\makefile" Position="312 161 1242 769" LineCol="6 0"/><File00003 Name="G:\Mikrokopter\Flight_Crtl\v0067g\main.c" Position="334 190 1264 798" LineCol="130 0"/></Files></AVRWorkspace>
<AVRWorkspace><IOSettings><CurrentRegisters/></IOSettings><part name="ATMEGA644"/><Files><File00000 Name="G:\Mikrokopter\Flight_Crtl\v0067g\timer0.c" Position="266 101 1182 710" LineCol="164 0" State="Maximized"/><File00001 Name="G:\Mikrokopter\Flight_Crtl\v0067g\analog.h" Position="288 130 1218 738" LineCol="0 0" State="Maximized"/><File00002 Name="G:\Mikrokopter\Flight_Crtl\v0067g\makefile" Position="310 159 1240 767" LineCol="6 0" State="Maximized"/><File00003 Name="G:\Mikrokopter\Flight_Crtl\v0067g\main.c" Position="332 188 1262 796" LineCol="135 0" State="Maximized"/><File00004 Name="G:\Mikrokopter\Flight_Crtl\v0067g\GPS.c" Position="262 71 1402 978" LineCol="542 5" State="Maximized"/><File00005 Name="G:\Mikrokopter\Flight_Crtl\v0067g\fc.c" Position="376 246 1288 829" LineCol="1193 18" State="Maximized"/><File00006 Name="G:\Mikrokopter\Flight_Crtl\v0067g\gps.h" Position="398 275 1310 858" LineCol="0 0" State="Maximized"/></Files></AVRWorkspace>
/branches/salvo_gps/Basis_v0067g/trunk/uart.c
49,16 → 49,16
"Ersatzkompass ",
"Usr_Par1 ", //10
"Usr_par3 ",
"Motor_Vorne ",
/* "Motor_Vorne ",
"Motor_Hinten ",
"Motor_Links ",
"Motor_Rechts ", //15
*/
"delta_east ",
"delta_north ",
"int_east ",
"int_north ", //15
 
/* "delta_east ",
"delta_north ",
"speed_e ",
"speed_n ", //15
*/
"Index ",
"UBat ",
"Messwert_Nick ",