Home Toolbox functions Sample projects Tutorials Downloads |
|
Reference: Chapter 2 in Multibody Mechanics and Visualization by Harry Dankowicz, published by Springer Verlag UK, 2004.
To illustrate the use of auxiliary observers to represent linked mechanisms.
This Mambo project contains a non-stationary crane tower, a non-stationary crane jib, and a non-stationary crane trolley. The crane configuration may be specified in four independent steps, namely
towerlx, towerly, and towerlz: lengths of the sides of the segments of the tower.
jiblx, jibly, and jiblz: lengths of the sides of the segments of the jib.
q1: angle of rotation of the jib relative to the crane tower about an axis parallel to the tower.
q2: displacement of the trolley along the jib from the tower axis. crane.zip (zip file, 8 kb, December 30, 2012) >Restart(): >DeclareObservers(World,Jib,Trolley): >for i from -7 by 2 to -3 do DefineObjects( [World,'Block',point=MakeTranslations(world,towerlx/2,-towerly/2,i*towerlz/2),xlength=.05,ylength=.05,zlength=towerlz,color=cyan], [World,'Block',point=MakeTranslations(world,towerlx/2,towerly/2,i*towerlz/2),xlength=.05,ylength=.05,zlength=towerlz,color=cyan], [World,'Block',point=MakeTranslations(world,-towerlx/2,-towerly/2,i*towerlz/2),xlength=.05,ylength=.05,zlength=towerlz,color=cyan], [World,'Block',point=MakeTranslations(world,-towerlx/2,towerly/2,i*towerlz/2),xlength=.05,ylength=.05,zlength=towerlz,color=cyan], [World,'Block',point=MakeTranslations(world,0,towerly/2,(i-1)*towerlz/2),xlength=towerlx,ylength=.05,zlength=.05,color=cyan], [World,'Block',point=MakeTranslations(world,0,-towerly/2,(i-1)*towerlz/2),xlength=towerlx,ylength=.05,zlength=.05,color=cyan], [World,'Block',point=MakeTranslations(world,towerlx/2,0,(i-1)*towerlz/2),xlength=.05,ylength=towerly,zlength=.05,color=cyan], [World,'Block',point=MakeTranslations(world,-towerlx/2,0,(i-1)*towerlz/2),xlength=.05,ylength=towerly,zlength=.05,color=cyan], [World,'Block',point=MakeTranslations(world,towerlx/2,0,(i-1)*towerlz/2),xlength=.05,ylength=towerly,zlength=.05,color=cyan], [World,'Block',point=MakeTranslations(world,towerlx/2,0,i*towerlz/2),orient=Matrix([[1,0,0],[0,towerlz/sqrt(towerly^2+towerlz^2),-towerly/sqrt(towerly^2+towerlz^2)],[0,towerly/sqrt(towerly^2+towerlz^2),towerlz/sqrt(towerly^2+towerlz^2)]]),xlength=.05,ylength=.05,zlength=sqrt(towerly^2+towerlz^2),color=cyan], [World,'Block',point=MakeTranslations(world,-towerlx/2,0,i*towerlz/2),orient=Matrix([[1,0,0],[0,towerlz/sqrt(towerly^2+towerlz^2),towerly/sqrt(towerly^2+towerlz^2)],[0,-towerly/sqrt(towerly^2+towerlz^2),towerlz/sqrt(towerly^2+towerlz^2)]]),xlength=.05,ylength=.05,zlength=sqrt(towerly^2+towerlz^2),color=cyan], [World,'Block',point=MakeTranslations(world,0,towerly/2,i*towerlz/2),orient=Matrix([[towerlz/sqrt(towerlx^2+towerlz^2),0,towerlx/sqrt(towerlx^2+towerlz^2)],[0,1,0],[-towerlx/sqrt(towerlx^2+towerlz^2),0,towerlz/sqrt(towerlx^2+towerlz^2)]]),xlength=.05,ylength=.05,zlength=sqrt(towerlx^2+towerlz^2),color=cyan], [World,'Block',point=MakeTranslations(world,0,-towerly/2,i*towerlz/2),orient=Matrix([[towerlz/sqrt(towerlx^2+towerlz^2),0,-towerlx/sqrt(towerlx^2+towerlz^2)],[0,1,0],[towerlx/sqrt(towerlx^2+towerlz^2),0,towerlz/sqrt(towerlx^2+towerlz^2)]]),xlength=.05,ylength=.05,zlength=sqrt(towerlx^2+towerlz^2),color=cyan]): od: >DefineObjects( [World,'Block',point=MakeTranslations(world,0,0,-towerlz/2),xlength=3*towerlx/2,ylength=3*towerly/2,zlength=towerlz,color=green], [World,'Block',point=MakeTranslations(world,3*towerlx/4,0,-towerlz/2),xlength=towerlx/10,ylength=towerly,zlength=towerlz/2,color=blue], [World,'Cylinder',point=MakeTranslations(world,0,0,.05),radius=(towerlx+towerly)/4,length=.1,color=blue]): >for i from -7 by 2 to 13 do DefineObjects( [Jib,'Block',point=MakeTranslations(jib,-.1,-jibly/2,i*jiblz/2),xlength=.05,ylength=.05,zlength=jiblz,color=cyan], [Jib,'Block',point=MakeTranslations(jib,-.1,jibly/2,i*jiblz/2),xlength=.05,ylength=.05,zlength=jiblz,color=cyan], [Jib,'Block',point=MakeTranslations(jib,-jiblx-.1,-jibly/2,i*jiblz/2),xlength=.05,ylength=.05,zlength=jiblz,color=cyan], [Jib,'Block',point=MakeTranslations(jib,-jiblx-.1,jibly/2,i*jiblz/2),xlength=.05,ylength=.05,zlength=jiblz,color=cyan], [Jib,'Block',point=MakeTranslations(jib,-jiblx/2-.1,jibly/2,(i-1)*jiblz/2),xlength=jiblx,ylength=.05,zlength=.05,color=cyan], [Jib,'Block',point=MakeTranslations(jib,-jiblx/2-.1,-jibly/2,(i-1)*jiblz/2),xlength=jiblx,ylength=.05,zlength=.05,color=cyan], [Jib,'Block',point=MakeTranslations(jib,-.1,0,(i-1)*jiblz/2),xlength=.05,ylength=jibly,zlength=.05,color=cyan], [Jib,'Block',point=MakeTranslations(jib,-jiblx-.1,0,(i-1)*jiblz/2),xlength=.05,ylength=jibly,zlength=.05,color=cyan], [Jib,'Block',point=MakeTranslations(jib,-.1,0,i*jiblz/2),orient=Matrix([[1,0,0],[0,jiblz/sqrt(jibly^2+jiblz^2),-jibly/sqrt(jibly^2+jiblz^2)],[0,jibly/sqrt(jibly^2+jiblz^2),jiblz/sqrt(jibly^2+jiblz^2)]]),xlength=.05,ylength=.05,zlength=sqrt(jibly^2+jiblz^2),color=cyan], [Jib,'Block',point=MakeTranslations(jib,-jiblx-.1,0,i*jiblz/2),orient=Matrix([[1,0,0],[0,jiblz/sqrt(jibly^2+jiblz^2),jibly/sqrt(jibly^2+jiblz^2)],[0,-jibly/sqrt(jibly^2+jiblz^2),jiblz/sqrt(jibly^2+jiblz^2)]]),xlength=.05,ylength=.05,zlength=sqrt(jibly^2+jiblz^2),color=cyan], [Jib,'Block',point=MakeTranslations(jib,-jiblx/2-.1,jibly/2,i*jiblz/2),orient=Matrix([[jiblz/sqrt(jiblx^2+jiblz^2),0,jiblx/sqrt(jiblx^2+jiblz^2)],[0,1,0],[-jiblx/sqrt(jiblx^2+jiblz^2),0,jiblz/sqrt(jiblx^2+jiblz^2)]]),xlength=.05,ylength=.05,zlength=sqrt(jiblx^2+jiblz^2),color=cyan], [Jib,'Block',point=MakeTranslations(jib,-jiblx/2-.1,-jibly/2,i*jiblz/2),orient=Matrix([[jiblz/sqrt(jiblx^2+jiblz^2),0,-jiblx/sqrt(jiblx^2+jiblz^2)],[0,1,0],[jiblx/sqrt(jiblx^2+jiblz^2),0,jiblz/sqrt(jiblx^2+jiblz^2)]]),xlength=.05,ylength=.05,zlength=sqrt(jiblx^2+jiblz^2),color=cyan]): od: >DefineObjects( [Jib,'Block',point=MakeTranslations(jib,-jiblx/2-.1,0,14*jiblz/2-.025),xlength=jiblx+.05,ylength=jibly+.05,zlength=.05,color=cyan], [Jib,'Block',point=MakeTranslations(jib,jiblx-.1,0,-6*jiblz/2),xlength=2*jiblx,ylength=jibly,zlength=1.5*jiblz,color="{.8,.8,.8}"]): >DefineObjects( [Trolley,'Block',point=MakeTranslations(jib,2*jiblx/3,0,0),xlength=jiblx/3,ylength=jibly,zlength=jiblz/2,color=red], [Trolley,'Block',point=MakeTranslations(jib,14*jiblx/15,0,0),xlength=jiblx/5,ylength=jibly,zlength=jiblz/3,color=red]): >GeometryOutput(main=World,states=[q1,q2],parameters=[towerlx,towerly,towerlz,jiblx,jibly,jiblz],checkargs,checktree,filename="crane.geo"); |
©2004-2017 Harry Dankowicz Mechanical Science and Engineering University of Illinois at Urbana-Champaign | Home Toolbox functions Sample projects Tutorials Downloads |