In [ ]:
from __future__ import print_function
from math import pi
#Acme rod specs
pitch = 2 #millimeters
numStarts = 4
lead = numStarts*pitch/10.0 #cm
#Syringe specs
syringeDiameter = 26.7 #millimeters
syringeArea = pi*(syringeDiameter/10.0)**2/4.0 #cm^2
#Motor specs
microSteps = 16
stepsPerRev = 200
numSteps = stepsPerRev*microSteps#200 steps with 1/8 microstepping
resolution = lead*syringeArea/numSteps #mL\n"
print (u"{:0.3f} \u03bcL resolution".format(resolution*1000))
In [ ]:
def computeRewardTime(desiredVolume): #desired volume in mL
volumePerStep = resolution #mL
msPerStep = 2 #ms
stepsNeeded = desiredVolume/volumePerStep #steps
return round(stepsNeeded*msPerStep,2)