Subversion Repositories FlightCtrl

Rev

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

Rev 2140 Rev 2142
Line 1... Line 1...
1
#include <util/delay.h>
1
#include <util/delay.h>
2
#include <stddef.h>
2
#include <stddef.h>
3
#include <string.h>
3
#include <string.h>
4
#include "configuration.h"
4
#include "configuration.h"
-
 
5
#include "controlMixer.h"
5
#include "rc.h"
6
#include "rc.h"
6
#include "output.h"
7
#include "output.h"
7
#include "sensors.h"
8
#include "sensors.h"
8
#include "flight.h"
9
#include "flight.h"
Line 36... Line 37...
36
 
37
 
37
{offsetof(ParamSet_t, gyroPID[2].P), offsetof(DynamicParams_t, gyroPID[2].P),0,255},
38
{offsetof(ParamSet_t, gyroPID[2].P), offsetof(DynamicParams_t, gyroPID[2].P),0,255},
38
{offsetof(ParamSet_t, gyroPID[2].I), offsetof(DynamicParams_t, gyroPID[2].I),0,255},
39
{offsetof(ParamSet_t, gyroPID[2].I), offsetof(DynamicParams_t, gyroPID[2].I),0,255},
Line 39... Line -...
39
{offsetof(ParamSet_t, gyroPID[2].D), offsetof(DynamicParams_t, gyroPID[2].D),0,255},
-
 
40
 
-
 
41
{offsetof(ParamSet_t, gimbalServoConfigurations[0].manualControl), offsetof(DynamicParams_t, gimbalServoManualControl[0]),0,255},
40
{offsetof(ParamSet_t, gyroPID[2].D), offsetof(DynamicParams_t, gyroPID[2].D),0,255},
42
{offsetof(ParamSet_t, gimbalServoConfigurations[1].manualControl), offsetof(DynamicParams_t, gimbalServoManualControl[1]),0,255},
41
 
43
{offsetof(ParamSet_t, outputFlash[0].timing), offsetof(DynamicParams_t, output0Timing),0,255},
42
{offsetof(ParamSet_t, outputFlash[0].timing), offsetof(DynamicParams_t, output0Timing),0,255},
Line 44... Line 43...
44
{offsetof(ParamSet_t, outputFlash[1].timing), offsetof(DynamicParams_t, output1Timing),0,255},
43
{offsetof(ParamSet_t, outputFlash[1].timing), offsetof(DynamicParams_t, output1Timing),0,255},
Line 132... Line 131...
132
void setOtherDefaults(void) {
131
void setOtherDefaults(void) {
133
  // Control
132
  // Control
134
  staticParams.externalControl = 0;
133
  staticParams.externalControl = 0;
135
  staticParams.IFactor = 52;
134
  staticParams.IFactor = 52;
Line 136... Line 135...
136
 
135
 
137
  staticParams.airspeedCorrection = 100;
136
  staticParams.airspeedCorrection = 1;
Line 138... Line 137...
138
  staticParams.isFlyingThreshold = 100;
137
  staticParams.isFlyingThreshold = 10;
139
 
138
 
140
  // Servos
139
  // Servos
-
 
140
  staticParams.servoCount = 7;
-
 
141
  staticParams.servos[CONTROL_ELEVATOR].reverse = 1;
Line 141... Line -...
141
  staticParams.servoCount = 7;
-
 
142
  staticParams.servosReverse = CONTROL_SERVO_REVERSE_ELEVATOR | CONTROL_SERVO_REVERSE_RUDDER;
-
 
143
 
-
 
144
  staticParams.gimbalServoMaxManualSpeed = 10;
-
 
145
  for (uint8_t i=0; i<2; i++) {
-
 
146
    staticParams.gimbalServoConfigurations[i].manualControl = 128;
-
 
147
    staticParams.gimbalServoConfigurations[i].stabilizationFactor = 0;
-
 
148
    staticParams.gimbalServoConfigurations[i].minValue = 32;
-
 
149
    staticParams.gimbalServoConfigurations[i].maxValue = 224;
-
 
150
    staticParams.gimbalServoConfigurations[i].flags = 0;
142
  staticParams.servos[CONTROL_AILERONS].reverse = 0;
151
  }
143
  staticParams.servos[CONTROL_RUDDER].reverse = 1;
Line 152... Line 144...
152
 
144
 
153
  // Battery warning and emergency flight
145
  // Battery warning and emergency flight
Line 192... Line 184...
192
 
184
 
193
void IMUConfig_default(void) {
185
void IMUConfig_default(void) {
194
  IMUConfig.gyroPIDFilterConstant = 8;
186
  IMUConfig.gyroPIDFilterConstant = 8;
195
  IMUConfig.gyroDFilterConstant = 1;
187
  IMUConfig.gyroDFilterConstant = 1;
196
  IMUConfig.rateTolerance = 120;
188
  IMUConfig.rateTolerance = 120;
197
  IMUConfig.gyroDWindowLength = 3;
189
  IMUConfig.gyroDWindowLength = 8;
198
  IMUConfig.gyroQuadrant = 2;
190
  IMUConfig.gyroQuadrant = 2;
Line 199... Line 191...
199
  IMUConfig.imuReversedFlags = 0;
191
  IMUConfig.imuReversedFlags = 0;
200
 
192