How to limit steepness of inv exp curve?

335 Views Asked by At

I am trying to implement a motorised system that will move an object whose velocity has the shape of an inverse exponential curve. In other words it will begin very fast and then slowly come to a halt.

I have a problem in that the initial steepness of the curve is too high meaning that the acceleration of the motor is more than it can handle. I want a gentler slope whilst still moving the same distance within the same time limit.

So I have

$$y = a(1-r)^t$$

I have rearranged this as:

$$t = \frac{\ln(y/a)}{\ln(1-r)}$$

The motor that I am using is a stepper motor which is triggered by pulses. Each pulse moves the motor one more step (with e.g. 200 steps / revolution). The faster I send pulses, the faster it moves. I therefore need to calculate how much time to wait before sending the next pulse so that the motor's velocity follows an exponential curve; starting quickly and eventually coming to a halt.

In the above equation, $y$ is the number of steps left (i.e. the height of the curve), $a$ is the total number of steps + 1, and $r$ is the rate of decay.

So if I want to move 955 steps within 3 seconds,

$$r = 1 - (1/956)^{1/3}$$

So how can I modify the equation, $t = \ln(y/a) / \ln(1-r)$ so as to soften the steepness of this curve and still stay within the boundaries of 955 steps and 3s?

Since I know what the maximum torque of the motor is, I know what the maximum acceleration it can handle is. Ideally, I'd therefore like to have an equation whose maximum steepness (ie $dy/dt$) would not exceed a given limit.

Perhaps this picture will help explain what I'm trying to do:

crude drawing of less steep curve