Rev 2039 | Rev 2052 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2039 | Rev 2048 | ||
---|---|---|---|
Line 152... | Line 152... | ||
152 | uint8_t maxValue; |
152 | uint8_t maxValue; |
153 | uint8_t flags; |
153 | uint8_t flags; |
154 | } servo_t;*/ |
154 | } servo_t;*/ |
Line 155... | Line 155... | ||
155 | 155 | ||
156 | int16_t calculateStabilizedServoAxis(uint8_t axis) { |
156 | int16_t calculateStabilizedServoAxis(uint8_t axis) { |
157 | int32_t value = angle[axis] / 64L; // between -500000 to 500000 extreme limits. Just about |
157 | int32_t value = attitude[axis] / 64L; // between -500000 to 500000 extreme limits. Just about |
158 | // With full blast on stabilization gain (255) we want to convert a delta of, say, 125000 to 2000. |
158 | // With full blast on stabilization gain (255) we want to convert a delta of, say, 125000 to 2000. |
159 | // That is a divisor of about 1<<14. Same conclusion as H&I. |
159 | // That is a divisor of about 1<<14. Same conclusion as H&I. |
160 | value *= staticParams.servoConfigurations[axis].stabilizationFactor; |
160 | value *= staticParams.servoConfigurations[axis].stabilizationFactor; |
161 | value /= 256L; |
161 | value /= 256L; |