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

32-bit limitation on raw motor positions #192

Open
kmpeters opened this issue Nov 17, 2022 · 4 comments
Open

32-bit limitation on raw motor positions #192

kmpeters opened this issue Nov 17, 2022 · 4 comments
Milestone

Comments

@kmpeters
Copy link
Member

The RRBV, REP, and RMP are currently limited to 32 bits:

field(RRBV,DBF_LONG) {
prompt("Raw Readback Value")
special(SPC_NOMOD)
}
field(RMP,DBF_LONG) {
prompt("Raw Motor Position")
special(SPC_NOMOD)
}
field(REP,DBF_LONG) {
prompt("Raw Encoder Position")
special(SPC_NOMOD)
}

Changing the fields from DBF_LONG to DBF_INT64 will break compability with EPICS base 3.15. Higher-resolution encoders are going to be increasingly common.

@kmpeters kmpeters modified the milestones: Future, R8-0 May 23, 2023
@tboegi
Copy link
Contributor

tboegi commented Jun 18, 2024

I stumbled accross the same problem while working with a piezo stage.
My feeling is that we could add additionally fields in double.
This is what the existing model 3 driver already support, so that
changes in the existing driver(s) are not needed.
And a double can hold 48 raw bits.

Something like FRBV, FRMP, FREP.
What do you guys think ?
@kmpeters @mp49 @MarkRivers

@MarkRivers
Copy link
Member

I would be interested to know what would break if RRBV, etc. were changed to double and the motor record modified accordingly. It could still treat them as integers, but the number of effective bits would be 52 rather than 32. Would that affect drivers?

@kmpeters
Copy link
Member Author

I stumbled accross the same problem while working with a piezo stage. My feeling is that we could add additionally fields in double. This is what the existing model 3 driver already support, so that changes in the existing driver(s) are not needed. And a double can hold 48 raw bits.

Something like FRBV, FRMP, FREP. What do you guys think ? @kmpeters @mp49 @MarkRivers

I don't think adding extra asyn parameters & records solves the problem. The motor record thinks the motor is moving in the wrong direction when the raw position rolls over when it hits 32 bits.

The workaround we've used for encoders higher than 32-bits is to convert the raw encoder reading into motor units and use it in the RDBL input of the motor with URIP=Yes.

@tboegi
Copy link
Contributor

tboegi commented Jun 19, 2024

@MarkRivers Changing RRBV, REP and RMP into double does not give any compilation warnings for
all motor modules.
However, I didn't change devMotorAsyn.c to utilize the extra bits available in the motorRecord.

All in all, the RDBL solution seems a good way forward to me, thanks @kmpeters

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

3 participants