General Mechatronics Driver
General Mechatronics GM6-PCI card based motion control system
For detailed description, please refer to the System integration manual.
The GM6-PCI motion control card is based on an FPGA and a PCI bridge interface ASIC. A small automated manufacturing cell can be controlled, with a short time system integration procedure. The following figure demonstrating the typical connection of devices related to the control system:
-
It can control up to six axis, each can be stepper or CAN bus interface or analogue servo.
-
GPIO: Four time eight I/O pins are placed on standard flat cable headers.
-
RS485 I/O expander modules: RS485 bus was designed for interfacing with compact DIN-rail mounted expander modules. An 8-channel digital input, an 8-channel relay output and an analogue I/O (4x +/-10 Volts output and 8x +/-5 Volts input) modules are available now. Up to 16 modules can be connected to the bus altogether.
-
20 optically isolated input pins: Six times three for the direct connection of two end switch and one homing sensor for each axis. And additionally, two optically isolated E-stop inputs.
Installing:
loadrt hal_gm
During loading (or attempted loading) the driver prints some useful debugging messages to the kernel log, which can be viewed with dmesg.
Up to 3 boards may be used in one system.
The following connectors can be found on the GM6-PCI card:
I/O connectors
9 | 7 | 5 | 3 | 1 |
---|---|---|---|---|
IOx/7 |
IOx/5 |
IOx/3 |
IOx/1 |
VCC |
10 | 8 | 6 | 4 | 2 |
---|---|---|---|---|
GND |
IOx/6 |
IOx/4 |
IOx/2 |
IOx/0 |
Each pin can be configured as digital input or output. GM6-PCI motion control card has 4 general purpose I/O (GPIO) connectors, with eight configurable I/O on each. Every GPIO pin and parameter name begins as follows:
gm.<nr. of card>.gpio.<nr of gpio con>
,where <nr of gpio con> is form 0 to 3. For example:
gm.0.gpio.0.in-0
indicates the state of the first pin of the first GPIO connector on the GM6-PCI card. Hal pins are updated by function
gm.<nr of card>.read
Pins
Parameters
Axis connectors
1 |
Encoder A |
2 |
+5 Volt (PC) |
3 |
Encoder B |
4 |
Encoder Index |
5 |
Fault |
6 |
Power Enabled |
7 |
Step/CCW/B |
8 |
Direction/CW/A |
9 |
Ground (PC) |
10 |
DAC serial line |
Axis interface modules
Small sized DIN rail mounted interface modules gives easy way of connecting different types of servo modules to the axis connectors. Seven different system configurations are presented in the System integration manual for evaluating typical applications. Also the detailed description of the Axis modules can be found in the System integration manual.
For evaluating the appropriate servo-drive structure the modules have to be connected as the following block diagram shows:
Encoder
The GM6-PCI motion control card has six encoder modules. Each encoder module has three channels:
-
Channel-A
-
Channel-B
-
Channel-I (index)
It is able to count quadrature encoder signals or step/dir signals. Each encoder module is connected to the inputs of the corresponding RJ50 axis connector.
Every encoder pin and parameter name begins as follows:
gm.<nr. of card>.encoder.<nr of axis>
,where <nr of axis> is form 0 to 5. For example:
gm.0.encoder.0.position
refers to the position of encoder module of axis 0.
The GM6-PCI card counts the encoder signal independently from Machinekit. Hal pins are updated by function:
gm.<nr of card>.read
Pins
Parameters
HAL example
Setting encoder module of axis 0 to receive 500 CPR quadrature encoder signal and use reset to round position.
setp gm.0.encoder.0.counter-mode 0 # 0: quad, 1: stepDir
setp gm.0.encoder.0.index-mode 1 # 0: reset pos at index, 1:round pos at index
setp gm.0.encoder.0.counts-per-rev 2000 # GM process encoder in 4x mode, 4x500=2000
setp gm.0.encoder.0.index-invert 0
setp gm.0.encoder.0.min-speed-estimate 0.1 # in position unit/s
setp gm.0.encoder.0.position-scale 20000 # 10 encoder rev cause the machine to
move one position unit (10x2000)
Connect encoder position to Machinekit position feedback:
net Xpos-fb gm.0.encoder.0.position => axis.0.motor-pos-fb
Stepgen module
The GM6-PCI motion control card has six stepgen modules, one for each axis. Each module has two output signals. It can produce Step/Direction, Up/Down or Quadrature (A/B) pulses. Each stepgen module is connected to the pins of the corresponding RJ50 axis connector.
Every stepgen pin and parameter name begins as follows:
gm.<nr. of card>.stepgen.<nr of axis>
,where nr of axis is form 0 to 5. For example:
gm.0.stepgen.0.position-cmd
refers to the position command of stepgen module of axis 0 on card 0.
The GM6-PCI card generates step pulses independently from Machinekit. Hal pins are updated by function
gm.<nr of card>.write
Pins
Parameters
For evaluating the appropriate values see the timing diagrams below:
HAL example
Setting stepgen module of axis 0 to generate 1000 step pulse per position unit:
setp gm.0.stepgen.0.step-type 0 # 0:stepDir, 1:UpDown, 2:Quad
setp gm.0.stepgen.0.control-type 0 # 0:Pos. control, 1:Vel. Control
setp gm.0.stepgen.0.invert-step1 0
setp gm.0.stepgen.0.invert-step2 0
setp gm.0.stepgen.0.maxvel 0 # do not set maxvel for step
# generator, let interpolator control it.
setp gm.0.stepgen.0.maxaccel 0 # do not set max acceleration for
# step generator, let interpolator control it.
setp gm.0.stepgen.0.position-scale 1000 # 1000 step/position unit
setp gm.0.stepgen.0.steplen 1000 # 1000 ns = 1 us
setp gm.0.stepgen.0.stepspace1000 # 1000 ns = 1 us
setp gm.0.stepgen.0.dirdelay 2000 # 2000 ns = 2 us
Connect stepgen to axis 0 position reference and enable pins:
net Xpos-cmd axis.0.motor-pos-cmd => gm.0.stepgen.0.position-cmd
net Xen axis.0.amp-enable-out => gm.0.stepgen.0.enable
Enable and Fault signals
The GM6-PCI motion control card has one enable output and one fault input HAL pins, both are connected to each RJ50 axis connector and to the CAN connector.
Hal pins are updated by function:
gm.<nr of card>.read
Pins
Axis DAC
The GM6-PCI motion control card has six serial axis DAC driver modules, one for each axis. Each module is connected to the pin of the corresponding RJ50 axis connector. Every axis DAC pin and parameter name begins as follows:
gm.<nr. of card>.dac.<nr of axis>
,where nr of axis is form 0 to 5. For example:
gm.0.dac.0.value
refers to the output voltage of DAC module of axis 0. Hal pins are updated by function:
gm.<nr of card>.write
Pins
Pins | Type and direction | Pin description |
---|---|---|
.enable |
(bit, In) |
Enable DAC output. When enable is false, DAC output is 0.0 V. |
.value |
(float, In) |
Value of DAC output in Volts. |
Parameters
CAN-bus servo amplifiers
The GM6-PCI motion control card has CAN module to drive CAN servo amplifiers. Implementation of higher level protocols like CANopen is further development. Currently GM produced power amplifiers has upper level driver which export pins and parameters to HAL. They receive position reference and provide encoder feedback via CAN bus.
The frames are standard (11 bit) ID frames, with 4 byte data length. Tha baud rate is 1 Mbit. The position commad IDs for axis 0..5 are 0x10..0x15. The position feedback IDs for axis 0..5 are 0x20..0x25.
These configuration can be changed with the modifivation of hal_gm.c and recompiling Machinekit.
Every CAN pin and parameter name begins as follows:
gm.<nr. of card>.can-gm.<nr of axis>
,where <nr of axis> is form 0 to 5. For example:
gm.0.can-gm.0.position
refers to the output position of axis 0 in position units.
Hal pins are updated by function:
gm.<nr of card>.write
Watchdog timer
Watchdog timer resets at function:
gm.<nr of card>.read
Pins
Pins | Type and direction | Pin description |
---|---|---|
gm.<nr of card>.watchdog-expired |
(bit, Out) |
Indicates that watchdog timer is expired. |
Watchdog timer overrun causes the set of power-enable to low in hardware.
Parameters
End-, homing- and E-stop switches
25 | 23 | 21 | 19 | 17 | 15 | 13 | 11 | 9 | 7 | 5 | 3 | 1 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
GND |
1/End- |
2/End+ |
2/Hom-ing |
3/End- |
4/End+ |
4/Hom-ing |
5/End- |
6/End+ |
6/Hom-ing |
E-Stop 2 |
V+ (Ext.) |
26 | 24 | 22 | 20 | 18 | 16 | 14 | 12 | 10 | 8 | 6 | 4 | 2 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
GND |
1/End+ |
1/Hom-ing |
2/End- |
3/End+ |
3/Hom-ing |
4/End- |
5/End+ |
5/Hom-ing |
6/End- |
E-Stop 1 |
V+ (Ext.) |
The GM6-PCI motion control card has two limit- and one homing switch input for each axis. All the names of these pins begin as follows:
gm.<nr. of card>.axis.<nr of axis>
,where nr of axis is form 0 to 5. For example:
gm.0.axis.0.home-sw-in
indicates the state of the axis 0 home switch.
Hal pins are updated by function:
gm.<nr of card>.read
Pins
Status LEDs
CAN
Color: Orange
-
Blink, during data communication.
-
On, when any of the buffers are full - communication error.
-
Off, when no data communication.
RS485
Color: Orange
-
Blink, during initialization of modules on the bus
-
On, when the data communication is up between all initialized modules.
-
Off, when any of the initialized modules dropped off because of an error.
EMC
Color: White
-
Blink, when Machinekit is running.
-
Otherwise off.
Boot
Color: Green
-
On, when system booted successfully.
-
Otherwise off.
Error
Color: Red
-
Off, when there is no fault in the system.
-
Blink, when PCI communication error.
-
On, when watchdog timer overflowed.
RS485 I/O expander modules
These modules were developed for expanding the I/O and function capability along an RS485 line of the GM6-PCI motion control card.
Available module types:
-
8-channel relay output module - gives eight NO-NC relay output on a three pole terminal connector for each channel.
-
8-channel digital input module - gives eight optical isolated digital input pins.
-
8 channel ADC and 4-channel DAC module - gives four digital-to-analogue converter outputs and eight analogue-to-digital inputs. This module is also optically isolated from the GM6-PCI card.
Automatic node recognizing:
Each node connected to the bus was recognized by the GM6-PCI card automatically. During starting Machinekit, the driver export pins and parameters of all available modules automatically.
Fault handling:
If a module does not answer regularly the GM6-PCI card drops down the module. If a module with output do not gets data with correct CRC regularly, the module switch to error sate (green LED blinking), and turns all outputs to error sate.
Connecting the nodes:
The modules on the bus have to be connected in serial topology, with termination resistors on the end. The start of the topology is the PCI card, and the end is the last module.
Adressing:
Each node on the bus has a 4 bit unique address that can be set with a red DIP switch.
Status LED:
A green LED indicates the status of the module:
-
Blink, when the module is only powered, but not jet identified, or when module is dropped down.
-
Off, during identification (computer is on, but Machinekit not started)
-
On, when it communicates continuously.
Relay output module
For pinout, connection and electrical charasteristics of the module, please refer to the System integration manual.
All the pins and parameters are updated by the following function:
gm.<nr. of card>.rs485
It should be added to servo thread or other thread with larger period to avoid CPU overload. Every RS485 module pin and parameter name begins as follows:
gm.<nr. of card>.rs485.<modul ID>
,where <modul ID> is form 00 to 15.
Pins
Pins | Type and direction | Pin description |
---|---|---|
.relay-<0-7> |
(bit, Out) |
Output pin for relay |
Parameters
Parameters | Type and direction | Parameter description |
---|---|---|
.invert-relay-<0-7> |
(bit, R/W) |
Negate relay output pin |
HAL example
gm.0.rs485.0.relay-0 # First relay of the node.
gm.0 # Means the first GM6-PCI motion control card (PCI card address = 0)
.rs485.0 # Select node with address 0 on the RS485 bus
.relay-0 # Select the first relay
Digital input module
For pinout, connection and electrical charasteristics of the module, please refer to the System integration manual.
All the pins and parameters are updated by the following function:
gm.<nr. of card>.rs485
It should be added to servo thread or other thread with larger period to avoid CPU overload. Every RS485 module pin and parameter name begins as follows:
gm.<nr. of card>.rs485.<modul ID>
,where <modul ID> is form 00 to 15.
Pins
Pins | Type and direction | Pin description |
---|---|---|
.in-<0-7> |
(bit, Out) |
Input pin |
.in-not-<0-7> |
(bit, Out) |
Negated input pin |
HAL example
gm.0.rs485.0.in-0 # First input of the node.
# gm.0 - Means the first GM6-PCI motion control card (PCI card address = 0)
# .rs485.0 - Select node with address 0 on the RS485 bus
# .in-0 - Select the first digital input module
DAC & ADC module
For pinout, connection and electrical charasteristics of the module, please refer to the System integration manual.
All the pins and parameters are updated by the following function:
gm.<nr. of card>.rs485
It should be added to servo thread or other thread with larger period to avoid CPU overload. Every RS485 module pin and parameter name begins as follows:
gm.<nr. of card>.rs485.<modul ID>
,where <modul ID> is form 00 to 15.
Pins
Parameters
HAL example
gm.0.rs485.0.adc-0 # First analogue channel of the node.
# gm.0 - Means the first GM6-PCI motion control card (PCI card address = 0)
# .rs485.0 - Select node with address 0 on the RS485 bus
# .adc-0 - Select the first analogue input of the module
Teach Pendant module
For pinout, connection and electrical charasteristics of the module, please refer to the System integration manual.
All the pins and parameters are updated by the following function:
gm.<nr. of card>.rs485
It should be added to servo thread or other thread with larger period to avoid CPU overload. Every RS485 module pin and parameter name begins as follows:
gm.<nr. of card>.rs485.<modul ID>
,where <modul ID> is form 00 to 15. Note that on the Teach Pendant module it cannot be changed, and pre-programmed as zero. Upon request it can be delivered with firmware pre-programmed different ID.
Pins
Parameters
HAL example
gm.0.rs485.0.adc-0 # First analogue channel of the node.
# gm.0 - Means the first GM6-PCI motion control card (PCI card address = 0)
# .rs485.0 - Select node with address 0 on the RS485 bus
# .adc-0 - Select the first analogue input of the module
Errata
GM6-PCI card Errata
The revision number in this section refers to the revision of the GM6-PCI card device.
Rev. 1.2
-
Error: The PCI card do not boot, when Axis 1. END B switch is active (low). Found on November 16, 2013.
-
Reason: This switch is connected to a boot setting pin of FPGA
-
Problem fix/workaround: Use other switch pin, or connect only normally open switch to this switch input pin.