Insert Position Coordinates Into Driver

Hi again, I still have been unable to correctly drive a segment
using positions, I can use the AnyKinEqInterPolDriver with reference
to a joint and drive a segment fine with time and data, but that is
merely controlling the angle,

I used the AnyKinEqInterPolDriver Motion and merely referenced the 2
nodes that i want to measure the postion in and am recieving an
error, i’ll post my simple example below, if you have any thoughts
or a simple example on how to drive a segment using 3 dimensional
data it would be greatly appreciated.

// Todo: Write a small description of your model here

Main = {

// The actual body model goes in this folder
AnyFolder MyModel = {

 // Global Reference Frame
 AnyFixedRefFrame GlobalRef = {
   AnyDrawRefFrame DrwGlobalRef = {
     ScaleXYZ = {0.1, 0.1, 0.1};
     RGB = {0,1,0};
   };
         AnyRefNode bla1 = {
     sRel = {0,0,0};
   };



 };  // Global reference frame
 AnyFolder Segs = {
   AnySeg Alpha ={
     r0 = {0.1, 0, 0};
     Mass = 2;
     Jii = {0.001, 0.01, 0.01};
     AnyDrawSeg drw = {};

     AnyRefNode base = {
       sRel = {-.1,0,0};
     };

     AnyRefNode end = {
       sRel = {.2,0,0};
     };

   };//alpha
  };//segs
 AnyFolder Jnts = {
   //---------------------------------
   AnyRevoluteJoint jntbla = {
     Axis = z;
     AnyRefNode &basenode = ..GlobalRef.bla1;
     AnyRefNode &uppernode = ..Segs.Alpha.base;
   };
 };//Jnts
 AnyFolder Drivers = {

   AnyFolder KinematicMeasures = {
     AnyKinLinear Pos = {
       // These are the nodes that the measure refers to
       AnyRefNode &Ground = Main.MyModel.GlobalRef.bla1;
       AnyRefNode &UpperArmNode = Main.MyModel.Segs.Alpha.end;
       Ref = 0;

     };
   };//kinematicmeasure
     AnyVector Time = { 0,10,20,30,40};

     AnyKinEqInterPolDriver Motion = {
       AnyKinLinear &bla=.KinematicMeasures.Pos;

       MeasureOrganizer = {0,1};
       T = .Time;
       Type = PiecewiseLinear;
       Data = {{0,
           .1,
           .2,
           .3,
           .4
         }} ;

       Reaction.Type = {Off};
     };
   };

}; // MyModel

// The study: Operations to be performed on the model
AnyBodyStudy MyStudy = {
AnyFolder &Model = .MyModel;
RecruitmentSolver = MinMaxSimplex;
Gravity = {0.0, -9.81, 0.0};
tEnd = 40;
};

}; // Main

I found the errors in my last post, especially at measure(),my
current file will compile but i’m getting an overconstrained
message, my thought was as shown in my code below, insert the data
points for each axis, “measureorganizer 0 and 1”, and since the
segment is .2 i used axis positions so the positions should be right
on, i also tried just driving with 1 axis driver as well and am
still getting the overcontrained message, any thoughts on whats
wrong?

// Todo: Write a small description of your model here

Main = {

// The actual body model goes in this folder
AnyFolder MyModel = {

 // Global Reference Frame
 AnyFixedRefFrame GlobalRef = {
   AnyDrawRefFrame DrwGlobalRef = {
     ScaleXYZ = {0.1, 0.1, 0.1};
     RGB = {0,1,0};
   };
         AnyRefNode bla1 = {
     sRel = {0,0,0};
   };



 };  // Global reference frame
 AnyFolder Segs = {
   AnySeg Alpha ={
     r0 = {0.1, 0, 0};
     Mass = 2;
     Jii = {0.001, 0.01, 0.01};
     AnyDrawSeg drw = {};

     AnyRefNode base = {
       sRel = {0,0,0};
     };

     AnyRefNode end = {
       sRel = {.2,0,0};
     };

   };//alpha
  };//segs
 AnyFolder Jnts = {
   //---------------------------------
   AnyRevoluteJoint jntbla = {
     Axis = z;
     AnyRefNode &basenode = ..GlobalRef.bla1;
     AnyRefNode &uppernode = ..Segs.Alpha.base;
   };
 };//Jnts
 AnyFolder Drivers = {

   AnyFolder KinematicMeasures = {
     AnyKinLinear Pos = {
       // These are the nodes that the measure refers to
       AnyRefNode &Ground = Main.MyModel.GlobalRef.bla1;
       AnyRefNode &UpperArmNode = Main.MyModel.Segs.Alpha.end;
       Ref = 0;


     };//pos
   };//kinematicmeasure
     AnyVector Time = { 0,5,10};

// AnyKinEqSimpleDriver gogo = {
//AnyRevoluteJoint &Hinge = Main.MyModel.Jnts.jntbla;
//DriverPos = {0};
//DriverVel = {1*pi/180};
////};
AnyKinEqInterPolDriver Motion = {
AnyKinLinear &bla=.KinematicMeasures.Pos;

       MeasureOrganizer = {0};
       T = .Time;
       Type = PiecewiseLinear;
       Data = {{.2,
           0,
           -.2
         }} ;

       Reaction.Type = {Off};
     };//motion kineqinterpoldriver
     AnyKinEqInterPolDriver Motion2 = {
       AnyKinLinear &bla2=.KinematicMeasures.Pos;

       MeasureOrganizer = {1};
       T = .Time;
       Type = PiecewiseLinear;
       Data = {{0,
           0.2,
           0
         }} ;

       Reaction.Type = {Off};
     };//motion kineqinterpoldriver
   };//drivers

}; // MyModel

// The study: Operations to be performed on the model
AnyBodyStudy MyStudy = {
AnyFolder &Model = .MyModel;
RecruitmentSolver = MinMaxSimplex;
Gravity = {0.0, -9.81, 0.0};
tEnd = 10;
KinematicTol = .5;
};

}; // Main

Hi Atlas?

You have a problem consisting of one seg and a revolute joint this is
a problem with one dof. This means you can drive one dof only, you
try to drive two dofs.

I have outcommented the driver named “Motion” and retained the
driver “Motion2” which are driving the y direction. Then the model
solves and runs without warnings, but it do not move. The reason for
this is the property KinematiTol you have set to 0.5, this value is
so large that that the mechanism do not have to move in order to full
its kinematic constraits. So outcomment this line and let it run on
it’s default value, then you will see a motion.

The tutorials on http://www.anybodytech.com/476.0.html might make it
easier for you to learn how to use the system.

Best regards
Søren, AnyBody support

— In anyscript@yahoogroups.com, “atlas242131” <atlas242131@…>
wrote:
>
> I found the errors in my last post, especially at measure(),my
> current file will compile but i’m getting an overconstrained
> message, my thought was as shown in my code below, insert the data
> points for each axis, “measureorganizer 0 and 1”, and since the
> segment is .2 i used axis positions so the positions should be
right
> on, i also tried just driving with 1 axis driver as well and am
> still getting the overcontrained message, any thoughts on whats
> wrong?
>
> // Todo: Write a small description of your model here
>
> Main = {
>
> // The actual body model goes in this folder
> AnyFolder MyModel = {
>
> // Global Reference Frame
> AnyFixedRefFrame GlobalRef = {
> AnyDrawRefFrame DrwGlobalRef = {
> ScaleXYZ = {0.1, 0.1, 0.1};
> RGB = {0,1,0};
> };
> AnyRefNode bla1 = {
> sRel = {0,0,0};
> };
>
>
>
> }; // Global reference frame
> AnyFolder Segs = {
> AnySeg Alpha ={
> r0 = {0.1, 0, 0};
> Mass = 2;
> Jii = {0.001, 0.01, 0.01};
> AnyDrawSeg drw = {};
>
> AnyRefNode base = {
> sRel = {0,0,0};
> };
>
> AnyRefNode end = {
> sRel = {.2,0,0};
> };
>
> };//alpha
> };//segs
> AnyFolder Jnts = {
> //---------------------------------
> AnyRevoluteJoint jntbla = {
> Axis = z;
> AnyRefNode &basenode = …GlobalRef.bla1;
> AnyRefNode &uppernode = …Segs.Alpha.base;
> };
> };//Jnts
> AnyFolder Drivers = {
>
> AnyFolder KinematicMeasures = {
> AnyKinLinear Pos = {
> // These are the nodes that the measure refers to
> AnyRefNode &Ground = Main.MyModel.GlobalRef.bla1;
> AnyRefNode &UpperArmNode = Main.MyModel.Segs.Alpha.end;
> Ref = 0;
>
>
> };//pos
> };//kinematicmeasure
> AnyVector Time = { 0,5,10};
> // AnyKinEqSimpleDriver gogo = {
> //AnyRevoluteJoint &Hinge = Main.MyModel.Jnts.jntbla;
> //DriverPos = {0};
> //DriverVel = {1*pi/180};
> ////};
> AnyKinEqInterPolDriver Motion = {
> AnyKinLinear &bla=.KinematicMeasures.Pos;
>
> MeasureOrganizer = {0};
> T = .Time;
> Type = PiecewiseLinear;
> Data = {{.2,
> 0,
> -.2
> }} ;
>
> Reaction.Type = {Off};
> };//motion kineqinterpoldriver
> AnyKinEqInterPolDriver Motion2 = {
> AnyKinLinear &bla2=.KinematicMeasures.Pos;
>
> MeasureOrganizer = {1};
> T = .Time;
> Type = PiecewiseLinear;
> Data = {{0,
> 0.2,
> 0
> }} ;
>
> Reaction.Type = {Off};
> };//motion kineqinterpoldriver
> };//drivers
>
>
> }; // MyModel
>
> // The study: Operations to be performed on the model
> AnyBodyStudy MyStudy = {
> AnyFolder &Model = .MyModel;
> RecruitmentSolver = MinMaxSimplex;
> Gravity = {0.0, -9.81, 0.0};
> tEnd = 10;
> KinematicTol = .5;
> };
>
> }; // Main
>