Subversion Repositories FlightCtrl

Rev

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

Rev 851 Rev 857
Line 192... Line 192...
192
        cli();
192
        cli();
193
        mm3_x_axis = MM3.x_axis;
193
        mm3_x_axis = MM3.x_axis;
194
        mm3_y_axis = MM3.y_axis;
194
        mm3_y_axis = MM3.y_axis;
195
        mm3_z_axis = MM3.z_axis;
195
        mm3_z_axis = MM3.z_axis;
196
        SREG = tmp_sreg;
196
        SREG = tmp_sreg;
197
/*     
197
       
198
        int temp = Aktuell_az-550;
198
        int temp = Aktuell_az-550;
199
        DebugOut.Analog[2] = temp;
-
 
200
        // Lage-Berechnung mittels Acc-Messwerte
199
        // Lage-Berechnung mittels Acc-Messwerte
201
        tilt = atan2_i(temp,AdWertAccNick*64);
200
        tilt = atan2_i(temp,AdWertAccNick*64);
202
        DebugOut.Analog[0] = tilt;
-
 
203
        sin_nick = sin_i(tilt);
201
        sin_nick = sin_i(tilt);
204
        cos_nick = cos_i(tilt);
202
        cos_nick = cos_i(tilt);
Line 205... Line 203...
205
       
203
       
206
        tilt = atan2_i(temp,AdWertAccRoll*64);
-
 
207
        DebugOut.Analog[1] = tilt;
204
        tilt = atan2_i(temp,AdWertAccRoll*64);
208
        sin_roll = sin_i(tilt);
205
        sin_roll = sin_i(tilt);
-
 
206
        cos_roll = cos_i(tilt);
209
        cos_roll = cos_i(tilt);
207
 
210
*/     
208
/*     
211
        // Lage-Berechnung mittels Gyro-Integral
209
        // Lage-Berechnung mittels Gyro-Integral
212
        uint16_t div_faktor;
210
        uint16_t div_faktor;
Line 213... Line 211...
213
        div_faktor = (uint16_t)EE_Parameter.UserParam3 *8;
211
        div_faktor = (uint16_t)EE_Parameter.UserParam3 *8;
Line 217... Line 215...
217
        cos_nick = cos_i(tilt);
215
        cos_nick = cos_i(tilt);
Line 218... Line 216...
218
 
216
 
219
        tilt = (IntegralRoll /div_faktor);
217
        tilt = (IntegralRoll /div_faktor);
220
        sin_roll = sin_i(tilt);
218
        sin_roll = sin_i(tilt);
221
        cos_roll = cos_i(tilt);
219
        cos_roll = cos_i(tilt);
222
       
220
*/     
223
        // Offset und Normalisierung
221
        // Offset und Normalisierung
224
        Hx = (((int32_t)(mm3_x_axis - MM3_calib.X_off)) *512) /MM3_calib.X_range;
222
        Hx = (((int32_t)(mm3_x_axis - MM3_calib.X_off)) *512) /MM3_calib.X_range;
225
        Hy = (((int32_t)(mm3_y_axis - MM3_calib.Y_off)) *512) /MM3_calib.Y_range;
223
        Hy = (((int32_t)(mm3_y_axis - MM3_calib.Y_off)) *512) /MM3_calib.Y_range;