Network Servo Interface Adapters for LinuxCNC

This release requires card firmware 3.0.0 or later. Please contact me for update instructions.

Installation - Debian 12 Bookworm (PREEMPT_RT)

LinuxCNC driver v3.2.0 and up

LinuxCNC HAL driver module name is nyx. During operation the controller and SSCNET network are synchronized to servo thread of the LinuxCNC. Servo thread period should be set to

Module parameters:

The following HAL commands load the driver and add its callback function to the servo thread:

loadrt motmod servo_period_nsec=888888 ...
loadrt nyx maxdrives=6 param_file=par/j2s.par
addf nyx.0.rd servo-thread	
addf nyx.0.wr servo-thread

servo parameter file

Servo parameters are transfered to drives during initialization after LinuxCNC startup. Sample files are located in /usr/share/nyx. For MR-J*-B and SGD* parameter file is optional - drives will use values from the EEPROM. For MDS drives parameter file is mandatory.

Consult servo drive manual for parameters description.

nyx

Controller status pins:

servo

Depending on adapter the driver supports up to 16 servo amplifiers, AX number is 00 thru 15. Parameters:

Mechatrolink uses a fraction of max motor speed/torque as units during velocity control, see [NYX] section in nyx-mtl2.ini sample config for sample values.

Pins:

encoder

An encoder input channel converts quadrature signals on CN2 Phase A, Phase B, Index Z into 32-bit up/down counter values. The sampling requency is 45 MHz. NN is encoder channel: 00 or 01. Parameter:

Pins:

The interface is intended for use with motion.spindle-index-enable and motion.spindle-revs.

gpio

Digital input signals IN0..IN11 connected to CN1. Pins:

Expansion connector CN2 as GP inputs IN12..IN29. Pins:

Digital output signals OUT0..OUT7 going to CN3:

dac

2-channel 12-bit digital-to-analog converter on YEX1-A expansion board. Paramaters:

Pins:

yio

Connected YIO modules are detected, pins are created for each on nyx module load. ID is by DIP switches, 00 thru 15.

Pins:

YO32P pins:

YAO2 params:

YAO2 pins:

Absolute encoder support

Motors with absolute encoders allow to skip LinuxCNC homing operation on each startup. Patched version of LinuxCNC adds the folloing pins to halui module:

Those pins can be connected to

net x-abs-ok   halui.joint.0.set-homed <= nyx.0.servo-00.abs-ok
net x-abs-lost halui.joint.0.unhome <= nyx.0.servo-00.abs-lost

To enable absolute encoder mode, set parameters:

For Yaskawa drives write Pn002 to NVRAM. Start LinuxCNC and execute the following commands (should be in servo-off):

$ sudo nyxq servo pwnv 0-2:Pn002=0x13 # axes 0..2. power cycle amps, will show A.810
$ sudo nyxq servo abs 0 1 2 # execute encoder setup op and power cycle again

Add [JOINT_n]ABSOLUTE_ENCODER=1 var to .ini configuration file. LinuxCNC will save the motor_offset to the position file instead of current position.

Mitsubishi MDS-x-SP spindle drive sync moves

The mdssp component emulates ABZ incremental encoder using spindle drive postion feedback. To use it for lathe threading or rigid tapping make sure SP038 bit 2 (0x0004) is set to 1 and make the following HAL connections:

loadrt mdssp
addf mdssp.0 servo-thread
net s-counts   nyx.0.servo-05.counts => mdssp.0.spindle-counts-in
net s-oriented nyx.0.servo-05.spindle-oriented => mdssp.0.spindle-oriented-in
net s-index    spindle.0.index-enable  => mdssp.0.index-request
net s-revs     spindle.0.revs          <= mdssp.0.revs

To make emulated spindle index postiion repeatable between LinuxCNC restarts, execute the "orient spindle" op once.

Z-index homing

When using MR-J3-BS or MR-J4-B-RJ amps in fully-closed mode with an ABZ incremental linear/rotary load-side encoder LinuxCNC's Z-index homing is supported. To use it add to HAL/INI:

net x-home   nyx.0.servo-00.di3           => joint.0.home-sw-in
net x-index  nyx.0.servo-00.index-enable <=> joint.0.index-enable
net x-homing nyx.0.servo-00.undroop      <=  joint.0.homing

HOME_USE_INDEX = YES
ABSOLUTE_ENCODER = 0

Z-index homing is also supported with SSCNET III/H and Mechatrolink I, II since fw 3.0.10, MDS-A/B/C-V since 3.4.0

nyxq utility