AnyForce Direction

Hello,
I am having trouble visualizing the direction of an applied AnyForce
to a joint. Is there any way to have a vector drawn automatically? I
know you can use a draw vector object, but then you could draw the
vector any direction that is specified, which may not be the actual
direction.

If I understand the pedal demo tutorial correctly: If the joint
position is positive, and I apply a positive AnyForce to that joint,
then the resulting moment will act to help push or turn in the
positive direction of the joint. A negative AnyForce applied to the
joint will act the other direction, and help push in the negative
joint direction.

Please let me know if I understand correctly. It seems sometimes I
have to add a negative to the draw vector object, and sometimes I
don’t. It’s not consistent.

Also, for future versions of AnyBody, it would be nice to have
automatic visual feedback for these kinds of objects. That way it
would be more clear which direction things are going. I’m never sure
whether I am applying loads or moments in the proper direction, which
slows down the programming considerably!

Brent

Hi Brent

If you have two segments with an anykinlinear in between, and you
apply a positve anyforce to the measure it will add a force acting in
the positive direction of the coordinate system which the measure
make use of. It will not matter if the position of this measure is
negative or not, it will act in the positive direction of the
coordinate system, similarly ofcourse if a negative force is applied.
The moments also use the same setup.

I think your understanding in general is correct but you write that
if the position of the joint is positive then… This is not
important, the important thing is the direction of the axes in the
measure not its positions.

Please be aware that the AnyDrawVector always makes use of the global
coordinate system, so often you have to translate the forces in the
global system before being able to draw them correctly, this depends
on your measure.

We have not seen any inconsistency in drawing the forces, but if your
problem persists please upload it and we will take a look at it.

We have automatic visualizations of the joint forces on our whislist
too, it would be really helpfull. We hope to be able to provide them
in the future.

I am unsure about the pedal demo tutorial you mention?, is it the
pedal model in the repository you refer too, i can not locate a
tutorial with this content.

Please ask again if you have further questions

Best regards
Søren

— In anyscript@yahoogroups.com, “blulrey” <blulrey@…> wrote:
>
> Hello,
> I am having trouble visualizing the direction of an applied AnyForce
> to a joint. Is there any way to have a vector drawn
automatically? I
> know you can use a draw vector object, but then you could draw the
> vector any direction that is specified, which may not be the actual
> direction.
>
> If I understand the pedal demo tutorial correctly: If the joint
> position is positive, and I apply a positive AnyForce to that joint,
> then the resulting moment will act to help push or turn in the
> positive direction of the joint. A negative AnyForce applied to the
> joint will act the other direction, and help push in the negative
> joint direction.
>
> Please let me know if I understand correctly. It seems sometimes I
> have to add a negative to the draw vector object, and sometimes I
> don’t. It’s not consistent.
>
> Also, for future versions of AnyBody, it would be nice to have
> automatic visual feedback for these kinds of objects. That way it
> would be more clear which direction things are going. I’m never
sure
> whether I am applying loads or moments in the proper direction,
which
> slows down the programming considerably!
>
> Brent
>

Hello Søren,
The pedal demo I was referring to starts in Lesson 5 of the Building Block
Tutorial.
http://www.anybodytech.com/559.0.html
In that tutorial, the position of the joint was used in calculating the spring
force, and a
negative was added so that the direction would be correct.

I discovered one thing that was causing some problems for me. Most joints have
a Ref
variable which allows you to designate the coordinate system: -1 for global, 0
for the first
ref frame, and 1 for the second ref frame. I don’t think this Ref variable
works in the
revolute joint as it does in the other joints, however I have not checked all
the types of
joints. For the revolute joint, I think you have to physically change the order
of the
references to specify which coordinate system is being used.

This problem is related to my main problem when using AnyBody, which is being
able to
tell which way things are going and what coordinate systems are used, especially
in larger
models.

I will work on my model some more and upload it if I continue to have problems.

Thank you,
Brent

— In anyscript@yahoogroups.com, “AnyBody Support” <support@…> wrote:
>
> Hi Brent
>
> If you have two segments with an anykinlinear in between, and you
> apply a positve anyforce to the measure it will add a force acting in
> the positive direction of the coordinate system which the measure
> make use of. It will not matter if the position of this measure is
> negative or not, it will act in the positive direction of the
> coordinate system, similarly ofcourse if a negative force is applied.
> The moments also use the same setup.
>
> I think your understanding in general is correct but you write that
> if the position of the joint is positive then… This is not
> important, the important thing is the direction of the axes in the
> measure not its positions.
>
> Please be aware that the AnyDrawVector always makes use of the global
> coordinate system, so often you have to translate the forces in the
> global system before being able to draw them correctly, this depends
> on your measure.
>
> We have not seen any inconsistency in drawing the forces, but if your
> problem persists please upload it and we will take a look at it.
>
> We have automatic visualizations of the joint forces on our whislist
> too, it would be really helpfull. We hope to be able to provide them
> in the future.
>
> I am unsure about the pedal demo tutorial you mention?, is it the
> pedal model in the repository you refer too, i can not locate a
> tutorial with this content.
>
> Please ask again if you have further questions
>
>
> Best regards
> Søren
>
> — In anyscript@yahoogroups.com, “blulrey” <blulrey@> wrote:
> >
> > Hello,
> > I am having trouble visualizing the direction of an applied AnyForce
> > to a joint. Is there any way to have a vector drawn
> automatically? I
> > know you can use a draw vector object, but then you could draw the
> > vector any direction that is specified, which may not be the actual
> > direction.
> >
> > If I understand the pedal demo tutorial correctly: If the joint
> > position is positive, and I apply a positive AnyForce to that joint,
> > then the resulting moment will act to help push or turn in the
> > positive direction of the joint. A negative AnyForce applied to the
> > joint will act the other direction, and help push in the negative
> > joint direction.
> >
> > Please let me know if I understand correctly. It seems sometimes I
> > have to add a negative to the draw vector object, and sometimes I
> > don’t. It’s not consistent.
> >
> > Also, for future versions of AnyBody, it would be nice to have
> > automatic visual feedback for these kinds of objects. That way it
> > would be more clear which direction things are going. I’m never
> sure
> > whether I am applying loads or moments in the proper direction,
> which
> > slows down the programming considerably!
> >
> > Brent
> >
>

I am still having trouble figuring out the directions. I have uploaded a copy
of my model in
AnyForce_Direction.zip

I started with the standing model, and included some of the drivers from the
free posture
move model (I think you suggested this method awhile go). There is a file named
BNDR.any
which contains the device I added to the environment, as well as the model
environment
connection. The device has a torsional spring near each hip joint, and segments
that contact
the chest and each thigh. There should be forces pushing up on the chest and
down on each
thigh. I modeled the spring with AnyForces at the joints of the device.

I cannot tell which direction to apply the AnyForces. When looking at the
coordinate systems,
I thought it should be positive for the upper segment, and negative for the
lower segments.
A positive moment about the z axis would push up, and a negative moment would
push
down. However, when looking at the reactions, and at the result of
AnyForceMomentMeasures, it seems like a positive AnyForce must be applied to the
lower
segments also. This doesn’t make sense to me.

I would appreciate any help.
Thank you,
Brent

Hi Brent,

Søren has been traveling this week, so I had a brief look at your
model instead.

You really understand the AnyScript features and structure very well.
I noticed that you are adding the necessary items to existing folders
in the BNDR file, and that is very nice structuring.

But I did not fully understand the function of the massless
SpringRightSeg and its left counterpart. So let me give you a general
explanation and relate that to your model:

When you add an anyforce to a joint and want to use the joint angle
to specify the size of the force, then the force gets the same
direction as the joint angle and works between the two segments
metting at the joint.

So to work out the direction of the force, investigate the direction
of the joint angle. In the pedal example, the joint angle gets bigger
as the pedal is depressed, and this should also make the torsional
spring moment bigger, albeit working against the joint angle. So the
definition is like this:

F = -..SpringStiff*.HingeJoint.Pos;

i.e. the torque gets bigger in absolute value but works against the
increase of the joint angle and therfore has the minus sign in front.

So if I modify your hip position variable in the mannequin file like
this:

   AnyVector HipFlexion = {80, 70, 60, 50, 40, 30, 20};

then the LowerJointRight.Pos will extend during the movement. If the
associated spring is going to help this extansion then the spring
force must be positive and decreasing just like the
ForceLowerRight.Fout you have defined is. This torque will be added
directly to the joint and will affect the two segments joined there
and consequently the body parts attached to the segments.

It seems to me you hve done it correctly, but as I said, I do not
really understand what the massless spring segment does.

I hope this helps.

Best regards,
John

— In anyscript@yahoogroups.com, “blulrey” <blulrey@…> wrote:
>
> I am still having trouble figuring out the directions. I have
uploaded a copy of my model in
> AnyForce_Direction.zip
>
> I started with the standing model, and included some of the drivers
from the free posture
> move model (I think you suggested this method awhile go). There is
a file named BNDR.any
> which contains the device I added to the environment, as well as
the model environment
> connection. The device has a torsional spring near each hip joint,
and segments that contact
> the chest and each thigh. There should be forces pushing up on the
chest and down on each
> thigh. I modeled the spring with AnyForces at the joints of the
device.
>
> I cannot tell which direction to apply the AnyForces. When looking
at the coordinate systems,
> I thought it should be positive for the upper segment, and negative
for the lower segments.
> A positive moment about the z axis would push up, and a negative
moment would push
> down. However, when looking at the reactions, and at the result of
> AnyForceMomentMeasures, it seems like a positive AnyForce must be
applied to the lower
> segments also. This doesn’t make sense to me.
>
> I would appreciate any help.
> Thank you,
> Brent
>

Hi John,
Thank you for taking a look at my model. I am getting used to the AnyScript
syntax, and
the object-oriented programming.

I now understand how the AnyForce works. After thinking about it for a couple
days, I had
almost figured it out on my own. I think the main problem, as I already
mentioned, is the
lack of visual feedback. The other problem is knowing which coordinate system
is being
used, and from which point-of-view. For example with 2 nodes, A and B, will a
linear
measure start at B and point to A? Or start at A and go to B? Does this depend
on the
order the references are made in the measure, and not on the coordinate system
used by
the measure? That is the way it seems to operate.

Brent

— In anyscript@yahoogroups.com, “AnyBody Support” <support@…> wrote:
>
> Hi Brent,
>
> Søren has been traveling this week, so I had a brief look at your
> model instead.
>
> You really understand the AnyScript features and structure very well.
> I noticed that you are adding the necessary items to existing folders
> in the BNDR file, and that is very nice structuring.
>
> But I did not fully understand the function of the massless
> SpringRightSeg and its left counterpart. So let me give you a general
> explanation and relate that to your model:
>
> When you add an anyforce to a joint and want to use the joint angle
> to specify the size of the force, then the force gets the same
> direction as the joint angle and works between the two segments
> metting at the joint.
>
> So to work out the direction of the force, investigate the direction
> of the joint angle. In the pedal example, the joint angle gets bigger
> as the pedal is depressed, and this should also make the torsional
> spring moment bigger, albeit working against the joint angle. So the
> definition is like this:
>
> F = -…SpringStiff*.HingeJoint.Pos;
>
> i.e. the torque gets bigger in absolute value but works against the
> increase of the joint angle and therfore has the minus sign in front.
>
> So if I modify your hip position variable in the mannequin file like
> this:
>
> AnyVector HipFlexion = {80, 70, 60, 50, 40, 30, 20};
>
> then the LowerJointRight.Pos will extend during the movement. If the
> associated spring is going to help this extansion then the spring
> force must be positive and decreasing just like the
> ForceLowerRight.Fout you have defined is. This torque will be added
> directly to the joint and will affect the two segments joined there
> and consequently the body parts attached to the segments.
>
> It seems to me you hve done it correctly, but as I said, I do not
> really understand what the massless spring segment does.
>
> I hope this helps.
>
> Best regards,
> John
>
>
> — In anyscript@yahoogroups.com, “blulrey” <blulrey@> wrote:
> >
> > I am still having trouble figuring out the directions. I have
> uploaded a copy of my model in
> > AnyForce_Direction.zip
> >
> > I started with the standing model, and included some of the drivers
> from the free posture
> > move model (I think you suggested this method awhile go). There is
> a file named BNDR.any
> > which contains the device I added to the environment, as well as
> the model environment
> > connection. The device has a torsional spring near each hip joint,
> and segments that contact
> > the chest and each thigh. There should be forces pushing up on the
> chest and down on each
> > thigh. I modeled the spring with AnyForces at the joints of the
> device.
> >
> > I cannot tell which direction to apply the AnyForces. When looking
> at the coordinate systems,
> > I thought it should be positive for the upper segment, and negative
> for the lower segments.
> > A positive moment about the z axis would push up, and a negative
> moment would push
> > down. However, when looking at the reactions, and at the result of
> > AnyForceMomentMeasures, it seems like a positive AnyForce must be
> applied to the lower
> > segments also. This doesn’t make sense to me.
> >
> > I would appreciate any help.
> > Thank you,
> > Brent
> >
>

Hello Brent,

>The other problem is knowing which coordinate system
>is being used, and from which point-of-view. For
>example with 2 nodes, A and B, will a linear
>measure start at B and point to A? Or start at
>A and go to B? Does this depend on the
>order the references are made in the measure, and
>not on the coordinate system used by
>the measure?

I think there are really two questions here:

  1. Does the vector defined by the linear measure go from A to B or
    from B to A? As far as I remember it goes from A to B.

  2. In which coordinate system is this vector expressed? This is the
    more subtle part. The user can decide by setting a variable caled Ref
    inside the measure. By default, Ref = -1, which means that the vector
    is expressed in global coordinates. If you set Ref = 0, then the
    vector will be in the coordinate system of the first item in the
    measure, i.e. in the coordinate system of A.

If you set Ref = 1, then the vector will be in the coordinate system
of the second item in the measure, i.e. B.

This ability to express measures in a coordinate frame of your choice
is most useful for driving models by means of measured data. When we
drive models by motion capture data, we usually elect to use the
local reference frames of the segments, because they are more robust
against different body postures.

You may want to consult the new second part of this tutorial:
http://www.anybodytech.com/500.0.html
for further information.

Best regards,
John