-
Notifications
You must be signed in to change notification settings - Fork 369
Reset the PIDs states when controller is at rest #1666
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
base: master
Are you sure you want to change the base?
Conversation
in your example, when should the controller be reset? if the robot is moved manually, the error won't be zero in the end right? and in the case where the input is zero, and with some integral action the error also converges to zero. If the controller will be reset, the robot will jump/sag? |
@christophfroehlich @KmakD shouldn't we consider this in the |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1666 +/- ##
==========================================
+ Coverage 84.77% 84.79% +0.02%
==========================================
Files 127 127
Lines 12096 12121 +25
Branches 1036 1038 +2
==========================================
+ Hits 10254 10278 +24
Misses 1503 1503
- Partials 339 340 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
I have objections in this approach, see my unanswered question |
Sorry for late respone, I had a few days off.
The robot should be reset only when the input is zero and the error is zero.
Assuming velocity control, when the robot is no longer moved, the velocity feedback becomes zero and the error will be also zero.
I'm not sure if I fully understans this, If controller is reset when the input and error are 0, the output will also be 0, so there is no way it will jump/sag |
const auto zero_threshold = params_.gains.dof_names_map[params_.dof_names[i]].zero_threshold; | ||
if (std::abs(reference_interfaces_[i]) < zero_threshold && std::abs(error) < zero_threshold) |
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 agree with @christophfroehlich
Zero itself is a valid reference. IMHO using that to reset the PIDs is not a smart decision
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 agree, using reference values is not a perfect solution, but I can't think of a better way to detect this.
There was once an idea to add emergency-stop feature in ros2_control that can be set in hardware component and propagated to all controllers (as a flag if I remember correctly). That would be perfect in this case. What happened to that idea?
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.
is “Configuration/Movement/Safety-critical" interfaces definition ( ros-controls/roadmap#51) relevant for this scenario ?
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.
If I understand this correctly this will only allow to configure command interfaces depending if hardware component is active/inactive. In controller we would like to be able to read hardware interface state and act if it was deactivated/halted, or have some global flag that indicates hardware e-stop was triggerd
This feature can help when it is impossible to send commands to hardware but the controller may receive state values.
To justify that let me give an example. You have a robot that has a hardware e-stop. When it is in e-stop state the controller receives a false reading (e.g. someone manually moves the robot). This increases the integral part of the PID, which sets the output to some fixed value. If the robot is smart it won't let you reset the e-stop when it receives non zero command, if not it will move unexpectedly as soon as e-stop is reset. This functionality will reset the PID if the controller is at rest (error and input is 0) for a specified time preventing that.
To send us a pull request, please:
colcon test
andpre-commit run
(requires you to install pre-commit bypip3 install pre-commit
)