Re: forces in joints
Posted: Wed Jul 03, 2013 4:00 am
Thanks Ayman and Jiang,
again shortly what I want to implement:
two sticks with a principally free joint in between, but the joint producing resistance when bended (bushing force?). And of course I need the possibility to induce this bending by pressing against the body who is not ground.
Below my approach so far, using an actuator. Actuator does not seem to be the right choice as Ayman said, but how else to apply a simple force?
Thanks in advance and best kind regards
Uwe
Here the model (again my question, if there is no way to upload a textfile for this purpose). As far as I believe, it has two cylinders scaled to 2cm length with a rotational stiffness of 0.1 (whatever that means). I have already reduced that value, because I was afraid not to see the effect because the stiffness is to high.
<?xml version="1.0" encoding="UTF-8" ?>
<OpenSimDocument Version="30000">
<Model name="multisegment_test">
<credits>The OpenSim Development Team (Reinbolt, J; Seth, A; Habib, A; Hamner, S)</credits>
<publications>This is an example model distributed with OpenSim</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>0.1</inertia_xx>
<inertia_yy>0.1</inertia_yy>
<inertia_zz>0.02</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>cyl_small.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> 0.01 0.01 0.01</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>
</Body>
<Body name="cyl2">
<mass>0.1</mass>
<mass_center> 0 0 0</mass_center>
<inertia_xx>0.1</inertia_xx>
<inertia_yy>0.1</inertia_yy>
<inertia_zz>0.02</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="joint1">
<!--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.01</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.01</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="_xRotation">
<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
<motion_type>rotational</motion_type>
<!--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="_yRotation">
<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
<motion_type>rotational</motion_type>
<!--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="_zRotation">
<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
<motion_type>rotational</motion_type>
<!--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="_xTranslation">
<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
<motion_type>translational</motion_type>
<!--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="_yTranslation">
<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
<motion_type>translational</motion_type>
<!--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="_zTranslation">
<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
<motion_type>translational</motion_type>
<!--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>cyl_small.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> 0.01 0.01 0.01</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>
</Body>
</objects>
</BodySet>
<!--Constraints in the model.-->
<ConstraintSet>
<objects />
<groups />
</ConstraintSet>
<!--Forces in the model.-->
<ForceSet>
<objects>
<BushingForce name="Joint1Bushing">
<!--One of the two bodies connected by the bushing.-->
<body_1>ground</body_1>
<!--The other of the two bodies connected by the bushing.-->
<body_2>cyl2</body_2>
<!--Location of bushing frame on body 1.-->
<location_body_1>0 0 0.01</location_body_1>
<!--Orientation of bushing frame in body 1 as x-y-z, body fixed Euler rotations.-->
<orientation_body_1>0 0 0</orientation_body_1>
<!--Location of bushing frame on body 2.-->
<location_body_2>0 0 -0.01</location_body_2>
<!--Orientation of bushing frame in body 2 as x-y-z, body fixed Euler rotations.-->
<orientation_body_2>0 0 0</orientation_body_2>
<!--Stiffness parameters resisting relative rotation (Nm/rad).-->
<rotational_stiffness>0.1 0.1 0.1</rotational_stiffness>
<!--Stiffness parameters resisting relative translation (N/m).-->
<translational_stiffness>0 0 0</translational_stiffness>
<!--Damping parameters resisting relative angular velocity. (Nm/(rad/s))-->
<rotational_damping>0 0 0</rotational_damping>
<!--Damping parameters resisting relative translational velocity. (N/(m/s)-->
<translational_damping>0 0 0</translational_damping>
</BushingForce>
<PointActuator name="bending_force">
<!--Name of Body to which this actuator is applied.-->
<body>cyl2</body>
<!--Location of application point; in body frame unless point_is_global=true-->
<point>0 0 0.01</point>
<!--Interpret point in Ground frame if true; otherwise, body frame.-->
<point_is_global>false</point_is_global>
<!--Force application direction; in body frame unless force_is_global=true.-->
<direction>1 0 0</direction>
<!--Interpret direction in Ground frame if true; otherwise, body frame.-->
<force_is_global>true</force_is_global>
<!--The maximum force produced by this actuator when fully activated.-->
<optimal_force>80</optimal_force>
</PointActuator>
</objects>
<groups />
</ForceSet>
<!--Markers in the model.-->
<MarkerSet>
<objects />
<groups />
</MarkerSet>
<!--ContactGeometries in the model.-->
<ContactGeometrySet>
<objects />
<groups />
</ContactGeometrySet>
</Model>
</OpenSimDocument>
again shortly what I want to implement:
two sticks with a principally free joint in between, but the joint producing resistance when bended (bushing force?). And of course I need the possibility to induce this bending by pressing against the body who is not ground.
Below my approach so far, using an actuator. Actuator does not seem to be the right choice as Ayman said, but how else to apply a simple force?
Thanks in advance and best kind regards
Uwe
Here the model (again my question, if there is no way to upload a textfile for this purpose). As far as I believe, it has two cylinders scaled to 2cm length with a rotational stiffness of 0.1 (whatever that means). I have already reduced that value, because I was afraid not to see the effect because the stiffness is to high.
<?xml version="1.0" encoding="UTF-8" ?>
<OpenSimDocument Version="30000">
<Model name="multisegment_test">
<credits>The OpenSim Development Team (Reinbolt, J; Seth, A; Habib, A; Hamner, S)</credits>
<publications>This is an example model distributed with OpenSim</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>0.1</inertia_xx>
<inertia_yy>0.1</inertia_yy>
<inertia_zz>0.02</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>cyl_small.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> 0.01 0.01 0.01</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>
</Body>
<Body name="cyl2">
<mass>0.1</mass>
<mass_center> 0 0 0</mass_center>
<inertia_xx>0.1</inertia_xx>
<inertia_yy>0.1</inertia_yy>
<inertia_zz>0.02</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="joint1">
<!--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.01</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.01</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="_xRotation">
<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
<motion_type>rotational</motion_type>
<!--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="_yRotation">
<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
<motion_type>rotational</motion_type>
<!--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="_zRotation">
<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
<motion_type>rotational</motion_type>
<!--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="_xTranslation">
<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
<motion_type>translational</motion_type>
<!--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="_yTranslation">
<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
<motion_type>translational</motion_type>
<!--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="_zTranslation">
<!--Coordinate can describe rotational, translational, or coupled motion. Defaults to rotational.-->
<motion_type>translational</motion_type>
<!--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>cyl_small.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> 0.01 0.01 0.01</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>
</Body>
</objects>
</BodySet>
<!--Constraints in the model.-->
<ConstraintSet>
<objects />
<groups />
</ConstraintSet>
<!--Forces in the model.-->
<ForceSet>
<objects>
<BushingForce name="Joint1Bushing">
<!--One of the two bodies connected by the bushing.-->
<body_1>ground</body_1>
<!--The other of the two bodies connected by the bushing.-->
<body_2>cyl2</body_2>
<!--Location of bushing frame on body 1.-->
<location_body_1>0 0 0.01</location_body_1>
<!--Orientation of bushing frame in body 1 as x-y-z, body fixed Euler rotations.-->
<orientation_body_1>0 0 0</orientation_body_1>
<!--Location of bushing frame on body 2.-->
<location_body_2>0 0 -0.01</location_body_2>
<!--Orientation of bushing frame in body 2 as x-y-z, body fixed Euler rotations.-->
<orientation_body_2>0 0 0</orientation_body_2>
<!--Stiffness parameters resisting relative rotation (Nm/rad).-->
<rotational_stiffness>0.1 0.1 0.1</rotational_stiffness>
<!--Stiffness parameters resisting relative translation (N/m).-->
<translational_stiffness>0 0 0</translational_stiffness>
<!--Damping parameters resisting relative angular velocity. (Nm/(rad/s))-->
<rotational_damping>0 0 0</rotational_damping>
<!--Damping parameters resisting relative translational velocity. (N/(m/s)-->
<translational_damping>0 0 0</translational_damping>
</BushingForce>
<PointActuator name="bending_force">
<!--Name of Body to which this actuator is applied.-->
<body>cyl2</body>
<!--Location of application point; in body frame unless point_is_global=true-->
<point>0 0 0.01</point>
<!--Interpret point in Ground frame if true; otherwise, body frame.-->
<point_is_global>false</point_is_global>
<!--Force application direction; in body frame unless force_is_global=true.-->
<direction>1 0 0</direction>
<!--Interpret direction in Ground frame if true; otherwise, body frame.-->
<force_is_global>true</force_is_global>
<!--The maximum force produced by this actuator when fully activated.-->
<optimal_force>80</optimal_force>
</PointActuator>
</objects>
<groups />
</ForceSet>
<!--Markers in the model.-->
<MarkerSet>
<objects />
<groups />
</MarkerSet>
<!--ContactGeometries in the model.-->
<ContactGeometrySet>
<objects />
<groups />
</ContactGeometrySet>
</Model>
</OpenSimDocument>