-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implement cascading PID control #2
Comments
As far as I can tell, torque values used as reference (i.e. commanded via |
iPOS help dialogues: Regarding the screenshot attached in #2 (comment) / #1 (comment), note both feedforward terms in Position controller are moved to the Speed controller section if Control mode is configured as Speed instead of Position (this is not our use case). Moreover, the Load speed limit field in Position controller disappears if we select Close only position and current loop (again, not our case). Lastly, there are no feedforward terms present if position/speed controllers are closed using the fast loop. See also: http://www.technosoft.ro/KB/index.php?/article/AA-15475/0/Advanced-controllers-tuning.html.
|
WIP: teo.ods |
I am going to close this as WONTFIX. The point of going all the way down to the basics of how iPOS controllers work was to replicate them as closely as possible in Gazebo. There are several challenges that make this very unlikely to happen (triple cascading PID, stiction, no model available for an EC motor, different sampling times...). Instead, it makes more sense to work with what we have now and improve it via proper configuration. I have introduced a pidTuning.py script at roboticslab-uc3m/tools@a63896d which allows to modify the PID coefficients (via IPidControl). The results of a step response are plotted for visual inspection and analysis. It also features a "staircase" input to emulate the actual behavior of a longer, fixed-velocity trajectory. Commit 4807410 introduced the new coefficients in the model. Besides, I am also adding the "externalwrench" Gazebo/YARP plugin in the main SDF file to emulate the behavior of the leg limbs while standing on one foot (Fz = 540 N). PS: I had to change the NWS state publisher port period from 10 ms to 1 ms (here). |
Stemming from #1, this issue is intended to focus mainly on the analysis and implementation of PID control in Gazebo.
#1 (comment)
I'm focusing now on PID joint controllers. Real TEO hardware is somewhat tricky:
Ideally, we'd like to implement a new control type in Gazebo-YARP that would more closely match real robot behavior. Then, similar or exact same values as provided in the iPOS configuration would be reused in this plugin. However, the variable sampling periods are a significant obstacle. Physics in Gazebo are updated each millisecond by default and defined by two elements:
<max_step_size>
and<real_time_update_rate>
(ref). If not provided, Gazebo assumes the following<physics>
element:Gazebo's ODE plugin updates physics at a fixed rate of 1 ms, then Gazebo itself will strive to advance steps at 1000 Hz to match real time, i.e. real time factor is
0.001*1000=1.0
. If too computationally expensive, simulation time will lag behind real time (real time factor less than1.0
). Info:I've tried to tighten simulation times and the most I can achieve without degrading the real time factor is 0.2-0.25 ms (200-250 microseconds). It is virtually not possible to achieve a fast control loop of 100 microseconds, much less 50 microseconds, as resource usage is too high.
In short, I'd need to take shortcuts, perhaps forcing all three stages (position PID, speed PI, current PI) to operate at the same "slow loop" sampling period. It is yet to be determined whether that same PID coefficients originating from the iPOS configuration would still be valid in a simulated environment and with the improvements proposed here. Moreover, what if the slow loop period is 0.5 ms instead of 1 ms, but we reuse PID coeffs in a 1 ms loop?
Options:
joint_pid_gazebo_v1
, which is a position PID + speed PID (i.e. 2 per joint), and tune with care.#1 (comment)
As spoken, both @smcdiaz and I agree on
Implement cascading PID
control would be a great option, even if the parameters would have to be different (hopefully, proportional, and no problem if fully re-tuned). : )#1 (comment)
See roboticslab-uc3m/yarp-devices#253 (comment) regarding sampling rates and slow/fast loop configuration. Besides, MotionChip II Data Sheet (P091.055.MCII.DSH.0704) states in Section 3.5: Special Features:
#1 (comment)
Just in case, regarding
gazebo::common::PID
: implementation, reference.#1 (comment)
MotionChip™ II Configuration Setup User Manual provides details on the implementation of the motion controllers in Section 3.5 (see also the description of their TML parameters, especially in Section 4.2.5). There is a correspondence between numerical values and TML parameters in the EasySetUp's "Drive Setup" dialog, as shown below:
All TML parameters are saved in the parameters.cfg file by EasySetUp.
The text was updated successfully, but these errors were encountered: