Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AndyThirtover opened this issue Jul 20, 2019 · 1 comment
Open

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

AndyThirtover opened this issue Jul 20, 2019 · 1 comment

Comments

@AndyThirtover
Copy link

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

@pootle
Copy link
Owner

pootle commented Jul 20, 2019

Well that was a silly mistake I made, but I hadn't tested more than the basics.

I'm going to update this software soon as I have a real project to use it on coming up, This current version is really just a proof of concept

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants