-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved initialisation order. Stopped calling pidInit before gyro detected #4218
Improved initialisation order. Stopped calling pidInit before gyro detected #4218
Conversation
src/main/fc/config.c
Outdated
@@ -342,6 +342,13 @@ void validateAndFixConfig(void) | |||
#endif | |||
|
|||
#ifndef USE_OSD_SLAVE | |||
if (systemConfig()->activeRateProfile >= CONTROL_RATE_PROFILE_COUNT) {// sanity check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A space would be nice here. ;-)
src/main/fc/config.c
Outdated
if (systemConfig()->activeRateProfile >= CONTROL_RATE_PROFILE_COUNT) {// sanity check | ||
systemConfigMutable()->activeRateProfile = 0; | ||
} | ||
if (systemConfig()->pidProfileIndex >= MAX_PROFILE_COUNT) {// sanity check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here.
@@ -267,7 +267,6 @@ static void setPidProfile(uint8_t pidProfileIndex) | |||
if (pidProfileIndex < MAX_PROFILE_COUNT) { | |||
systemConfigMutable()->pidProfileIndex = pidProfileIndex; | |||
currentPidProfile = pidProfilesMutable(pidProfileIndex); | |||
pidInit(currentPidProfile); // re-initialise pid controller to re-initialise filters and config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it feels like activateConfig() should call pidInit(), but that still won't fix the underlying problem on first boot.
6ee7399
to
f41dee3
Compare
src/main/fc/config.c
Outdated
@@ -594,19 +607,13 @@ void readEEPROM(void) | |||
if (!loadEEPROM()) { | |||
failureMode(FAILURE_INVALID_EEPROM_CONTENTS); | |||
} | |||
|
|||
validateAndFixConfig(); | |||
validateAndFixGyroConfig(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this has to be guarded by #ifndef USE_OSD_SLAVE
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks.
Has this fix been added to RC6? I just upgraded to RC6 and bug is still present. |
@VoicOfReason , this code has been added to RC6. Please could you describe the bug that you are still experiencing? |
Flies level at liftoff and after hitting throttle or doing some maneuvers,
it flies slanted or tilted so bad that I have To crank stick sometime all
the day to keep it level. It gets progressively worse. If I land and
calibrate gyro it flies level again but then starts flying tilted again
soon. Tried swapping all motors, FC, and radio Rx but same problem. Fc
used: betaflight f3 and f7v2. I tried Adjusting add Lpf and add trim but
does nothing. Also turned on in flight add calib. Does nothing.
…On Tue, Oct 3, 2017 at 12:32 AM Martin Budden ***@***.***> wrote:
@VoicOfReason <https://github.com/voicofreason> , this code has been
added to RC6. Please could you describe the bug that you are still
experiencing?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4218 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAq5OZoMjc3dtc96nipeBniUgGUt_jOpks5socDagaJpZM4PhqiB>
.
|
Let me edit that post again:
Flies level at liftoff and after hitting throttle or doing some maneuvers,
it flies slanted or tilted so bad that I have To crank stick sometime all
the way to keep it level. It gets progressively worse. Sometimes it drift
severely to right and other times to the left. If I land and calibrate
gyro using stick command (left: low, low, right: center, down) it flies
level again but then starts flying tilted again soon, especially after big
throttle punches. However, sometimes when I tiled side to side I can watch
it get progressively worse in a matter of seconds to where it becomes
unflyable and dangerous.. Tried swapping all motors, FC, and radio Rx but
same problem. Fc's used: betaflight f3 and Omnibus f7v2. I tried Adjusting
ACC Lpf and ACC trim but does nothing. Also turned on in flight ACC calib.
Does nothing. I have a separate build (a GT200) with BFF3 that has the same
issue though not as bad, and that is a completely different frame, motors,
ESC's, etc.
…On Tue, Oct 3, 2017 at 7:10 AM, Peter Freund ***@***.***> wrote:
Flies level at liftoff and after hitting throttle or doing some maneuvers,
it flies slanted or tilted so bad that I have To crank stick sometime all
the day to keep it level. It gets progressively worse. If I land and
calibrate gyro it flies level again but then starts flying tilted again
soon. Tried swapping all motors, FC, and radio Rx but same problem. Fc
used: betaflight f3 and f7v2. I tried Adjusting add Lpf and add trim but
does nothing. Also turned on in flight add calib. Does nothing.
On Tue, Oct 3, 2017 at 12:32 AM Martin Budden ***@***.***>
wrote:
> @VoicOfReason <https://github.com/voicofreason> , this code has been
> added to RC6. Please could you describe the bug that you are still
> experiencing?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#4218 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAq5OZoMjc3dtc96nipeBniUgGUt_jOpks5socDagaJpZM4PhqiB>
> .
>
|
This looks to be causing a double initialisation on FC boot: #4257 |
Is this drifting issue now fixed and merged into a release? Would like to test it again |
No description provided.