Spring force

Typically: "How do I... ", "How can I... " questions
Post Reply
geerten
Posts: 77
Joined: 14 Feb 2013, 13:57

Spring force

Post by geerten »

Hi,

To model a spring it is advised to use the torque/force (on page joint description).

Could you elaborate more how exactly this models a spring with a certain force? Also in combination with the PID control, because the spring damper example also uses a PID control...

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

Re: Spring force

Post by coppelia »

Hello Geerten,

a joint that is in force/torque mode, and has the PID controll enabled, together with the "regulate torque/force" item, will behave like a spring (also damped if desired).

In above described mode, the positional error (e) of the joint will be used to calculate a force on that joint. So that force will be proportional to e, like a linear spring, where the force is proportional to the displacement.

Cheers

geerten
Posts: 77
Joined: 14 Feb 2013, 13:57

Re: Spring force

Post by geerten »

But how would I match the parameters in V-REP to the specifications of an existing spring?

So what is the influence of the parameters (force, and the PID parameters) on the final force (which is based on the parameters plus the positional error)?

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

Re: Spring force

Post by coppelia »

Here is Hook's law:

F=k*x

where F is the force of a spring, k its constant, and x its displacement (or stretch/compression)

In V-REP when using the setting previously mentioned:

F=ctrl*maxForce

where ctrl is the control, and maxforce the maximum force indicated for that joint. For ctrl we have:

ctrl=e*P+integratedErrors*I+(e-previous_e)*D

With the PID parameters in P, I and D

Cheers

F=ctrl*maxForce

geerten
Posts: 77
Joined: 14 Feb 2013, 13:57

Re: Spring force

Post by geerten »

One final question about this:

What is the unit of max torque/force? Newton?

One feature request with this: it would be nice to have the units explicitly mentioned next to every field that has a unit..

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

Re: Spring force

Post by coppelia »

Hello Geerten,

The Unit in the GUI depends on your settings. Also, if your selected joint is a prismatic joint, then the Unit will be a force expressed in Newton (given that your settings are on meters and seconds). But if your selected joint is a revolute joint, then the Unit will be a torque expressed in Newton*m (here also given that you have the default settings).

Cheers

Post Reply