Skip to content

Smoothing Motor Readback

Freddie Akeroyd edited this page Jan 18, 2022 · 15 revisions

Several Galil systems use analogue feedback as the encoder, this is effectively an absolute encoder (so no need to rehome etc) but the readback can be noisy and this has caused issues in the past with setpoints looking like they are drifting.

To solve this issue, the readbacks can be smoothed using an EPICS compress record and this fed into the motor record by using its optional readback link functionality. So the motor record internally sets values as usual, but using a different route for readback. A few notes on the system:

  • the motor record REP field is monitored via the _EPOS_CALC PV, stored in a circular buffer in a compress record and then a configurable number are averaged to provide an EPOS_AV PV. The linking is done via a channel access monitor, so assumes that the readback is noisy and that the noisy rate is sufficient to generate a good number of values to average. It would be possible to explicitly scan this record if you wished to average a less noisy signal.
  • when the motor record is using the readback link, it is in "no encoder" mode i.e. it thinks it is in open loop. The only visible effect of this is that on startup it didn't sync the last setpoint to the current readback, this has been resolved by forcing a delayed write to the motor record SYNC field after ioc startup (see _EPOS_INIT and _EPOS_SYNC PVs). This needs to be delayed so channel access and other things have started.
  • a readback delay needs to be set on the motor record, this is because the compress record averaged values will be a bit biased by the motion that has just occurred otherwise and so any retry calculation distance will be incorrect.

For with setup of MTR0105 for example you would

  • have a non-zero max retries count - default is 10
  • set a readback delay, currently using 5 seconds
  • set readback resolution to 1
  • set a readback link value - for MTR0105 on WISH this is IN:WISH:MOT:MTR0105:EPOS_AV CP MS
  • set use encoder to no (do this before setting readback)
  • set use readback to yes
Clone this wiki locally