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

Slew rate 2 #8228

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Slew rate 2 #8228

wants to merge 3 commits into from

Conversation

jaxxzer
Copy link
Member

@jaxxzer jaxxzer commented Apr 24, 2018

This one supercedes #8213 and is revised according to review in dev call.

patrickelectric and others added 3 commits May 1, 2018 09:02
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
Co-authored-by: Jacob Walser <jwalser90@gmail.com>
@jaxxzer
Copy link
Member Author

jaxxzer commented May 8, 2018

Use float multiplication, not division.

// Apply rate of change limiting to an input
// max_rate is the maximum allowed rate of change as a percentage of the range per second
// dt is the time delta in seconds between calls
void limit_value_slew_rate(float& previous, float& current, float range, float max_rate, float dt) {
Copy link
Member

Choose a reason for hiding this comment

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

The limit_demand_slew_rate method is already big to be in the header, but this one is huge. Please move it to the cpp file.

max_change = 0.001 * range;
}

current = constrain_float(current, previous - max_change, previous + max_change);
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if limit.X should be set.

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.

4 participants