Thursday, September 4, 2008
I have been using Solid Edge 3D CAD software for 1-2 years for my mechanical design projects in the past. But now, according to the standardization in my design organization, I have to switch to use Unigraphics software instead, or we call it in short as "UG NX4" (the latest version is NX6).
To be honest, at first I still like Solid Edge because I think I can make modeling and assembly in Solid Edge faster and easier than in UG. But one of the good thing for UG is Motion Simulation module that help me simulate the movement of mechanical assemblies before releasing for manufacturing. I know that Solid Edge also has this kind of simulation module, but I didn't have a chance to use (no license). So in this post, I would like to share how easy to set up motion simulation in UG NX4.
Let's start with a very simple modeling.
I would like to see how the cylinder moves when it is pushed by the rotating lever. So I start with making UG modeling as shown above. Those parts can be "features" in single UG file or the assembly of several UG files.
Once the assembly is ready, I can then start "Motion Simulation"
At Motion Navigator, right-click and select "New Simulation"
UG NX4 will show the pop-up Motion Joint Wizard windows for automatic setting of joints for simulation. For this example I just click at cancel button in order to set the links and joints manually.
Next, what I have to do is to set necessary links and joints for motion simulation. I have to start with creating of links. Parts or features that cannot moved and no contact with other parts, can be excluded for link setting. In the example, the fixed column can be excluded from link setting. I can leave it as it is, just for showing purpose only.
First, I would set the lever as a link in motion simulation by clicking at "link" icon and select the lever and rename it as "lever"
Do the same thing for the cylinder and the block.
Why do I need to set the block as link?
I have to set the block as link though it is not moving because I would like to set the 3D contact between the cylinder and the block, otherwise the cylinder will fall down during simulation! I have to also select "fix the link" for the block in order to prevent falling down when simulation start.
At Motion Navigator, I can see the links and joint I've created. We can see that though I don't set the joint for each link yet, but there is "J001" joint at Motion Navigator pane because UG NX4 creates "fixed joint" automatically when we select "fix the link" during creating of the link.
Next, I create a revolute joint and set motion driver for the lever. This step is very important. The point and direction of joint must be correct i.e. Z-axis should be the axis of rotation.
Then I create the 3D Contact between the cylinder and the block and also between the lever and the cylinder.
Then we're ready to start simulation. But we have to make sure that the solver environment is "Dynamics" not "Kinematics" because I would like to see the effect of 3D contact. (Click at calculator icon)
Next, start motion simulation by clicking at "Animation" and set time = 1 and step = 100 and see the result.
Watch the following video for the result.
Recommended articles related to Unigraphics NX4 Motion Simulation
Monday, September 1, 2008
Motion Simulation in Solid Edge using sketches together with Microsoft Excel VBA Programming Part III
1) Create new file in Microsoft Excel
2) Press Alt+F11 to enter Microsoft Visual Basic windows as shown below
3) Right click in Project Explorer at new file name (in this example, new excel file name = Book2) > Insert > Module
4) To make Solid Edge type libraries available to the Visual Basic Object Browser, click References on the Project menu. On the References dialog box, select the Solid Edge libraries you want to access.
All variable automation is accessed through the Variables collection and Variable objects. The Variables collection serves two purposes: it allows you to create and access variable objects, and it allows you to work with dimensions as variables.
Note: When debugging programs that interact with the Variable Table, it helps to have the Variable Table displayed while stepping through the program. The Variable Table shows the results as they are executed.
5) Write the following code into VBA code area as shown below,
You can copy & paste the following code to your excel VBA.
' Example of using VBA code to control variables in Solid Edge document
' By AkeBlogger
On Error Resume Next
'Declare the program variables.
Dim iAngle As Single
Dim objApp As Object
Dim objVariables As Object
Dim objVariable As Object
' Checking for the active document
Set objApp = GetObject(, "SolidEdge.Application")
If Err Then
MsgBox "You must open Solid Edge before executing this module!!", vbOKOnly + vbExclamation, "Error"
'Connect to a running instance of Solid Edge.
Set objApp = GetObject(, "SolidEdge.Application")
'Access the Variables collection.
Set objVariables = objApp.ActiveDocument.Variables
For iAngle = 0 To 360 Step 2
' Changing Cam_angle from 0, 2, 4, ..., 360 deg.
Call objVariables.Edit("Cam_angle", iAngle)
6) Open Solid Edge file from previous example and delete formula in Variables Table as shown below, because in this example we will control the variable (dimension) using VBA code directly.
7) We are now ready for simulation. Resize VBA Windows as shown below then click run to see the result.
Watch the following video for the actual result!
Monday, August 25, 2008
Motion Simulation in Solid Edge using sketches together with Microsoft Excel VBA Programming Part II
In this post, I would like to show how easy to make it using variables table.You can use the Variable Table to define and edit functional relationships between the dimensions of a design in a familiar spreadsheet format. The Variable Table is accessed with the Variables command on the Tools menu. There are two types of variables: dimensions displayed in the design and variables you create directly in the Variable Table. Dimension variables directly control elements of a design. Variables that you create cannot directly control the design. A user variable must be set equal to a value or mathematical expression; for example, PI = 3.14159. Variables can control dimensional relationships by setting the dimensional relationship equal to the variable.Let's begin...
1) Open Solid Edge and make a sketch as shown below.
Mechanism in this example consists of cam, lever, pull rod and four bar linkage. What we have to do is to make sure that when the dimension of cam angle is changed, the entire mechanism is changed accordingly. You can simply check this by clicking at the dimension of cam angle and rotate your mouse wheel to see if entire mechanism is moving or not.
2) To set the name of variables
When you place the dimensions for a design, variables for these dimensions are placed into the variable table automatically. If the Variable Table is open, any dimension that is placed by you or the software will display in the Variable Table after the dimension is placed. Working with the variable table open allows you to change the dimension's name that is generated by the software to a more logical name as you work. When you rename variables, the variable names should contain only letters, numbers, and the underscore character. You should not use punctuation characters.In Solid Edge: select Tools > Variables > Variables
and click at the dimension you want to change the name, for this case select the dimension of cam angle and change "Name" to cam_angle and select "Expose" to show this variable name to other application as shown below.
3) To Link variable in Solid Edge to Microsoft Excel
You can use Microsoft Excel or other spreadsheet software to link Solid Edge variables to a spreadsheet. Before you can link variables to a spreadsheet, you must first create the variables you want in the Solid Edge document. When you link Solid Edge variables to a spreadsheet, the document names and folder path for the spreadsheet and the Solid Edge document should contain only letters, numbers, and the underscore character. You should not use punctuation characters. To successfully edit the linked Solid Edge variables from the spreadsheet later, you must open the Solid Edge and spreadsheet documents in a specific order:
You can open the spreadsheet document first, then open the linked Solid Edge document.
You can open the Solid Edge document first, then click the Edit Links command on the shortcut menu when a linked formula is selected within the variable table. You can then use the Open Source option on the Links dialog box to open the spreadsheet document.
In this example, the excel file is saved at E:\Online Biz\Web\Blog\Mechanical-Design-Handbook\
File name: ex-solid-edge1.xls
and this is the content of the excel file...
In Solid edge: select Tools > Variables > Variables and select the variable named "cam_angle" as you created in previous step. And enter the following formula into "Formula" column,
You can see that to link to another excel workbook, just put "@" at the first position then follows by the path and file name of excel file, sheet name and cell.
R2C2 means row 2 and column 2 which is cell B2
Now solid edge variable is linked and control by cell value in excel.
If you change value in cell B2, you will see the movement of cam mechanism.
Watch the result in the following video clip.
Saturday, May 17, 2008
However, instead of using "Motion" application, I would like to show you how to simulate the motion of mechanical parts using a sketch in Solid Edge together with Microsoft Excel.
Most of the time, I started my mechanical design with the concept and layout using sketches. If we could simulate the motion of mechanical parts in a sketch, it would help me a lot.
I got this idea when I was playing with sketches and constraints in Solid Edge. Solid Edge allows us to change the dimensions easily by just rotating the mouse wheel.
Watch the following video to see how easy to make the motion in sketch.
So what I have to do is just to have Microsoft Excel VBA changes the dimensional values in Solid Edge sketch.
Here is the results of this idea ...
Let's see how to do this in the next post...
Read more info about Solid Edge: Ultimate 3D CAD Software
Friday, May 9, 2008
So your LHS is something like =PI()*E20^3/32 (suppose that the value of d is in cell E20), then do in the same way for your RHS. Next, enter formula in another cell to calculate the difference between LHS and RHS. I suppose that you enter this formula in cell F11
Wednesday, April 30, 2008
Normal stresses are plotted as horizontal coordinates, with tensile stresses (positive) plotted to the right of the origin and compressive stresses (negative) plotted to the left. Shearing stresses are plotted as vertical coordinates, with those tending to produce a clockwise rotation of the stress element plotted above the s axis, and those tending to produce a counterclockwise rotation of the stress element plotted below the s axis.
The results obtained from Mohr's circle are identical with the equation derived from the free-body diagram. Consequently, Mohr's circle provides an extremely useful aid in the solution for, and visualization of, the stresses on various planes through a point in a stressed body in terms of the stresses on two mutually perpendicular planes through the point. Although Mohr's circle can be drawn to scale and used to obtain values of stresses and angles by direct measurements on the figure, it is probably more useful as a pictorial aid to the analyst who is performing analytical determinations of stresses and their directions at the point.
Useful information about Mohr's Circle:
DOWNLOAD Mohr's Circle Excel file for FREE
Wednesday, March 19, 2008
Mechanical design usually deals with movement of several parts. There are a lot of softwares that help simulate the movement of concerned parts of machines such as UG, Solid Edge, Solid Work, etc.
But how do you make simulation without those softwares?
I use Microsoft Excel to do the simulation of my timing diagram. Watch the video.
Actually it is nothing but motion simulation using graphing method in Microsoft Excel. It cannot simulate all of your complex movements, but it helps you get the feeling of how your machine will behave according to your timing diagram.
This technique uses VBA (Visual Basic for Application) to control the movements. What you have to do is to prepare the excel spreadsheet with the table defining the sketch of your machine parts to be used in simulation. You have to set the formula in excel spreadsheet to manipulate the location (x,y) and rotation (angle). After proper settings, just let VBA code, which is embedded in Microsoft Excel, changes the control values in the manipulation table (the x-y chart is linked to this table). Then you can control the movement of parts that move in translation or rotation. For example, I use an indexing box at my transport conveyor which has 4 stops and the cam profile is MS (Modified Sine). So I put MS function into my VBA code and I can see how my conveyor is moving at the same as others.
Example of Modified Sine Movement Function.
' Modified Sine function
' T is dimensionless
' hm is stroke of movement
Function MS(T As Double, hm As Double)
Const PI = 3.14159265358979
Dim T5 As Double, T6 As Double
Dim V1 As Double, V2 As Double, V3 As Double, V4 As Double, V5 As Double, V6 As Double
Dim S1 As Double, S2 As Double, S3 As Double, S4 As Double, S5 As Double, S6 As Double
Dim Am As Double
Dim s As Double
Const T1 = 0.125
Const T2 = 0.125
Const T3 = 0.5
Const T4 = 0.5
T5 = 1 - T1
T6 = T5
Am = 1 / (2 * T1 / PI + (2 - 8 * T1) / PI ^ 2)
V1 = 2 / PI * T1 * Am
V2 = V1
V5 = V1
V6 = V1
V3 = 2 / PI * (T3 - T2) * Am + V2
V4 = V3
S1 = 2 * T1 ^ 2 / PI * Am - (2 * T1 / PI) ^ 2 * Am
S2 = S1
S3 = (2 / PI * (T3 - T2)) ^ 2 * Am + V2 * (T3 - T2) + S2
S4 = S3
S5 = 1 - S1
S6 = S5
Select Case T
Case 0 To T1
s = 2 * T1 / PI * Am * (T - 2 * T1 / PI * Sin(PI * T / (2 * T1)))
Case T2 To T3
s = (2 / PI * (T3 - T2)) ^ 2 * Am * (1 - Cos(PI * (T - T2) / (2 * (T3 - T2)))) + V2 * (T - T2) + S2
Case T4 To T5
s = 2 / PI * (T5 - T4) * Am * (2 / PI * (T5 - T4) * Sin(PI * (T - T4) / (2 * (T5 - T4))) - (T - T4)) + V4 * (T - T4) + S4
Case T6 To 1
s = (2 / PI * (1 - T6)) ^ 2 * Am * (Cos(PI * (T - T6) / (2 * (1 - T6))) - 1) + V6 * (T - T6) + S6
s = 1
MS = s * hm
For those who are interested in downloading the example file, please click the link below
DOWNLOAD EXAMPLE FILE FOR FREE
Extract the zip file with password: mechanical-design-handbook.blogspot.com
Thursday, February 21, 2008
a flexible tooth, molded to a belt that has tension members built in. The
teeth are flexible allowing the load to be spread out over all the teeth in
contact with the pulley. Timing belts are part of a larger category of
power transmission devices called synchronous drives. These belt or
cable-based drives have the distinct advantage of not slipping, hence the
name synchronous. Synchronous or positive drive also means these belts
can even be used in wet conditions, provided the pulleys are stainless
steel or plastic to resist corrosion.
Timing belts come in several types, depending on their tooth profile
and manufacturing method. The most common timing belt has a trapezoidal
shaped tooth. This shape has been the standard for many years,
but it does have drawbacks. As each tooth comes in contact with the mating
teeth on a pulley, the tooth tends to be deflected by the cantilever
force, deforming the belt’s teeth so that only the base of the tooth
remains in contact. This bending and deformation wastes energy and
also can make the teeth ride up pulley’s teeth and skip teeth. The deformation
also increases wear of the tooth material and causes the timing
belt drive to be somewhat noisy.
Several other shapes have been developed to improve on this design,
the best of which is the curved tooth profile. A trade name for this shape
is HTD for High Torque Design. Timing belts can be used at very low
rpm, high torque, and at power levels up to 250 horsepower. They are an
excellent method of power transfer, but for a slightly higher price than
chain or plastic-and-cable chain