Subversion Repositories FlightCtrl

Rev

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

Rev 2026 Rev 2027
Line 9... Line 9...
9
// For scope debugging only!
9
// For scope debugging only!
10
#include "rc.h"
10
#include "rc.h"
Line 11... Line 11...
11
 
11
 
Line 12... Line -...
12
#define INTEGRAL_LIMIT 100000
-
 
13
 
-
 
14
/*
-
 
15
 #define DEBUGINTEGRAL 0
-
 
16
 #define DEBUGDIFFERENTIAL 0
-
 
17
 #define DEBUGHOVERTHROTTLE 0
-
 
18
 #define DEBUGHEIGHTSWITCH 0
-
 
19
 */
12
#define INTEGRAL_LIMIT 100000
Line 20... Line 13...
20
 
13
 
21
#define LATCH_TIME 40
14
#define LATCH_TIME 40
22
 
15
 
Line 124... Line 117...
124
    else if (iHeight < -INTEGRAL_LIMIT) { iHeight = -INTEGRAL_LIMIT; if (DEBUGINTEGRAL) {DebugOut.Digital[0] = 0; DebugOut.Digital[1] = 0; }}
117
    else if (iHeight < -INTEGRAL_LIMIT) { iHeight = -INTEGRAL_LIMIT; if (DEBUGINTEGRAL) {DebugOut.Digital[0] = 0; DebugOut.Digital[1] = 0; }}
125
    else if (iHeight > 0) { if (DEBUGINTEGRAL) DebugOut.Digital[0] = 1;}
118
    else if (iHeight > 0) { if (DEBUGINTEGRAL) DebugOut.Digital[0] = 1;}
126
    else if (iHeight < 0) { if (DEBUGINTEGRAL) DebugOut.Digital[1] = 1;}
119
    else if (iHeight < 0) { if (DEBUGINTEGRAL) DebugOut.Digital[1] = 1;}
127
  */
120
  */
Line 128... Line 121...
128
 
121
 
129
  int16_t dThrottle = ((heightError * staticParams.heightP) >> 9)
122
  int16_t dThrottle = ((heightError * staticParams.heightP) >> 10)
Line 130... Line 123...
130
    /*+ iHeight / 10000L * staticParams.Height_ACC_Effect */-((dHeight * staticParams.heightD) >> 7);
123
    /*+ iHeight / 10000L * staticParams.Height_ACC_Effect */-((dHeight * staticParams.heightD) >> 7);
131
 
124
 
132
  if (dThrottle > staticParams.heightControlMaxThrottleChange)
125
  if (dThrottle > staticParams.heightControlMaxThrottleChange)