-
Notifications
You must be signed in to change notification settings - Fork 119
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
Gravity compensation #100
Comments
Testing with #91, the falling seems to have stopped. Here you can view the video where the controller seems to be in equilibrium at the start and then I try to rotate the tcp with my hand. Based on the video, do you think the rotational pid gains are too high for my setup ? Will have to do more tests, but the PR seems promising. |
Another question : If I tune my |
Thanks for continuously dedicating time to this!
In general, very low rotational gains may hide the effect of incorrect gravity compensation for some time, but eventually, the robot will drift if not balanced exactly in all rotated poses. Ideally, the controller's stability should be somewhat disjoint from the gravity thing, but I'm not sure at the moment. Concerning the videos, what happens in In the second video I'll see if I can setup an integration test for this. That's probably the best approach to check mechanical plausibility in a systematic way.
Mostly, yes. The default suggestions are the same. The compliance controller has the additional stiffness to parameterize. When that is zero, the compliance controller should move as fast as would the force controller with the same controller gains. Increasing the stiffness will, of course, generate the offset-proportional restoring forces, but the controller's sensitivity should be the same. |
Your controller is really good !
I forgot to crop the video to remove the waiting time. At around
Yeah I'm not sure either, it could also be that the robotiq FTS sensed high torques. I will try to replicate and save the FTS data. Not sure if their were a lot of drift caused by me FTS...
It feels natural when moving but I will recheck to confirm this. I will also recheck my COG parameters. Seems fine with the UR |
My fts reference was the same as the robot eef which was erroneous. Now the frame is on the end of the sensor tool side. I have removed the sensor mass and rectified the COM parameters. tool:
# Mass of everything that's mounted after the sensor.
mass: 1.93
# The center of mass in the ft_sensor_ref_link.
# Take a measure and try to estimate that as good as possible.
com_x: -0.0325
com_y: 0.0
com_z: 0.067 I have restested the arm and put screnshots and force and torque plots here (alternate-com folder). The behavior is mostly the same as before, but was not able to trigger the sudden movement. I will try to test with my FTS and the gripper only because the COM parameters are given by the manufacturer and should be more precise then my custom dual gripper. This will help me pinpoint if my problem comes from my COM parameters or the gravity compensation algorithm. fzi-master [pd gain = 1.5]The robot starts failling from a rotation point of view as the first video posted. The kkstb-master [pd gain = 1.5]The robot does not fall, but it slowly drifts but kept in equilibrium. Notice that the torques are kept between -0.1 and 0.1 N compared to the fzi-master, but the Z-axis force drifts up to -1 N then is kept into equilibrium. But when I rotate with my hand it starts drifting. @KKSTB Do you have this behavior with your robot and your PR ? kkstb-master [pd gain = 0.01]With the old default pd rotational gains, the robot is in equilibrium, but I can't force the robot to rotate by hand because of the gains are so small. |
To simplify my use case, the robot now has a FTS + 2F-140 Gripper. The COM parameters have been adjusted from the manufacturer table (see below). I see the same behavior as my dual gripper setup. I think the problem is more with the gravity compensation algorithms or some parameters that needs to be tuned. my_cartesian_force_controller:
type: "position_controllers/CartesianForceController"
robot_base_link: "ur3_base_link"
end_effector_link: "robotiq_2f140_tcp"
ft_sensor_ref_link: "robotiq_ft300_frame_id"
joints: *robot_joints
solver:
error_scale: 0.5
iterations: 100
pd_gains:
trans_x: {p: 0.05}
trans_y: {p: 0.05}
trans_z: {p: 0.05}
rot_x: {p: 1.5}
rot_y: {p: 1.5}
rot_z: {p: 1.5}
# Gravity should point towards the center of earth.
# In robot_base_link.
gravity:
x: 0
y: 0
z: -9.81
tool:
# Mass of everything that's mounted after the sensor.
mass: 1.025
# The center of mass in the ft_sensor_ref_link.
# Take a measure and try to estimate that as good as possible.
com_x: 0.0
com_y: 0.0
com_z: 0.073 FZI-masterThe controller starts at around 6 seconds. The robot drifts instantly. IMG_0497.MOVKKSTB-masterThe controller starts when the robot does a small sudden jump (around 1 second). Drifts a little, then when I rotate the gripper it drifts more. IMG_ok.MOV |
Redid some of the tests with a real time kernel and without the use of an Ethernet switch. The end result is the same. At the moment I don't need the gravity compensation but at some point I'm sure I will do. Happy to test things whenever you need! |
@stefanscherzinger I will finally need the gravity compensation, so I will try to debug this further. If you have any suggestions feel free to comment.
|
Yes I got this behavior as well. This is due to some deviation in actual mass+cog and yaml mass+cog, causing a sideway drift in tared force after rotating the effector. The effect is just like you tare a weighting scale and rotate the weighting scale, causing drift in weighting scale reading. You may also experiment with this effect by reducing yaml mass, i.e. reduce the effect of gravity compensation. With less gravity compensation, the drift should become more significant.
Could this be because there is not enough time delay after taring, causing the last FTS reading before taring to sneak into the controller? |
@KKSTB Thanks for the detailed info !
Were you able to remove the drift when rotating the effector with your calibrated mass+cog ? I also got a small drift after starting the controller. Do you see a small drift with your calibrated mass+cog at equilibrium ?
Maybe, will have to check. Do you zero the FTS before or after taring the signal from the controller ? |
Thanks again for your detailed reports in this thread!
I personally would prefer a qualitative experiment. Unfortunately, I haven't found the time so far, but an integration test with a simple ft sensor dummy should let us check if the gravity compensation (both old and new proposed fix) work as intended.
I would leave the gains high for this test and test only two rotations. My envisioned setup is something like this: In which (1) is the zero-ed ft-sensor setup with signaled gravity compensation in the force controller, and (2) and (3) are rotations (e.g. done manually by hand) to check if the algorithm works. As mentioned earlier (also by @KKSTB) these are things to keep in mind:
I'll see to put this via simulation into an integration test..
Unfortunately no. That's only in code for now. Edit: Your second video from here (KKSTB-master) is already close to testing (2). But it's difficult for me to distinguish a faulty algorithm from effect 2. from the list above. |
Out of curiosity has there been any progress on this? |
Not from my side, unfortunately. |
Hello @stefanscherzinger and others, I’ve been meaning to post here earlier. I have been keenly following this discussion, but didn't get the time to ask. I was wondering if I could have you opinion on this, as I've been stuck with gravity compensation for a while now. Apologies in advance for the long post. I will divide it into two parts. So, I tried testing this on a UR10e in the lab last week, but the robot kept sinking. UR10e's internal FT sensor exhibitied ridiculously weird behaviour. I decided to test this first in a Gazebo simulation instead. SetupHere are the key aspects of my Gazebo setup:
Note: The reason why Observations:I've been reading the discussions on gravity compensation. Kindly, correct me if my understanding is wrong. Assuming it is correct: In the What I can't seem to understand is the behaviour here I ran a few experiments in the simulation based on the setup described above: While, the controller was running, I record data for different steps in the `computeForceError() viz:
Experiment 1:I started as follows:
Observed Behaviour:experiment_1.video-converter.com.mp4Based on this, (see compensated Compensated Gravity Force/Torque in the figure above). Compensation seems to happen properly (as these values seem to be low/close to zero). However, this causes the forces to be as depicted in Final Force/Torque plot above (Fz > 15 N). I was wondering the following and what you guys think:
Note: I ran a second experiment, the only thing I did different this time was that I did not call the signal taring service this time. However, there seemed to be practically no difference between the plots/video I obtained in the second experiment and the ones posted above. Note sure why is that yet. Results from another experiment follow in the next comment. |
Experiment 2Before running this experiment, I commented out this. This is the only change I made. Everything else stayed the same. I ran the setup as previously, without signal taring. Observed behaviourexperiment_4.video-converter.com.mp4Here the robot seems to drift downwards, but not as abruptly as in the previous experiment. As you can see in the video. I also published desired force values to the
The robot seems to hold the final position and orientation until I turned the controller off. Obviously, the final values, that are eventually displayed in base link (not depicted here) are pretty similar to the compensated values (since they do not contain the tared term). Again, I am not sure if it was a realistic to do this. What do you guys reckon? Apart from this, I have another question. If an FT Sensor comes with in-built functionalities of resetting and gravity compensation, do we still require gravity compensation and signal taring features from this controller? Thank you!! |
@Mohatashem Many thanks for your experiments and thoughts about this! I have been out-of-office for three weeks and would like to continue fixing gravity compensation once and for all. I'll need some time to get back into this topic and follow your investigations. Until then I can respond to your brief questions:
Yes, that's correct and how I remember it. Gravity compensation is always active when used, albeit not changing anything if the end-effector stays upright without orientations after switching the system on and starting with a previously zero-biased sensor.
No, I guess that's it. Here's the principal idea that I found in a different issue.
Yes, that's different. The current approach assumes that the sensor measures zero forces/torques when the controller starts.
No, we wouldn't. If every sensor had a built-in gravity compensation (and preferably dynamics-compensation) of everything that's attached to it, then I would drop that part from the controllers. |
Problem description
This is a continuation of #73 regarding gravity compensation. Starting with the
force_controller
, I have adjusted the pid gains for rotation to1.0
. This produces the effect seen on the video below (the tcp starts to rotate as falling !). With the previous default gains0.01
, the robot does not move, but trying to force a rotation by moving by hand does not seem to work. Moving by hand for translation works as expectedt. As you said in a previous commit, maybe the default values where too low to have a significant effect.Should I try adjusting the pid gains for rotation to be stable, or this could be the effect of the gravity compensation which may be wrong as #39 seems to suggest. In the mean time I will try the #91 PR.
out.mp4
Software versions
To Reproduce
My controller config
and how I initialise and tare the signal.
The text was updated successfully, but these errors were encountered: