×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Function to calculate valve motion velocity
4

Function to calculate valve motion velocity

Function to calculate valve motion velocity

(OP)
I am trying to write some functions to calculate the velocity, acceleration, and jerk (change in acceleration) of some valve motion data.

The data is typically about 220 points
The x axis is evenly spaced with an increment of 1
The y axis is provided in a list of "position data"


I would like to know the best way to accuratly calculate the
velocity, acceleration, and jerk of the y axis at each increment
along the x axis.


Below are two methods I have tried to calculate velocity at EXACTLY the point along the X axis of the distance measurment, obviouslyat least one of them is wrong.

Note: Calculating the velocity between two points is easy, the problem is finding the velocity on the point.


X Increment,    Y Position,    Velocity,    Avg Velocity,

1 -------------    1
           >-----------    1
2 -------------    2           >-----------    4.5 (velocity at 2)
           >-----------    8
3 -------------    10




X Increment,    Y Position,    Avg Position,    Velocity,

1 -------------    1
           >-----------    1.5
2 -------------    2             >----------    3.75 (velocity at 2)
           >-----------    6
3 -------------    10


Is there a better way to do this?

Jonathan T. Schmidt
http://www.schmidtmotorworks.com

RE: Function to calculate valve motion velocity

The link below has the formulas.

Valve velocity ==> Three point rule for f'(x)

Valve acceleration ==> Three point rule for f'(x)

for jerk apply the f'(x) above to the velocity values instead of the position values.

h= increment


http://math.fullerton.edu/mathews/n2003/NumericalDiffMod.html

RE: Function to calculate valve motion velocity

(OP)
That is exactly what I was looking for, thanks.

Also thanks for posting "h= increment" I was trying to figure out what the characters represented. Any other tips would be appriciated.

Jonathan T. Schmidt
http://www.schmidtmotorworks.com

RE: Function to calculate valve motion velocity

Yes, I have another tip.

A star to someone who really helped you is always a good move.

Regards

eng-tips, by professional engineers for professional engineers
Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips Fora.

RE: Function to calculate valve motion velocity

motorsportdesign:  If you use excel i have put a file up at
http://cronik.orcon.net.nz/files/Valve%20Motion.xls
that contains the (hopefully) correct formulas.
Plug your data in and redo the charts and you should be away.
I haven't used any particular units so you will probably need to scale them to suit.

Another point is that by the time you get to the third derivative (jerk) the cumulative error might be getting to a point where it is significant. But at least you will have a general idea where things are headed.

HTH

RE: Function to calculate valve motion velocity

You could connect the position points using a Cubic Spline Interpolation.  This has the advantage that third order equations exist continously which can be differentiated to give smoothed values for velocity, acceleration and jerk.

RE: Function to calculate valve motion velocity

(OP)
sried "You could connect the position points using a Cubic Spline Interpolation.  This has the advantage that third order equations exist continously which can be differentiated to give smoothed values for velocity, acceleration and jerk."

I think you are on to something, the more I look at this, it becomes clear that using 3 points isn't enough to find the slope at point two.

I would like to do the Cubic Spline Interpolation (or maybe Quintic) but I don't know how to write the formula for either. I ordered a book on splines, any pointers would be appriciated.




http://www.imagehosting.com/out.php/i772196_3point.JPG

Jonathan T. Schmidt
http://www.schmidtmotorworks.com

RE: Function to calculate valve motion velocity

(OP)
Cronic, thanks for the spreadsheet, what do you think about the use of more than three points?

Jonathan T. Schmidt
http://www.schmidtmotorworks.com

RE: Function to calculate valve motion velocity

Numerical Recipes in C has a decent explanation of Cubic Spline Interpolation.

http://www.nrbook.com/a/bookcpdf.php

I'd suggest that you try to find a Math Package that does a Cubic Spline Interpolation.  You are correct that you may need a higher order function as a Cubic Spline connects acceleration at points to be equal in direction but not in magnitude.

RE: Function to calculate valve motion velocity

Try plotting your data and getting Excel to determine the trendline.  When you're graphically satisfied with the fit, have Excel write the formula.  Copy the formula, paste it into a cell, and parse it such that you can construct the differentials.

See http://www.eng-tips.com/viewthread.cfm?qid=184726&page=1


Norm

RE: Function to calculate valve motion velocity

(OP)

How about if I use a general conic equation from five points?

x     y
0.0   0.1
0.25  0.2
0.5   0.3
0.75  0.7
1.0   0.9

(32 * x^2)+(-120* x*y)+(100*y^2)+(12*x)+(1)  =  0

Can someone show me how to write an equation to get the:

velocity in y axis
acceleration in y axis
jerk (change in acceleration) in y axis

at 0.5 (the third point)?

Jonathan T. Schmidt
http://www.schmidtmotorworks.com

RE: Function to calculate valve motion velocity

You differentiate the equation.  Go to

http://www.hostsrv.com/webmab/app1/MSP/quickmath/02/pageGenerate?site=mathcom&s1=calculus&;s2=differentiate&s3=basic

However with a second order equation, you will have a velocity equation, the acceleration will be a constant and the jerk will be zero.

The cubic spline is an improvement since third order equations are strung together (there is a new cubic equation between every two points).  You can differentiate every equation to give

First derivative = Second Order Equation for velocity.

Second derivative = First order equation for acceleration.

Third derivative = A constant Jerk in the interval.

RE: Function to calculate valve motion velocity

(OP)
sried,

Yes, now I get it, the conic won't work I need to use a cubic spline instead.

Now I will focus on figuring out how to do that.
I ordered a book on splines, I hope I can figure it out from that.

Jonathan T. Schmidt
http://www.schmidtmotorworks.com

RE: Function to calculate valve motion velocity

Drilling down through previous posts here, you will find this website.

http://www.xlxtrfun.com/XlXtrFun/XlXtrFun.htm

An Excel add on that will give you Cubic Spine Interpolation and the first and second derivatives (Velocity and Acceleration).  Hopefully, cells will contain the second derivative equations so you can get the jerk.

RE: Function to calculate valve motion velocity

Consider buying The Cam Design Book.  It comes with 90 day cam design software.  Chapter 10 is really about automotive cam design and is awesome.

http://www.designofmachinery.com/

RE: Function to calculate valve motion velocity

(OP)
sried,

Thanks for the link, it does have a good spreadsheet to learn from but the code is buried in an xll and dll file.
The dll has two functions

ddydx

Returns the second derivative of the interpolated curve at the given X using the defaults of Interpolate

dydx

Returns the first derivative of the interpolated curve at the given X using the defaults of Interpolate


I guess I can use the functions but would prefer to code them myself if possible.

My cam handbook just arrived in the mail, maybe it has some functions.

Jonathan T. Schmidt
http://www.schmidtmotorworks.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources