Skip to content
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

stabilization quat_int IERROR scale fix #1205

Merged
merged 1 commit into from
Jul 6, 2015

Conversation

flixr
Copy link
Member

@flixr flixr commented Jun 10, 2015

This should (tm) result in less of a quantization error for the integral part (less static offset).
Reduce the GAIN_PRESCALER_I accordingly so that the gains set in the airframe file keep same scale.

While here also simplify the fb command prescalers/scaling...

@flixr flixr added this to the v5.6 milestone Jun 24, 2015
@flixr flixr force-pushed the stab_int_quat_prescalers branch from 6bac782 to a4ab590 Compare June 26, 2015 20:40
@flixr
Copy link
Member Author

flixr commented Jun 26, 2015

Only tested this in NPS, it should be correct.
@gautierhattenberger would be great if you could cross check the prescalers...

@gautierhattenberger
Copy link
Member

On the IGAIN, the sum_err was divided by1024, then multiplied by 48 and divided 2, so if you have 1024 as input, output is : 1024* (1/1024)*48*(1/2) = 24.
Now you have a division by 128, then multiply by 4, so for the same input you have: 1024*(1/128)*4 = 32.
If I'm correct, by multiplying by 3 instead of 4, you should have the same final value than before.

This should (tm) result in less of a quantization error for the integral part (less static offset).
Reduce the GAIN_PRESCALER_I accordingly so that the gains set in the airframe file keep same scale.

While here also simplify the fb command prescalers/scaling...
@flixr flixr force-pushed the stab_int_quat_prescalers branch from a4ab590 to 6a99ae4 Compare June 30, 2015 21:44
@flixr
Copy link
Member Author

flixr commented Jun 30, 2015

Correct, thanks for checking again :-)
Amended the commit...
I guess should we also increase the INTEGRATOR_BOUND according to the new IERROR_SCALE?
That is assuming it had a meaningful value before...

@gautierhattenberger
Copy link
Member

I guess so. It seems it should be 8 times bigger

@flixr
Copy link
Member Author

flixr commented Jul 4, 2015

Actually I think it makes sense to keep the limit, which would translate to just under 180deg (in float representation of the quat int) if would look at it like this...

@gautierhattenberger
Copy link
Member

I never pay much attention to the sum_err value, but if you think it is already high enough, I'm fine.

flixr added a commit that referenced this pull request Jul 6, 2015
stabilization quat_int IERROR scale fix

This should (tm) result in less of a quantization error for the integral part (less static offset).
Reduce the GAIN_PRESCALER_I accordingly so that the gains set in the airframe file keep same scale.

While here also simplify the fb command prescalers/scaling...
@flixr flixr merged commit c389e0c into paparazzi:master Jul 6, 2015
@flixr flixr deleted the stab_int_quat_prescalers branch July 6, 2015 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants