Four-Bar Linkage Virtual Reality Model
ii
iii
Abstract The paper mainly describes the procedure of simulating four-bar linkage virtual reality model by computer. We use virtual reality toolbox of Matlab 6.1 to process simulation of animation, and then write program for blocks. Making use of the toolbox of the program can reduce the time we spend on operating and drawing. We can apply virtual reality toolbox to dynamic system simulation of continuous or discrete time. First, saving needing block, and key in many various parameters, and then do simulating by using virtual reality toolbox; correcting gradually to achieve our demanding goal. Before using the toolbox, we must have background knowledge about four-bar linkage motion mechanism. So we draw the motion trajectory of four-bar linkage and provide simple introduction. That makes everybody more similar to four-bar linkage motion. And virtual reality toolbox can simulate plane take-off and object harmonic motion. Hope the paper can provide more information on dynamic simulation. iv
....12 Overview..12 Interacting with a Virtual Scene...13 VRML Editors 13 VRML Viewers..14 4.3 Function List 15 Block List 17..18 v
..27..28 vi
racing car virtual reality model and browser.13 Virtual Reality Toolbox Sink block showing the VRML tree for the associated virtual world 14 vrbuild Virtural Reality Toolbox VR Source Point Light View point Clock theta_2 B_x vii
theta_3 viii
1
(mechanism) (object) (link) (joint) [1] 2-1 1 2 4 3 Four-bar linkage 3 Connecting rod or Coupler Floating link [3] 2
Crank 180 Rocker - - - [3] Grashof 360 Grashof 360 [3] Grashof (crank and rocker) 2-2 360 3
(double crank) 2-3 360 4
(double rocker) 2-5 5
360 (crank) (rocker) Grashof 360 [3] 2-6 (slider crank) 2-7 [3] 6
1 2 3 4 2-8 (double slider) 7
r1r2r3r4 θ 1 θ 2 θ 3 θ 4 x y OQR PQR 8
(Transmission angle) Z 2 Z 2 [2] 3 4 3 = 4-3 ------------------(3.4) 90 (Closure) (Branch) 9
3 4 90-90 45 [2] 1 = cos 1 [ (Z 2 + r4 2 r3 2 ) / (2 Z r4) ] = cos 1 [ (Z 2 + r1 2 r2 2 ) / (2 Z r1) ] 4 = 180 (+ ) -------------------------(3.5) 10
0 2180 0 180 180 2360 180 360 4 [2] 11
4.1 Overview 12
4-1 racing car virtual reality model and browser 4.2 Interacting with a Virtual Scene You can create virtual worlds that are driven from the Simulink environment using standard Virtual Reality Modeling Language (VRML) technology with the Virtual Reality toolbox. A complete working environment is provided with the Virtual Reality Toolbox. It includes a VRML authoring tool for creating virtual reality worlds, as well as a VRML viewer and a VRML Web browser plug-in for viewing virtual worlds. The Virtual Reality Toolbox includes the V-Realm Builder for Windows platforms, which is used to create and edit complex three-dimensional virtual worlds 13
without extensive VRML coding. This and other three-dimensional editing tools offer the power and versatility needed to create many types of practical and technical models. For example, you can import three-dimensional objects from most CAD packages to make the authoring process easier and more efficient. 4-2 Virtual Reality Toolbox Sink block showing the VRML tree for the associated virtual world. 4.2.2 VRML Viewers 14
4.3 Function List MATLAB interface functions vrclear vrgetpref vrinstall vrsetpref vrview vrwho vrwhos Purge closed virtual worlds from memory Get Virtual Reality Toolbox preferences Check or install the toolbox components Set Virtual Reality Toolbox preferences View virtual worlds in a browser List virtual worlds in memory List virtual worlds in memory, long form Simulink blocks vrlib Open the Virtual Reality Toolbox Simulink block library VRNODE object methods fields get isvalid set sync vrnode List VRML fields belonging to this node Get a property or a VRML field of the node True for a valid VRNODE object Change a property or a VRML field of the node Synchronize a VRML field with clients Create a VRNODE object VRWORLD object methods close Close a virtual world 15
delete edit get isvalid nodes nodetypes open reload save set view vrworld Deletes a closed virtual world from memory Edit the world in the VRML editor Get a property of a virtual world True for a valid VRWORLD object List named nodes contained in the world List possible node types for the given world Open a virtual world Reload a world from its associated file Save the world to a VRML file Change a property of a virtual world View a world in a browser Create a VRWORLD object 16
4.4 Block List Joystick Input Asynchronous joystick input. Magellan SpaceMouse Processes input from Magellan SpaceMouse device VR Placeholder Gnerate a vector of VR Placeholder signals for masking the unused or unaffected components of a VRML field VR Signal Expander Expand input vector into a fully qualified VRML field signal, filling the blank positions in the output port with the VR Placeholder signal VR Sink Controls the selected properties of a virtual world according to given inputs VR Source Reads the selected properties of a virtual world 17
Matlab6.1 Virtural Reality Toolbox Matlab6.1 Virtural Reality Toolbox vrbuild2 5-1 vrbuild2 3-2 18
5-2 vrbuild2 Matlab6.1 Simulink Virtural Reality Toolbox 3-3 VR Source 3-4 Edit p1-link2 childrenshapeappearancematerial diffuse Color ShapegeometryCylinder height =0.5radius =1.25 Point Light View point Point Lightlocation x=0y=10z=0 x=0y=0z=10 Point Light View pointlocation x=5y=5z=10 View point 3-5 3-4 VR Signal Expander simulink 3-6 3-7 19
5-3 Virtural Reality Toolbox 5-4 VR Source 20
5-5 Point Light View point 5-6 21
5-7 3-7 Clock t=10 3-8 Block Parameter f=0.1 theta_2=2*pi*u[2]*u[1] 3-9 A_x=cos(u[1]) A_y= sin(u[1]) B_x=u[1]+sqrt(9-u[2]^2) 3-10 B_y=0 theta_3=atan2(u[4]-u[2],u[3]-u[1]) 3-11 C_x =(u[1]+u[3])/2 C_y =(u[2]+u[4])/2 22
5-8 Clock 5-9 theta_2 23
5-10 B_x 5-11 theta_3 24
5-12 Point of joint A Ax = cos θ2 Ay = sin θ2 θ2 = 2 π f t Point of joint B Bx = Ax + 9- Ay By = 0 Point of center of C Cx = 1/2Ax + Bx Cy = 1/2Ay + By θ3 = tan 2By - AyBx - Ax p1_link2 p2_link2 p3_link3 p1_link2 p4_link3p6_link4p7_link4 25
x p5_link3 p2_link2 p3_link3 p4_link3 p6_link4p7_link4 26
Matlab6.1 Simulink Virtural Reality Toolbox Blaxxun Contact51.exe Internet Explorer 27
MATLAB 28