Correct way to implement a gripper

Post Reply
eatingdirt
Posts: 8
Joined: Fri Mar 28, 2014 4:42 am

Correct way to implement a gripper

Post by eatingdirt »

Hi,
I am attempting to simulate a robotic arm which ends in a gripper with 2 fingers. I have all the joints articulating nicely using hinge constraints and the btDantzingSolver.

However when I attempt to grab another rigid body just a simple block between the 2 gripper fingers the object and gripper fingers appear to repel each other and fly off in opposing directions.

I have tried experimenting with mass and friction with no effect.

Is there a proper method for implementing a gripper that can pick up, move around and drop rigid bodies?
kingchurch
Posts: 28
Joined: Sun May 13, 2012 7:14 am

Re: Correct way to implement a gripper

Post by kingchurch »

What did you mean by "they repel each other" ? Do you mean the finger bounced off the block ? If that's the case try assign a physics material with 0 restitution (bounciness) and 1.0 friction coefficient. Also make your motor/finger torques stronger. And increase the #of iterations of the solver. Reduce the Simulation Step size as a last resort. Which simulation step did you run Dantzing ? A screenshot will help others to understand the topology of your fingers.
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Correct way to implement a gripper

Post by Basroil »

Sounds like you're closing the kinematic chain with "perfect" motors. The forces are undefined in the case of a closed chain when solving via velocity, and sounds like your arm oscillates until the forces are above what the solver can properly handle. If that is the case, try limiting the maximum motor torque to a reasonable amount. If you know how much force you want (at most), you can limit the motor based on the amount and the effective moment arm. Not a perfect solution, but usually close enough.
eatingdirt
Posts: 8
Joined: Fri Mar 28, 2014 4:42 am

Re: Correct way to implement a gripper

Post by eatingdirt »

Thank you for the suggestions, its been a few weeks since I had a chance to work on this and just trying your suggestions now.

Lowering the the motor torque values has helped a lot....I have been able to grasp an object, lift and move it without the object twitching out of the grippers. Its not perfect yet as there is a general twitchy-ness to objects when grasped if the mass of the object is too small compared to the maxMotorImpluse applied.

I have been adjusting the motor torque and the mass of the objects I try to pick up and there seems to be a careful balance that needs to be achieved. I am not sure what you mean by a "perfect" motor (I am not strong on the physics of things).

A better description of what occurs when I grasp an object if I just close the fingers on the object, the object will twitch/jiggle as I lower the joint maxMotorImpulse (I think this is the motor torque).....I am calling btHingeConstraint->enableAngularMotor() and have been adjusting the maxMotorImpulse parameter (values around 1.0 and 2.0) are giving the best results when attempting to grab an object with mass 1kg. I can lift the object but it will slide out of the grippers. If I lower the mass of the object it starts twitching/jiggling a lot more and will jiggle itself out of the grippers.

If this helps at all I am running the simulation approx every 30ms with maxSubSteps at 7.

The suggestions have me moving again, thank you
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Correct way to implement a gripper

Post by Basroil »

eatingdirt wrote: I am not sure what you mean by a "perfect" motor (I am not strong on the physics of things).

A better description of what occurs when I grasp an object if I just close the fingers on the object, the object will twitch/jiggle as I lower the joint maxMotorImpulse (I think this is the motor torque).....I am calling btHingeConstraint->enableAngularMotor() and have been adjusting the maxMotorImpulse parameter (values around 1.0 and 2.0) are giving the best results when attempting to grab an object with mass 1kg.
Perfect motors just means motors with an infinite proportional response (strength increases linearly with error to infinity), no latency, etc. Basically any kinematic motor is perfect (you can add more realistic responses, but only by switching to a dynamic model, and it seems you are controlling the objects via velocity methods (rather than force) so your motors (at default) are basically perfect motors.
eatingdirt wrote: I can lift the object but it will slide out of the grippers. If I lower the mass of the object it starts twitching/jiggling a lot more and will jiggle itself out of the grippers.

If this helps at all I am running the simulation approx every 30ms with maxSubSteps at 7.
Simulation rate seems low (~33Hz), usually robots are simulated between 200 and 2000Hz depending on what you are doing, at least with methods like bullet and non-car robots. If the wiggling is due to collisions, it might help to increase simulation rate (internal rate at least).
eatingdirt
Posts: 8
Joined: Fri Mar 28, 2014 4:42 am

Re: Correct way to implement a gripper

Post by eatingdirt »

The jiggling I was seeing turns out to be the method I was using to hold the hinge at a specific angle....every tick (33ms) I was updating the hinge velocity using enableAngularMotor() based on the diff from current angle to my desired angle. This repeated oscillation of the joint motors would jiggle the held object and allow it to slip.

I have changed things so that once the angle of the joint is within a certain error margin it forces the velocity to 0 which stops this jiggling and stops the object from slipping.

Is there a better way to hold a hinge joint at a specific angle?

I will see if increasing the simulation rate of the bullet side of things helps....currently the bullet simulation rate is tied to the visualization rate which is probably not good. As you can guess I am not going for accurate simulation of real motors and joints but instead a generalized simulation which can be applied to a variety of different joint combinations.

But as things stand at the moment I can pick up objects and move them around...thanks again for your help.
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Correct way to implement a gripper

Post by Basroil »

eatingdirt wrote:I have changed things so that once the angle of the joint is within a certain error margin it forces the velocity to 0 which stops this jiggling and stops the object from slipping.

Is there a better way to hold a hinge joint at a specific angle?
Looks like you've taken your first step into "imperfect" motors :wink:

I use a similar method for controlling Dynamixel AX12 sims, and so far it's as accurate as the best published results using more complicated methods. It's not a perfect solution, but it's good enough that standard control methods that work on the sim will work on the real thing too.
Post Reply