-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
[Multirotor] add yaw rate low pass filter #24173
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -292,3 +292,17 @@ PARAM_DEFINE_FLOAT(MC_YAWRATE_K, 1.0f); | |
* @group Multicopter Rate Control | ||
*/ | ||
PARAM_DEFINE_INT32(MC_BAT_SCALE_EN, 0); | ||
|
||
/** | ||
* First order low pass filter cutoff frequency for yaw rate control | ||
* | ||
* Reduces vibrations by lowering high frequency torque caused by rotor acceleration. | ||
* 0 disables the filter | ||
* | ||
* @min 0 | ||
* @max 10 | ||
* @unit Hz | ||
* @decimal 3 | ||
* @group Multicopter Rate Control | ||
*/ | ||
PARAM_DEFINE_FLOAT(MC_YAWRATE_FC, 2.f); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if I have a better suggestion, but does this naming make sense? Something more along the lines of yaw torque filter cutoff or in someway distinguish that it's specifically the output? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The suggested name from #21434 was There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed it to |
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.
This function could potentially be misleading in the case you call
setCutoffFreq(float cutoff_freq)
which sets_time_constant
but then useupdate(const T &sample)
for the update which assumessetParameters(dt, _time_constant)
was already called. I don't have a great idea how to make it clear but see the potential for people to run into this 😬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, I was wondering about this too. Should we instead have two distinct classes? One where dt needs to be set during the
update
call and the other one that uses thesetParameters
to update the alpha.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.
Seems overkill no? Would it be a performance hit to just always use the "One where dt needs to be set during the update" and in the cases it's static just pass a constant? Seems way easier compared to the multiple options for basically the same thing.
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 does seem like overkill, but having separate classes could make each individually a bit easier to use, harder to misuse. Having to know which update to call when used a certain way is a leaky abstraction.