Basic Dynamics Questions

Typically: "How do I... ", "How can I... " questions
Post Reply
njustus
Posts: 1
Joined: 11 May 2020, 05:10

Basic Dynamics Questions

Post by njustus »

Hello,

I'm just getting started with Coppelia, and dealing with some very basic issues, so I would like to talk to people who have some practical experience. My project is to simulate an apple-picking operation with a robotic manipulator. Step 1 is to simulate an apple hanging from a tree, which has some springiness in the limbs. I'm currently trying to do this with the heirarchy (static base shape)->(rotary joint, torque control mode, hoping to get it to freely rotate)->(inter-joint shape that seems necessary to dynamically enable joints)->(prismatic joint set to force control mode)->(apple-sphere)

I have a bunch of questions.

1) Is there a way to make a shape respondable, non-static, and non-dynamic? I want the objects connecting the springs to be massless particles that can still move around and dynamically enable the joints, but I can't find a way to do so throught he menus. My ideal would be a joint->joint connection but that also doesn't seem to be possible while getting the downstream joint to act like a spring.

2) This setup is very unstable, with the apple spinning around and flying all over the place, even when the apple and inter-joint shape have similar masses/inertias. I was hoping for a stretchy-pendulum kind of action. Any idea why/how to stop it?

3) Because of the instability, I was thinking of just doing XYZ prismatic joints. Later on when I get the gripper to grab the apple with the IK toolkit, will this cause problems if I try to move it because there's no rotary D.o.F?

4) I want the spring-joint to be custom and nonlinear for the specifics of the project and am writing my controls in python. Is there a way to directly set the force output of a joint? I only see a setting for max force in the API. Right now I'm thinking I might have to adjust the target position for the joint to get the force I want, which seems silly. Would I just make a joint control function in a child script that sets the joint to max force? What would I set the joint velocity to?

5) Am I overthinking this/doing something fundamentally wrong?

Thanks in advance for all your help, I really appreciate it.
Nathan

coppelia
Site Admin
Posts: 10366
Joined: 14 Dec 2012, 00:25

Re: Basic Dynamics Questions

Post by coppelia »

Hello Nathan,

I think your approach sound fine. There are probably a few things to adjust tweak.

There is no possibility to add a mass-less dynamic shape. How would that shape react to a force? Infinite acceleration? So you have to work with auxiliary shapes, that have mass and inertia. You should however carefully chose those values, also depending on the selected physics engine: except for Vortex, and to a certain extent Newton, the other engines require not too different masses/inertias between connected shapes.

I would add some drag or damping for the the apple and/or auxiliary shape. This can be found in the material properties. You can also set a higher torque for your revolute joint, while keeping a target velocity of 0, for some damping in that joint. And having the prismatic joint in spring-damper mode is also a good idea.

You can also write your own joint controller, by using a joint control callback. Typically there are only two parameters to set in each simulation step: the max. force/torque, and the target velocity. The physics engine will then apply the max. force/torque until the target velocity was reached.

Cheers

Post Reply