forked from M-Labs/artiq
1
0
Fork 0

suservo: document class arguments

This commit is contained in:
Robert Jördens 2018-05-14 14:59:55 +02:00
parent 976bb5e935
commit 4ddb29fa02
1 changed files with 21 additions and 7 deletions

View File

@ -16,6 +16,18 @@ COEFF_SHIFT = 11
class SUServo: class SUServo:
"""Sampler-Urukul Servo configuration device.
:param channel: RTIO channel number
:param pgia_device: Name of the Sampler PGIA gain setting SPI bus
:param cpld0_device: Name of the first Urukul CPLD SPI bus
:param cpld1_device: Name of the second Urukul CPLD SPI bus
:param dds0_device: Name of the AD9910 device for the DDS on the first
Urukul
:param dds1_device: Name of the AD9910 device for the DDS on the second
Urukul
:param core_device: Core device name
"""
kernel_invariants = {"channel", "core", "pgia", "cpld0", "cpld1", kernel_invariants = {"channel", "core", "pgia", "cpld0", "cpld1",
"dds0", "dds1", "ref_period_mu"} "dds0", "dds1", "ref_period_mu"}
@ -162,14 +174,16 @@ class SUServo:
class Channel: class Channel:
"""SU-Servo channel""" """Sampler-Urukul Servo channel
:param channel: RTIO channel number
:param servo_device: Name of the parent SUServo device
"""
kernel_invariants = {"channel", "core", "servo", "servo_channel"} kernel_invariants = {"channel", "core", "servo", "servo_channel"}
def __init__(self, dmgr, channel, servo_device, def __init__(self, dmgr, channel, servo_device):
core_device="core"):
self.core = dmgr.get(core_device)
self.servo = dmgr.get(servo_device) self.servo = dmgr.get(servo_device)
self.core = self.servo.core
self.channel = channel self.channel = channel
# FIXME: this assumes the mem channel is right after the control # FIXME: this assumes the mem channel is right after the control
# channels # channels
@ -243,14 +257,14 @@ class Channel:
Where: Where:
* :math:`y_n` and :math:`y_{n-1}` are the current and previous * :math:`y_n` and :math:`y_{n-1}` are the current and previous
filter outputs, clipped to :math:`[0, 1]`. filter outputs, clipped to :math:`[0, 1]`.
* :math:`x_n` and :math:`x_{n-1}` are the current and previous * :math:`x_n` and :math:`x_{n-1}` are the current and previous
filter inputs filter inputs
* :math:`o` is the offset * :math:`o` is the offset
* :math:`a_0` is the normalization factor :math:`2^{11}` * :math:`a_0` is the normalization factor :math:`2^{11}`
* :math:`a_1` is the feedback gain * :math:`a_1` is the feedback gain
* :math:`b_0` and :math:`b_1` are the feedforward gains for the two * :math:`b_0` and :math:`b_1` are the feedforward gains for the two
delays delays
.. seealso:: :meth:`set_iir` .. seealso:: :meth:`set_iir`