Subversion Repositories FlightCtrl

Rev

Rev 1467 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1467 Rev 1478
Line 16... Line 16...
16
 
16
 
17
    	// throttle
17
    	// throttle
18
    	throttle = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] + HELI_THROTTLE_DEADBAND;
18
    	throttle = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] + HELI_THROTTLE_DEADBAND;
Line 19... Line 19...
19
    	if (throttle < 5) throttle = 0;
19
    	if (throttle < 5) throttle = 0;
20
 
20
 
21
    	tmp = throttle / HELI_THROTTLE_SENSITIVITY;
21
    	tmp = throttle * 10 / HELI_THROTTLE_SENSITIVITY;
22
    	if (tmp > HELI_MAX_THROTTLE * 2) tmp = HELI_MAX_THROTTLE * 2;
22
    	if (tmp > HELI_MAX_THROTTLE * 2) tmp = HELI_MAX_THROTTLE * 2;
23
		DebugOut.Analog[7] = tmp;
23
		DebugOut.Analog[7] = tmp;
24
		if (MotorenEin == 0 || MikroKopterFlags & FLAG_NOTLANDUNG) {
24
		if (MotorenEin == 0 || MikroKopterFlags & FLAG_NOTLANDUNG) {
25
			tmp = 0;
25
			tmp = 0;
Line 26... Line 26...
26
	    }
26
	    }
27
    	servo[4] = tmp;
27
    	servo[4] = tmp;
28
 
28
 
Line 29... Line 29...
29
		// pitch
29
		// pitch
30
    	pitch = throttle / HELI_PITCH_SENSITIVITY + HELI_PITCH_BASE;
30
    	pitch = throttle * 5 / HELI_PITCH_SENSITIVITY + HELI_PITCH_BASE;
31
    	if (pitch > HELI_MAX_PITCH) pitch = HELI_MAX_PITCH;
31
    	if (pitch > HELI_MAX_PITCH) pitch = HELI_MAX_PITCH;
Line 32... Line 32...
32
 
32
 
33
		servo[0] = 127 - pitch;
33
		servo[0] = 127 - (pitch * SERVO1_DIR);
Line 34... Line 34...
34
		servo[1] = 127 + pitch;
34
		servo[1] = 127 + (pitch * SERVO2_DIR);
35
		servo[2] = 127 + pitch;
35
		servo[2] = 127 + (pitch * SERVO3_DIR);
36
 
36
 
37
 
37
 
38
    	nick = IntegralNick / (EE_Parameter.GyroAccFaktor * 4);
38
    	nick = IntegralNick / (EE_Parameter.GyroAccFaktor * 4);
39
    	roll = IntegralRoll / (EE_Parameter.GyroAccFaktor * 4);
39
    	roll = IntegralRoll / (EE_Parameter.GyroAccFaktor * 4);
Line 40... Line 40...
40
 
40
 
41
		// nick
41
		// nick
42
    	nick /= HELI_NICK_GYRO_SENSITIVITY;
42
    	nick /= HELI_NICK_GYRO_SENSITIVITY;
43
    	nick -= PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] / HELI_NICK_SENSITIVITY;
43
    	nick -= PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] * 10 / HELI_NICK_SENSITIVITY;
44
    	servo[0] -= nick;
44
    	servo[0] -= (nick * SERVO1_DIR);
Line 45... Line 45...
45
    	servo[1] += nick;
45
    	servo[1] += (nick * SERVO2_DIR);
46
    	servo[2] -= nick;
46
    	servo[2] -= (nick * SERVO3_DIR);
47
 
47
 
Line 48... Line 48...
48
		// roll
48
		// roll
49
    	roll /= HELI_ROLL_GYRO_SENSITIVITY;
49
    	roll /= HELI_ROLL_GYRO_SENSITIVITY;
Line 50... Line 50...
50
    	roll -= PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] / HELI_ROLL_SENSITIVITY;
50
    	roll -= PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] * 10 / HELI_ROLL_SENSITIVITY;