Skip to content

Communication Interfaces

The MTS160 supports multiple communication interfaces for integration with various control systems:

  • Serial Communication (RS232)
  • CAN Communication
  • USB (for configuration and testing)

The MTS160 features a unique multi-interface, multi-protocol communication port that uses only two shared pins or the 4-pin connector. The choice of the protocol and interfaces are software selectable.

Internal Interface Switching Circuit

Serial Communication

Serial communication is the factory default mode. It operates in full duplex mode with:

  • 8 data bits
  • No parity
  • One stop bit
  • No flow control
  • No command echo

Serial Protocol

The MTS160 uses a custom ASCII based serial protocol, based on a command-response model with the following structure:

Command PrefixCommand CodeComma Seperated Fields Carriage Return (\r)

where:

  • Command Prefix: Indicates the type of command
  • Command: 4 letter command code (not case sensitive)
  • Fields: Optional values for the command

Command Prefixes

PrefixTypeDescription
!SetExecute actions or set configuration parameters
?GetRequest sensor data or read configuration
#RepeatLike Get, but repeats at specified interval
@StopStops all running repeat commands

Examples

For Set commands (!):

Command: !COMMAND
Response: !COMMAND,OK

For Get commands (?):

Command: ?COMMAND
Response: ?COMMAND,data1,data2,...

For Repeat commands (#):

Command: #COMMAND,interval_ms
Response: ?COMMAND,data1,data2,... (repeating)

Serial Commands Reference

Commands Overview

Action Commands

CommandDescriptionAccess
ZEROCalibrate Zero LevelWrite
STSTExecute Self-TestWrite
SAVESave current configuration to internal memoryWrite
RSETReset to Factory DefaultsWrite

Data Request Commands

CommandDescriptionAccess
FWVRFirmware VersionRead
HWVRHardware VersionRead
SNIDSensor IDRead
NVCDNavicode MarkerRead
RSENRaw Sensor ValuesRead
SALLAll Sensor DataRead
STRSSelf-Test ResultsRead
TWIDTape Magnetic WidthRead

Configuration Commands

CommandDescriptionAccess
CMCFCommunication ModeRead/Write
RSCFRS232 ConfigurationRead/Write
CNCFCAN ConfigurationRead/Write
SNCFSensor ConfigurationRead/Write

Data Request Commands

FWVR

Description: Firmware Version
Access: Read

ParameterDescriptionTypeFormat
versionFirmware Versionuint32_t010203 = v1.2.3
buildFirmware Builduint32_t-
hashFirmware Hashuint32_t-

HWVR

Description: Hardware Version
Access: Read

ParameterDescriptionTypeRange
versionHardware Versionuint8_t-

SNID

Description: Sensor ID
Access: Read

ParameterDescriptionTypeRange
idSensor IDuint32_t-

NVCD

Description: Navicode Marker
Access: Read

ParameterDescriptionTypeRange
navicodeNavicodeuint16_t0-65535
countNavicode Counteruint8_t0-255

RSEN

Description: Raw Sensor Values
Access: Read

ParameterDescriptionTypeUnits/Range
frontFront Sensor Valuesint16_t[16]±16000 mT
backBack Sensor Valuesint16_t[16]±16000 mT

RAWS

Description: Raw Sensor Values (Unzeroed)
Access: Read

ParameterDescriptionTypeUnits/Range
frontFront Sensor Valuesint16_t[16]±16000 mT
backBack Sensor Valuesint16_t[16]±16000 mT

SALL

Description: All Sensor Data
Access: Read

ParameterDescriptionTypeRange
tape_detectTape Detectionuint8_t0=No Tape, 1=Tape Detected
left_posLeft Tape Positionint8_t±80 mm
right_posRight Tape Positionint8_t±80 mm
left_angleLeft Tape Angleint8_t±90°
right_angleRight Tape Angleint8_t±90°
left_marker_detectedLeft Marker Detecteduint8_t0-1
right_marker_detectedRight Marker Detecteduint8_t0-1
fork_detectedFork Detecteduint8_t0-1
merge_detectedMerge Detecteduint8_t0-1
intersection_detectedIntersection Detecteduint8_t0-1
left_marker_xy_positionx/y position of left marker in deci-mmint16_t[2]-
right_marker_xy_positionx/y position of right marker in deci-mmint16_t[2]-
countPacket Countuint8_t0-255

WARNING

Fork, Merge and Intersection Detection flags are not yet active

STAT

Description: Sensor Status
Access: Read

ParameterDescriptionTypeRange
statusSensor Statusuint8_t-

STRS

Description: Self-Test Results
Access: Read

ParameterDescriptionTypeRange
resultSelf-test Resultuint8_t0=Fail, 1=Pass
min_deltaMinimum magnetic field deltauint16_t-
max_deltaMaximum magnetic field deltauint16_t-

STPF

Description: Self-Test Pass/Fail
Access: Read

ParameterDescriptionTypeRange
resultPass or Failuint8_t0=Fail, 1=Pass

TWID

Description: Tape Magnetic Width
Access: Read

ParameterDescriptionTypeRange
validFlag if magnetic width is validuint8_t0-1
magnetic_widthWidth of magnetic tape at pulse thresholduint16_tdeci-mm

PTVL

Description: Production Test Values
Access: Read

ParameterDescriptionTypeUnits
led_left_vfLeft LEDs RGB Vfuint16_t[3]mV
led_right_vfRight LEDs RGB Vfuint16_t[3]mV
can_low_idleCAN Low Idle Voltageuint16_tmV
can_high_idleCAN High Idle Voltageuint16_tmV
can_loopbackCAN Loopback Testuint8_t0=Fail, 1=Pass
rs485_v_highRS485 High Voltageuint16_tmV
rs485_v_lowRS485 Low Voltageuint16_tmV
rs485_loopbackRS485 Loopback Testuint8_t0=Fail, 1=Pass
rs232_v_highRS232 High Voltageuint16_tmV
rs232_v_lowRS232 Low Voltageint16_tmV
rs232_loopbackRS232 Loopback Testuint8_t0=Fail, 1=Pass
power_v55V Power Supply Voltageuint16_tmV
power_v5_current5V Power Supply Currentuint16_tmA
power_v_inInput Voltageuint16_tmV
hall_sensors_idleHall Sensors Idle Valuesuint16_t[32]mV
hall_sensors_deltaHall Sensors Delta Valuesuint16_t[32]mV

AMON

Description: Analog Monitoring Values
Access: Read

ParameterDescriptionTypeUnits
v_inInput Voltageuint16_tmV
v_5v5V Supply Voltageuint16_tmV
i_5V5V Supply Currentuint16_tmA
v_data_lowData Low Line Voltageuint16_tmV
v_data_highData High Line Voltageuint16_tmV
v_led_highLED High Voltageuint16_tmV
v_led_lowLED Low Voltageuint16_tmV
mcu_tempMCU Temperatureint8_t°C

CNER

Description: CAN Error Counter
Access: Read

ParameterDescriptionTypeRange
tx_errorCAN TX Error Counteruint8_t0-255
rx_errorCAN RX Error Counteruint8_t0-255

Configuration Commands

CMCF

Description: Communication Mode
Access: Read/Write

ParameterDescriptionTypeOptionsDefault
com_modeCommunication Protocoluint8_t0=RS232, 1=CANopen0

RSCF

Description: RS232 Configuration
Access: Read/Write

ParameterDescriptionTypeOptionsDefault
baudrateBaudrateuint32_t9600, 19200, 38400, 57600, 115200115200
invertedInverteduint8_t0=False, 1=True0

CNCF

Description: CAN Configuration
Access: Read/Write

ParameterDescriptionTypeOptions/RangeDefault
node_idNode IDuint8_t1-1271
baudrateBaudrateuint32_t125000, 250000, 500000, 1000000125000
auto_runAuto Runuint8_t0=False, 1=True0
en_terminationEnable Termination Resistoruint8_t0=False, 1=True0
heartbeat_periodHeartbeat Perioduint16_t0-65536 ms1000
tpdo1_enableTPDO1 Enableuint8_t0-1-
tpdo1_periodTPDO1 Perioduint16_t0-65536 ms0
tpdo2_enableTPDO2 Enableuint8_t0-1-
tpdo2_periodTPDO2 Perioduint16_t0-65536 ms0
tpdo3_enableTPDO3 Enableuint8_t0-1-
tpdo3_periodTPDO3 Perioduint16_t0-65536 ms0

SNCF

Description: Sensor Configuration
Access: Read/Write

ParameterDescriptionTypeOptions/RangeDefault
polarityTape Polarityuint8_t0=North/South, 1=South/North0
tape_detect_thresholdTape Detection Thresholduint16_tμT-
tape_pulse_thresholdTape Detection Threshold as % of peakuint8_t0-100 %50
marker_thresholdMarker Thresholduint16_tμT50
auto_widthAuto tape width detectionuint8_t0=False, 1=True-
tape_magnetic_widthTape Magnetic Width at pulse thresholduint16_tdeci-mm-

CAN Communication

The MTS160 implements CANOpen protocol for seamless integration with industrial control systems.

TPDO Communication

Three Transmit Process Data Objects (TPDOs) are available:

1. "Sense" TPDO (0x180 + NodeID)

ByteContentTypeRange
1Left PositionS8±80 mm
2Right PositionS8±80 mm
3Left AngleS8±90°
4Right AngleS8±90°
5Status FlagsU8See below

Status Flags:

Bit 7: Merge Detect
Bit 6: Fork Detect
Bit 5: Intersection Detect
Bit 4: Right Marker Detect
Bit 3: Left Marker Detect
Bit 2-1: Tape Detect (2 bits)
Bit 0: Fault Detect

WARNING

Fork, Merge and Intersection Detection flags are not yet active

2. "Marker" TPDO (0x280 + NodeID)

BytesContentTypeScale
1-2Left Marker X PositionS16x0.1 mm
3-4Left Marker Y PositionS16x0.1 mm
5-6Right Marker X PositionS16x0.1 mm
7-8Right Marker Y PositionS16x0.1 mm

3. "Navicode" TPDO (0x380 + NodeID)

ByteContentTypeRange
1-2NavicodeU160-65535
3CounterU80-255

SDO Objects

IndexSubNameTypeAccessDescription
0x20000ZEROU8WOSet zero point
0x20010SELFTESTU8WOTrigger self-test
0x20021TAPE_POLARITYU8RWTrack polarity
0x20022TRACK_THRESHOLDU8RWTrack detection threshold
0x20023MARKER_THRESHOLDU8RWMarker detection threshold
0x20031SELFTEST_RESULTU8ROSelf-test pass/fail
0x20032MIN_MAGNETIC_DELTAU8ROMinimum sensor response
0x20033MAX_MAGNETIC_DELTAU8ROMaximum sensor response

Simple CAN Implementation

For systems without CANOpen support, the sensor can operate in a simplified mode:

  1. Configure desired TPDOs and enable Auto-Run using PC Utility
  2. Parse incoming frames using this structure:

To identify frames:

  1. Extract Node ID: frame.id & 0x7F
  2. Extract TPDO type: frame.id & 0xFF80
    • 0x180: Sense TPDO
    • 0x280: Marker TPDO
    • 0x380: Navicode TPDO

EDS File

A CANOpen Electronic Data Sheet (EDS) file is available at naviq.com for network integration.

USB Interface

The USB interface appears as a virtual COM port and supports:

  • All serial commands
  • PC Utility connection
  • Firmware updates
  • Configuration changes
  • Data logging

Note: While functionally identical to RS232, USB is not recommended for permanent robot integration.