tripipy icon indicating copy to clipboard operation
tripipy copied to clipboard

goto(x,wait=False) Motor does not move, output disabled

Open AndyThirtover opened this issue 4 years ago • 1 comments

Here's the goto function:

def goto(self, targetpos, wait=True):
    self.md.enableOutput(True)
    self.md.writeInt('XTARGET',int(self.ustepsPerRev*targetpos))
    if wait:
        self.wait_reached()
    self.md.enableOutput(False)

If wait is False the output is immediately disabled and hence the motor does not move

I've made another two functions:

def async_goto(self, targetpos):
    self.md.enableOutput(True)
    self.md.writeInt('XTARGET',int(self.ustepsPerRev*targetpos))

def are_we_there_yet(self):
    return self.md.readInt('XACTUAL') - self.md.readInt('XTARGET')

Although this works, I don't consider it elegant, perhaps the name of the second function should be diff_from_target.

Physical tests are showing the the motor and driver are not getting hot.

Regards

Andy

AndyThirtover avatar Jul 20 '19 12:07 AndyThirtover