-
Hello, I am a master student working on the iCub at Munich ICS (the robot is iCubMunich01 with upgrades) and we are trying to control the robot using the velocity commands, through the 'IVelocityControl' class. The joints of the robot can be set to velocity control using the 'IControlMode' class or manually in the 'yarpmotorgui' control panel, but it doesn't seem to respond to the 'velocityMove' commands nor we can modify the velocity value using the slider in the 'yarpmotorgui'. We have noticed that the 'Velocity PID' controller values are not defined, and we can't modify them using the PID window from the 'yarpmotorgui': When the desired values are changed and sent, current values won't update. However, the values of the 'Position PID' controller can be changed without any problems. We have found the file where the parameters are defined, 'icub_right_arm.xml'. There are PID controllers defined for position and torque but not for velocity. Is defining values in this 'xml' file the solution to be able to change the values of the PID controller, or the problem is that the joints can't be velocity-controlled? Regards, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hi @guiolpei welcome to our community 👋 Let's leave the GUI aside for a moment. Could you post on Gist the relevant portion of the code you're using to control the robot in velocity? This way we can inspect, run and comment on it. What I suspect is that you're not aware of the safety timeout of With this in mind, you have to keep sending velocity commands (even the same command as a sort of heartbeat) at a proper rate to sustain the control mechanism and prevent timeout expiration. At the low level, the velocity commands are integrated to yield position setpoints; thereby, the relevant PID gains are still those of the position domain. In this respect, I don't know actually what are pure velocity PID gains used for. Perhaps, they're effective only for those devices where a native low-level velocity control can be performed (@randaz81 might be of help here). |
Beta Was this translation helpful? Give feedback.
-
Thank you for your quick response, Ugo. The code we are using is here: https://gist.github.com/guiolpei/383cc7f24a5c8f233b5d90ed9719458a The control is done through another class that acts as a wrapper to the 'IControlMode' class. This code works correctly on the iCub simulator but fails to work on the real robot. In the simulator, the joint moves at 5 deg/s until the 0 velocity command is sent. The GUI also shows the correct value for the velocity. We weren't aware that there was a safety timeout of I understand then that velocity PID is not needed as you said, and as it is depicted in the following figure: |
Beta Was this translation helpful? Give feedback.
-
Yep, the diagram is correct 👍 In the following piece of your main iCubRightArmCtrl->velocityMove(3, 5.0);
iCubRightArmCtrl->velocityMove(3, 0); you're basically commading a movement in velocity and soon afterward you stop it. A typical velocity control loop resembles these snippets instead:
|
Beta Was this translation helpful? Give feedback.
Yep, the diagram is correct 👍
In the following piece of your main
you're basically commading a movement in velocity and soon afterward you stop it.
A typical velocity control loop resembles these snippets instead:
setpoint
:T
seconds: