linear motor expression with several timesteps

Hi All,

i want to move a solid in a motion analysis as shown in the Picture.

Because of the resolution limitation maybe the quality of the picture is not good enough.

If you need a higher res. picture you can download it here http://dl.dropbox.com/u/1362871/Motion%20Plot.png

My Problem is the expression formulation because of the timesteps.

For the first timestep (0 - 0.55sec) its easy:

(10*((TIME/0.55)**3)-15*((TIME/0.55)**4)+6*((TIME/0.55)**5))*0.720)

But now i have no idea how to add the other timesteps (2-7) into the expression.

The only way i have found is to use the IF function. But thats a terrible solution.

I do not want to use the interpolated method.

Hopefully you can help me.

Thanks

SolidworksMotion Studies
Answers 5
SF
SF 2010-09-02 Best Answer

Hi Christian,

This looks like you can get close using a step function for each stage. There are additional interpolations, but with a step function you specify the start time, start value and then end time and end value. Step functions are cumulative, so the next function will be relative to the first. As an example:

STEP(TIME, 0, 0, 0.55,720)+STEP(TIME, 0.65,0,0.95,-150)+STEP(TIME,0.95,0,1.25,150)+STEP(TIME, 1.35, 0, 1.95,-720)

If you look in the help you'll find the following:

The STEP(a, x1, y1, x2, y2) function returns a smooth step function applied to an expression a for time or for a result. The smooth cubic function starts rising at (x1,y1) on the horizontal axis, and levels off at (x2,y2). Use this function in expressions for forces or motors.

Format

STEP(a, x1, y1, x2, y2)

Arguments

aSelect any valid result from the list, or enter time.
x1The point on the horizontal axis at which the step begins to rise.
y1The value of the step function before the point x1.
x2The point on the horizontal axis at which the step levels off.
y2The value of the step function at the leveling off point x2.

Step Function Equation

The STEPfunction approximates the Heaviside step function with a cubic polynomial.

FunctionDefinition
STEP (a, x1, y1, x2, y2) =y1; a ≤ x1
y1 + (x2 - x1) * z2·(3-2*z); x1< a < x2
y2; a ≥ x2
z =((a - x1)/(x2 - x1))

The other alternative you have is to just import this data as datapoints (save the function data as csv or txt and load it into motion.

Cheers,

Ian

CR
CR 2010-09-02

Hi Ian,

thank you for your answer.

I know the possibility to use the step function. But i need exactly the same motion as shown in the plot.

I also know the possibilitiy to use datapoints. But because of the creation of them they are less user friendly for often usage.

I'm looking for something similar as the step function but with my own motion defintion.

Something like Step(TIME,0,f(TIME),0.55,720)+Step(TIME,0.55,720,0.65,720)+Step(TIME,0.65,f(time),0.95,570)+..... but without the STEP motion...

I hope you understand what i mean.....

Thanks

SF
SF 2010-09-02

Hi Christian,

Fro 2010, data points or nested if conditions are you best bet for user functions. I agree nested if conditions are messy to enter and interact with. What I do is create them in a separate text file and copy and past them in since it is far easier to create and edit in that files.

If you signed up for 2011 beta, it would be worth looking at some of the new functionality in there for functions to see if they will meet your exact needs. If you're not on the beta program, unfortunately you will have to wait until the 2011 pre-release is available.

Cheers,

Ian

CR
CR 2010-09-02

Hi Ian,

hmm...

Is there any possibility to do what i want with a macro?

I don't understand how to create a linear motor expression feature by a macro.

The other motor types are no problem (constant velocity, interpolated, oscillating, distance).

But how to create a motor with expression?

In the API there is only a Expression property.

Thanks

SF
SF 2010-09-02

Hi Christian,

The API interface still only deals with the existing functions supported through the interface. However, you could very easily define data point curves on the fly to then drive the motors (create a simple interface to control what inputs the user can choose from and then create the data points from that to run the simulation with).

This is how the Rockwell Automation integration works. You build up your motor curves in their free tool, it sends it to motion and solves the model and then can load the results back to size the appropriate Allen Bradley motor for your needs.

There is another alternative, but I have not looked at the API to see how it supports stopping the simulation at certain points/events to adjust the function definition.If it does, then you could swap out the expression with the relevant curve segment at the specific times, however the onus would be on you to ensure continuity in the functions or you will get spikes at the transitions and potentially solver failures.

Cheers,

Ian