Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Sep 11, 2007

Mechatronic toolkit tutorial

2 ratings | 3.00 out of 5
Read in | Print

Overview

This tutorial covers how to use the mechatronic toolkit tutorial

 

Exercise 1: 3D CAD Model Setup (10 minutes)

In this first exercise, open a 3D CAD model of a simplified 2-axis milling machine designed in SolidWorks and configure it to run a simple motion simulation.

1. Launch NI LabVIEW software either from the taskbar shortcut icon or from Start->All Programs->LabVIEW 8.2.1.

2. In LabVIEW, open project LabVIEW-SolidWorks Mechatronics Toolkit Hands On.lvproj located in the Desktop\mechatronic hands on folder.

 

3. Expand the virtual folders in the project until you see the Example 1. 3D CAD Configuration\Exercise\SolidWorks Model subfolder and double-click on 2 axis mill COSMOS (starting point).SLDASM. This action launches SolidWorks and opens the model.

4. Make sure the COSMOSMotion tab is active. If not, go to Tools->Add Ins and mark the check boxes on the left and the right.

5. Click on the COSMOSMotion Tab to display the objects under “Assembly Components.” By right-clicking on the names, define “knee-2” as a ground part and “saddle” and “table” as moving parts.

                       

 

You can now click and drag the table components to move them around.

 

6. Then configure the axis and define a simple move. To do this, expand the Constraints>>Joints tree. Right-click on “Axis 1” and click on “Properties.” Configure the properties as shown below. Change the “Motion Type” and “Function” options and type the values for “sec” and “mm.”

                                

 

7. Go back to the left pane, right-click on “Motion Model,” and select “Simulation Parameters.” Leave all parameters to default except “time,” which should match the maximum time length on the profile (3 seconds).

                

8. In the bottom part of the left pane, hit the Run Simulation button. You should see the model move.

 

9. Close the COSMOSMotion model.


 

Exercise 2: Virtual Machine Prototyping (15 minutes)

In this exercise, learn how to virtually prototype the milling machine. Design a motion profile in LabVIEW and implement it on the 3D CAD model of the milling machine. If it is not already running, launch LabVIEW from All Programs->National Instruments->LabVIEW 8.2.1.

1. Browse through the folders to open Example 2\Basic Motion\Exercise\SolidWorks Model\2 axis mill COSMOS.SLDASM and Example 2\Basic Motion\Exercise\Exercise 2.vi.

The Front Panel Window should resemble the following image.

 

2. On the menu bar, select Window->Show Block Diagram or hit CTRL+E to bring up the block diagram. The block diagram should resemble the image below.

3. Now design a motion profile consisting of a straight line and an arc move for the milling machine to follow.

4. Navigate to the Project Explorer window and browse to My Computer>>LabVIEW-SolidWorks Mechatronics Toolkit from the tree structure.

 

5. From the NI Motion Assistant folder, drag and drop the following VIs into the block diagram:

  • 1D or 2D Straight Line Move.vi
  • 2D Arc Move.vi
  • PlotXY moves.vi

6. From the COSMOSMotion Simulation folder, drag and drop Run COSMOSMotion Simulation.vi on the block diagram.

7. Wire the VIs together as shown below.

 

8. Arrange the windows so you can see the SolidWorks window. Make sure the 2-axis mill model is loaded and the COSMOSMotion tab is visible in the SolidWorks pane.

9. Run the VI. You should now see the milling machine model run through a simulation of the moves you designed in LabVIEW. Close the SolidWorks model.

 


 

Exercise 3: Collision Detection (10 minutes)

In this exercise, explore how you can use LabVIEW and SolidWorks to validate machine motion profiles.

1. Open the COSMOSMotion model called 4 axis mill Cosmos.SLDAM and the LabVIEW VI exercise 3.vi in the virtual folders \Example 3. Collision Detection\SolidWorks Model and \Example 3. Collision Detection\Exercise, respectively.

 

Make sure that the file path from which LabVIEW loads the motion profile is correct. (Desktop\Mechatronics Hands-On\LabVIEW Demos\Motion Contours\2D Figure 8.txt)

2. Navigate to the Project Explorer window and browse to My Computer>>LabVIEW-SolidWorks Mechatronics Toolkit from the tree structure. From the NI Motion Assistant and COSMOSMotion Simulation folders, place the following VIs on the block diagram:

  1. 2D Contour move.vi two times
  2. PlotXY Motion.vi
  3. Run COSMOSMotion Simulation.vi

Connect all the controls and indicators. Your final block diagram should look similar to the image below.

3. Run the VI and, on the SolidWorks window, observe how the system moves. If you look closely, you can see the two mills collide.

4. Go to the SolidWorks workspace and choose COSMOSMotion->Check Interferences…. from the menu toolbar. Select the two tables and hit the “Find Now” button.

5. Select the two tables (should turn green) and hit the “Find Now” button.

 

Exercise 4: Motor Sizing (15 minutes)

In this exercise, use LabVIEW and SolidWorks to correctly size a motor and power drive needed to move the milling stage with a desired performance. First, use LabVIEW to generate a motion profile. Then simulate the motion on COSMOSMotion, find the needed torque and angular velocity on the motor, and save that information into a file. LabVIEW reads those files and helps determine whether the motor is capable.

1. Open the SolidWorks model 2 axis mill Cosmos (with motor). SLDASM in the My Computer\Example 4. Motor Sizing\SolidWorks Model virtual folder.

Notice in this model that a screw object has been added to provide the necessary input/output to correctly simulate a motor. Define the pitch of the screw by browsing to the \Motion Model\Constraints\Joints\Screw tab and right-clicking to open the “Properties” page

 

                            

Note that you might have to remove the simulated data before being able to access object properties.

2. Open and run motor simulation.vi, located in the My Computer\Example 3. Motor Sizing\Exercise virtual folder. Use this VI to create a motion profile and feed it into SolidWorks

3. Import the numeric results of the COSMOSMotion simulation into LabVIEW. Go back to the SolidWorks window and expand the “screw” component on the Constrains\Joints path in the Motion Model tree. Right-click and add a plot for “Position Angle\About Z axis.”

4. Repeat step 2 to add “angular velocity around z axis” and “moment around x axis.” You should now have three graphs on the screen as shown below.

5. Now use these graphs to save the information to the file and open it in LabVIEW. Right-click on each graph and select “Export CSV.” Leave default filename and path (for example, Moment - X-Screw.csv on the \Milling Stages).

6. Minimize the SolidWorks window and open and run motor simulation.vi from the LabVIEW Project.

Notice the different indicators – Temperature Rise, Over Temperature, and Over Voltage – that might show if you have chosen an incorrect motor.

7. Now try to improve the performance of the system by increasing both speed and acceleration of the motion profile. Repeat steps 2 through 6 using the following parameters in motion motor sizing.vi.

Max Velocity 1600                           Max Acceleration 1200

Max Deceleration 1200                  Max Jerk 1200

 

8. After motor simulation.vi execution, you should receive some warning if the desired profile might cause overtemperature/overvoltage on the motor you plan to use.

 

   For more information visit

www.ni.com/mechatronics

www.ni.com/motion

www.ni.com/embeddedcontrol

 
2 ratings | 3.00 out of 5
Read in | Print

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).