5
$\begingroup$

enter image description here

I am designing a two dimensional cam profiles. I want to use the "modified sine" method for drawing the position and angle changes. (see attached sketch). The modified sine curve is actually a combination of cycloidal curve at the first and last 1/8 of the curve and a sine curve in the middle 7/8 of the curve. It is easily employed when the terminal velocities are zero. However, often times it is necessary for a cam profile to simply go from one velocity (perhaps zero) to a constant terminal velocity. The terminal velocity is simply an angle on the displacement diagram.

The profile is defined by:

$$ y= \begin{cases} \frac h{4+\pi}\left(\pi\frac\theta\beta-\frac14 \sin \left(4 \pi \frac\theta\beta \right) \right), & 0\lt\theta\lt\frac18\beta \\[2ex] \frac h{4+\pi}\left(2+\pi\frac\theta\beta-\frac94 \sin \left(4\pi\frac\theta{3\beta}+\frac\pi3 \right) \right), & \frac18\beta\lt\theta\lt\frac78\beta \\[2ex] \frac h{4+\pi} \left(4+\pi\frac\theta\beta-\frac14 \sin \left(4\pi\frac\theta\beta \right) \right), & \frac78\beta\lt\theta\lt\beta \end{cases}$$

The maximum velocity which can be achieved is at $45\deg \left( \frac\pi4 \right)$ therefore, only the first half of the curve is usable for my need.

as an example,

what method would you employ to design a curve that would go from point $(0,0)$ at angle zero, to the point $(3,2)$ slope $30$ degrees.

What coefficients $h$ and $\beta$ in the above equations will create a curve such that the slope at point $(3,2)$ is equal to $\frac{30}{180}\pi$?

$\endgroup$
1
  • $\begingroup$ I think you may have some of your math wrong. The terminal velocity is not actually an angle, but rather the derivative $\frac{dy}{d\theta}$ and the maximum velocity occurs at $\theta = 0.5\beta$. I don't know if you can really solve this problem unless you give a desired slope (velocity) instead of a desired angle. Additionally, units would be much appreciated. $\endgroup$
    – regdoug
    Commented Mar 18, 2015 at 23:03

1 Answer 1

2
$\begingroup$

I would use a Hermite interpolation. It uses the following four functions:

$ h_1 = 2s^3 - 3s^2 + 1 $

$ h_2 = -2s^3 + 3s^2 $

$ h_3 = s^3 - 2s^2 + s $

$ h_4 = s^3 - s^2 $

And combines them like this:

$ output = (h_1 * startPoint) + (h_2 * endPoint) + (h_3 * gradientIn) + (h_4 * gradientOut) $

The value $ s $ in the four functions is your interpolating parameter, as it goes from $ 0 $ to $ 1 $ the $ output $ goes from your $ startPoint $ $ (0, 0) $ to your $ endPoint $ $(3, 2) $. Your $ gradientIn $ wasn't specified, but looks to be $ 0 $ and $gradientOut $ is as you specified: $tan(\frac{\pi}{6}) = \frac{1}{\sqrt{3}} $ so removing the terms that will multiply by zero (start point and gradient in):

$ x_s = (h_2 * x_{end}) + (h_4 * tan(\frac{\pi}{6})) = (h_2 * 3) + (h_4 * \frac{1}{\sqrt{3}}) $

$ y_s = (h_2 * y_{end}) + (h_4 * tan(\frac{\pi}{6})) = (h_2 * 2) + (h_4 * \frac{1}{\sqrt{3}}) $

If you want more information about this type of interpolation curve, here is a mathematical description and a more functional description.

$\endgroup$
2
  • $\begingroup$ Thanks for the work you have done. However, I do not know how to arrive at a general equation from this solution. It seems only to apply to the example. $\endgroup$ Commented Mar 17, 2015 at 22:21
  • $\begingroup$ The general equation starts "output = (h1 * startPoint) + ..." - only the bit after that is specific to your example. To understand, use 0 for startPoint and 1 for endPoint and then plot 's' as 'x' and 'output' as 'y'. Try adjusting the gradient in/out to see how the curve is affected and get a feel for it. Then you will see how easy it can be to re-parameterise 's' over multiple segments if you want to build up more complex curves (correcting the gradients for any scaling applied). $\endgroup$
    – jhabbott
    Commented Mar 18, 2015 at 2:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.