# call $ bin/frappy-server razorbillUC220T
# in frappy directory, with python with frappy libraries installed.

Node('UC220T.psi.ch',
     'A Razorbill UC220T controlled by a RP100 high voltage powersupply and a ACM1219 (AD7746) capacitance meter',
      interface='tcp://5123')

Mod('io1',
    'frappy_psi.RP100.RP100IO',
    'communication',
    uri='serial:///dev/ttyACM0?baudrate=9600+bytesize=8+parity=none+stopbits=1')
Mod('V1',
    'frappy_psi.RP100.VoltageChannel',
    'Voltage Channel 1',
    temp='T',
    io='io1',
    target=Param(min=-200, max=200),
    max_target=120,
    min_target=-20,
    slew_rate=100,
    channel=1)
Mod('V2',
    'frappy_psi.RP100.VoltageChannel',
    'Voltage Channel 2',
    temp='T',
    io='io1',
    target=Param(min=-200, max=200),
    max_target=120,
    min_target=-20,
    slew_rate=100,
    channel=2)

Mod('io2',
    'frappy_psi.ACM1219.ACM1219IO',
    'communication',
    uri='serial:///dev/ttyUSB0?baudrate=9600+bytesize=8+parity=none+stopbits=1')
Mod('C1C2',
    'frappy_psi.ACM1219.BothChannels',
    'Capacitance channels 1 and 2',
    io='io2')
Mod('d',
    'frappy_psi.ACM1219.Displacement',
    'razorbill displacement from capacitance',
    cap='C1C2',
    channel=1,
    alpha290K=56.710,
    d0=95.443,
    Cp=0.01883,
    d0_curve={'a':4.21,'b':-0.00157,'c':-3.38e-5,'d':5.28e-8,'e':-6.93e-11},
    temp='T')
Mod('F',
    'frappy_psi.ACM1219.Force',
    'razorbill force from capacitance',
    cap='C1C2',
    channel=2,
    alpha290K=374.23,
    f0=315.63,
    Cp=0.0755,
    f0_curve={'a':38.9,'b':-0.0147,'c':-0.000346,'d':8.96e-7,'e':-1.58e-9},
    temp='T')
Mod('stress',
    'frappy_psi.ACM1219.Stress',
    'Sample stress from force',
    force='F',
    area=0.1,
    )
Mod('strain',
    'frappy_psi.ACM1219.Strain',
    'Sample strain from force',
    displacement='d',
    L=3,
    )
Mod('YM',
    'frappy_psi.ACM1219.YoungsModulus',
    'Sample youngs modulus from stress and strain',
    stress='stress',
    strain='strain',
    )

Mod('T',
    'frappy_psi.dummy.Temp',
    'dummy T written from client',
    target=Param(min=1, max=325),
    )
