PoLabs PoKeys57CNC User manual

PoKeys57CNC and Mach4
Step by step guide - a.k.a. beginners guide
Version: 13/12/2017

PoKeys57CNC and Mach4 –step by step guide
2
www.poscope.com
SAFETY INFORMATION
This product is intended for integration by the user into a computer numerical control (CNC)
machine. It is the user's responsibility to assess the overall system design and address all safety
considerations that affect the users and equipment. The user assumes all responsibility for system
design, including compliance with regulatory standards and codes issued by the applicable entities.
PoLabs do not make any claims as to the suitability of this equipment for the user’s application.
Serious personal injury or equipment damage can occur from the improper integration, installation
or operation of this product.
This product is not guaranteed to be fail-safe. The system that this equipment is used with shall be
fitted with a separate means of fail-safe protection, emergency-stop capability and/or system power
removal. This equipment may be connected to dangerous power sources, including electrical power
sources. Dangerous voltage levels may be present at this equipment or at connected devices.
Measures must be taken to prevent persons from contacting voltage sources which may be present.
Equipment should be housed inside an enclosure suitable for the intended environment. Safety
interlocks should be provided to prevent any and all dangers to personnel.
CNC machine tools are inherently dangerous, and can cause injury to operators and maintenance
personnel. Operators and maintenance personnel shall be properly trained in the safe use, operation
and maintenance of such machines. Automated machines that this equipment may be used with can
move at any time. All persons exposed to such machines must understand the dangers that are
present.

PoKeys57CNC and Mach4 –step by step guide
3
www.poscope.com
Table of contents
PoKeys57CNC and Mach4 –step by step guide ...................................................................................... 4
Getting familiar with electronic components ..................................................................................... 4
Stepper motors................................................................................................................................ 5
PoStep25-32 vs. PoStep60-256 ....................................................................................................... 6
PoPower24-100 or PoPower48-320? .............................................................................................. 8
PoKeys57CNC controller.................................................................................................................. 9
PoPower12-25 ................................................................................................................................. 9
Let’s start connecting ........................................................................................................................ 10
Power supply ................................................................................................................................. 10
Stepper motors.............................................................................................................................. 11
Make custom flat cables................................................................................................................ 12
Connect the stepper motor controllers and PoKeys57CNC controller ......................................... 12
Connect limit and home switches ................................................................................................. 14
Connect probe............................................................................................................................... 16
Connect E-stop switch................................................................................................................... 16
Connecting other signals with the PoKeys57CNC device.............................................................. 17
Connecting spindle controller ....................................................................................................... 19
Connecting spindle speed sensor.................................................................................................. 21
Connecting spindle encoder.......................................................................................................... 21
Enabling threading support........................................................................................................... 22
Connect other peripherals ............................................................................................................ 23
Final check and power up.............................................................................................................. 23
Mapping PoKeys digital IO signals to Mach4 IO............................................................................ 24
Basic configuration of the PoKeys57CNC device............................................................................... 25
Selecting PoKeys57CNC connection type...................................................................................... 25
Using USB connection ................................................................................................................... 26
Using Ethernet connection............................................................................................................ 27
Mach4 setup...................................................................................................................................... 30

PoKeys57CNC and Mach4 –step by step guide
4
www.poscope.com
PoKeys57CNC and Mach4 –step by step guide
In this tutorial we will describe a step by step procedure how to build your own electronic
system for CNC Machine and use Mach4 software with PoKeys plugin to get your CNC up and
running.
This tutorial focuses on the electronic system of the CNC machine with software and leaves
out mechanical design. We will assume that the target CNC machine has 3 axes with one
motor per axis.
Getting familiar with electronic components
For a three-axis CNC machine you will need the following parts:
3x stepper motor (one per axis),
3x stepper motor driver (e.g. PoStep driver),
Stepper driver power supply (e.g. PoPower),
Controller power supply (e.g. PoPower12-25),
PoKeys57CNC controller,
Additionally (not necessary, but helpful):
PoPendant 1C with manual pulse generator,
PoNETkbd48CNC keyboard with 48 keys, designed for CNC operation,
CablePack PoKeys57CNC (connectors and flat cable set),
Limit switches and E-Stop button.

PoKeys57CNC and Mach4 –step by step guide
5
www.poscope.com
Stepper motors
The motors vary in rated current and holding torque. As you can find out, not all stepper
motors have the same number of wires. The 4-wire stepper motor has 1 coil per phase and
8-wire has 2 coils per phase and can be run in parallel or serial mode. Parallel mode needs
higher current, has lower inductance and better torque. Serial mode needs lower current
and has lower torque. You can find a more detailed explanation about stepper motors here
(http://blog.poscope.com/stepper-motor-driver-user-manual-complete-edition/internet) or
on some other internet sites.
Nema 17 (SY42STH47-1684B Stepper Motor)
4-wire
Nema 23 (SY60STH86-3008 Stepper Motor)
8-wire

PoKeys57CNC and Mach4 –step by step guide
6
www.poscope.com
PoStep25-32 vs. PoStep60-256
Stepper motors require voltages and/or currents that the controller simply can’t produce.
Therefore we need to use a stepper motor driver. This electronic device will transform your
movement instructions from a controller in to a sequence where the windings in stepper
motor will be turned on or off, resulting in motor motion. More on
http://blog.poscope.com/stepper-motor-driver/
PoStep25-32
PoStep60-256
● 0.5 to 2.5 A phase current
● up to 6.0 A phase current
● Simple current and microstepping setup with
jumper
● Simple setup of current, micro-step and other
settings with software via USB
● Compatible with 4, 6 and 8 wire stepper
motors of any voltage
● Compatible with 4, 6 and 8 wire stepper
motors of any voltage
●+10 VDC to +30 VDC power supply
●+10 VDC to +50 VDC power supply
● 1, 2, 4, 8, 16 and 32 micro-steps per step
● 1, 2, 4, 8, 16, 32, 64, 128 and 256 micro-steps
per step
● Mixed decay mode for smoother moving
of motors
● Mixed decay mode for smoother moving
of motors
● 3,3V and 5V logic compatible inputs
● 3,3V and 5V logic compatible isolated inputs
● 250 kHz maximum step rate
● 250 kHz maximum step rate
● 0 °C To 70 °C operating temperature
● 0 °C To 70 °C operating temperature
● LED Power, Error and Enable Indicator
● LED Power, VM, Status, Fault and Stal
indicator
● On board temperature sensor
● Improved thermal managing
● Improved thermal managing
● It can be driven from USB without controller
● Compact size: 50 mm X 52 mm
● Compact size: 54 mm X 75 mm
PoStep60 stepper motor drivers configuration
To configure the PoStep60 stepper motor drivers, download latest software pack PoStep60
(available on the PoLabs homepage under Downloads) and unpack it to your computer. The
application allows you to configure and control stepper driver’s parameters. You can also
test the operation of the driver without CNC controller.

PoKeys57CNC and Mach4 –step by step guide
7
www.poscope.com
Connect PoStep60-256 with USB cable to your computer and run PoStep60v0.xx.exe. Use Driver
setup tab to configure driver. The selection boxes allow you to choose the microstepping
setting and motor currents setting. Once the values are entered, click on Write values to driver
to confirm changes. Do the same procedure for all drivers you will use.
You can check if the motor is wired correctly and if it works properly, in Step control tab. Set
the maximum speed with dial button. Click on Run button and move speed slider left or right
to command the motor rotation. More detailed describtion on
http://blog.poscope.com/stepper-motor-driver-user-manual-complete edition/

PoKeys57CNC and Mach4 –step by step guide
8
www.poscope.com
PoPower24-100 or PoPower48-320?
Choose appropriate power supply, taking into account witch stepper motor and driver type
you are going to use.
Stepper motor type
SY42STH47-1684B
Nema 17
SY57STH56-4004A
Nema 23
SY60STH86-3008
Nema 23
Power Supply
PoPower24-100
PoPower24-100
or
PoPower48-320
PoPower48-320
Stepper driver
PoStep25-32
PoStep25-32
or
PoStep60-256
PoStep60-256

PoKeys57CNC and Mach4 –step by step guide
9
www.poscope.com
PoKeys57CNC controller
PoKeys57CNC is a blend between general purpose PoKeys device and motor controller. The
device is targeted primarily for controlling up to 8 STEP/DIR signal driven motors (stepper
motors, servo drives, etc.) in various applications with the addition of powerful PoKeys
device features. Device contains dedicated connectors for connections with motor drivers,
pendants, (HD44780-compatible) LCD module etc. In addition, 5 analog inputs with 12-bit
resolution are available.
PoPower12-25
PoKeys57CNC requires external 6-26 V power supply to be connected to the board in order
for the device to operate correctly (device may not operate according to the specifications if
the external power supply is not present). For this purpose we can use PoPower12-25.

PoKeys57CNC and Mach4 –step by step guide
10
www.poscope.com
Let’s start connecting
Power supply
Start connecting power supply part, but don’t plug it into the AC socket until all
connections are done.
You should consider some general rules. Use color coded cable to connect all
three AC plug wires (L, N and PE). L-brown, N-blue, PE- yellow/green. In some
countries colors can be different as described. Remember - the yellow/green wire
must be always and exclusively used for PE wire (Protective Earth)!
Hint. You can preserve one AC plug cable if you connect both PoPower AC inputs
in parallel.
Remove approx. 1 cm (1/3 inch) of insulation at wire end. Insert wire’s end into
power supply connector and use a screwdriver to attach.
Use red and black (blue) wires for DC voltage. Red for positive power supply lines
(+V) and black for negative power supply lines (-V, GND).
Connect DC outputs (+V, -V) from the PoPower24-100 or PoPower48-320 to
PoStep power supply connector. DC outputs from the PoPower12-25 connect to
PoKeys57CNC power supply connector. Use screwdriver to attach.
Power supply selection jumper on PoKeys57CNC board should be set on “EXT”

PoKeys57CNC and Mach4 –step by step guide
11
www.poscope.com
Stepper motors
Connect the stepper motor wires to the PoStep60-256 or PoStep25-32 driver output pins A,
A’ and B, B’; marked on PCB. Use a table below for 4 or 8-wire stepper motor.
4-wire stepper motor pin-out:
green
black
blue
red
pin A
pin A'
pin B
pin B'
8-wire stepper motor pin-out (parallel coil connection):
yellow/white
yellow
red/white
red
green/white
green
black/white
black
pin A
pin A'
pin A'
pin A
pin B
pin B'
pin B'
pin B

PoKeys57CNC and Mach4 –step by step guide
12
www.poscope.com
Make custom flat cables
Make custom flat cables using the CablePackPoKeys57CNC. Some cables are included to
PoStep drivers but, if you need a cable to fit your needs, you can make it on your own. If you
are making cables for the first time, you can help yourself with our tutorial
http://blog.poscope.com/cablepack-pokeys57cnc-connectors/.
Connect the stepper motor controllers and PoKeys57CNC controller
If you are using PoStep drivers, use the provided cables to connect the PoStep motor driver
to PoKeys57CNC controller. Insert one end of the cable into the 10-pin IDC connector on the
PoStep driver and insert the other end to one of the PoKeys57CNC motor connectors
(labeled as MOTOR1 … MOTOR 8).

PoKeys57CNC and Mach4 –step by step guide
13
www.poscope.com
If you are using a stepper driver without a 10-pin IDC connector with the correct pinout, we
suggest using adapter board 10-5, shown below, which allows you to connect the motion-
related signals directly.
Adapter board 10-5 (https://www.poscope.com/product/adapter-board-10-5/)
Alternative to the adapter board above is to use a 10-pin flat cable with so called flying leads
on one end –equip the flat cable with the 10-pin IDC connector on one side only and spread
the wires on the other end. Connect the wires straight to your stepper motor driver.
If your stepper motor driver has differential inputs (noticeable by the +/- signal pairs), we
suggest wiring the negative signals (usually named PUL-, DIR- and ENA-) to GND of the
PoKeys57CNC motor output and positive signals (named PUL+, DIR+ and ENA+) to step,
direction and enable outputs of the PoKeys57CNC motor output.

PoKeys57CNC and Mach4 –step by step guide
14
www.poscope.com
Connect limit and home switches
We will take a look on how to connect limit and home switches of your CNC machine to the
PoKeys57CNC controller.
The PoKeys57CNC controller has screw terminals (labeled AX+) for one switch per each axis.
Additional switches can be connected to the Limit/Home connector next to the screw
terminals - adapter board 20-20 (https://www.poscope.com/product/adapter-board-20-20/)
can be used to access individual inputs.
As can be seen on the illustration, up to three switches can be connected for each axis.
Switches of axis 1 must be connected to the axis 1 switches inputs (inputs of the unused axes
cannot be re-used for other axes).
Each switch input is already equipped with a 10 kOhm pull-up resistor to +5 V and a 10 kHz
low-pass filter against the noise, as illustrated below.

PoKeys57CNC and Mach4 –step by step guide
15
www.poscope.com
This configuration allows the simple mechanical switches and electronic switches with pure
NPN-type output to be connected directly to the input.
The number of GND terminals is lesser than the number of all individual inputs. All GND
terminals are connected together and can be shared among multiple switches.
Mechanical switches
Mechanical switches can be directly connected between the GND and the selected input
terminal. Both NC (normally-closed) and NO (normally-open) switches are supported.
If NO (normally-open) switches are used, select the ‘Invert’ option for the selected switch in
the Pulse engine configuration in PoKeys plugin for Mach4.
If no switch is connected to specific input, make sure that it is configured as ‘Disabled’ in the
Pulse engine configuration in PoKeys plugin in Mach4.
Electronic switches with pure NPN (open-collector) output
There are various types of electronic switches (e.g. inductive, capacitive, optical switches
etc.) with a pure NPN (open-collector) type output. These can directly be connected to
PoKeys57CNC inputs, as shown on the illustration below.
Connect the GND of the sensor to GND of the sensor’s power supply and PoKeys57CNC GND.
Connect the sensor’s signal output to PoKeys57CNC input terminal. Connect sensor’s
positive power input to positive terminal of the sensor’s power supply.

PoKeys57CNC and Mach4 –step by step guide
16
www.poscope.com
Switches/sensors with pure NPN-type outputs have no built-in pull-up resistors and require
an external one.
Switches/sensors with NPN-type outputs and integrated pull-up resistor have to be
connected to +5 V power supply. If sensor has built-in pull-up resistor and requires higher
voltage to operate, it may not be used with PoKeys57CNC device.
Electronic switches with PNP output
PoKeys57CNC is not designed to be used with switches or sensors with PNP-type output.
Connect probe
Probe input is available on the same connector as the axis limit switches and has the same
characteristics.
Connect E-stop switch
PoKeys57CNC is designed to include an emergency switch on the pendant –hence the input
for the emergency switch is wired to the Pendant connector on the PoKeys57CNC.
E-stop switch can be connected either to dedicated E-stop connector (red 4-pin connector)
or to pendant connector (a combination of both is also allowed since both are wired in
series). You can use one of the following wiring options:
a) E-stop switch is connected to dedicated 4-pin E-stop connector between pins 2 and 3.
Jumper 'NeST' must be removed and inserted into the pendant connector between
pins 4 and 6.
b) E-stop switch is connected to pendant connector (between pins 4 and 6). Jumper
'NeST' must be present.
c) Two E-stop switches are connected - one to dedicated 4-pin E-stop connector
(betwen pins 2 and 3) and one to pendant connector (between pins 4 and 6).
d) No E-stop switch is used –make sure that the ‘NeST’ jumper is in position and pins 4
and 6 of the Pendant connector are shorted with another jumper, as shown below.

PoKeys57CNC and Mach4 –step by step guide
17
www.poscope.com
Connecting other signals with the PoKeys57CNC device
Check the specifications of your external device to determine the type of the input or output signals.
Logical inputs (e.g. low current CMOS or TTL logical levels)
Compatible PoKeys signals: Any pin marked as ‘Pin x’ (where x is a number) that can be configured
as digital output (DO5, DO5_D or DIO33 types) - suggestion: use DO5 or DO5_D
Wiring: Connect PoKeys GND to common ground of the external device, connect PoKeys output pin
to external device input
Logical outputs (e.g. CMOS or TTL logical level output signals)
Compatible PoKeys signals: Any pin marked as ‘Pin x’ (where x is a number) that can be configured
as digital input (DI5P, DI33P, DIO33 types) - suggestion: use DI5P or DI33P
Wiring: Connect PoKeys GND to common ground of the external device, connect PoKeys input pin to
external device output
Optocoupler inputs - active high
Compatible PoKeys signals: PoKeys pin marked as either of DO5, DO5_D, OCOC or REL type in
PoKeys57CNC specifications - suggestion: use OCOC or REL
Wiring for DO5, DO5_D:
Connect PoKeys GND to common ground of the external device (or a dedicated input ground
connection if applicable), connect PoKeys output pin to external device input
Wiring for OCOC:
Connect PoKeys OC+ to positive power supply voltage (max. 50 V), OC- to external device input and
negative power supply to external device common ground (or a dedicated input ground connection if
applicable)
Wiring for REL:
Connect one PoKeys relay contact to positive power supply voltage, the other relay contact to the
external device input and negative power supply voltage to external device common ground (or a
dedicated input ground connection if applicable)
Optocoupler inputs - active low
Compatible PoKeys signals: PoKeys pin marked as either of DO5, DO5_D, OCOC, OCSSR or REL type
in PoKeys57CNC specifications - suggestion: use OCOC or REL
Wiring for DO5, DO5_D:
Connect PoKeys GND to common ground of the external device, connect PoKeys pin to external
device input.
Wiring for OCOC:
Connect OC+ to external device input and connect OC- to external device common ground (or a
dedicated input ground connection if applicable). If external device input requires a power supply

PoKeys57CNC and Mach4 –step by step guide
18
www.poscope.com
input, connect the appropriate power supply (do not use +5V from the PoKeys device or the power
supply used for powering the PoKeys device to avoid ground loops).
Wiring for OCSSR:
Connect PoKeys GND to common ground of the external device, connect PoKeys SSR output pin to
external device input.
Wiring for REL:
Connect one PoKeys relay contact to external device input and the other relay contact to the
common ground of the external device (or a dedicated input ground connection if applicable)
Optocoupler outputs (also relay outputs) - both optocoupler pins are accessible
Compatible PoKeys signals: Any pin marked as ‘Pin x’ (where x is a number) that can be configured
as digital input (DI5P, DI33P, DIO33 types) - suggestion: use DI5P or DI33P
Wiring: Connect PoKeys GND to negative lead of the external device output (sometimes marked as
common), connect PoKeys input pin to external device positive output lead
Optocoupler outputs - active low (signal is tied to ground by the external device when active)
Compatible PoKeys signals: Any pin marked as ‘Pin x’ (where x is a number) that can be configured
as digital input (DI5P, DI33P, DIO33 types) - suggestion: use DI5P or DI33P
Wiring: Connect PoKeys GND to common ground of the external device, connect PoKeys input pin to
external device output
Optocoupler outputs - active high (signal is tied to positive power supply by the external device
when active)
Compatible PoKeys signals: PoKeys pins are not compatible with this signal type

PoKeys57CNC and Mach4 –step by step guide
19
www.poscope.com
Connecting spindle controller
There are different possibilities to control the spindle motor, depending on the spindle controller
control inputs available and their types. The following inputs are commonly found on spindle motor
controllers:
-master on/off input: turns the spindle motor on or off
-forward direction: activates the forward direction (and usually also starts the motor)
-backwards direction: activates the backwards direction (and usually also starts the
motor)
-spindle speed voltage input: usually indicated with the variable resistor
(potentiometer) and referenced to a certain common voltage (also one of the supply
leads for the indicated potentiometer)
The selected PoKeys output signal can be found in the Mach4 output signals list as
described in chapter Mapping PoKeys digital IO signals to Mach4 IO on page 24
Pay attention when connecting galvanically isolated I/O pins of the PoKeys device -
these pins have a dedicated ground signal named GNDi. Do not connect GNDi to GND
since this renders the galvanic isolation irrelevant.
Spindle controller with master on/off function or with forward direction signal only
If your spindle controller only has an on/off control input and the spindle speed is either constant or
manually adjusted, use the appropriate PoKeys pin to drive the spindle controller on/off control
input (check chapter Connecting other signals with the PoKeys57CNC device on page 17 for more
information).
Configure the selected output pin of the PoKeys device in Mach4 output signals configuration (Config
> Mach4 > Output signals) for ‘Spindle On’or ‘Spindle Fwd’signal.
Spindle controller with on/off, forwards and backwards direction signals
If your spindle controller has on/off, forwards and backwards control inputs and the spindle speed is
either constant or manually adjusted, use the appropriate PoKeys pin to drive the spindle controller
control inputs (check chapter Connecting other signals with the PoKeys57CNC device on page 17 for
more information).

PoKeys57CNC and Mach4 –step by step guide
20
www.poscope.com
Configure the selected output pins of the PoKeys device in Mach4 output signals configuration
(Config > Mach4 > Output signals) for ‘Spindle On’, ‘Spindle Fwd’and ‘Spindle Rev’signals.
Spindle controller with analog spindle speed input
First, connect other spindle controller digital control signals as described above for on/off and
direction control signals.
Use the 0-10V analog output signal of the PoKeys device to control the speed of the spindle. Connect
GNDi (pay attention to using GNDi and not GND!) to the common or ground voltage signal of the
spindle speed input. Connect 0-10V analog output signal of the PoKeys device to control voltage
signal of the spindle speed input. +10V voltage output of the spindle controller should be left
unconnected. Make sure that the spindle controller is configured to accept 0-10V analog voltage
signal as the spindle speed reference.
The 0-10V analog output signal of the PoKeys device is generated by low-pass filtering the PWM
signal (on pin 17 in case of PoKeys57CNC). Therefore, the signal is configured in PoKeys plugin for
Mach4 under the ‘Miscellaneous’tab. Set the PWM frequency to 20000 Hz, enable PWM on pin 17,
select Pin 17 as the ‘Spindle output’and check ‘Set to 0 when OFF’, as shown on image below.
Table of contents
Popular Control System manuals by other brands

Eaton
Eaton COOPER POWER SERIES Installation and operation instructions

Crestron
Crestron CP2 Operation guide

LEGRAND
LEGRAND DA-LITE user manual

Bosch
Bosch Rexroth IndraDrive Mi KCU02 instruction manual

ORTAL
ORTAL Heat Control System Installation and operation manual

Leviton
Leviton Decora DZR15 installation instructions