Subversion Repositories FlightCtrl

Rev

Rev 1635 | Rev 1821 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1635 Rev 1646
Line 93... Line 93...
93
  }
93
  }
94
  /*
94
  /*
95
   * While we are still using userparams for flight parameters, do set
95
   * While we are still using userparams for flight parameters, do set
96
   * some safe & meaningful default values.
96
   * some safe & meaningful default values.
97
   */
97
   */
98
  staticParams.UserParams1[4] = 0b01010101;
98
  staticParams.UserParams1[3] = 10;                     // Throttle stick D=10
-
 
99
  staticParams.UserParams2[0] = 0b11010101; // All gyro filter constants 2; acc. 4
99
  staticParams.UserParams1[5] = 2;                      // H&I motor smoothing.
100
  staticParams.UserParams2[1] = 2;                      // H&I motor smoothing.
100
  staticParams.UserParams1[6] = 120;
101
  staticParams.UserParams2[2] = 120;            // Yaw I factor
101
  staticParams.UserParams1[7] = 5;
102
  staticParams.UserParams2[3] = 100;            // Max Z acceleration for acc. correction of angles.                    
102
}
103
}
Line 103... Line 104...
103
 
104
 
104
void setOtherDefaults(void) {
105
void setOtherDefaults(void) {
105
/* Channel assignments were changed to the normal:
106
/* Channel assignments were changed to the normal:
Line 129... Line 130...
129
  staticParams.GyroP = 80;
130
  staticParams.GyroP = 80;
130
  staticParams.GyroI = 100;
131
  staticParams.GyroI = 100;
131
  staticParams.LowVoltageWarning = 94;
132
  staticParams.LowVoltageWarning = 94;
132
  staticParams.EmergencyGas = 35;
133
  staticParams.EmergencyGas = 35;
133
  staticParams.EmergencyGasDuration = 30;
134
  staticParams.EmergencyGasDuration = 30;
134
  staticParams.UfoArrangement = 0;
135
  staticParams.Unused0 = 0;
135
  staticParams.IFactor = 32;
136
  staticParams.IFactor = 32;
136
  staticParams.ServoPitchControl = 100;
137
  staticParams.ServoPitchControl = 100;
137
  staticParams.ServoPitchComp = 40;
138
  staticParams.ServoPitchComp = 40;
138
  staticParams.ServoPitchCompInvert = 0;
139
  staticParams.ServoPitchCompInvert = 0;
139
  staticParams.ServoPitchMin = 50;
140
  staticParams.ServoPitchMin = 50;
Line 144... Line 145...
144
  staticParams.LoopHysteresis = 50;
145
  staticParams.LoopHysteresis = 50;
145
  staticParams.BitConfig = 0;
146
  staticParams.BitConfig = 0;
146
  staticParams.AxisCoupling1 = 90;
147
  staticParams.AxisCoupling1 = 90;
147
  staticParams.AxisCoupling2 = 67;
148
  staticParams.AxisCoupling2 = 67;
148
  staticParams.AxisCouplingYawCorrection = 0;
149
  staticParams.AxisCouplingYawCorrection = 0;
149
  staticParams.GyroAccTrim = 2;
-
 
150
  staticParams.DynamicStability = 50;
150
  staticParams.DynamicStability = 50;
151
  staticParams.J16Bitmask = 95;
151
  staticParams.J16Bitmask = 95;
152
  staticParams.J17Bitmask = 243;
152
  staticParams.J17Bitmask = 243;
153
  staticParams.J16Timing = 15;
153
  staticParams.J16Timing = 15;
154
  staticParams.J17Timing = 15;
154
  staticParams.J17Timing = 15;
Line 172... Line 172...
172
 
172
 
173
/***************************************************/
173
/***************************************************/
174
/*    Default Values for parameter set 1           */
174
/*    Default Values for parameter set 1           */
175
/***************************************************/
175
/***************************************************/
-
 
176
void ParamSet_DefaultSet1(void) { // sport
176
void ParamSet_DefaultSet1(void) { // sport
177
  setOtherDefaults();
177
  gyro_setDefaults();
178
  gyro_setDefaults();
178
  setDefaultUserParams();
-
 
179
  setOtherDefaults();
179
  setDefaultUserParams();
180
  memcpy(staticParams.Name, "Sport\0",6);
180
  memcpy(staticParams.Name, "Sport\0",6);
Line 181... Line 181...
181
}
181
}
182
 
182
 
183
/***************************************************/
183
/***************************************************/
184
/*    Default Values for parameter set 2           */
184
/*    Default Values for parameter set 2           */
-
 
185
/***************************************************/
185
/***************************************************/
186
void ParamSet_DefaultSet2(void) { // normal
186
void ParamSet_DefaultSet2(void) { // normal
187
  setOtherDefaults();
187
  gyro_setDefaults();
-
 
188
  setDefaultUserParams();
188
  gyro_setDefaults();
189
  setOtherDefaults();
-
 
190
  staticParams.Height_Gain = 3;
189
  setDefaultUserParams();
191
  staticParams.GyroAccTrim = 32;
190
  staticParams.Height_Gain = 3;
192
  staticParams.J16Timing = 20;
191
  staticParams.J16Timing = 20;
193
  staticParams.J17Timing = 20;
192
  staticParams.J17Timing = 20;
Line 194... Line 193...
194
  memcpy(staticParams.Name, "Normal\0", 7);
193
  memcpy(staticParams.Name, "Normal\0", 7);
195
}
194
}
196
 
195
 
197
/***************************************************/
196
/***************************************************/
-
 
197
/*    Default Values for parameter set 3           */
198
/*    Default Values for parameter set 3           */
198
/***************************************************/
199
/***************************************************/
199
void ParamSet_DefaultSet3(void) { // beginner
200
void ParamSet_DefaultSet3(void) { // beginner
-
 
201
  gyro_setDefaults();
200
  setOtherDefaults();
202
  setDefaultUserParams();
201
  gyro_setDefaults();
203
  setOtherDefaults();
202
  setDefaultUserParams();
204
  staticParams.GlobalConfig = CFG_ROTARY_RATE_LIMITER | CFG_AXIS_COUPLING_ACTIVE | CFG_COMPASS_ACTIVE | CFG_GPS_ACTIVE;//CFG_HEIGHT_CONTROL | CFG_HEIGHT_SWITCH | CFG_COMPASS_FIX;
203
  staticParams.GlobalConfig = CFG_ROTARY_RATE_LIMITER | CFG_AXIS_COUPLING_ACTIVE | CFG_COMPASS_ACTIVE | CFG_GPS_ACTIVE;//CFG_HEIGHT_CONTROL | CFG_HEIGHT_SWITCH | CFG_COMPASS_FIX;
205
  staticParams.Height_Gain = 3;
-
 
206
  staticParams.EmergencyGasDuration = 20;
204
  staticParams.Height_Gain = 3;
207
  staticParams.AxisCouplingYawCorrection = 70;
205
  staticParams.EmergencyGasDuration = 20;
208
  staticParams.GyroAccTrim = 32;
206
  staticParams.AxisCouplingYawCorrection = 70;
209
  staticParams.J16Timing = 30;
207
  staticParams.J16Timing = 30;