Contact Force not acting

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Malavika Harikrishnan
Posts: 12
Joined: Wed Mar 02, 2016 9:38 am

Contact Force not acting

Post by Malavika Harikrishnan » Fri May 27, 2016 3:53 am

Hello,

I have a model with two air tight contact mesh`s and an elastic foundation contact force defined between them, however the force is not acting and the parts just pass through each other
I have used mesh and contact forces before without any issues, however I cant find my bug here
I tried changing the geometry files with those of the walker model just to check and the force still doesnt act so I guess its not the geometry



Does the size of the mesh have an influence on the force? My model is in mm range and I scaled it on Inventor
Is it possible to use contact mesh and any other force except elastic foundation?

Here is a snippet of the code

Code: Select all

<ForceSet>
			<objects>
				<ElasticFoundationForce name="Shaft_B">
					<!--Material properties.-->
					<ElasticFoundationForce::ContactParametersSet name="contact_parameters">
						<objects>
							<ElasticFoundationForce::ContactParameters>
								<!--Names of geometry objects affected by these parameters.-->
								<geometry>c_contact b_contact</geometry>
								<stiffness>100000</stiffness>
								<dissipation>0.1</dissipation>
								<static_friction>0.5</static_friction>
								<dynamic_friction>0.5</dynamic_friction>
								<viscous_friction>0.5</viscous_friction>
							</ElasticFoundationForce::ContactParameters>
						</objects>
						<groups />
					</ElasticFoundationForce::ContactParametersSet>
					<!--Slip velocity (creep) at which peak static friction occurs.-->
					<transition_velocity>0</transition_velocity>
				</ElasticFoundationForce>
			</objects>
			<groups />
		</ForceSet>
		<!--Markers in the model.-->
		<MarkerSet>
			<objects />
			<groups />
		</MarkerSet>
		<!--ContactGeometries  in the model.-->
		<ContactGeometrySet>
			<objects>
				<ContactMesh name="c_contact">
					<!--Body name to connect the contact geometry to-->
					<body_name>C</body_name>
					<!--Location of geometry center in the body frame-->
					<location>0 0.002376 -0.0182</location>
					<!--Orientation of geometry in the body frame-->
					<orientation>0 0 0</orientation>
					<!--Filename that contain mesh geomtry (supports .obj, .stl, .vtp). Mesh should be closed and water-tight.-->
					<filename>shaftscaled.obj</filename>
				</ContactMesh>
				<ContactMesh name="b_contact">
					<!--Body name to connect the contact geometry to-->
					<body_name>B</body_name>
					<!--Location of geometry center in the body frame-->
					<location>0 0 0</location>
					<!--Orientation of geometry in the body frame-->
					<orientation>0 0 0</orientation>
					<!--Filename that contain mesh geomtry (supports .obj, .stl, .vtp). Mesh should be closed and water-tight.-->
					<filename>PartBmscaled.obj</filename>
				</ContactMesh>
			</objects>
			<groups />
		</ContactGeometrySet>

Any help would be appreciated

Thanks in advance

User avatar
Hao Yang Chan
Posts: 9
Joined: Tue Jun 02, 2015 7:40 am

Re: Contact Force not acting

Post by Hao Yang Chan » Tue May 31, 2016 7:14 am

I cant see anything wrong with the code you have, Im guessing there's a problem in your BodySets.

User avatar
Malavika Harikrishnan
Posts: 12
Joined: Wed Mar 02, 2016 9:38 am

Re: Contact Force not acting

Post by Malavika Harikrishnan » Fri Jun 03, 2016 3:10 am

Thank you but I cannot seem to find the problem still

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: Contact Force not acting

Post by Dimitar Stanev » Fri Jun 03, 2016 4:54 am

Hi,

Can you upload the whole model, so we can have a look? It is hard to find a bug from a piece of code, where something else might cause the problem.

Best

User avatar
Rahul Agrawal
Posts: 47
Joined: Mon Aug 31, 2015 3:16 pm

Re: Contact Force not acting

Post by Rahul Agrawal » Tue Jun 07, 2016 11:01 am

can you tell me the maximum thickness of elastic foundation that can be used

User avatar
Malavika Harikrishnan
Posts: 12
Joined: Wed Mar 02, 2016 9:38 am

Re: Contact Force not acting

Post by Malavika Harikrishnan » Wed Jun 08, 2016 7:15 am

Dear Jim,

PFA The entire code

I was wondering if it could be a geometry problem? The exact model worked fine when the dimensions of the CAD file were not scaled
I mean to say I scaled the geometries on CAD to 100 times smaller to make it in tune with the opensim anatomy geometries for later use

Thank you very much for your help

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<OpenSimDocument Version="30000">
	<Model name="VisualisingCAD">
		<credits>Frank Anderson, Peter Loan, Ayman Habib, Ajay Seth, Michael Sherman</credits>
		<publications>Unassigned</publications>
		<length_units>meters</length_units>
		<force_units>N</force_units>
		<!--Acceleration due to gravity.-->
		<gravity> 0 0 0</gravity>
		<!--Bodies in the model.-->
		<BodySet>
			<objects>
				<Body name="ground">
					<mass>0</mass>
					<mass_center> 0 0 0</mass_center>
					<inertia_xx>1</inertia_xx>
					<inertia_yy>1</inertia_yy>
					<inertia_zz>1</inertia_zz>
					<inertia_xy>0</inertia_xy>
					<inertia_xz>0</inertia_xz>
					<inertia_yz>0</inertia_yz>
					<!--Joint that connects this body with the parent body.-->
					<Joint />
					<VisibleObject>
						<!--Set of geometry files and associated attributes, allow .vtp, .stl, .obj-->
						<GeometrySet>
							<objects>
								<DisplayGeometry>
									<!--Name of geometry file .vtp, .stl, .obj-->
									<geometry_file>plane.vtp</geometry_file>
									<!--Color used to display the geometry when visible-->
									<color> 1 1 1</color>
									<!--Name of texture file .jpg, .bmp-->
									<texture_file />
									<!--in body transform specified as 3 rotations (rad) followed by 3 translations rX rY rZ tx ty tz-->
									<transform> 0 0 0 0 0 0</transform>
									<!--Three scale factors for display purposes: scaleX scaleY scaleZ-->
									<scale_factors> 1 1 1</scale_factors>
									<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded-->
									<display_preference>0</display_preference>
									<!--Display opacity between 0.0 and 1.0-->
									<opacity>1</opacity>
								</DisplayGeometry>
							</objects>
							<groups />
						</GeometrySet>
						<!--Three scale factors for display purposes: scaleX scaleY scaleZ-->
						<scale_factors> 1 1 1</scale_factors>
						<!--transform relative to owner specified as 3 rotations (rad) followed by 3 translations rX rY rZ tx ty tz-->
						<transform> 0 0 0 0 0 0</transform>
						<!--Whether to show a coordinate frame-->
						<show_axes>false</show_axes>
						<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded Can be overriden for individual geometries-->
						<display_preference>0</display_preference>
					</VisibleObject>
					<WrapObjectSet>
						<objects />
						<groups />
					</WrapObjectSet>
				</Body>
				<Body name="A">
					<mass>10</mass>
					<mass_center> 0 0 0</mass_center>
					<inertia_xx>1</inertia_xx>
					<inertia_yy>1</inertia_yy>
					<inertia_zz>1</inertia_zz>
					<inertia_xy>0</inertia_xy>
					<inertia_xz>0</inertia_xz>
					<inertia_yz>0</inertia_yz>
					<!--Joint that connects this body with the parent body.-->
					<Joint>
						<WeldJoint name="AToGround">
							<!--Name of the parent body to which this joint connects its owner body.-->
							<parent_body>ground</parent_body>
							<!--Location of the joint in the parent body specified in the parent reference frame. Default is (0,0,0).-->
							<location_in_parent>0 0 0</location_in_parent>
							<!--Orientation of the joint in the parent body specified in the parent reference frame. Euler XYZ body-fixed rotation angles are used to express the orientation. Default is (0,0,0).-->
							<orientation_in_parent>0 1.5 0</orientation_in_parent>
							<!--Location of the joint in the child body specified in the child reference frame. For SIMM models, this vector is always the zero vector (i.e., the body reference frame coincides with the joint). -->
							<location>0 0 0</location>
							<!--Orientation of the joint in the owing body specified in the owning body reference frame.  Euler XYZ body-fixed rotation angles are used to express the orientation. -->
							<orientation>0 0 0</orientation>
							<!--Set holding the generalized coordinates (q's) that parmeterize this joint.-->
							<CoordinateSet>
								<objects />
								<groups />
							</CoordinateSet>
							<!--Whether the joint transform defines parent->child or child->parent.-->
							<reverse>false</reverse>
						</WeldJoint>
					</Joint>
					<VisibleObject>
						<!--Set of geometry files and associated attributes, allow .vtp, .stl, .obj-->
						<GeometrySet>
							<objects>
								<DisplayGeometry>
									<!--Name of geometry file .vtp, .stl, .obj-->
									<geometry_file>PartA.stl</geometry_file>
									<!--Color used to display the geometry when visible-->
									<color> 1 1 1</color>
									<!--Name of texture file .jpg, .bmp-->
									<texture_file />
									<!--in body transform specified as 3 rotations (rad) followed by 3 translations rX rY rZ tx ty tz-->
									<transform> 0 0 0 0 0 0</transform>
									<!--Three scale factors for display purposes: scaleX scaleY scaleZ-->
									<scale_factors> 1 1 1</scale_factors>
									<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded-->
									<display_preference>4</display_preference>
									<!--Display opacity between 0.0 and 1.0-->
									<opacity>1</opacity>
								</DisplayGeometry>
							</objects>
							<groups />
						</GeometrySet>
						<!--Three scale factors for display purposes: scaleX scaleY scaleZ-->
						<scale_factors> 1 1 1</scale_factors>
						<!--transform relative to owner specified as 3 rotations (rad) followed by 3 translations rX rY rZ tx ty tz-->
						<transform> 0 0 0 0 0 0</transform>
						<!--Whether to show a coordinate frame-->
						<show_axes>false</show_axes>
						<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded Can be overriden for individual geometries-->
						<display_preference>4</display_preference>
					</VisibleObject>
					<WrapObjectSet>
						<objects />
						<groups />
					</WrapObjectSet>
				</Body>
				<Body name="B">
					<mass>10</mass>
					<mass_center> 0 0 0</mass_center>
					<inertia_xx>1</inertia_xx>
					<inertia_yy>1</inertia_yy>
					<inertia_zz>1</inertia_zz>
					<inertia_xy>0</inertia_xy>
					<inertia_xz>0</inertia_xz>
					<inertia_yz>0</inertia_yz>
					<!--Joint that connects this body with the parent body.-->
					<Joint>
						<FreeJoint name="BToA">
							<!--Name of the parent body to which this joint connects its owner body.-->
							<parent_body>A</parent_body>
							<!--Location of the joint in the parent body specified in the parent reference frame. Default is (0,0,0).-->
							<location_in_parent>0 0 0</location_in_parent>
							<!--Orientation of the joint in the parent body specified in the parent reference frame. Euler XYZ body-fixed rotation angles are used to express the orientation. Default is (0,0,0).-->
							<orientation_in_parent>0 0 0</orientation_in_parent>
							<!--Location of the joint in the child body specified in the child reference frame. For SIMM models, this vector is always the zero vector (i.e., the body reference frame coincides with the joint). -->
							<location>0 0 0</location>
							<!--Orientation of the joint in the owing body specified in the owning body reference frame.  Euler XYZ body-fixed rotation angles are used to express the orientation. -->
							<orientation>0 0 0</orientation>
							<!--Set holding the generalized coordinates (q's) that parmeterize this joint.-->
							<CoordinateSet>
								<objects>
									<Coordinate name="BToA_xRotation">
										<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
										<motion_type>rotational</motion_type>
										<!--The minimum and maximum values that the coordinate can range between. Rotational coordinate range in radians and Translational in meters.-->
										<range>-1.5707963267949 1.5707963267949</range>
										<!--Flag indicating whether or not the values of the coordinates should be prescribed according to the function above. It is ignored if the no prescribed function is specified.-->
										<locked>true</locked>
										<prescribed>false</prescribed>
									</Coordinate>
									<Coordinate name="BToA_yRotation">
										<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
										<motion_type>rotational</motion_type>
										<!--The value of this coordinate before any value has been set. Rotational coordinate value is in radians and Translational in meters.-->
										<default_value>0</default_value>
										<!--The minimum and maximum values that the coordinate can range between. Rotational coordinate range in radians and Translational in meters.-->
										<range>-1.5707963267949 1.5707963267949</range>
										<!--Flag indicating whether or not the values of the coordinates should be constrained to the current (e.g. default) value, above.-->
										<locked>true</locked>
										<!--Flag indicating whether or not the values of the coordinates should be prescribed according to the function above. It is ignored if the no prescribed function is specified.-->
										<prescribed>false</prescribed>
									</Coordinate>
									<Coordinate name="BToA_zRotation">
										<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
										<motion_type>rotational</motion_type>
										<!--The minimum and maximum values that the coordinate can range between. Rotational coordinate range in radians and Translational in meters.-->
										<range>-1.5707963267949 1.5707963267949</range>
										<!--Flag indicating whether or not the values of the coordinates should be prescribed according to the function above. It is ignored if the no prescribed function is specified.-->
										<prescribed>false</prescribed>
									</Coordinate>
									<Coordinate name="BToA_xTranslation">
										<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
										<motion_type>translational</motion_type>
										<!--The value of this coordinate before any value has been set. Rotational coordinate value is in radians and Translational in meters.-->
										<default_value>0</default_value>
										<!--The minimum and maximum values that the coordinate can range between. Rotational coordinate range in radians and Translational in meters.-->
										<range>-1 1</range>
										<!--Flag indicating whether or not the values of the coordinates should be constrained to the current (e.g. default) value, above.-->
										<locked>true</locked>
										<!--Flag indicating whether or not the values of the coordinates should be prescribed according to the function above. It is ignored if the no prescribed function is specified.-->
										<prescribed>false</prescribed>
									</Coordinate>
									<Coordinate name="BToA_yTranslation">
										<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
										<motion_type>translational</motion_type>
										<!--The value of this coordinate before any value has been set. Rotational coordinate value is in radians and Translational in meters.-->
										<default_value>0</default_value>
										<!--The minimum and maximum values that the coordinate can range between. Rotational coordinate range in radians and Translational in meters.-->
										<range>-10 10</range>
										<!--Flag indicating whether or not the values of the coordinates should be constrained to the current (e.g. default) value, above.-->
										<locked>true</locked>
										<!--Flag indicating whether or not the values of the coordinates should be prescribed according to the function above. It is ignored if the no prescribed function is specified.-->
										<prescribed>false</prescribed>
									</Coordinate>
									<Coordinate name="BToA_zTranslation">
										<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
										<motion_type>translational</motion_type>
										<!--The value of this coordinate before any value has been set. Rotational coordinate value is in radians and Translational in meters.-->
										<default_value>0</default_value>
										<!--The minimum and maximum values that the coordinate can range between. Rotational coordinate range in radians and Translational in meters.-->
										<range>-10 10</range>
										<!--Flag indicating whether or not the values of the coordinates should be constrained to the current (e.g. default) value, above.-->
										<locked>true</locked>
										<!--Flag indicating whether or not the values of the coordinates should be prescribed according to the function above. It is ignored if the no prescribed function is specified.-->
										<prescribed>false</prescribed>
									</Coordinate>
								</objects>
								<groups />
							</CoordinateSet>
							<!--Whether the joint transform defines parent->child or child->parent.-->
							<reverse>false</reverse>
						</FreeJoint>
					</Joint>
					<VisibleObject>
						<!--Set of geometry files and associated attributes, allow .vtp, .stl, .obj-->
						<GeometrySet>
							<objects>
								<DisplayGeometry>
									<!--Name of geometry file .vtp, .stl, .obj-->
									<geometry_file>PartBm.stl</geometry_file>
									<!--Color used to display the geometry when visible-->
									<color> 1 1 1</color>
									<!--Name of texture file .jpg, .bmp-->
									<texture_file />
									<!--in body transform specified as 3 rotations (rad) followed by 3 translations rX rY rZ tx ty tz-->
									<transform> 0 0 0 0 0 0</transform>
									<!--Three scale factors for display purposes: scaleX scaleY scaleZ-->
									<scale_factors> 1 1 1</scale_factors>
									<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded-->
									<display_preference>4</display_preference>
									<!--Display opacity between 0.0 and 1.0-->
									<opacity>1</opacity>
								</DisplayGeometry>
							</objects>
							<groups />
						</GeometrySet>
						<!--Three scale factors for display purposes: scaleX scaleY scaleZ-->
						<scale_factors> 1 1 1</scale_factors>
						<!--transform relative to owner specified as 3 rotations (rad) followed by 3 translations rX rY rZ tx ty tz-->
						<transform> 0 0 0 0 0 0</transform>
						<!--Whether to show a coordinate frame-->
						<show_axes>false</show_axes>
						<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded Can be overriden for individual geometries-->
						<display_preference>4</display_preference>
					</VisibleObject>
					<WrapObjectSet>
						<objects />
						<groups />
					</WrapObjectSet>
				</Body>
				<Body name="C">
					<mass>10</mass>
					<mass_center> 0 0 0</mass_center>
					<inertia_xx>1</inertia_xx>
					<inertia_yy>1</inertia_yy>
					<inertia_zz>1</inertia_zz>
					<inertia_xy>0</inertia_xy>
					<inertia_xz>0</inertia_xz>
					<inertia_yz>0</inertia_yz>
					<!--Joint that connects this body with the parent body.-->
					<Joint>
						<FreeJoint name="CToB">
							<!--Name of the parent body to which this joint connects its owner body.-->
							<parent_body>B</parent_body>
							<!--Location of the joint in the parent body specified in the parent reference frame. Default is (0,0,0).-->
							<location_in_parent>0 -0.01 -0.0105</location_in_parent>
							<!--Orientation of the joint in the parent body specified in the parent reference frame. Euler XYZ body-fixed rotation angles are used to express the orientation. Default is (0,0,0).-->
							<orientation_in_parent>0 0 0</orientation_in_parent>
							<!--Location of the joint in the child body specified in the child reference frame. For SIMM models, this vector is always the zero vector (i.e., the body reference frame coincides with the joint). -->
							<location>0 0 0</location>
							<!--Orientation of the joint in the owing body specified in the owning body reference frame.  Euler XYZ body-fixed rotation angles are used to express the orientation. -->
							<orientation>0 0 0</orientation>
							<!--Set holding the generalized coordinates (q's) that parmeterize this joint.-->
							<CoordinateSet>
								<objects>
									<Coordinate name="CToB_xRotation">
										<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
										<motion_type>rotational</motion_type>
										<!--The minimum and maximum values that the coordinate can range between. Rotational coordinate range in radians and Translational in meters.-->
										<range>-1.5707963267949 1.5707963267949</range>
										<!--Flag indicating whether or not the values of the coordinates should be prescribed according to the function above. It is ignored if the no prescribed function is specified.-->
										<prescribed>false</prescribed>
									</Coordinate>
									<Coordinate name="CToB_yRotation">
										<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
										<motion_type>rotational</motion_type>
										<!--The value of this coordinate before any value has been set. Rotational coordinate value is in radians and Translational in meters.-->
										<default_value>0</default_value>
										<!--The minimum and maximum values that the coordinate can range between. Rotational coordinate range in radians and Translational in meters.-->
										<range>-1.5707963267949 1.5707963267949</range>
										<!--Flag indicating whether or not the values of the coordinates should be constrained to the current (e.g. default) value, above.-->
										<locked>false</locked>
										<!--Flag indicating whether or not the values of the coordinates should be prescribed according to the function above. It is ignored if the no prescribed function is specified.-->
										<prescribed>false</prescribed>
									</Coordinate>
									<Coordinate name="CToB_zRotation">
										<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
										<motion_type>rotational</motion_type>
										<!--The minimum and maximum values that the coordinate can range between. Rotational coordinate range in radians and Translational in meters.-->
										<range>-1.5707963267949 1.5707963267949</range>
										<!--Flag indicating whether or not the values of the coordinates should be prescribed according to the function above. It is ignored if the no prescribed function is specified.-->
										<locked>true</locked>
										<prescribed>false</prescribed>
									</Coordinate>
									<Coordinate name="CToB_xTranslation">
										<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
										<motion_type>translational</motion_type>
										<!--The value of this coordinate before any value has been set. Rotational coordinate value is in radians and Translational in meters.-->
										<default_value>0</default_value>
										<!--The minimum and maximum values that the coordinate can range between. Rotational coordinate range in radians and Translational in meters.-->
										<range>-1 1</range>
										<!--Flag indicating whether or not the values of the coordinates should be constrained to the current (e.g. default) value, above.-->
										<locked>true</locked>
										<!--Flag indicating whether or not the values of the coordinates should be prescribed according to the function above. It is ignored if the no prescribed function is specified.-->
										<prescribed>false</prescribed>
									</Coordinate>
									<Coordinate name="CToB_yTranslation">
										<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
										<motion_type>translational</motion_type>
										<!--The value of this coordinate before any value has been set. Rotational coordinate value is in radians and Translational in meters.-->
										<default_value>0</default_value>
										<!--The minimum and maximum values that the coordinate can range between. Rotational coordinate range in radians and Translational in meters.-->
										<range>-10 10</range>
										<!--Flag indicating whether or not the values of the coordinates should be constrained to the current (e.g. default) value, above.-->
										<locked>true</locked>
										<!--Flag indicating whether or not the values of the coordinates should be prescribed according to the function above. It is ignored if the no prescribed function is specified.-->
										<prescribed>false</prescribed>
									</Coordinate>
									<Coordinate name="CToB_zTranslation">
										<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
										<motion_type>translational</motion_type>
										<!--The value of this coordinate before any value has been set. Rotational coordinate value is in radians and Translational in meters.-->
										<default_value>0</default_value>
										<!--The minimum and maximum values that the coordinate can range between. Rotational coordinate range in radians and Translational in meters.-->
										<range>-10 10</range>
										<!--Flag indicating whether or not the values of the coordinates should be constrained to the current (e.g. default) value, above.-->
										<locked>true</locked>
										<!--Flag indicating whether or not the values of the coordinates should be prescribed according to the function above. It is ignored if the no prescribed function is specified.-->
										<prescribed>false</prescribed>
									</Coordinate>
								</objects>
								<groups />
							</CoordinateSet>
							<!--Whether the joint transform defines parent->child or child->parent.-->
							<reverse>false</reverse>
						</FreeJoint>
					</Joint>
					<VisibleObject>
						<!--Set of geometry files and associated attributes, allow .vtp, .stl, .obj-->
						<GeometrySet>
							<objects>
								<DisplayGeometry>
									<!--Name of geometry file .vtp, .stl, .obj-->
									<geometry_file>PartCscaled.stl</geometry_file>
									<!--Color used to display the geometry when visible-->
									<color> 1 1 1</color>
									<!--Name of texture file .jpg, .bmp-->
									<texture_file />
									<!--in body transform specified as 3 rotations (rad) followed by 3 translations rX rY rZ tx ty tz-->
									<transform> 0 0 0 0 0 0</transform>
									<!--Three scale factors for display purposes: scaleX scaleY scaleZ-->
									<scale_factors> 1 1 1</scale_factors>
									<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded-->
									<display_preference>4</display_preference>
									<!--Display opacity between 0.0 and 1.0-->
									<opacity>0.38</opacity>
								</DisplayGeometry>
							</objects>
							<groups />
						</GeometrySet>
						<!--Three scale factors for display purposes: scaleX scaleY scaleZ-->
						<scale_factors> 1 1 1</scale_factors>
						<!--transform relative to owner specified as 3 rotations (rad) followed by 3 translations rX rY rZ tx ty tz-->
						<transform> 0 0 0 0 0 0</transform>
						<!--Whether to show a coordinate frame-->
						<show_axes>true</show_axes>
						<!--Display Pref. 0:Hide 1:Wire 3:Flat 4:Shaded Can be overriden for individual geometries-->
						<display_preference>4</display_preference>
					</VisibleObject>
					<WrapObjectSet>
						<objects />
						<groups />
					</WrapObjectSet>
				</Body>
			</objects>
			<groups />
		</BodySet>
		<!--Constraints in the model.-->
		<ConstraintSet>
			<objects />
			<groups />
		</ConstraintSet>
		<!--Forces in the model.-->
		
		<!--Markers in the model.-->
		<MarkerSet>
			<objects />
			<groups />
		</MarkerSet>
		<!--ContactGeometries  in the model.-->
		<ContactGeometrySet>
			<objects>
				<ContactMesh name="c_contact">
					<!--Body name to connect the contact geometry to-->
					<body_name>C</body_name>
					<!--Location of geometry center in the body frame-->
					<location>0 0.002376 -0.0182</location>
					<!--Orientation of geometry in the body frame-->
					<orientation>0 0 0</orientation>
					<!--Filename that contain mesh geomtry (supports .obj, .stl, .vtp). Mesh should be closed and water-tight.-->
					<filename>shaftscaled.obj</filename>
				</ContactMesh>
				<ContactMesh name="b_contact">
					<!--Body name to connect the contact geometry to-->
					<body_name>B</body_name>
					<!--Location of geometry center in the body frame-->
					<location>0 0 0</location>
					<!--Orientation of geometry in the body frame-->
					<orientation>0 0 0</orientation>
					<!--Filename that contain mesh geomtry (supports .obj, .stl, .vtp). Mesh should be closed and water-tight.-->
					<filename>PartBmNew.obj</filename>
				</ContactMesh>
			</objects>
			<groups />
		</ContactGeometrySet>
		<ForceSet>
			<objects>
				<ElasticFoundationForce name="Shaft_B">
					<!--Flag indicating whether the force is disabled or not. Disabled means that the force is not active in subsequent dynamics realizations.-->
					<isDisabled>false</isDisabled>
					<!--Material properties.-->
					<ElasticFoundationForce::ContactParametersSet name="">
						<objects>
							<ElasticFoundationForce::ContactParameters name="">
								<!--Names of geometry objects affected by these parameters.-->
								<geometry>c_contact b_contact</geometry>
								<stiffness>10000</stiffness>
								<dissipation>0.1</dissipation>
								<static_friction>0.5</static_friction>
								<dynamic_friction>0.5</dynamic_friction>
								<viscous_friction>0.5</viscous_friction>
							</ElasticFoundationForce::ContactParameters>
						</objects>
						<groups />
					</ElasticFoundationForce::ContactParametersSet>
					<!--Slip velocity (creep) at which peak static friction occurs.-->
					<transition_velocity>0</transition_velocity>
				</ElasticFoundationForce>
			</objects>
			<groups />
		</ForceSet>
		<!--Controllers in the model.-->
		<ControllerSet name="Controllers">
			<objects />
			<groups />
		</ControllerSet>
		<!--Additional components in the model.-->
		<ComponentSet name="MiscComponents">
			<objects />
			<groups />
		</ComponentSet>
		<!--Probes in the model.-->
		<ProbeSet>
			<objects />
			<groups />
		</ProbeSet>
	</Model>
</OpenSimDocument>

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: Contact Force not acting

Post by Dimitar Stanev » Wed Jun 08, 2016 8:34 am

Sorry I can figured what is wrong. Maybe by scaling something got messy. Can you visualize the actual geometry of the contacts to be sure?

Best

User avatar
Malavika Harikrishnan
Posts: 12
Joined: Wed Mar 02, 2016 9:38 am

Re: Contact Force not acting

Post by Malavika Harikrishnan » Mon Jun 13, 2016 12:49 am

Dear Jim,

Figured it out and the issue was rather silly
The elastic foundation force stiffness wasnt scaled in proportion enough. Had to be raised til around 1e+020 to see some effect visually

Thanks for your help
Best Regards

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: Contact Force not acting

Post by Dimitar Stanev » Mon Jun 13, 2016 4:13 am

Hi,

Good to know, thanks for reporting back.

Best

POST REPLY