Skip to content
Dominik Zarfl edited this page Mar 23, 2025 · 2 revisions

LinuxCnc_PokeysLibComp

Overview

The LinuxCnc_PokeysLibComp project integrates PoKeys devices with LinuxCNC, providing control and monitoring capabilities. This repository contains the necessary components, scripts, and documentation to set up and use PoKeys devices with LinuxCNC.

Directory Structure

The repository is organized into the following directories:

  • pokeys_uspace/: Contains Source of pokeys userspace component for interfacing with PoKeys devices.
  • pokeys_py/: prepared for Contains Python scripts for interfacing with PoKeys devices.
  • pokeys_rt/: Contains Source of pokeys_homecomp real-time component for PoKeys devices.
  • tests/: Contains unit tests, integration tests, and other testing-related files.
  • docs/: Contains project-related documentation.
  • scripts/: Contains scripts for setup, configuration, and auxiliary tasks.

Installation

To install the LinuxCnc_PokeysLibComp project, follow these steps:

git clone https://github.com/zarfld/LinuxCnc_PokeysLibComp.git
cd LinuxCnc_PokeysLibComp
sudo sh install.sh

Hardware Requirements

The project has been tested with the following hardware:

  • RaspberryPi4 (for LinuxCNC)
  • PoKeys57E
  • PoExtBusOC16CNC for Axes-Stepper Enable/Pulse/Dir
  • CNC keyboard – PoNETkbd48CNC
  • PoRelay8 – Relay extension board
  • PoExtBusOC16
  • PoKeys57CNC
  • PoStep25-32 (v1.3)

Library Status

The following features have been implemented and tested:

  • [e] Connecting to USB devices
  • Connecting to network devices
  • Reading device data
  • Reading digital inputs
  • Writing digital outputs
  • Reading analog inputs
  • PoExtBus writing
  • PoExtBus reading
  • LCD operations
  • Matrix LED
  • Setting pin functions
  • Reading pin functions
  • Setting pin key codes
  • Reading pin key codes
  • PWM operations
  • Pulse engine operations
  • [i] Matrix keyboard setup
  • [i] Matrix keyboard reading
  • kbd48CNC set LED
  • kbd48CNC get Button Status
  • Using encoders
  • I2C operations
  • SPI operation
  • PoIL operations
  • [i] 1-wire operations

x ... available i ... implemented but not tested ! ... implemented but not working yet p ... planned e ... known issue

PoRelay8:

  • needs to be connected in Parallel to kbd48CNC with white PoExt Cable OR using Canbus (connecting it using the Red PoExtBus cable to the i2C extender which is delivered with kbd48CNC will not work)
  • if it is used together with "non smart" PoExtBus devices (e.g. PoExtBusOC16) use "PoExtBus - Smart" page on Pokeys-SW to set "Sequence ID"
  • inputs not available (yet?)

PoExtBusOC16

  • can be set using pokeys.0.PoExtBus.#.Out-0..7 (all 16outs can be used pokeys.0.PoExtBus.0 and pokeys.0.PoExtBus.1)
  • inputs not available

PoExtBusOC16CNC

  • see "PulseEnginev2"

kbd48CNC:

  • using as PoNet-extension buard attached to Pokeys57E
  • using CanBus (6Pin MicroMatch Connector) directly on Pokeys57CNC

Pokeys57E

  • connected using Ethernet
  • Read&Set of Digital IO on HalPins pokeys.0.Pins.*.DigitalValueGet / DigitalValueSet
  • Readt of AnalogValue IO on HalPins pokeys.0.Pins.*.AnalogValue on the pins that support that
  • periphals listed above was tested on this device.

changing structure of IOs to "Canonical Device Interface" in work

Pokeys57CNC

  • connected using USB
  • connected using Ethernet
  • LinuxCNC example config in Work (using the pinsetup as available on PCB)
  • Switchng OC Outputs pokeys.0.PEv2.ExternalOCOutput.0..3
  • Switchng Relay Outputs (SSR1 & 2 -> pokeys.0.PEv2.ExternalRelayOutput.0 & 1) (SSR1 & 2 -> pokeys.0.PEv2.ExternalRelayOutput.0 & 1)
  • using USB connection seems "faster" than using ethernet - may depend on networksetup (networkswitch vs. direct connection)

Pokeys57E

  • connected using USB (currently could not connect on newer distributions see issue #231 )

PulseEnginev2

  • Setting Status Running/Stop depending on LinuxCNC state ("machine-on")
  • Reading Status of Limit+/- and Home switches
  • setting External OC and RelayOutputs - in case that "Extended IO" is available and activated (Pokeys57CNC)
  • setting PinConfiguration for Limits, Home, Probe & Emergency switches based in LinuxCNC-INI configuration - not reliable
  • parametrizing MaxSpeed, MaxAccelleration, ... based on LinuxCNC configuarion (mm/sec to pulses/sec conversion is being done using JOINT.*.STEPSCALE)