SSCNET II Interface Adapter for LinuxCNC
LinuxCNC driver module
LinuxCNC HAL driver module name is sscii. During operation the
controller and SSCNET network are synchronized to servo thread of the
LinuxCNC. Therefore servo thread period should be set to 888888 ns - the
period of SSCNET-II network. The following HAL commands load the driver and
add its callback function to the servo thread:
loadrt motmod servo_period_nsec=888888 ...
loadrt sscii
addf sscii.0 servo-thread
sscii
Controller status pins:
- sscii.0.ready (bit, out) - the controller is in sync with
LinuxCNC 0.88ms servo thread. Before it come true other pins are
inactive
- sscii.0.error-cnt (u32, out) - communication error count. Number
of clocks when servo thread sync was absent. If the value increases then
the jitter is probably too large. Jitter tolerance is about 100
microseconds
- sscii.0.phase (float, out) - offset of the servo thread call
relative to the timing slot of controller's 0.88ms cycle, in microseconds.
Should not exceed +/-50us
servo
The driver supports up to 6 servo amplifiers, axis number 0 thru 5. Parameters:
- sscii.0.servo.axis.pos-scale (float, rw) - position scale factor, in length units per revolution. Default is 5, which is suitable for direct motor coupling to 5mm lead ball screw
- sscii.0.servo.axis.vel-scale (bit, rw) - velocity scale factor. Default is 10, so that vel-cmd is in rotation per minute with 0.1 rpm resolution
- sscii.0.servo.axis.origin (signed, rw) - position offset
Pins:
- sscii.0.servo.axis.online (bit, out) - the controller has detected and initialized axis servo amplifier
- sscii.0.servo.axis.offline (bit, out) - inverted "online" pin output
- sscii.0.servo.axis.ready (bit, out) - READY-ON status (power relay is on)
- sscii.0.servo.axis.enabled (bit, out) - SERVO-ON status
- sscii.0.servo.axis.warning (bit, out) - servo amplifier warning
- sscii.0.servo.axis.alarm (bit, out) - servo amplifier alarm
- sscii.0.servo.axis.alarm-code (u32, out) - servo amplifier alarm code (hex)
- sscii.0.servo.axis.zero-speed (bit, out) - motor velocity is below zero speed threshold (param No.30)
- sscii.0.servo.axis.in-position (bit, out) - position complete (threshold set in param No.20)
- sscii.0.servo.axis.power (bit, in) - turn on amplifier power relay (READY-ON)
- sscii.0.servo.axis.enable (bit, in) - enable servo (SERVO-ON)
- sscii.0.servo.axis.pos-cmd (float, in) - commanded position
- sscii.0.servo.axis.pos-fb (float, out) - motor feedback position
- sscii.0.servo.axis.velocity-mode (bit, rw) - velocity control mode. Change is possible at zero speed only
- sscii.0.servo.axis.vel-cmd (float, in) - commanded velocity
- sscii.0.servo.axis.vel-fb (float, out) - motor velocity feedback
- sscii.0.servo.axis.trq-fb (float, out) - motor torque feedback, percents from nominal motor torque
- sscii.0.servo.axis.droop (s32, out) - droop pulse count. The difference between commanded and actual position of servo motor
- sscii.0.servo.axis.error-cnt (s32, out) - controller-amplifier feedback transfer error count
- sscii.0.servo.axis.limit-torque (bit, in) - turn on torque limiting
- sscii.0.servo.axis.forward-torque (float, in) - forward rotation torque limit, percents
- sscii.0.servo.axis.reverse-torque (float, in) - reverse rotation torque limit, percents
- sscii.0.servo.axis.torque-clamped (bit, out) - torque clamp indication
- sscii.0.servo.axis.absolute (bit, out) - absolute position feedback is valid (param No.1)
- sscii.0.servo.axis.abs-pos-lost (bit, out) - absolute position is not valid
encoder
An encoder input channel converts quadrature signals on CN2 Phase A, Phase B, Index Z into 32-bit up/down counter values. The maximum count frequency is 20 MHz. Parameter:
- sscii.0.encoder.enc.cpr (float, rw) - encoder resolution, counts per revolution. Sign defines rotation direction. Default is minus 10000
Pins:
- sscii.0.encoder.enc.index-enable (bit, io) - reset counter on next index mark Z
- sscii.0.encoder.enc.pos (float, out) - encoder counter divided by cpr parameter value. Signed fractional number of revolutions.
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:
- sscii.0.gpio.n.in (bit, out) - a value of digital input n 0 thru 11
- sscii.0.gpio.n.in-not (bit, out) - inverted
Digital output signals OUT0..OUT7 going to CN3:
- sscii.0.gpio.n.out (bit, in) - set output number n 0 thru 7
dac
2-channel 12-bit digital-to-analog converter on YEX1-A expansion board. Paramaters:
- sscii.0.dac.chan.scale (float, rw) - max value (10V output voltage). Default is 1.0, chan is 0..1
Pins:
- sscii.0.dac.chan.out (float, in) - DAC output voltage, values 0..scale give 0V..10V
Absolute encoder support
All Mitsubishi J2 Super series motors feature absolute encoders. This
allows to eliminate LinuxCNC homing operation on each startup. As LinuxCNC
2.7.4 lacks support of absolute encoders a patch is provided. It adds pins
to halui module:
- halui.joint.n.set-homed (bit, in) - set axis "homed"
state to true for current offsets without actually performing a homing
operation
Upon startup a script is executed which inspects if servo amplifiers are
in absolute mode and position data is valid. In that case it sets
corresponding axes to "homed". Also the patch changes values saved into
position.txt file from current position pos_fb to motor_offset. TODO:
change to preserve compatibility.
Added INI file parameters MAX_JOG_VELOCITY, MAX_AJOG_VELOCITY to
differentiate maximum jogging velocity from absolute maximum velocity that
can be used in programs. AXIS UI sliders "Jog Speed" and "Max Velocity"
behave consistent.
Firmware upgrade
FPGA configuration and embedded processor firmware are stored in a 16
Mbit FLASH memory chip. Memory is divided to 64K bytes sectors. Sector 0
contains a bootloader, sectors 1-6 - backup configuration, 8-13 - primary
configuration. FLASH writing is performed by the nyxflash utility. Examples:
Writing primary configuration:
$ sudo nyxflash nyx_fw_v1.1.bin
writing nyx_fw_v0.12.bin 340604 bytes to 0x80000
erasing sector #8 #9 #10 #11 #12 #13
writing sector #8 #9 #10 #11 #12 #13
programming successful
exiting monitor
Writing bootloader:
$ sudo nyxflash BOOT
writing BOOT 64 bytes to 0x0
erasing sector #0
writing sector #0
programming successful
exiting monitor
Optional second argument specifies starting offset, in hex bytes. For
example, writing a backup configuration, which is located at offset
0x10000:
$ sudo nyxflash nyx_fw_v1.1.bin 10000
writing nyx_fw_v0.12.bin 340604 bytes to 0x10000
erasing sector #1 #2 #3 #4 #5 #6
writing sector #1 #2 #3 #4 #5 #6
programming successful
exiting monitor
Giving ERASE as an argument erases a sector at given address:
$ sudo nyxflash ERASE 0
erasing sector #0
exiting monitor
Caution! If the utility reports verification errors do not turn off the
computer. Repeat the writing command instead. If the bootloader or both
primary and backup configurations are damaged then the board is rendered
unusable without FPGA JTAG programmer.
REBOOT argument performs the FPGA reconfiguration