Menu

SShapeRamping

Anonymous

Introduction

S-Shape acceleration can be achieved with the use of a sigmoid function in the expression of the speed with respect to time. A commonly used function is the function v(t) = 1 / (1+exp(-t)) depicted in Figure 1.

-->

Details

A common implementation consists in giving to acceleration a(t) the shape depicted in Figure 2, yielding in a S-Shape ramping for the speed, as speed is the integral of acceleration. Actually, dv/dt=a(t) depicted in Figure 1 is approximated to a simpler function in parts: a(t) = j * t for 0 < t < t_1, a(t) = j * t_1 for t_1 < t < t_2, a(t) = j * (t_1 - t) for t_2 < t < t_2 + t_1. *

-->

The discretization of the above function in parts for a(t) is straightforward, hence the computation of v(t). For a stepper motor, v(t) is the angular speed. From v(t) we can simply deduce the expression for the step interrupt timer register: treg(t) = (360/steps360) * (1 / (TIMERPERIOD * v(t))) where v(t) is expressed in degrees/sec, steps360 is the number of steps of the stepper motor, and TIMERPERIOF is the period of the timer in seconds.