         // avoid polling millis too often
         for (int i=0; i<10; i++) onestep(pulse);
     }
-    for (int i=0; i<accelSteps; i++) {
+    for (int i=0; i<(accelSteps - (decelDiff * recentre)); i++) {
         onestep(map(i, 0, accelSteps, pulse, startstoppulse));
     }
     if (recentre) findsensor(startstoppulse);

        // TODO log map
        onestep(map(i, 0, glisssteps, startpulse, endpulse));
    }
    for (int i=0; i<accelSteps; i++) {
        onestep(map(i, 0, accelSteps, endpulse, max(maxPulse, endpulse)));
    }
    findsensor(max(maxPulse, endpulse));

// speeds
#define pulseWidth      5
#define accelSteps     90
#define decelDiff      10 // shorten decel to be sure of finding sensor
#define halfTurnSteps 200 // steps for a half turn
#define minPulse      500
#define maxPulse     2500
