# $Header: https://oberon.oapd.inaf.it/shins/trunk/shins/etc/motion_ctrl/wheels/motion_ctrl.wheels.nd_filt_w-dev.cfg 3864 2022-03-28 07:32:22Z depa $

LOAD                                  = [NAME=ND_FILT_W, LIB=BasdaMoccaMpiaNDevice]

#
# connection address: tcp://HOST:PORT or tty:/dev/ttyS0:9600:8:no
#

MOD.WH1.CFG.CONNECTION.ADDRESS          = tcp://192.168.61.52:4000

#
# the used MoCon card
#

MOD.WH1.CFG.CONNECTION.CARD             = 1

#
# the used MoCon module
#

MOD.WH1.CFG.CONNECTION.MODULE           = 2

MOD.WH1.CFG.CONNECTION.TIMEOUT:Time     = 00:00:03.000000      +UNIT=hour                             # its the time how long the service should wait for a normal command response like ACK (this timeout is blocking the service but the MoCon sends the ACK immediately)
MOD.WH1.CFG.CONNECTION.EVENT_TIMEOUT:Time = 00:00:00.500000    +UNIT=hour                             # its the time how long the service should wait for a event message (Pay attention: this timeout blocks the service while it is waiting for an event which might not send immediately)
MOD.WH1.CFG.CONNECTION.UPLOAD_TIME:Time = 00:00:00.008541000   +UNIT=hour                             # this time needs to be measured in advance to calculate the correct timing for the net profile block upload

#
# enter the motor datasheet config file here either with absolute path or
# just the config file. The TwiceAsNice parser will try to locate the file.
#

MOD.WH1.CFG.DATASHEET.CONFIG            = motion_ctrl/wheels/motion_ctrl.wheels-dev_WH_datasheet_new.cfg

#
# the travel range of the module in steps
#

#MOD.WH1.CFG.DATASHEET.TRAVELRANGE:Point = [-33000.0, 33000.0]  +UNIT=steps  +LABEL=["MIN", "MAX"]

CFG.ONEWAY:Bool      = 0
CFG.FULLTURN = 1985482  +UNIT=steps  +LABEL="FULLTURN"

# this velocity is used to scan all position reference switches;
# not all position switches will be detected when the velocity is to fast,
# on the other hand the position switch scan will take a long time when the
# velocity is to slow
CFG.SCAN_VELOCITY:Double = 100.0

#
# the switch width is the distance where the reference signals are returned
#

CFG.SWITCHWIDTH = 60

#
# switch depth is the bit depth of the reference switches
#

CFG.SWITCHDEPTH = 8
CFG.SWITCHMASK = 0b11111000:8


# device configuration parameter to define which position value should be periodically updated
# default: 0 MoCon internal software Encoder
#          1 incremental Encoder
#          2 absolute Encoder
#          3 MoCon internal software Encoder + incremental Encoder
#          4 MoCon internal software Encoder + absolute Encoder
#          5 incremental Encoder + absolute Encoder
#          6 MoCon internal software Encoder + incremental Encoder + absolute Encoder
CFG.POSITION.AUTOUPDATE:Int          = 0

# device configuration parameter to define which position value should be returned by
# getPosition or displayed in the GUI
# default: 0 MoCon internal software Encoder
#          1 incremental Encoder
#          2 absolute Encoder
CFG.POSITION.REPORT:Int              = 0

# device configuration parameter to define in which unit the position value should be returned. The value is the index of the CFG.TRANS
CFG.POSITION.UNIT                    = STEPS

#
# device configuration parameter
#
# Depending on how many named position you like to have add here the properties with the positions values and the labels.
# The labels are used to display them in the GUI. The position values are the absolute target positions of the motor in steps.
# The property of the named position needs to be numbered serially.
#

CFG.NAMED_POS.ABS.0:Int           =        0              +LABEL=["FWheel"]   +NAME="OD4"
CFG.NAMED_POS.ABS.1:Int           =   250000              +LABEL=["FWheel"]   +NAME="HOLE"  # proposed 248185
CFG.NAMED_POS.ABS.2:Int           =   496371              +LABEL=["FWheel"]   +NAME="OD0_2"
CFG.NAMED_POS.ABS.3:Int           =   744556              +LABEL=["FWheel"]   +NAME="OD0_5"
CFG.NAMED_POS.ABS.4:Int           =   992742              +LABEL=["FWheel"]   +NAME="OD1"
CFG.NAMED_POS.ABS.5:Int           =  1240927              +LABEL=["FWheel"]   +NAME="OD1_3"
CFG.NAMED_POS.ABS.6:Int           =  1489113              +LABEL=["FWheel"]   +NAME="OD2"
CFG.NAMED_POS.ABS.7:Int           =  1737298              +LABEL=["FWheel"]   +NAME="OD3"

#
# This is the named position for relative movements. It can be used in engineering mode in order to move the motor to a relative position several times.
# without to edit the target position permanently.
#

#CFG.NAMED_POS.REL.0:Int           = 800                 +LABEL=["FWheel"]   +NAME="Rel. 0"

#
# This are the position switch codings for the single named positions
#


#
# It follows the definition of the coordination transformation
# from the focal plane in the motor coordinate system.
# It is also used to convert to different units.

CFG.TRANS.STEPS:Point                  = [1, 0]               +LABEL=["Scale", "Offset"] +PREC=0
CFG.TRANS.DEGREE:Point                  = [1.81316e-4, 0]      +LABEL=["Scale", "Offset"] +PREC=1
#CFG.TRANS.MM:Point                     = [10, 0]              +LABEL=["Scale", "Offset"] +PREC=2
