Rev 1077 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1077 | Rev 1078 | ||
---|---|---|---|
Line 28... | Line 28... | ||
28 | /***************************************************/ |
28 | /***************************************************/ |
29 | /* Default Values for parameter set 1 */ |
29 | /* Default Values for parameter set 1 */ |
30 | /***************************************************/ |
30 | /***************************************************/ |
31 | void ParamSet_DefaultSet1(void) // sport |
31 | void ParamSet_DefaultSet1(void) // sport |
32 | { |
32 | { |
33 | ParamSet.ChannelAssignment[CH_NICK] = 1; |
33 | ParamSet.ChannelAssignment[CH_NICK] = 1; |
34 | ParamSet.ChannelAssignment[CH_ROLL] = 2; |
34 | ParamSet.ChannelAssignment[CH_ROLL] = 2; |
35 | ParamSet.ChannelAssignment[CH_GAS] = 3; |
35 | ParamSet.ChannelAssignment[CH_GAS] = 3; |
36 | ParamSet.ChannelAssignment[CH_YAW] = 4; |
36 | ParamSet.ChannelAssignment[CH_YAW] = 4; |
37 | ParamSet.ChannelAssignment[CH_POTI1] = 5; |
37 | ParamSet.ChannelAssignment[CH_POTI1] = 5; |
38 | ParamSet.ChannelAssignment[CH_POTI2] = 6; |
38 | ParamSet.ChannelAssignment[CH_POTI2] = 6; |
39 | ParamSet.ChannelAssignment[CH_POTI3] = 7; |
39 | ParamSet.ChannelAssignment[CH_POTI3] = 7; |
40 | ParamSet.ChannelAssignment[CH_POTI4] = 8; |
40 | ParamSet.ChannelAssignment[CH_POTI4] = 8; |
41 | ParamSet.GlobalConfig = CFG_AXIS_COUPLING_ACTIVE | CFG_COMPASS_ACTIVE | CFG_GPS_ACTIVE;//CFG_HEIGHT_CONTROL | CFG_HEIGHT_SWITCH | CFG_COMPASS_FIX; |
41 | ParamSet.GlobalConfig = CFG_AXIS_COUPLING_ACTIVE | CFG_COMPASS_ACTIVE | CFG_GPS_ACTIVE;//CFG_HEIGHT_CONTROL | CFG_HEIGHT_SWITCH | CFG_COMPASS_FIX; |
42 | ParamSet.Height_MinGas = 30; |
42 | ParamSet.Height_MinGas = 30; |
43 | ParamSet.MaxHeight = 251; // Wert : 0-250 251 -> Poti1 |
43 | ParamSet.MaxHeight = 251; // Wert : 0-250 251 -> Poti1 |
44 | ParamSet.Height_P = 10; // Wert : 0-32 |
44 | ParamSet.Height_P = 10; // Wert : 0-32 |
45 | ParamSet.Height_D = 30; // Wert : 0-250 |
45 | ParamSet.Height_D = 30; // Wert : 0-250 |
46 | ParamSet.Height_ACC_Effect = 30; // Wert : 0-250 |
46 | ParamSet.Height_ACC_Effect = 30; // Wert : 0-250 |
47 | ParamSet.Height_Gain = 4; // Wert : 0-50 |
47 | ParamSet.Height_Gain = 4; // Wert : 0-50 |
48 | ParamSet.Stick_P = 15; // Wert : 1-24 |
48 | ParamSet.Stick_P = 15; // Wert : 1-24 |
49 | ParamSet.Stick_D = 30; // Wert : 0-250 |
49 | ParamSet.Stick_D = 30; // Wert : 0-250 |
50 | ParamSet.Yaw_P = 12; // Wert : 1-20 |
50 | ParamSet.Yaw_P = 12; // Wert : 1-20 |
51 | ParamSet.Gas_Min = 8; // Wert : 0-32 |
51 | ParamSet.Gas_Min = 8; // Wert : 0-32 |
52 | ParamSet.Gas_Max = 230; // Wert : 33-250 |
52 | ParamSet.Gas_Max = 230; // Wert : 33-250 |
53 | ParamSet.GyroAccFactor = 30; // Wert : 1-64 |
53 | ParamSet.GyroAccFactor = 30; // Wert : 1-64 |
54 | ParamSet.CompassYawEffect = 128; // Wert : 0-250 |
54 | ParamSet.CompassYawEffect = 128; // Wert : 0-250 |
55 | ParamSet.Gyro_P = 80; // Wert : 0-250 |
55 | ParamSet.Gyro_P = 80; // Wert : 0-250 |
56 | ParamSet.Gyro_I = 150; // Wert : 0-250 |
56 | ParamSet.Gyro_I = 150; // Wert : 0-250 |
57 | ParamSet.LowVoltageWarning = 94; // Wert : 0-250 |
57 | ParamSet.LowVoltageWarning = 94; // Wert : 0-250 |
58 | ParamSet.EmergencyGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
58 | ParamSet.EmergencyGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
59 | ParamSet.EmergencyGasDuration = 30; // Wert : 0-250 // Zeit bis auf EmergencyGas geschaltet wird, wg. Rx-Problemen |
59 | ParamSet.EmergencyGasDuration = 30; // Wert : 0-250 // Zeit bis auf EmergencyGas geschaltet wird, wg. Rx-Problemen |
60 | ParamSet.UfoArrangement = 0; // X oder + Formation |
60 | ParamSet.UfoArrangement = 0; // X oder + Formation |
61 | ParamSet.I_Factor = 32; |
61 | ParamSet.I_Factor = 32; |
62 | ParamSet.UserParam1 = 0; //zur freien Verwendung |
62 | ParamSet.UserParam1 = 0; //zur freien Verwendung |
63 | ParamSet.UserParam2 = 0; //zur freien Verwendung |
63 | ParamSet.UserParam2 = 0; //zur freien Verwendung |
64 | ParamSet.UserParam3 = 0; //zur freien Verwendung |
64 | ParamSet.UserParam3 = 0; //zur freien Verwendung |
65 | ParamSet.UserParam4 = 0; //zur freien Verwendung |
65 | ParamSet.UserParam4 = 0; //zur freien Verwendung |
66 | ParamSet.UserParam5 = 0; // zur freien Verwendung |
66 | ParamSet.UserParam5 = 0; // zur freien Verwendung |
67 | ParamSet.UserParam6 = 0; // zur freien Verwendung |
67 | ParamSet.UserParam6 = 0; // zur freien Verwendung |
68 | ParamSet.UserParam7 = 0; // zur freien Verwendung |
68 | ParamSet.UserParam7 = 0; // zur freien Verwendung |
69 | ParamSet.UserParam8 = 0; // zur freien Verwendung |
69 | ParamSet.UserParam8 = 0; // zur freien Verwendung |
70 | ParamSet.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
70 | ParamSet.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
71 | ParamSet.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
71 | ParamSet.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
72 | ParamSet.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
72 | ParamSet.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
73 | ParamSet.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
73 | ParamSet.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
74 | ParamSet.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
74 | ParamSet.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
75 | ParamSet.ServoNickRefresh = 5; |
75 | ParamSet.ServoNickRefresh = 5; |
76 | ParamSet.LoopGasLimit = 50; |
76 | ParamSet.LoopGasLimit = 50; |
77 | ParamSet.LoopThreshold = 90; // Wert: 0-250 Schwelle für Stickausschlag |
77 | ParamSet.LoopThreshold = 90; // Wert: 0-250 Schwelle für Stickausschlag |
78 | ParamSet.LoopHysteresis = 50; |
78 | ParamSet.LoopHysteresis = 50; |
79 | ParamSet.LoopConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
79 | ParamSet.BitConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
80 | ParamSet.Yaw_PosFeedback = 90; |
80 | ParamSet.Yaw_PosFeedback = 90; |
81 | ParamSet.Yaw_NegFeedback = 5; |
81 | ParamSet.Yaw_NegFeedback = 5; |
82 | ParamSet.AngleTurnOverNick = 85; |
82 | ParamSet.AngleTurnOverNick = 85; |
83 | ParamSet.AngleTurnOverRoll = 85; |
83 | ParamSet.AngleTurnOverRoll = 85; |
84 | ParamSet.GyroAccTrim = 16; // 1/k |
84 | ParamSet.GyroAccTrim = 16; // 1/k |
85 | ParamSet.DriftComp = 4; |
85 | ParamSet.DriftComp = 4; |
86 | ParamSet.DynamicStability = 100; |
86 | ParamSet.DynamicStability = 100; |
87 | ParamSet.J16Bitmask = 95; |
87 | ParamSet.J16Bitmask = 95; |
88 | ParamSet.J17Bitmask = 243; |
88 | ParamSet.J17Bitmask = 243; |
89 | ParamSet.J16Timing = 15; |
89 | ParamSet.J16Timing = 15; |
90 | ParamSet.J17Timing = 15; |
90 | ParamSet.J17Timing = 15; |
91 | ParamSet.NaviGpsModeControl = 253; |
91 | ParamSet.NaviGpsModeControl = 253; |
92 | ParamSet.NaviGpsGain = 100; |
92 | ParamSet.NaviGpsGain = 100; |
93 | ParamSet.NaviGpsP = 90; |
93 | ParamSet.NaviGpsP = 90; |
94 | ParamSet.NaviGpsI = 90; |
94 | ParamSet.NaviGpsI = 90; |
95 | ParamSet.NaviGpsD = 90; |
95 | ParamSet.NaviGpsD = 90; |
96 | ParamSet.NaviGpsACC = 0; |
96 | ParamSet.NaviGpsACC = 0; |
97 | ParamSet.NaviGpsMinSat = 6; |
97 | ParamSet.NaviGpsMinSat = 6; |
98 | ParamSet.NaviStickThreshold = 8; |
98 | ParamSet.NaviStickThreshold = 8; |
- | 99 | ParamSet.NaviWindCorrection = 90; |
|
- | 100 | ParamSet.NaviSpeedCompensation = 30; |
|
- | 101 | ParamSet.NaviOperatingRadius = 100; |
|
- | 102 | ParamSet.NaviAngleLimitation = 60; |
|
99 | memcpy(ParamSet.Name, "Sport\0",6); |
103 | memcpy(ParamSet.Name, "Sport\0",6); |
100 | } |
104 | } |
Line 101... | Line 105... | ||
101 | 105 | ||
102 | 106 | ||
103 | /***************************************************/ |
107 | /***************************************************/ |
104 | /* Default Values for parameter set 2 */ |
108 | /* Default Values for parameter set 2 */ |
105 | /***************************************************/ |
109 | /***************************************************/ |
106 | void ParamSet_DefaultSet2(void) // normal |
110 | void ParamSet_DefaultSet2(void) // normal |
107 | { |
111 | { |
108 | ParamSet.ChannelAssignment[CH_NICK] = 1; |
112 | ParamSet.ChannelAssignment[CH_NICK] = 1; |
109 | ParamSet.ChannelAssignment[CH_ROLL] = 2; |
113 | ParamSet.ChannelAssignment[CH_ROLL] = 2; |
110 | ParamSet.ChannelAssignment[CH_GAS] = 3; |
114 | ParamSet.ChannelAssignment[CH_GAS] = 3; |
111 | ParamSet.ChannelAssignment[CH_YAW] = 4; |
115 | ParamSet.ChannelAssignment[CH_YAW] = 4; |
112 | ParamSet.ChannelAssignment[CH_POTI1] = 5; |
116 | ParamSet.ChannelAssignment[CH_POTI1] = 5; |
113 | ParamSet.ChannelAssignment[CH_POTI2] = 6; |
117 | ParamSet.ChannelAssignment[CH_POTI2] = 6; |
114 | ParamSet.ChannelAssignment[CH_POTI3] = 7; |
118 | ParamSet.ChannelAssignment[CH_POTI3] = 7; |
115 | ParamSet.ChannelAssignment[CH_POTI4] = 8; |
119 | ParamSet.ChannelAssignment[CH_POTI4] = 8; |
116 | ParamSet.GlobalConfig = CFG_AXIS_COUPLING_ACTIVE | CFG_COMPASS_ACTIVE | CFG_GPS_ACTIVE;//CFG_HEIGHT_CONTROL | CFG_HEIGHT_SWITCH | CFG_COMPASS_FIX; |
120 | ParamSet.GlobalConfig = CFG_AXIS_COUPLING_ACTIVE | CFG_COMPASS_ACTIVE | CFG_GPS_ACTIVE;//CFG_HEIGHT_CONTROL | CFG_HEIGHT_SWITCH | CFG_COMPASS_FIX; |
117 | ParamSet.Height_MinGas = 30; |
121 | ParamSet.Height_MinGas = 30; |
118 | ParamSet.MaxHeight = 251; // Wert : 0-250 251 -> Poti1 |
122 | ParamSet.MaxHeight = 251; // Wert : 0-250 251 -> Poti1 |
119 | ParamSet.Height_P = 10; // Wert : 0-32 |
123 | ParamSet.Height_P = 10; // Wert : 0-32 |
120 | ParamSet.Height_D = 30; // Wert : 0-250 |
124 | ParamSet.Height_D = 30; // Wert : 0-250 |
121 | ParamSet.Height_ACC_Effect = 30; // Wert : 0-250 |
125 | ParamSet.Height_ACC_Effect = 30; // Wert : 0-250 |
122 | ParamSet.Height_Gain = 3; // Wert : 0-50 |
126 | ParamSet.Height_Gain = 3; // Wert : 0-50 |
123 | ParamSet.Stick_P = 12; // Wert : 1-24 |
127 | ParamSet.Stick_P = 12; // Wert : 1-24 |
124 | ParamSet.Stick_D = 16; // Wert : 0-250 |
128 | ParamSet.Stick_D = 16; // Wert : 0-250 |
125 | ParamSet.Yaw_P = 6; // Wert : 1-20 |
129 | ParamSet.Yaw_P = 6; // Wert : 1-20 |
126 | ParamSet.Gas_Min = 8; // Wert : 0-32 |
130 | ParamSet.Gas_Min = 8; // Wert : 0-32 |
127 | ParamSet.Gas_Max = 230; // Wert : 33-250 |
131 | ParamSet.Gas_Max = 230; // Wert : 33-250 |
128 | ParamSet.GyroAccFactor = 30; // Wert : 1-64 |
132 | ParamSet.GyroAccFactor = 30; // Wert : 1-64 |
129 | ParamSet.CompassYawEffect = 128; // Wert : 0-250 |
133 | ParamSet.CompassYawEffect = 128; // Wert : 0-250 |
130 | ParamSet.Gyro_P = 80; // Wert : 0-250 |
134 | ParamSet.Gyro_P = 80; // Wert : 0-250 |
131 | ParamSet.Gyro_I = 120; // Wert : 0-250 |
135 | ParamSet.Gyro_I = 120; // Wert : 0-250 |
132 | ParamSet.LowVoltageWarning = 94; // Wert : 0-250 |
136 | ParamSet.LowVoltageWarning = 94; // Wert : 0-250 |
133 | ParamSet.EmergencyGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
137 | ParamSet.EmergencyGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
134 | ParamSet.EmergencyGasDuration = 30; // Wert : 0-250 // Zeit bis auf EmergencyGas geschaltet wird, wg. Rx-Problemen |
138 | ParamSet.EmergencyGasDuration = 30; // Wert : 0-250 // Zeit bis auf EmergencyGas geschaltet wird, wg. Rx-Problemen |
135 | ParamSet.UfoArrangement = 0; // X oder + Formation |
139 | ParamSet.UfoArrangement = 0; // X oder + Formation |
136 | ParamSet.I_Factor = 32; |
140 | ParamSet.I_Factor = 32; |
137 | ParamSet.UserParam1 = 0; // zur freien Verwendung |
141 | ParamSet.UserParam1 = 0; // zur freien Verwendung |
138 | ParamSet.UserParam2 = 0; // zur freien Verwendung |
142 | ParamSet.UserParam2 = 0; // zur freien Verwendung |
139 | ParamSet.UserParam3 = 0; // zur freien Verwendung |
143 | ParamSet.UserParam3 = 0; // zur freien Verwendung |
140 | ParamSet.UserParam4 = 0; // zur freien Verwendung |
144 | ParamSet.UserParam4 = 0; // zur freien Verwendung |
141 | ParamSet.UserParam5 = 0; // zur freien Verwendung |
145 | ParamSet.UserParam5 = 0; // zur freien Verwendung |
142 | ParamSet.UserParam6 = 0; // zur freien Verwendung |
146 | ParamSet.UserParam6 = 0; // zur freien Verwendung |
143 | ParamSet.UserParam7 = 0; // zur freien Verwendung |
147 | ParamSet.UserParam7 = 0; // zur freien Verwendung |
144 | ParamSet.UserParam8 = 0; // zur freien Verwendung |
148 | ParamSet.UserParam8 = 0; // zur freien Verwendung |
145 | ParamSet.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
149 | ParamSet.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
146 | ParamSet.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
150 | ParamSet.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
147 | ParamSet.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
151 | ParamSet.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
148 | ParamSet.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
152 | ParamSet.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
149 | ParamSet.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
153 | ParamSet.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
150 | ParamSet.ServoNickRefresh = 5; |
154 | ParamSet.ServoNickRefresh = 5; |
151 | ParamSet.LoopGasLimit = 50; |
155 | ParamSet.LoopGasLimit = 50; |
152 | ParamSet.LoopThreshold = 90; // Wert: 0-250 Schwelle für Stickausschlag |
156 | ParamSet.LoopThreshold = 90; // Wert: 0-250 Schwelle für Stickausschlag |
153 | ParamSet.LoopHysteresis = 50; |
157 | ParamSet.LoopHysteresis = 50; |
154 | ParamSet.LoopConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts |
158 | ParamSet.BitConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts |
155 | ParamSet.Yaw_PosFeedback = 90; // Faktor, mit dem Yaw die Achsen Roll und Nick verkoppelt |
159 | ParamSet.Yaw_PosFeedback = 90; // Faktor, mit dem Yaw die Achsen Roll und Nick verkoppelt |
156 | ParamSet.Yaw_NegFeedback = 5; |
160 | ParamSet.Yaw_NegFeedback = 5; |
157 | ParamSet.AngleTurnOverNick = 85; |
161 | ParamSet.AngleTurnOverNick = 85; |
158 | ParamSet.AngleTurnOverRoll = 85; |
162 | ParamSet.AngleTurnOverRoll = 85; |
159 | ParamSet.GyroAccTrim = 32; // 1/k |
163 | ParamSet.GyroAccTrim = 32; // 1/k |
160 | ParamSet.DriftComp = 4; |
164 | ParamSet.DriftComp = 4; |
161 | ParamSet.DynamicStability = 75; |
165 | ParamSet.DynamicStability = 75; |
162 | ParamSet.J16Bitmask = 95; |
166 | ParamSet.J16Bitmask = 95; |
163 | ParamSet.J17Bitmask = 243; |
167 | ParamSet.J17Bitmask = 243; |
164 | ParamSet.J16Timing = 20; |
168 | ParamSet.J16Timing = 20; |
165 | ParamSet.J17Timing = 20; |
169 | ParamSet.J17Timing = 20; |
166 | ParamSet.NaviGpsModeControl = 253; |
170 | ParamSet.NaviGpsModeControl = 253; |
167 | ParamSet.NaviGpsGain = 100; |
171 | ParamSet.NaviGpsGain = 100; |
168 | ParamSet.NaviGpsP = 90; |
172 | ParamSet.NaviGpsP = 90; |
169 | ParamSet.NaviGpsI = 90; |
173 | ParamSet.NaviGpsI = 90; |
170 | ParamSet.NaviGpsD = 90; |
174 | ParamSet.NaviGpsD = 90; |
171 | ParamSet.NaviGpsACC = 0; |
175 | ParamSet.NaviGpsACC = 0; |
- | 176 | ParamSet.NaviGpsMinSat = 6; |
|
- | 177 | ParamSet.NaviStickThreshold = 8; |
|
- | 178 | ParamSet.NaviWindCorrection = 90; |
|
- | 179 | ParamSet.NaviSpeedCompensation = 30; |
|
172 | ParamSet.NaviGpsMinSat = 6; |
180 | ParamSet.NaviOperatingRadius = 100; |
173 | ParamSet.NaviStickThreshold = 8; |
181 | ParamSet.NaviAngleLimitation = 60; |
Line 174... | Line 182... | ||
174 | memcpy(ParamSet.Name, "Normal\0", 7); |
182 | memcpy(ParamSet.Name, "Normal\0", 7); |
175 | } |
183 | } |
176 | 184 | ||
177 | 185 | ||
178 | /***************************************************/ |
186 | /***************************************************/ |
179 | /* Default Values for parameter set 3 */ |
187 | /* Default Values for parameter set 3 */ |
180 | /***************************************************/ |
188 | /***************************************************/ |
181 | void ParamSet_DefaultSet3(void) // beginner |
189 | void ParamSet_DefaultSet3(void) // beginner |
182 | { |
190 | { |
183 | ParamSet.ChannelAssignment[CH_NICK] = 1; |
191 | ParamSet.ChannelAssignment[CH_NICK] = 1; |
184 | ParamSet.ChannelAssignment[CH_ROLL] = 2; |
192 | ParamSet.ChannelAssignment[CH_ROLL] = 2; |
185 | ParamSet.ChannelAssignment[CH_GAS] = 3; |
193 | ParamSet.ChannelAssignment[CH_GAS] = 3; |
186 | ParamSet.ChannelAssignment[CH_YAW] = 4; |
194 | ParamSet.ChannelAssignment[CH_YAW] = 4; |
187 | ParamSet.ChannelAssignment[CH_POTI1] = 5; |
195 | ParamSet.ChannelAssignment[CH_POTI1] = 5; |
188 | ParamSet.ChannelAssignment[CH_POTI2] = 6; |
196 | ParamSet.ChannelAssignment[CH_POTI2] = 6; |
189 | ParamSet.ChannelAssignment[CH_POTI3] = 7; |
197 | ParamSet.ChannelAssignment[CH_POTI3] = 7; |
190 | ParamSet.ChannelAssignment[CH_POTI4] = 8; |
198 | ParamSet.ChannelAssignment[CH_POTI4] = 8; |
191 | ParamSet.GlobalConfig = CFG_ROTARY_RATE_LIMITER | CFG_AXIS_COUPLING_ACTIVE | CFG_COMPASS_ACTIVE | CFG_GPS_ACTIVE;//CFG_HEIGHT_CONTROL | CFG_HEIGHT_SWITCH | CFG_COMPASS_FIX; |
199 | ParamSet.GlobalConfig = CFG_ROTARY_RATE_LIMITER | CFG_AXIS_COUPLING_ACTIVE | CFG_COMPASS_ACTIVE | CFG_GPS_ACTIVE;//CFG_HEIGHT_CONTROL | CFG_HEIGHT_SWITCH | CFG_COMPASS_FIX; |
192 | ParamSet.Height_MinGas = 30; |
200 | ParamSet.Height_MinGas = 30; |
193 | ParamSet.MaxHeight = 251; // Wert : 0-250 251 -> Poti1 |
201 | ParamSet.MaxHeight = 251; // Wert : 0-250 251 -> Poti1 |
194 | ParamSet.Height_P = 10; // Wert : 0-32 |
202 | ParamSet.Height_P = 10; // Wert : 0-32 |
195 | ParamSet.Height_D = 30; // Wert : 0-250 |
203 | ParamSet.Height_D = 30; // Wert : 0-250 |
196 | ParamSet.Height_ACC_Effect = 30; // Wert : 0-250 |
204 | ParamSet.Height_ACC_Effect = 30; // Wert : 0-250 |
197 | ParamSet.Height_Gain = 3; // Wert : 0-50 |
205 | ParamSet.Height_Gain = 3; // Wert : 0-50 |
198 | ParamSet.Stick_P = 8; // Wert : 1-24 |
206 | ParamSet.Stick_P = 8; // Wert : 1-24 |
199 | ParamSet.Stick_D = 16; // Wert : 0-250 |
207 | ParamSet.Stick_D = 16; // Wert : 0-250 |
200 | ParamSet.Yaw_P = 6; // Wert : 1-20 |
208 | ParamSet.Yaw_P = 6; // Wert : 1-20 |
201 | ParamSet.Gas_Min = 8; // Wert : 0-32 |
209 | ParamSet.Gas_Min = 8; // Wert : 0-32 |
202 | ParamSet.Gas_Max = 230; // Wert : 33-250 |
210 | ParamSet.Gas_Max = 230; // Wert : 33-250 |
203 | ParamSet.GyroAccFactor = 30; // Wert : 1-64 |
211 | ParamSet.GyroAccFactor = 30; // Wert : 1-64 |
204 | ParamSet.CompassYawEffect = 128; // Wert : 0-250 |
212 | ParamSet.CompassYawEffect = 128; // Wert : 0-250 |
205 | ParamSet.Gyro_P = 100; // Wert : 0-250 |
213 | ParamSet.Gyro_P = 100; // Wert : 0-250 |
206 | ParamSet.Gyro_I = 120; // Wert : 0-250 |
214 | ParamSet.Gyro_I = 120; // Wert : 0-250 |
207 | ParamSet.LowVoltageWarning = 94; // Wert : 0-250 |
215 | ParamSet.LowVoltageWarning = 94; // Wert : 0-250 |
208 | ParamSet.EmergencyGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
216 | ParamSet.EmergencyGas = 35; // Wert : 0-250 // Gaswert bei Empangsverlust |
209 | ParamSet.EmergencyGasDuration = 20; // Wert : 0-250 // Zeit bis auf EmergencyGas geschaltet wird, wg. Rx-Problemen |
217 | ParamSet.EmergencyGasDuration = 20; // Wert : 0-250 // Zeit bis auf EmergencyGas geschaltet wird, wg. Rx-Problemen |
210 | ParamSet.UfoArrangement = 0; // X oder + Formation |
218 | ParamSet.UfoArrangement = 0; // X oder + Formation |
211 | ParamSet.I_Factor = 16; |
219 | ParamSet.I_Factor = 16; |
212 | ParamSet.UserParam1 = 0; // zur freien Verwendung |
220 | ParamSet.UserParam1 = 0; // zur freien Verwendung |
213 | ParamSet.UserParam2 = 0; // zur freien Verwendung |
221 | ParamSet.UserParam2 = 0; // zur freien Verwendung |
214 | ParamSet.UserParam3 = 0; // zur freien Verwendung |
222 | ParamSet.UserParam3 = 0; // zur freien Verwendung |
215 | ParamSet.UserParam4 = 0; // zur freien Verwendung |
223 | ParamSet.UserParam4 = 0; // zur freien Verwendung |
216 | ParamSet.UserParam5 = 0; // zur freien Verwendung |
224 | ParamSet.UserParam5 = 0; // zur freien Verwendung |
217 | ParamSet.UserParam6 = 0; // zur freien Verwendung |
225 | ParamSet.UserParam6 = 0; // zur freien Verwendung |
218 | ParamSet.UserParam7 = 0; // zur freien Verwendung |
226 | ParamSet.UserParam7 = 0; // zur freien Verwendung |
219 | ParamSet.UserParam8 = 0; // zur freien Verwendung |
227 | ParamSet.UserParam8 = 0; // zur freien Verwendung |
220 | ParamSet.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
228 | ParamSet.ServoNickControl = 100; // Wert : 0-250 // Stellung des Servos |
221 | ParamSet.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
229 | ParamSet.ServoNickComp = 40; // Wert : 0-250 // Einfluss Gyro/Servo |
222 | ParamSet.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
230 | ParamSet.ServoNickCompInvert = 0; // Wert : 0-250 // Richtung Einfluss Gyro/Servo |
223 | ParamSet.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
231 | ParamSet.ServoNickMin = 50; // Wert : 0-250 // Anschlag |
224 | ParamSet.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
232 | ParamSet.ServoNickMax = 150; // Wert : 0-250 // Anschlag |
225 | ParamSet.ServoNickRefresh = 5; |
233 | ParamSet.ServoNickRefresh = 5; |
226 | ParamSet.LoopGasLimit = 50; |
234 | ParamSet.LoopGasLimit = 50; |
227 | ParamSet.LoopThreshold = 90; // Wert: 0-250 Schwelle für Stickausschlag |
235 | ParamSet.LoopThreshold = 90; // Wert: 0-250 Schwelle für Stickausschlag |
228 | ParamSet.LoopHysteresis = 50; |
236 | ParamSet.LoopHysteresis = 50; |
229 | ParamSet.LoopConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts |
237 | ParamSet.BitConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts |
230 | ParamSet.Yaw_PosFeedback = 90; // Faktor, mit dem Yaw die Achsen Roll und Nick verkoppelt |
238 | ParamSet.Yaw_PosFeedback = 90; // Faktor, mit dem Yaw die Achsen Roll und Nick verkoppelt |
231 | ParamSet.Yaw_NegFeedback = 5; |
239 | ParamSet.Yaw_NegFeedback = 5; |
232 | ParamSet.AngleTurnOverNick = 85; |
240 | ParamSet.AngleTurnOverNick = 85; |
233 | ParamSet.AngleTurnOverRoll = 85; |
241 | ParamSet.AngleTurnOverRoll = 85; |
234 | ParamSet.GyroAccTrim = 32; // 1/k |
242 | ParamSet.GyroAccTrim = 32; // 1/k |
235 | ParamSet.DriftComp = 4; |
243 | ParamSet.DriftComp = 4; |
236 | ParamSet.DynamicStability = 50; |
244 | ParamSet.DynamicStability = 50; |
237 | ParamSet.J16Bitmask = 95; |
245 | ParamSet.J16Bitmask = 95; |
238 | ParamSet.J17Bitmask = 243; |
246 | ParamSet.J17Bitmask = 243; |
239 | ParamSet.J16Timing = 30; |
247 | ParamSet.J16Timing = 30; |
240 | ParamSet.J17Timing = 30; |
248 | ParamSet.J17Timing = 30; |
241 | ParamSet.NaviGpsModeControl = 253; |
249 | ParamSet.NaviGpsModeControl = 253; |
242 | ParamSet.NaviGpsGain = 100; |
250 | ParamSet.NaviGpsGain = 100; |
243 | ParamSet.NaviGpsP = 90; |
251 | ParamSet.NaviGpsP = 90; |
244 | ParamSet.NaviGpsI = 90; |
252 | ParamSet.NaviGpsI = 90; |
- | 253 | ParamSet.NaviGpsD = 90; |
|
- | 254 | ParamSet.NaviGpsACC = 0; |
|
- | 255 | ParamSet.NaviGpsMinSat = 6; |
|
- | 256 | ParamSet.NaviStickThreshold = 8; |
|
245 | ParamSet.NaviGpsD = 90; |
257 | ParamSet.NaviWindCorrection = 90; |
246 | ParamSet.NaviGpsACC = 0; |
258 | ParamSet.NaviSpeedCompensation = 30; |
Line 247... | Line 259... | ||
247 | ParamSet.NaviGpsMinSat = 6; |
259 | ParamSet.NaviOperatingRadius = 100; |
248 | ParamSet.NaviStickThreshold = 8; |
260 | ParamSet.NaviAngleLimitation = 60; |
249 | memcpy(ParamSet.Name, "Beginner\0", 9); |
261 | memcpy(ParamSet.Name, "Beginner\0", 9); |
Line 283... | Line 295... | ||
283 | 295 | ||
284 | 296 | ||
285 | /***************************************************/ |
297 | /***************************************************/ |
286 | /* Read Parameter Set from EEPROM */ |
298 | /* Read Parameter Set from EEPROM */ |
287 | /***************************************************/ |
299 | /***************************************************/ |
288 | // number [0..5] |
300 | // number [1..5] |
289 | void ParamSet_ReadFromEEProm(uint8_t setnumber) |
301 | void ParamSet_ReadFromEEProm(uint8_t setnumber) |
290 | { |
302 | { |
291 | if (setnumber > 5) setnumber = 5; |
303 | if((1 > setnumber) || (setnumber > 5)) setnumber = 3; |
292 | eeprom_read_block((uint8_t *) &ParamSet.ChannelAssignment[0], &EEPromArray[EEPROM_ADR_PARAMSET_BEGIN + PARAMSET_STRUCT_LEN * setnumber], PARAMSET_STRUCT_LEN); |
304 | eeprom_read_block((uint8_t *) &ParamSet.ChannelAssignment[0], &EEPromArray[EEPROM_ADR_PARAMSET_BEGIN + PARAMSET_STRUCT_LEN * (setnumber - 1)], PARAMSET_STRUCT_LEN); |
Line 293... | Line 305... | ||
293 | LED_Init(); |
305 | LED_Init(); |
294 | } |
306 | } |
295 | 307 | ||
296 | /***************************************************/ |
308 | /***************************************************/ |
297 | /* Write Parameter Set to EEPROM */ |
309 | /* Write Parameter Set to EEPROM */ |
298 | /***************************************************/ |
310 | /***************************************************/ |
299 | // number [0..5] |
311 | // number [1..5] |
- | 312 | void ParamSet_WriteToEEProm(uint8_t setnumber) |
|
300 | void ParamSet_WriteToEEProm(uint8_t setnumber) |
313 | { |
301 | { |
314 | if(setnumber > 5) setnumber = 5; |
302 | if(setnumber > 5) setnumber = 5; |
315 | if(setnumber < 1) return; |
303 | eeprom_write_block((uint8_t *) &ParamSet.ChannelAssignment[0], &EEPromArray[EEPROM_ADR_PARAMSET_BEGIN + PARAMSET_STRUCT_LEN * setnumber], PARAMSET_STRUCT_LEN); |
316 | eeprom_write_block((uint8_t *) &ParamSet.ChannelAssignment[0], &EEPromArray[EEPROM_ADR_PARAMSET_BEGIN + PARAMSET_STRUCT_LEN * (setnumber - 1)], PARAMSET_STRUCT_LEN); |
304 | // set this parameter set to active set |
317 | // set this parameter set to active set |
Line 305... | Line 318... | ||
305 | eeprom_write_byte(&EEPromArray[PID_ACTIVE_SET], setnumber); |
318 | SetActiveParamSet(setnumber); |
306 | LED_Init(); |
319 | LED_Init(); |
307 | } |
320 | } |
Line 313... | Line 326... | ||
313 | { |
326 | { |
314 | uint8_t setnumber; |
327 | uint8_t setnumber; |
315 | setnumber = eeprom_read_byte(&EEPromArray[PID_ACTIVE_SET]); |
328 | setnumber = eeprom_read_byte(&EEPromArray[PID_ACTIVE_SET]); |
316 | if(setnumber > 5) |
329 | if(setnumber > 5) |
317 | { |
330 | { |
318 | setnumber = 2; |
331 | setnumber = 3; |
319 | eeprom_write_byte(&EEPromArray[PID_ACTIVE_SET], setnumber); |
332 | eeprom_write_byte(&EEPromArray[PID_ACTIVE_SET], setnumber); |
320 | } |
333 | } |
321 | return(setnumber); |
334 | return(setnumber); |
322 | } |
335 | } |
Line 323... | Line 336... | ||
323 | 336 | ||
324 | /***************************************************/ |
337 | /***************************************************/ |
325 | /* Set active parameter set */ |
338 | /* Set active parameter set */ |
326 | /***************************************************/ |
339 | /***************************************************/ |
327 | void SetActiveParamSet(uint8_t setnumber) |
340 | void SetActiveParamSet(uint8_t setnumber) |
328 | { |
341 | { |
- | 342 | if(setnumber > 5) setnumber = 5; |
|
329 | if(setnumber > 5) setnumber = 5; |
343 | if(setnumber < 1) setnumber = 1; |
330 | eeprom_write_byte(&EEPromArray[PID_ACTIVE_SET], setnumber); |
344 | eeprom_write_byte(&EEPromArray[PID_ACTIVE_SET], setnumber); |
Line 331... | Line 345... | ||
331 | } |
345 | } |
332 | 346 | ||
Line 340... | Line 354... | ||
340 | { |
354 | { |
341 | // if version check faild |
355 | // if version check faild |
342 | printf("\n\rInit. EEPROM: Generating Default-Parameter..."); |
356 | printf("\n\rInit. EEPROM: Generating Default-Parameter..."); |
343 | ParamSet_DefaultSet1(); // Fill ParamSet Structure to default parameter set 1 (Sport) |
357 | ParamSet_DefaultSet1(); // Fill ParamSet Structure to default parameter set 1 (Sport) |
344 | // fill all 5 parameter settings with set 1 except otherwise defined |
358 | // fill all 5 parameter settings with set 1 except otherwise defined |
345 | for (unsigned char i=0;i<6;i++) |
359 | for (uint8_t i = 1;i < 6; i++) |
346 | { |
360 | { |
347 | if(i==2) ParamSet_DefaultSet2(); // Kamera |
361 | if(i==2) ParamSet_DefaultSet2(); // Kamera |
348 | if(i==3) ParamSet_DefaultSet3(); // Beginner |
362 | if(i==3) ParamSet_DefaultSet3(); // Beginner |
349 | if(i>3) ParamSet_DefaultSet2(); // Kamera |
363 | if(i>3) ParamSet_DefaultSet2(); // Kamera |
350 | ParamSet_WriteToEEProm(i); |
364 | ParamSet_WriteToEEProm(i); |
351 | } |
365 | } |
352 | // default-Setting is parameter set 3 |
366 | // default-Setting is parameter set 3 |
353 | SetParamByte(PID_ACTIVE_SET, 3); |
367 | SetActiveParamSet(3); |
354 | // update version info |
368 | // update version info |
355 | SetParamByte(PID_VERSION, EEPARAM_VERSION); |
369 | SetParamByte(PID_VERSION, EEPARAM_VERSION); |
356 | } |
370 | } |
357 | // read active parameter set to ParamSet stucture |
371 | // read active parameter set to ParamSet stucture |
358 | ParamSet_ReadFromEEProm(GetParamByte(PID_ACTIVE_SET)); |
372 | ParamSet_ReadFromEEProm(GetActiveParamSet()); |
359 | printf("\n\rUsing Parameter Set %d", GetParamByte(PID_ACTIVE_SET)); |
373 | printf("\n\rUsing Parameter Set %d", GetActiveParamSet()); |
360 | } |
374 | } |