I am using the BikeModel3D. I changed the position of the crank and controlled the foot-pedal angle from the driver of the "AnyKinEqFourierDriver PedalRRotationFourier ". But when the crank for example set to 0.66 and 0.38 m, respectively saddlePos and saddleHeight, the model is run but the knees move to the lateral side. How can I control the knee?


The feet are attached to the pedals so it forms a close loop mechanism.
If you change the saddel position it may result in that the legs moves to the sides, i guess.

It would be possible to constraint the legs from not moving sideways but then you would have to remove other constraints in the model, to keep the number of kinematic constraints unchanged.

Please upload the model displaying the problem this will allow us to look at it.

Best regards

Thanks for the instant attention. I upload the model as you requested. In addition to the before-mentioned problem, when the crank is set (for example) in a position with 0.7 and 0.25 m coordinates, respectively for the saddlePos and the saddleHeight, the model does not run maybe due to the unwanted hip internal/external rotation.


Two sets of drivers have effect and you can play around with them to get it work for your case as emboldened below:
AnyKinEqSimpleDriver DatumRot = {
AnyKinRotational rot = {
AnyRefFrame &Datum = …Datum;
Type = RotVector;
MeasureOrganizer = {1,2};
DriverPos = {0,0};
DriverVel = {0,0};
for both left and right legs.

AnyKinEqFourierDriver PedalLRotationFourier ={
AnyKinMeasureOrg &Jnt = .FootLMovement;
Type = CosSin;
AnyVar a0 = -0.3797-0.25pi;
AnyVar a1 = 0.0205;
AnyVar b1 = -0.3393;
AnyVar a2 = 0.004906;
AnyVar b2 = 0.03654;
AnyVar w = 7.681;
Freq = …BikeParameters.Cadence/60;
A = { {a0+0.5
B = {{0,b1,b2}};
Reaction.Type = {Off};

For your defined saddle location, if you choose a0 = -0.3797-0.25*pi, this will correct the model posture. I should note that these two sets of drivers were defined for a range of postures that your case seems to be a little bit extreme (based on the saddle location) and out of optimal range for the drivers and for that reason, you need to change the values.

Please kindly upload your model files as a single zip file next time.

Hope it helps.

Best regards,
Mohammad S. Shourijeh, PhD
AnyBody Team

Thanks for your reply. I changed the values as you said. When I run the model in a position with 0.66 and 0.38 m coordinates, respectively for the saddlePos and the saddleHeight and check the knee joint coordinate, that varies 0.11-0.23 m in z axis. I guess, if I can constraint the hip external/internal rotation, legs do not move sideway. Can you help me to constraint the legs from not moving sideway?

Best regards


Sorry for the slow process.
The quickest way to do it would be to change one of the hard constraints on the foot to a soft constraint and adding a soft constraint on the z-direction movement of the knee joint. You will also need to change the kinematics solver to over-determinate (Kinematics.SolverType = KinSolOverDeterminate).

Hope it helps.

Best regards,