1.3.3 3D ConstraintsNow that the local point coordinates on each 3D body are defined, building the model is simply a matter of tying the points together with the correct mechanical constraints. Modeler3D provides a library of mechanical constraint objects that translate the desired physical conditions that are imposed on the model into mathematical equations. Constraint ObjectsFive constraint objects are used to model the slider-crank mechanism, constraining a total of 12 degrees of freedom (6 degrees of freedom for each moving body). Some 3D constraint objects. Note that the last character in the name of any Mech constraint object is an integer that specifies the number of degrees of freedom that it constrains. The first argument to each constraint object, cnum, is the user-specified constraint number. This number is used to reference the constraint later in the modeling process, just as body numbers are used to reference specific bodies. The point, vector, and axis arguments required by Modeler3D constraint objects are specified with Point, Vector, Line, Axis, and Plane objects, used in much the same manner as the built-in Mathematica graphics primitives, Point and Line. These objects are discussed in detail in Section 2.2. Building the ModelThe Modeler3D constraint objects used to model the physical relationships in the slider-crank model are as follows. A Revolute5 constraint forces the rotational axis of the crankshaft to be coincident with an axis on the ground body. This constrains five degrees of freedom: X, Y, and Z displacement and rotation about the global X or Y axes. The one degree of freedom left for the crankshaft is rotation about the global Z axis. The syntax of this constraint can be interpreted as, "Constrain a line on the ground body spanning from {0, 0, 0} to {0, 0, 5} to be coincident with a line on the crankshaft spanning from {0, 0, 0} to {0, 0, 5}, and constrain the origins of the two lines to be coincident."A ProjectedAngle1 constraint specifies the rotational orientation of the crankshaft. This constraint works by projecting two vectors onto a specified plane, and then specifying the angle between the two vectors. The crankshaft is now completely constrained. The syntax of this constraint can be interpreted as, "Constrain the counterclockwise direction angle of the vector {3, 0, 0} on the crankshaft to be crankangle units greater than the direction angle of the vector {3, 0, 0} on the ground body, when the two vectors are projected on a plane on the ground body defined by the three points {0, 0, 0}, {3, 0, 0}, and {0, 4, 0}."A Cylindrical4 constraint forces a vertical (+Y) line on the piston to be colinear with a vertical line on the ground body. This constrains four degrees of freedom, X and Z displacement of the piston, and X and Z axis rotation of the piston. The two degrees of freedom left are the pistons vertical translation in the cylinder and rotation of the piston in the cylinder.A RelativeDistance1 constraint forces an eccentric point on the crankshaft to lie five units distant from a point on the vertical axis of the piston. This models the length of the connecting rod. The syntax of this constraint can be interpreted as, "Constrain the absolute distance between a point {3, 0, 0} on the crankshaft and a point {0, 4, 0} on the piston to be equal to 5.0."An Orthogonal1 constraint forces a vector in the Z direction on the piston to be orthogonal to a vector in the X direction on the ground body. This constraint stops the piston from rotating in the cylinder, a function that would have been performed by the connecting rod in a real piston engine. This completes the constraint of the piston.The Modeler3D constraint objects are finally assembled into a mechanism model with SetConstraints. The fundamental model-building function. Here is the entire slider-crank model built in one step. SetConstraints returns Null. All of the mechanism equations generated by SetConstraints are stored internally in the Modeler3D private context.
|