Hello all
I have a question about "BikeModel3D’ model.
I want to import the cadence varied with each crank angle.
The varied cadence was collected from the outdoor cycling.
Is anybody can do this?
If it can, who can I do this?
Where can I import the data?
Thanks a lot
In the bike3d model, the crank is driven at a constant velocity by means of an AnyKinEqSimpleDriver. What you need to do is to replace this driver with an AnyKinEqInterPolDriver. This type of driver can read the measured crank positions from a text file.
Hello John
Thanks for your reply!
I find the “AnyKinEqSimpleDriver CrankRotation” in the “BikeFrameAndWheels.any” and adjust to “AnyKinEqInterPolDriver”.
Is that right?
And the text file is the crank position of every step?
And what is the “Type” of the “AnyKinEqInterPolDriver”?
Is anything in “AnyKinEqInterPolDriver” need to write?
Thanks a lot
Yes, the file contains the driver positions for each time step. The driver reads these positions and constructs a continuous function that interpolates them.
The Type of the driver specifies the interpolation function type. You should use “Bspline” and the BsplineOrder should be 4.
Dear John
So the parameters in the file should be “increasing progressively”, like 0,1,2…to 359?
The program is:
AnyKinEqInterPolDriver CrankRotation =
{
Type = Bspline;
BsplineOrder = 4;
FileName = “L601.txt”;
FileErrorContinueOnOff = Off;
};
Can I use the data we got from experiment? It’s 0,3,5,6…to 359.
And I tried to use the increasing progressively data, It’s can load.
But when it RunApplication, it shows:
1.0.1) …Load time positions have been re-established.
WARNING(OBJ.MCH.KIN1) : C:/D…s/C…n/M…s/A…x/A…3/A…n/DEMO/C…3/BikeModel3D.main.any : Study : Model is kinematically indeterminate : Position analysis failed : 272 independent constraints and 273 unknowns
The first column in the input file must be the time in seconds. Obviously time cannot run backwards, so these values should be increasing with each new line. The numbers you refer to:
0,3,5,6…to 359
…sound like they are frame values rather than times in seconds. So you should probably consider converting them using the frame rathe of your experiment to actual time values.
The error message:
WARNING(OBJ.MCH.KIN1) : C:/D…s/C…n/M…s/A…x/A…3/A…n/DEMO/C…3/BikeModel3D.main.any : Study : Model is kinematically indeterminate : Position analysis failed : 272 independent constraints and 273 unknowns
means that you are missing a kinematic constraint. It looks like you must have removed two constraints and have only added one. In this case, one of the degrees of freedom of the model is not determined.
Dear John
I tried to adjust the parameters, but it’s still failed.
So, could you please tell me what kind of parameters should be included in the text file?
I know the first column is the time in seconds.
Thanks a lot
Dear John
In my text file, the first column is the time in seconds. And the second column is the crank position for each time step.
And the error message is:
Model Warning: Study ‘Main.Study’ contains too few kinematic constraints to be kinematically determinate.
Evaluating model…
ERROR(OBJ.FILE1) : C:/U…s/C…I/D…s/A…x/A…3/A…n/DEMO/C…3/BikeFrameAndWheels.any : CrankRotation.FileName : Problem with file : C:\Users\CHIYI\Documents\AnyBody.4.x.x\AMMRV1.3\Application\DEMO\CYLin_BikeModel3D _ v7_S03 est1.txt(1) : Too many values on line in data file.
Okay, if you look at the interpolation driver, it will drive some number of degrees of freedom. If it only drives the crank angle, then it drives one degree of freedom. In that case, the system expects 1+1 = 2 columns in the data file. The first column is time in seconds and the second column is the value of the degree of freedom, i.e. the crank angle in radians.
Dear John
I tried to modifiy the text file.(First column is time in seconds, and second column is the crank angle in radians)
But it’s still error, the message is:
ERROR(OBJ.FILE1) : C:/D…s/C…n/M…s/A…x/A…3/A…n/E…s/B…D/BikeFrameAndWheels.any : CrankRotation.FileName : Problem with file : C:\Documents and Settings\Chi-Yi Lin\My Documents\AnyBody.4.x.x\AMMRV1.3\Application\Examples\BikeModel3D est1.txt(1) : Too many values on line in data file.
Hi John
I modified the text file with add a line feed at the end of the last line in the file, like “test4”.
But it shows the same error message.
ERROR(OBJ.FILE1) : C:/D…s/C…n/M…s/A…x/A…3/A…n/DEMO/C…3/BikeFrameAndWheels.any : CrankRotation.FileName : Problem with file : C:\Documents and Settings\Chi-Yi Lin\My Documents\AnyBody.4.x.x\AMMRV1.3\Application\DEMO\CYLin_BikeModel3D _ v7_S03 est4.txt(1) : Too many values on line in data file.
Yes, that seems to be the problem. Please have a look at the original simple driver. You will see that inside the driver, it refers to .CrankJoint:
AnyKinEqSimpleDriver CrankRotation = {
AnyRevoluteJoint &Jnt = .CrankJoint;
DriverPos = {0};
DriverVel = {-(…BikeParameters.Cadence/60)pi2};
Reaction.Type = {Off}; //This has to be zero otherwise the crank driver will carry the applied load
};
This is how the driver knows what to drive. Your interpolation driver does not have that reference, so it is driving 0 degrees of freedom and therefore expecting only one column in the file, i.e. the time column.
Dear John
I’m glad that I impoted the cadence successfully.
But when I try to RunApplication, sometimes had the “WARNING” message.
WARNING(OBJ.MCH.MUS3) : C:/D…s/C…n/M…s/A…x/A…3/A…n/DEMO/C…3/BikeModel3D.main.any : Study.InverseDynamics : Overloaded muscle configuration.
[COLOR=black]The [/COLOR]attachment is the muscle activity of VastusLateralis.
Except the part of crankrotation program, they were same as the original.
So, I have no idea about how can I do!
I am travelling at the moment and do not have much time. Have you also changed the moment loading the crank? It should be in phase with the rotation, such that you have the largest moment when the leg has good leverage and the smallest moment when the pedals are close to their top and bottom positions. In the original model, the rotation and imposed crank moment are synchronized, but after you have changes the crank rotation, this may no longer be the case.
The part of crank moment is under the “CrankRotation” at the “BikeFrameAndWheel.any”?
And also adjust the CrankMomentTopDeadCenter, CrankMomentOffset,CrankMomentAmp, CrankMomentPhase at the “main.any”?
So, How to adjust it?
Is any advice in Tutorial?
To have the crank moment synchronized in time with the rotation, you have to adjust the Cadence (to have the right frequency) and the the CrankMomentPhase (to have the right starting angle at t=0) in the Main file.