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

converted PI rate controller to floating point #1624

Closed
wants to merge 1 commit into from

Conversation

EwoudSmeur
Copy link
Member

As requested, the rate controller in floating point. I also changed the integrator scale to be divided by 512.0 to allow easy operation with the (I believe) standard 512.0 Hz control frequency. Anyway, the idea being that you can easily calculate the command after 1 sec 1 rad/s error with the current I gain, for instance compared to the P gain. Now I think about it... maybe dividing by periodic frequency is even better...

On a side note, the messages are now also in float, so do I have to make a pull request to pprzlink as well? Why is this separate by the way?

struct Int32Rates sum_err_increment;
RATES_SDIV(sum_err_increment, _error, 5);
struct FloatRates sum_err_increment;
RATES_SDIV(sum_err_increment, _error, 512.0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better use PERIODIC_FREQUENCY than hardcoded 512Hz..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good that you agree.

@flixr
Copy link
Member

flixr commented Apr 21, 2016

Yes, for the message change, you will need to make a PR in pprzlink.
And it was split out to e.g. finally offer an easier way to integrate communication with Paparazzi vehicles in other code...

You wanted to make the gains the "same" as in attitude stabilization in #1601, is that still the case?

@EwoudSmeur
Copy link
Member Author

Float attitude stabilization also has no scaling, so they are compatible. Stab att int still has scaling, so that is not directly compatible.

In this PR I changed the integrator scaling, and changed the gains appropriately in the airframe files. Nothing changed to the P gains.

@EwoudSmeur
Copy link
Member Author

So, can we merge this? @dewagter you still want to comment?

@flixr
Copy link
Member

flixr commented Apr 25, 2016

For me it's fine to merge after paparazzi/pprzlink#12

@gautierhattenberger
Copy link
Member

also fine for me

@dewagter
Copy link
Member

This was about "readability versus efficiency" ?

-Christophe

On Mon, Apr 25, 2016 at 6:29 PM, Felix Ruess notifications@github.com
wrote:

For me it's fine to merge after paparazzi/pprzlink#12
paparazzi/pprzlink#12


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#1624 (comment)

@flixr
Copy link
Member

flixr commented Apr 26, 2016

Not only readability and simplification: If you have an MCU with FPU, then the float impl is actually faster as there are less operations...

@flixr flixr closed this in 0c95b9e Apr 27, 2016
@EwoudSmeur EwoudSmeur deleted the rate_to_float branch June 3, 2016 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants