Sunday, August 22, 2010

How to use Unigraphics NX4 Motion Simulation in Timing Diagram Design Process - Part 5

The result of timing diagram design using overlapping motion with fifth-degree (3-4-5) polynomial and linear cam functions can be simulated in 3D motion. The simulation is done using Kinematics environment in Unigraphics (UG) NX4 Motion simulation module. The "spreadsheet run" command is used to control the motions of all driving joints as per the timing diagram. Mechanical Design Engineer can then modify and improve the timing diagram before releasing his design for manufacturing.

Here is the NX4 Motion simulation results.

Related articles:
Further reading related to UG NX

How to use Unigraphics NX4 Motion Simulation in Timing Diagram Design Process - Part 4

In [How to use Unigraphics NX4 Motion Simulation in Timing Diagram Design Process - Part 3], we've already set all the links and joints with drivers for links included in Motion Simulation using UG NX4 Motion simulation module. But the driver functions for both indexing mill and punch die are not as per the timing diagram yet. Now it's time to set them according to the timing diagram and see the simulation results in 3D movement.

1. Select "Graphing" command. The graphing command will export the value of displacement of all driving joints (have "driver"). By default, the displacement values of other driven joints will not be exported.

2. Select "Spreadsheet". This is to specify that we need to get the data in excel.
3. Click Ok to confirm.

UG NX4 will then open excel spreadsheet and put the data as shown in the above picture. You can see that the displacement of drv J_Mill and drv J_Die are linear as we specified earlier. Therefore, we will modify it by replacing all of these values with our preferred timing diagram.

4. Save the excel file as new name. This is to have another excel for formula entering. I use to try putting all formula in the original excel file exported from UG, but somehow with Excel 2007, it has an error (no problem with excel 2003). So I often make another excel file with all formula, and paste special only "values" into the original excel file.
5. Click Save to confirm new file name.

6. Enter formula into the column of drv J_Mill, revoulute
As we know from this example, the indexing mill has 16 heads (positions). So the angular displacement of the indexing mill in each cycle is 360/16 = 22.5 degress. So this is our hm. You can see how I enter the formula of cycloid in the above picture.

7. Open the excel file from [Polynomial Cam Function (Fifth-degree polynomial Example) - Part 4]. Copy the displacement values from column h(mm) as shown above.
It contains several displacement cam profiles such as fifth-degree polynomial and linear. It's too difficult to enter all of these formula in the excel file that we created in step 5. The easiest way is just copy it.

8. Paste special > Values into the column of drv J_Die, slider. Make sure that you paste only values, otherwise you may have the wrong values. Now we have all required data in the new file. It's time to paste them back to the original excel file exported from UG NX4 Motion Simulation Module.

9. Select all cells by clicking at the top-left corner of excel and click Copy.

10. Now switch back to original excel file exported from UG. The file name will be something like "Worksheet in motion_1" as shown above. Then select cell A1 and paste all value replacing all original values. After that Click at the top-left of excel software (Microsoft Office logo) and click "Update" (not shown in the above picture). This is to update values of this table into UG.

11. Switch windows back to UG NX4 Motion Simulation Environment. Then select "Spreadsheet Run".

12. There will be a pop-up windows as shown above. Select "Attached". This is to let UG uses data in the attached excel file (Attached excel file is the file "Worksheet in motion_1").

13. Click at the "Loop" play mode to see the motion simulation in several cycles.
14. Click "Play" button to start simulation.

You will see the results of timing timing diagram calculation in 3D motion. You can then see any interference that may exist, change the timing diagram, paste the values back again and see the simulation results until you satisfy with the results.

Quite a long post already. I'll put the video clip of the motion simulation result in the next post.

Further reading:

Saturday, August 21, 2010

How to use Unigraphics NX4 Motion Simulation in Timing Diagram Design Process - Part 3

In [How to use Unigraphics NX4 Motion Simulation in Timing Diagram Design Process - Part 2], we've finished setting the driver of revolute joint of the indexing mill. Then let's set the joint for the punch die.

Movement of the punch die is different from the indexing mill. It moves only in linear motion along Z axis (normal to top face of indexing mill). The joint for this kind of movement is called "Slider" joint. Here is how to set it:

1. Select Joint command.
2. Select "Slider" joint icon in the joint dialog box.
3. Select first link icon.
4. Select link "Die" as we previously created

5. Click at the "Orientation on the first link" icon.
6. Select "Point" from the drop-down menu.
7. Select center point of the cylinder as shown above to define the location of the slider joint.

8. Select "Vector" from the drop-down menu to define the direction of the slider joint.
9. Select the bottom face of cylinder to define the vector perpendicular to that plane. See the Z axis pointing downward.
10. Rename the slider joint to "J_Die".
11. Click Ok to confirm.

The slider joint setting procedures are almost done. Still to set the driver of this joint.

1. Right-click at the slider joint J_Die and select Edit to open the dialog box.
2. Change the slider joint motion driver to "Constant".
3. Type any value in the velocity text box e.g. 50. This sets the velocity of this slider joint to 50 mm/s.
4. Click Ok to confirm.

We've finished the setting procedures for motion simulation and we can now start simulation. But please note that the movement of indexing mill and punch are still not the same as what we need.

To see the motion simulation, follows the steps below:

1. Select "Animation" command
2. Enter the time for simulation in seconds e.g. 1.8 seconds mean the cycle time of machine speed of 2,000 pcs/h.
3. Enter number steps for simulation. The more steps, the smoother simulation results. Here I put 360 steps, which is easy to trace for every 1 degree in timing diagram.
4. Click Ok to confirm.

5. Change the domain to steps instead of time, just for easier tracing purpose.
6. Click "Play" button to see the simulation.

We can find the interference between the indexing mill and punch die during the motion simulation using UG NX4 motion simulation module. This is because the functions set for both drivers are not as per the timing diagram designed previously.

Next post will show how to use "graphing" and "spreadsheet run" to set the UG NX4 motion simulation as per the timing diagram. And you can watch for the result of effort to optimize the timing diagram in 3D Motion.

Further reading:

Saturday, August 14, 2010

How to use Unigraphics NX4 Motion Simulation in Timing Diagram Design Process - Part 2

Let's continue from previous post. Now it's time to see our previous calculation for the timing diagram of indexing mill and punch die in 3D Motion Simulation using Unigraphics (UG) NX4. Though we have made motion simulation in excel spreadsheet using excel VBA, it's much better and easier to do it in UG motion. The UG NX4 Assembly model is prepared as shown below.

Mating conditions of the assembly model is as according to the sketch shown in [Timing Diagram (Part 1 - No Overlap Movement)].

New to UG NX4 Motion Simulation? No problem, just follow our guideline in step-by-step, and you will find it easy to use. Let's see how to do...

We can enter into Motion Simulation Environment as shown below.
In motion simulation environment, we see all commands are disabled. Then we have to right-click on the assembly file and select New Simulation.

This command will create necessary UG files and put them into new folder automatically (see new folder and files in windows explorer).
Click at the environment command (calculator icon) and select "Kinematics". This is because we are going to use "Spreadsheet Run" to control the motion.

Then we define the links to use in motion simulation by just following the steps shown in the pictures.

1. Click link command.
2. Select object, for this case select the indexing mill.
3. Enter name of the link, for this case enter Mill.
4. Click Ok to confirm.

Do the same for the punch die. Now we have 2 links to use in motion simulation. But we can't start simulation yet. We still need to define the joint for each link and we have to make the "degrees of freedom" become zero, otherwise we need to simulate using "Dynamics" environment.

Let's starting defining joint of indexing mill. There are a lot of types to define, but for this indexing mill we select "revolute joint". The revolute joint has 1 degree of freedom because it can only rotate in Z-direction and this is what we want for the indexing mill. To set the joint, just follow the following steps:

1. Select Joint command.
2. Select "Revolute joint" icon (default) then select the "link". For this case, select the Mill.

The revolute joint definition is not complete yet because we have to define the point and direction of the joint. After selection of the link in step 2, the Joint windows automatically switch command to define the orientation of joint on the first link.

3. If not yet selected, select "Orientation of joint on the first link".
4. Select "Vector".
5. Select the top face of the indexing mill.
These steps are to define the direction of the joint. For the revolute joint, we need to define the Z-direction for rotation axis. By selecting the top face of the mill, we define the vector normal to that plane.
Now the revolute joint direction is defined, but we still have to define the exact location (point) of the rotation axis, for this case, it's the center of the indexing mill.
6. Change from "Vector" to "Point".
7. Select the center point of the index mill.
8. Rename the joint to "J_Mill". This is for reference and easy to trace back.
9. Click Ok to confirm.

It's still not finished yet for the setting of the revolute joint for indexing mill. Though, the vector and point are fully defined, but there's nothing define how it moves yet. At each instance, the revolute joint can rotate to any degrees. Therefore we need to define the last thing for this revolute joint, Motion Driver.

We can set the Motion Driver as follows:

1. Select "Constant"
2. Enter numerical value at "Velocity" box e.g. 100
3. Click Ok to confirm.

The above process sets the motion driver to have constant velocity of 100 deg/s. You may argue that the motion of this indexing mill as per the previous posts must be "cycloid" not constant velocity. Yes, that's right. But that is for later. For the moment it's enough to define it like this.

Let's take a break for a moment and continue in the next post.

How to use Unigraphics NX4 Motion Simulation in Timing Diagram Design Process - Part 1

During the process of timing diagram design, I normally start with some calculations in excel spreadsheet to minimize the acceleration but still satisfy the required process time. I can see the preferred displacement, velocity and acceleration profiles of the mechanisms from excel spreadsheet. What's next? Shall I start manufacturing?

Currently, I use Unigraphics (UG) NX4 to design the mechanical parts. When assembly modeling is done, I normally use the assembly model to simulate the movement of mechanisms with motion simulation module in UG.

It helps confirm the timing diagram before releasing the design for manufacturing. It helps a lot when the movement combined in 3D motion. I can find the interference with another mechanisms and solve it if there is any before release the design for manufacturing.

By the way, when I first start using UG NX4 motion simulation module, I find it easy to set the links and to define related joints for mechanisms. However, I find it difficult to define the driver functions using ADAMS-General built-in functions. The screen of function editor is as shown below.

These function requires especially when simulate in "Dynamics" environment. But I still prefer simulation in "Kinematics" environment, because it's fast and easy. With kinematics environment, I'm interested in only the displacement because the rest I've already calculated.

Can you imagine how difficult it is to write fifth-degree (3-4-5) polynomial cam functions for 3-4 sectors?

I'm still familiar with using excel spreadsheet to calculate things. It's easier if I can use the table that I've already made during the timing diagram design in UG NX4 motion simulation module instead of putting all movement functions again using another functions in UG. I finally found out that besides "Animation" and "Articulation", UG NX4 has another commands called "Graphing" and "Spreadsheet Run". These 2 commands allow me to use the excel spreadsheet that was calculated previously to see the motion simulation without entering new functions again. I can just copy & paste the values and see the results. If the timing diagram is wrong, I just modify it in excel spreadsheet using either fifth-degree (3-4-5) polynomial, cycloid, linear functions, etc. and copy & paste the values from table and see the simulation again.

Find out more details about How to use Unigraphics NX4 Motion Simulation in Timing Diagram Design Process in the next post.

Thursday, August 12, 2010

Polynomial Cam Function (Fifth-degree polynomial Example) - Part 4

In the post [Polynomial Cam Function (Fifth-degree polynomial characteristics) - Part 3], we know the characteristics of Fifth-degree polynomial cam profile. In this post we will see the example of using Fifth-degree polynomial together with Linear cam functions to improve the movement of mechanism. We can use the same example as what we did in the post [Timing Diagram (Part 4 - Timing Diagrams Comparison using Motion Simulation in Microsoft Excel)]. The original maximum acceleration of the die for that case without any overlap motion was 4.154 m/s2. But we did the improvement using cycloid cam curve and the maximum acceleration reduced to 0.804 m/s2. That was a big improvement on the acceleration of the mechanism. This time we can find that using Fifth-degree (3-4-5) polynomial cam function can also considerably reduce the maximum acceleration of the mechanism in the same level as cycloid cam profile. But the comparison between cycloid and fifth-degree polynomial for this case is not that significant. This is just to show how to use it. And please note that it doesn't mean that lowest acceleration is best movement for this kind of application. This is just only the example of using overlapping motion with fifth-degree polynomial cam profile.

Our constraints for this motion is still the same as previous example, the total displacement is 50 mm and the die has to move inside the hole for 30 mm. The die has to be away from the indexing mill surface about 1 mm before indexing mill really moves.

Please note that the velocity and acceleration functions derived in previous post has the unit of mm/rad and mm/rad2 respectively. To change the angular domain to time domain, we have to multiply velocity function and acceleration function by omega and omega2 respectively. Where omega is the angular velocity of cam shaft in rad/s. This is when v0 and v1 are in mm/rad and bm in deg. But normally it's easier to use v0 and v1 in mm/deg and bm in deg. So the unit of omega should be deg/s.

We can work out in more details and get the following displacement, velocity and acceleration profiles as shown in the following graphs.

Sector   Function        Start Angle   End Angle    h1         h2
   A-B     Linear             62                77                1.43       0.43
   B-C     Fifth-degree     77                206              0.43        50
   C-D     Dwell             206               306                50         50
   D-A     Fifth-degree    306                62                 50        1.43

Wednesday, August 4, 2010

Polynomial Cam Function (Fifth-degree polynomial characteristics) - Part 3

From[Polynomial Cam Function (Derivation of Fifth-degree function) - Part 2], we get the equations for displacement, velocity and acceleration of cam follower using fifth-degree (3-4-5) polynomial. All of these functions can be plotted in Excel spreadsheet as shown in the picture. This is for the case of zero velocity at both ends i.e v0 = 0 and v1 = 0. We can see that it looks like cycloid cam profile which has zero starting and ending velocity. But fifth-degree polynomial has ability to change the starting and ending velocity, while cycloid can't do that. So we have at least 4 parameters to configure the cam curve of fifth-degree polynomial i.e. the total displacement (hm), total angle (bm), starting velocity (v0) and ending velocity (v1). We also have to make sure that the connection between curves must not have any discontinuity. The functions such as cycloid and fifth-degree polynomial has continuity in its displacement, velocity and acceleration. But when connecting it with another curves, it may create discontinuity if we don't properly connect them together. 

Sunday, August 1, 2010

Polynomial Cam Function (Derivation of Fifth-degree function) - Part 2

In [Polynomial Cam Function (Introduction) - Part 1], we discussed about fundamental of cam design and introduction of polynomial cam function. In this post, we’re going to derive the equation of fifth-degree polynomial cam function. We start from the general term of fifth-degree polynomial function as follows.

s = c0 + c1(b/bm) + c2(b/bm)2 + c3(b/bm)3 + c4(b/bm)4 + c5(b/bm)5  ….. (eq.1)

s = displacement (mm)
b = cam angle in that sector (rad)
bm = total angle in that sector (rad)

We can find the velocity in mm/rad by derivative of displacement. Later we can change it to the time domain.

v = ds/db
v = c1/bm + 2c2/bm(b/bm) + 3c3/bm(b/bm)2 + 4c4/bm(b/bm)3 + 5c5/bm(b/bm)4

Rearrange to get,
v = 1/bm[c1 + 2c2(b/bm) + 3c3(b/bm)2 + 4c4(b/bm)3 + 5c5(b/bm)4]  ….. (eq.2)

Acceleration in mm/rad2 can be calculated by a = dv/db
a = 1/bm[2c2/bm + 6c3/bm(b/bm) + 12c4/bm(b/bm)2 + 20c5/bm(b/bm)3]

Rearrange to get,
a = 1/bm2[2c2 + 6c3(b/bm) + 12c4(b/bm)2 + 20c5(b/bm)3]  ….. (eq.3)

Then we set the boundary conditions for the function. Let us introduce another parameter, hm.

hm = total displacement in that sector (mm)

Applying boundary conditions:

(BC.1) At the beginning of movement, the displacement must start from 0 and has acceleration of 0. This is for connecting to another cam curves in other sectors. But we will leave the velocity at this point not equal to zero. Then we have more freedom to select the starting velocity. Of course, if the starting velocity is not zero, then we can’t connect it with dwell or cycloid functions because it will create discontinuity in velocity. But we will use it to connect with linear cam function or another fifth-degree polynomial curves.