a b/Application/Examples/BikeModel2D/Model/JointsAndDrivers.any
1
AnyFolder &BikeParameters = Main.BikeParameters;
2
3
/// This is the joint connecting the Pelvis segment to the bike.
4
AnyKinLinear SaddleJointLin = {
5
  //AnyRefNode & Sacrum= ..ModelFolder.Pelvis.LigArcuatumPubis;
6
  AnyRefNode & Sacrum= ..ModelFolder.Pelvis.HipJointsCenter;
7
  AnyRefNode & Saddel = ...BikeModel.BikeFrame.SaddelPos;
8
};
9
10
AnyKinEq SaddelJointLinConstraints = {
11
  AnyKinLinear &ref= .SaddleJointLin;
12
};
13
14
AnyKinRotational SaddelJointRot ={
15
  //AnyRefNode & Sacrum= ..ModelFolder.Pelvis.LigArcuatumPubis;
16
  AnyRefNode & Sacrum= ..ModelFolder.Pelvis.HipJointsCenter;
17
  AnyRefNode & Saddel = ...BikeModel.BikeFrame.SaddelPos;
18
  Type=RotAxesAngles;
19
};
20
21
AnyKinEqSimpleDriver SaddelRotation = {
22
  AnyKinRotational &Jnt = .SaddelJointRot;
23
  DriverPos = {0.15*pi,0,0};
24
  DriverVel = {0.0,0,0};
25
  //Setting Reaction.Type=1 means that the joint will generate the moment it will 
26
  //need to balance this DOF, setting it to 0 which is default will mean that muscles 
27
  //forces will be used for balancing the joint
28
  Reaction.Type = {On,On,On}; 
29
};
30
31
AnyFolder Right = {
32
  // This is the joint connecting the foot to the pedal. It simply
33
  // specifies that the linear distances between the two must be zero
34
  AnyKinLinear PedalJointLin = {
35
    AnyRefNode &Foot = ...ModelFolder.Right.Seg.Foot.GroundJoint;
36
    AnyRefNode &PedalR= ....BikeModel.Crank.RPedal;
37
  };
38
  AnyKinMeasureOrg PedalJointLinXY = {
39
    AnyKinLinear &ref=.PedalJointLin;
40
    MeasureOrganizer={0,1};
41
  };
42
  
43
  AnyKinEq PedalJointLinConstraints = {
44
    AnyKinMeasureOrg  &ref= .PedalJointLinXY;
45
  };
46
  
47
  // This measure is for controlling the rotation.
48
  AnyKinRotational PedalJointRot = {
49
    AnyRefFrame &Ground = ....BikeModel.BikeFrame;
50
    AnyRefNode &Foot = ...ModelFolder.Right.Seg.Foot.GroundJoint;
51
    Type=RotAxesAngles;
52
  };
53
  AnyKinMeasureOrg FootRMovement = {
54
    AnyKinRotational &GroundFoot = .PedalJointRot;
55
    MeasureOrganizer = {0,1};  // Standard rotational order = z,y,x = 0,1,2
56
  }; 
57
  
58
  AnyKinEqFourierDriver PedalRRotationFourier = {
59
    AnyKinMeasure& Jnt = .FootRMovement;
60
    Type = CosSin;
61
    AnyVar a0 = -0.3797-0.5*pi;
62
    AnyVar a1 = -0.0205;
63
    AnyVar b1 = 0.3393;
64
    AnyVar a2 = 0.004906;
65
    AnyVar b2 = 0.03654;
66
    AnyVar w = 7.681;
67
    Freq = ..BikeParameters.Cadence/60; 
68
    //    A = { {a0+0.5*pi,a1,a2},{0, 0,0}  };
69
    //    B = {{0,b1,b2},{0, 0,0} }; 
70
    //    Reaction.Type = {Off,Off};
71
    A = { {a0+0.5*pi,a1,a2}  };
72
    B = {{0,b1,b2} }; 
73
    Reaction.Type = {Off};
74
    MeasureOrganizer={0};
75
  };
76
};
77
78
AnyFolder Left = {
79
  
80
  // This is the joint connecting the foot to the pedal. It simply
81
  // specifies that the linear distances between the two mush be zero
82
  AnyKinLinear PedalJointLin = {
83
    AnyRefNode &Foot = ...ModelFolder.Left.Seg.Foot.GroundJoint;
84
    AnyRefNode &PedalR= ....BikeModel.Crank.LPedal;
85
  };
86
  
87
  AnyKinMeasureOrg PedalJointLinXY = {
88
    AnyKinLinear &ref=.PedalJointLin;
89
    MeasureOrganizer={0,1};
90
  };
91
  
92
  AnyKinEq PedalJointLinConstraints = {
93
    AnyKinMeasure& ref= .PedalJointLinXY;
94
  };
95
  
96
  // This measure is for controlling the rotation.
97
  AnyKinRotational PedalJointRot = {
98
    AnyRefFrame &Ground = ....BikeModel.BikeFrame;
99
    AnyRefNode &Foot = ...ModelFolder.Left.Seg.Foot.GroundJoint;
100
    Type=RotAxesAngles;
101
  };
102
  AnyKinMeasureOrg FootLMovement = {
103
    AnyKinRotational &GroundFoot = .PedalJointRot;
104
    MeasureOrganizer = {0,1};  // Standard rotational order = z,y,x = 0,1,2
105
  }; 
106
  
107
  AnyKinEqFourierDriver PedalLRotationFourier ={
108
    AnyKinMeasure& Jnt = .FootLMovement;
109
    Type = CosSin;
110
    AnyVar a0 = -0.3792-0.5*pi;
111
    AnyVar a1 = 0.0205;
112
    AnyVar b1 = -0.3373;
113
    AnyVar a2 = 0.004906;
114
    AnyVar b2 = 0.03654;
115
    AnyVar w = 7.681;
116
    Freq = ..BikeParameters.Cadence/60; 
117
    //    A = { {a0+0.5*pi,a1,a2},{0, 0,0}  };
118
    //    B = {{0,b1,b2},{0, 0,0} }; 
119
    //    Reaction.Type = {Off,Off};
120
    
121
    A = { {a0+0.5*pi,a1,a2} };
122
    B = {{0,b1,b2} }; 
123
    Reaction.Type = {Off};
124
    MeasureOrganizer={0};
125
  };
126
};