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

Allow for getting current position when stepper motor is moving #691

Closed
alexdewar opened this issue Nov 5, 2024 · 2 comments · Fixed by #743
Closed

Allow for getting current position when stepper motor is moving #691

alexdewar opened this issue Nov 5, 2024 · 2 comments · Fixed by #743
Assignees

Comments

@alexdewar
Copy link
Collaborator

alexdewar commented Nov 5, 2024

Currently we're using the SP command, which retrieves the set position. However, it won't work if the motor is moving, so we return None in this case. There's also a similar artificial limitation in the DummyStepperMotor device for testing purposes.

It would be useful to know the motor's position even while it's moving, though: if we could record this information in the CSV file then that's potentially extra data and it would be useful to be able to see the position in the GUI too (#583).

According to the manual, there is another command -- IP -- which retrieves the immediate (estimated) position, with this caveat: "This is the calculated trajectory position, which is not always equal to actual
position."

It would be worth playing with this to see if we can just replace SP with IP. Alternatively, we could just use IP only when the motor is moving.

@alexdewar
Copy link
Collaborator Author

I've had a play with this in the lab and it seems that the IP command gives the same result as SP if the motor is stationary, but will also give a sensible-seeming intermediate value if the motor is in motion.

I hereby propose that we drop SP in favour of IP.

@dc2917
Copy link
Contributor

dc2917 commented Nov 25, 2024

Need to consider what to do for dummy stepper motor. Save current position and return that, or interpolate?

@alexdewar Let's open an issue to poll the intermediate position to update the front-end (stepper motor panel and data file writer)

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

Successfully merging a pull request may close this issue.

2 participants