Closed vengelson closed 1 year ago
However, if C==A or C==B this SpringDamper works a normal spring-and-damper hanging freely anywhere in 2D.
@vengelson Can you provide an example for this?
I suppose in that case either of the following happens:
s_relx = v_relx = 0
=> f_x = 0
ors_rely = v_rely = 0
=> f_y = 0
.Additionally, and this is what probably happens in your case,
phi_rel = frame_b.phi - frame_a.phi = 0
. (Compare frame_b.phi
and frame_a.phi
signals.)Anyway, either f_x
or f_y
shall still be non-zero.
P.S We talk about PlanarMechanics.Parts.SpringDamper
, right?
Hello !
I was just concentrating on getting pendulums to work consistently between 3D Mechanical and Planar.
Please unpack the zip and try to run these three pendulums.
DualPlanarPendulum.body2 uses my suggested formulation for new SpringDamper in Planar library.
DualPlanarPendulum.body1 is using PlanarMechanics.Parts.SpringDamper which I believe is somewhat incorrect or not applicable in this case.
PendulumWithSpringDamper.body1 is from 3D Mechanical library. It has the same motion as DualPlanarPendulum.body2.
What you do in your model is a definition of a point-to-point spring/damper. And it is really not comparable to PlanarMechanics.Parts.SpringDamper
, see my comment https://github.com/dzimmer/PlanarMechanics/issues/67#issuecomment-78449735.
I have extended your example DualSpringProblem.DualPlanarPendulum
by a third pendulum model - see below. The behavior of body3
and body2
is very similar now. The only difference is due to a missing "rxf" ("r" cross "f") in your model (i.e. you define in SpringDamperWithLineForce
that frame_a.t = frame_b.t = 0
), which in fact makes also the difference between the two "oscillating" signals "DualPlanarPendulum 1: body2.r[1]" and "PendulumWithSpringDamper 1: body1.r[1]" in your plot. The same behavior with pendulum 3 can be reached, when setting body3.I
very small. Then, "rxf" plays nearly no role.
Concluding, I see no need to change the model now.
SpringDamper between frames A and B in Planar library is actually a combination of two springs AC(x direction) and CB(y direction). Two nonzero damping forces are created when |AB| remains constant but |AC| and |CB| change. Typically, this happens for a single pendulum. However, if C==A or C==B this SpringDamper works a normal spring-and-damper hanging freely anywhere in 2D. My proposal is that the derivative of distance |AB| is computed, the damping force is computed only once, and only after that it is split to x,y-components.