[ODE] Motor Stops revisited

Pursel, Ray USA erpursel at nps.navy.mil
Thu Jul 17 17:16:01 2003


This is a multi-part message in MIME format.

------_=_NextPart_001_01C34CC1.E902DCAE
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

Gentlemen,

	I'm trying to hang a helicopter fuselage under a rotor disk
using a ball joint.  I would like to constrain the travel in the body's
relative X and Y axes and eliminate any rotation in it's Z axis.  More
importantly, when I apply a force to mBody (the fuselage) which causes
it to rotate about it's Z axis, I want mMainRotor to correspondingly
rotate about mBody's Z axis also, as a helicopter's does.  A simple
rotation is hard because I would need to find the angle caused by the
force and then rotate mMainRotor accordingly.  I was hoping that keeping
mBody's Z axis rigid using an AMotorJoint would do the trick but the
Devil is apparently in the details.  This is what I've got so far (first
stab):

   // Create Joint between Rotor and Body connected at the Rotor's CG=20
   // (Ball Joint Constrained by Angular Motor Joint)
   mBallJoint =3D dJointCreateBall( physWorldID, 0 );
   dJointAttach( mBallJoint, mMainRotor, mBody );
   dJointSetBallAnchor( mBallJoint, 0.0, 0.0, 1.1 );

   mAMJoint =3D dJointCreateAMotor( physWorldID, 0 );
   dJointAttach( mAMJoint, mMainRotor, mBody );
   dJointSetAMotorMode( mAMJoint, dAMotorUser );
   dJointSetAMotorNumAxes( mAMJoint, 2 );

   dJointSetAMotorAxis( mAMJoint, 0, 2, 0.0, 1.0, 0.0 );
   dJointSetAMotorAxis( mAMJoint, 1, 2, 1.0, 0.0, 0.0 );
   dJointSetAMotorParam( mAMJoint, dParamHiStop, PI/12);
   dJointSetAMotorParam( mAMJoint, dParamLoStop, -PI/12);
   dJointSetAMotorParam2( mAMJoint, dParamHiStop, PI/12);
   dJointSetAMotorParam2( mAMJoint, dParamLoStop, -PI/12);

Thank you,
Capt Ray Pursel, USMC
Naval PostGraduate School
MOVES Institute www.movesinstitute.org



------_=_NextPart_001_01C34CC1.E902DCAE
Content-Type: text/html;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.0.6249.1">
<TITLE>Motor Stops revisited</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">Gentlemen,</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN =
LANG=3D"en-us">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN =
LANG=3D"en-us"> <FONT SIZE=3D2 FACE=3D"Courier New">I'm t</FONT><FONT =
SIZE=3D2 FACE=3D"Courier New">rying to hang a helicopter fuselage under =
a rotor disk using a ball joint.</FONT></SPAN><SPAN =
LANG=3D"en-us">&nbsp;<FONT SIZE=3D2 FACE=3D"Courier New"> I would like =
to constrain the travel in</FONT> <FONT SIZE=3D2 FACE=3D"Courier =
New">the</FONT></SPAN><SPAN LANG=3D"en-us"> <FONT SIZE=3D2 =
FACE=3D"Courier New">body's</FONT></SPAN><SPAN LANG=3D"en-us"><FONT =
SIZE=3D2 FACE=3D"Courier New"></FONT> <FONT SIZE=3D2 FACE=3D"Courier =
New">relative X</FONT></SPAN><SPAN LANG=3D"en-us"> <FONT SIZE=3D2 =
FACE=3D"Courier New">and</FONT></SPAN><SPAN LANG=3D"en-us"><FONT =
SIZE=3D2 FACE=3D"Courier New"></FONT> <FONT SIZE=3D2 FACE=3D"Courier =
New">Y axes and</FONT></SPAN><SPAN LANG=3D"en-us"> <FONT SIZE=3D2 =
FACE=3D"Courier New">eliminate</FONT></SPAN><SPAN LANG=3D"en-us"><FONT =
SIZE=3D2 FACE=3D"Courier New"></FONT> <FONT SIZE=3D2 FACE=3D"Courier =
New">any</FONT></SPAN><SPAN LANG=3D"en-us"> <FONT SIZE=3D2 =
FACE=3D"Courier New">rotation in</FONT></SPAN><SPAN LANG=3D"en-us"> =
<FONT SIZE=3D2 FACE=3D"Courier New">it's</FONT></SPAN><SPAN =
LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier New"> Z =
axis.&nbsp;</FONT></SPAN><SPAN LANG=3D"en-us"> <FONT SIZE=3D2 =
FACE=3D"Courier New">More importantly</FONT></SPAN><SPAN =
LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier New">, when =
I</FONT></SPAN><SPAN LANG=3D"en-us"> <FONT SIZE=3D2 FACE=3D"Courier =
New">apply a force to</FONT></SPAN><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Courier New"> mBody</FONT></SPAN><SPAN LANG=3D"en-us"><FONT =
SIZE=3D2 FACE=3D"Courier New"> (the fuselage)</FONT></SPAN><SPAN =
LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier New"></FONT></SPAN><SPAN =
LANG=3D"en-us"> <FONT SIZE=3D2 FACE=3D"Courier New">which causes it to =
rotate</FONT></SPAN><SPAN LANG=3D"en-us"> <FONT SIZE=3D2 FACE=3D"Courier =
New">about it's Z axis</FONT><FONT SIZE=3D2 FACE=3D"Courier New">, I =
want mMainRotor</FONT></SPAN><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Courier New"> to</FONT> <FONT SIZE=3D2 FACE=3D"Courier =
New">correspondingly rotate</FONT></SPAN><SPAN LANG=3D"en-us"> <FONT =
SIZE=3D2 FACE=3D"Courier New">about mBody's Z axis</FONT></SPAN><SPAN =
LANG=3D"en-us"> <FONT SIZE=3D2 FACE=3D"Courier =
New">also</FONT></SPAN><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Courier New">, as a helicopter's does</FONT></SPAN><SPAN =
LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier New">.</FONT></SPAN><SPAN =
LANG=3D"en-us">&nbsp;<FONT SIZE=3D2 FACE=3D"Courier =
New"></FONT></SPAN><SPAN LANG=3D"en-us"> <FONT SIZE=3D2 FACE=3D"Courier =
New">A simple rotation is hard because I would need to find the angle =
caused by the force and then rotate</FONT> <FONT SIZE=3D2 =
FACE=3D"Courier New">mMainRotor</FONT></SPAN><SPAN LANG=3D"en-us"><FONT =
SIZE=3D2 FACE=3D"Courier New"> accordingly</FONT></SPAN><SPAN =
LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier New">.</FONT></SPAN><SPAN =
LANG=3D"en-us">&nbsp;<FONT SIZE=3D2 FACE=3D"Courier New"> I was hoping =
that</FONT><FONT SIZE=3D2 FACE=3D"Courier New"> keeping mBody's Z axis =
rigid</FONT></SPAN><SPAN LANG=3D"en-us"> <FONT SIZE=3D2 FACE=3D"Courier =
New">using an</FONT></SPAN><SPAN LANG=3D"en-us"> <FONT SIZE=3D2 =
FACE=3D"Courier New">AMotorJoint</FONT> <FONT SIZE=3D2 FACE=3D"Courier =
New">would</FONT></SPAN><SPAN LANG=3D"en-us"> <FONT SIZE=3D2 =
FACE=3D"Courier New">do the trick</FONT></SPAN><SPAN =
LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier New"> but the Devil is =
apparently in the details</FONT></SPAN><SPAN LANG=3D"en-us"><FONT =
SIZE=3D2 FACE=3D"Courier New">.&nbsp; This is what I've got so =
far</FONT><FONT SIZE=3D2 FACE=3D"Courier New"> (first stab)</FONT><FONT =
SIZE=3D2 FACE=3D"Courier New">:</FONT></SPAN><SPAN =
LANG=3D"en-us"></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp; // Create Joint between Rotor and Body connected at =
the Rotor's CG</FONT></SPAN><SPAN LANG=3D"en-us"> </SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp; //</FONT></SPAN><SPAN LANG=3D"en-us"> <FONT SIZE=3D2 =
FACE=3D"Courier New">(Ball Joint Constrained by Angular Motor =
Joint)</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp; mBallJoint =3D dJointCreateBall( physWorldID, 0 =
);</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp; dJointAttach( mBallJoint, mMainRotor, mBody =
);</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp; dJointSetBallAnchor( mBallJoint, 0.0, 0.0, 1.1 =
);</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp; mAMJoint =3D dJointCreateAMotor( physWorldID, 0 =
);</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp; dJointAttach( mAMJoint, mMainRotor, mBody =
);</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp; dJointSetAMotorMode( mAMJoint, dAMotorUser =
);</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp; dJointSetAMotorNumAxes( mAMJoint, 2 =
);</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp; dJointSetAMotorAxis( mAMJoint, 0, 2, 0.0, 1.0, 0.0 =
);</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp; dJointSetAMotorAxis( mAMJoint, 1, 2, 1.0, 0.0, 0.0 =
);</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp; dJointSetAMotorParam( mAMJoint, dParamHiStop, =
P</FONT><FONT SIZE=3D2 FACE=3D"Courier New">I/12);</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp; dJointSetAMotorParam( mAMJoint, dParamLoStop, =
-PI/12);</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp; dJointSetAMotorParam</FONT></SPAN><SPAN =
LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier New">2</FONT></SPAN><SPAN =
LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier New">( mAMJoint, =
dParamHiStop, P</FONT><FONT SIZE=3D2 FACE=3D"Courier =
New">I/12);</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp; dJointSetAMotorParam</FONT></SPAN><SPAN =
LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier New">2</FONT></SPAN><SPAN =
LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier New">( mAMJoint, =
dParamLoStop, -PI/12);</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">Thank you,</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">Capt</FONT> <FONT SIZE=3D2 FACE=3D"Courier New">Ray =
Pursel</FONT></SPAN><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">, USMC</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">Naval PostGraduate School</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">MOVES Institute</FONT></SPAN><SPAN LANG=3D"en-us"> </SPAN><A =
HREF=3D"http://www.movesinstitute.org"><SPAN LANG=3D"en-us"><U><FONT =
COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Courier =
New">www.movesinstitute.org</FONT></U></SPAN><SPAN =
LANG=3D"en-us"></SPAN></A><SPAN LANG=3D"en-us"></SPAN></P>
<BR>

</BODY>
</HTML>
------_=_NextPart_001_01C34CC1.E902DCAE--