bluesky / hklpy

Diffractometer computation library with ophyd pseudopositioner support
https://blueskyproject.io/hklpy
BSD 3-Clause "New" or "Revised" License
4 stars 12 forks source link

units & offset updates not correct in Diffractometer #128

Closed prjemian closed 3 years ago

prjemian commented 3 years ago

Example was revised and tested. The tests have exposed some problems with how changes in units and offset are handled by the Diffractometer() class.

Need to revise how Diffractometer() responds to changes in units and offset signals. One problem observed is how the energy signal is affected when offset is changed.

Originally posted by @prjemian in https://github.com/bluesky/hklpy/issues/121#issuecomment-824388061

prjemian commented 3 years ago

Several things are off:

prjemian commented 3 years ago

When testing including a real EPICS IOC, used PVs from a soft IOC in lieu of a real monochromator. Here's the test daatabase record file for EPICS softIoc -d registers.db test command"

# file: registers.db
#
# purpose: test example for issue #72
# connect control system energy with diffractometer

record(ao, "EPICS:energy") {
  field(DESC, "monochromator energy")
  field(PREC, 5)
  field(EGU, "keV")
  field(VAL, 12.0)
}

record(ao, "EPICS:energy:offset") {
  field(DESC, "monochromator energy offset")
  field(PREC, 5)
  field(EGU, "keV")
  field(VAL, 0.0)
}

record(bo, "EPICS:energy:lock") {
  field(DESC, "lock hkl to mono?")
  field(ONAM, "locked")
  field(ZNAM, "unlocked")
  field(VAL, 0)
}