Subversion Repositories FlightCtrl

Rev

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

Rev 2069 Rev 2071
Line 47... Line 47...
47
      // Switch is ON
47
      // Switch is ON
48
      if (setHeightLatch <= LATCH_TIME) {
48
      if (setHeightLatch <= LATCH_TIME) {
49
        if (setHeightLatch == LATCH_TIME) {
49
        if (setHeightLatch == LATCH_TIME) {
50
          // Freeze the height as target. We want to do this exactly once each time the switch is thrown ON.
50
          // Freeze the height as target. We want to do this exactly once each time the switch is thrown ON.
51
          /* rampedTargetHeight = */ targetHeight = height;
51
          /* rampedTargetHeight = */ targetHeight = height;
-
 
52
          iHeight = 0;
52
        }
53
        }
53
        // Time not yet reached.
54
        // Time not yet reached.
54
        setHeightLatch++;
55
        setHeightLatch++;
55
      }
56
      }
56
    } else {
57
    } else {
Line 137... Line 138...
137
 
138
 
138
  //debugOut.analog[27] = dynamicParams.heightP;
139
  //debugOut.analog[27] = dynamicParams.heightP;
139
  //debugOut.analog[28] = dynamicParams.heightI;
140
  //debugOut.analog[28] = dynamicParams.heightI;
Line 140... Line 141...
140
  //debugOut.analog[29] = dynamicParams.heightD;
141
  //debugOut.analog[29] = dynamicParams.heightD;
Line 141... Line 142...
141
 
142
 
142
  int16_t dThrottle = dThrottleI + dThrottleP + dThrottleD;
143
  int16_t dThrottle = dThrottleI + dThrottleP - dThrottleD;
143
 
144
 
144
  if (dThrottle > staticParams.heightControlMaxThrottleChange)
145
  if (dThrottle > staticParams.heightControlMaxThrottleChange)