I don't think this is double intergration but I have the desired effects from using:
...
if int(d[2]) > 2700:
if x < 1400:
x += (int(d[2])-2700)/10
elif int(d[2]) < 2400:
if x > 0:
x -= (2400-int(d[2]))/10
if int(d[5]) > 2600:
if y > 0:
y -= (int(d[5])-2600)/10
elif int(d[5]) < 2400:
if y < 900:
y += (2400-int(d[5]))/10
...
Where int(d[2]) & int(d[5]) are the values from the accelerometer. And 2700, 2600, 2400 are the threshold values. 10 is the base speed.
I don't know what to call it, threshold deference maybe?