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

State of TangoAttrMotorCtrl #9

Open
dschick opened this issue Jun 22, 2021 · 2 comments
Open

State of TangoAttrMotorCtrl #9

dschick opened this issue Jun 22, 2021 · 2 comments

Comments

@dschick
Copy link

dschick commented Jun 22, 2021

Hi,

we are heavily using this great sardana-tango driver in our lab but noticed an issue with the TangoAttrMotorCtrl when determining the state of the motor.

As written in the StateOne() method initially the quality of the attribute is checked.
In our self-written tango DS we only change the State of the tango DS from 'DevState.ONtoDevState.MOVING`.
I hoped that the attribute quality is adapted automatically, but it does not.

So as fallback, the TangoAttrMotorCtrl then checks the current position and the set position with the corresponding threshold value. This of course requires a bit of overhead, as our tango DS does report the State already by itself.

I was wondering what would be the best way to adapt the TangoAttrMotorCtrl or our Tango DS?
As I understand it, I would need to change the attribute.qualitiy() by myself in the TangoDS?
I would like to avoid that and instead ask then for the State of the TangoDS in the TangoAttrMotorCtrl.

My idea would be the following sequence:

  1. ask for the attribute.quality
  2. check if a threshold is set:
    1. if the threshold is zero (or better negative) it is neglected
    2. if the threshold is >(=) 0 the current and set positions are compared
  3. the State of the TangoDS will be directly used

let me know what you think of this.

Best

Daniel

@guifrecuni
Copy link

Hi, making this "general-purpose controller" more generic makes sense to me ;-D
I guess with just few properties you can make the controller fit your needs and may help somebody else in the future

@dschick
Copy link
Author

dschick commented Jun 22, 2021

just made a PR #10
works as expected for me.
One would need to agree on how the handle the encoder threshold

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