Skip to the content
PCBKitNew board
2 layers43.2 × 64.1 mmInterface, the printed circuit board in 3D

A small AVR controller and a component to connect high precision encoder to LinuxCNC via Modbus RTU

Size
43.2 × 64.1 mm
Copper layers
2
Thickness
1.6 mm
Parts
35
Nets
29
Pads
116
Tracks, vias
358, 13
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
8 Sep 2019
Updated
27 Oct 2019

Overview

Interface is an open-source printed circuit board by futurelink, from the futurelink/linuxcnc-spindle-encoder repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 43.2 × 64.1 mm with 35 parts on 29 nets, routed with 358 tracks and 13 vias.

It is built around the L7805 and MAX483EPA+. Its parts include 12 resistors, 6 capacitors, 6 diodes, 5 connectors and 3 ICs. It belongs with the interfaces and adapters and robots and motor control boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

2

README

README.md

Incremental encoder Modbus RTU interface

This device is an interface to read incremental encoder meanings with Modbus. It supports encoders from 100 to 1000PPR and interpolate position up to 4 times, so maximum resolutuion is 4000PPR.

Device KiCAD 3D view

It's tested on 1000PPR encoder and it reads correct values on about 1000RPMs on internal 8MHz ATtiny2313 RC oscillator, and about 2000PPM on 16MHz crystal.

What does it do?

This small attiny2313 module and LinuxCNC component allows you to connect almost any precision encoder into LinuxCNC and it works even if it has no Z phase output.

It allows your lathe execute G33, G33.1 (synchronized motion) and G76 (threading) canned cycles and use G96 (constant surface speed) spindle control strategy.

Modbus

Device has slave ID 0x85. There are 6 16bit analog registers starting from reference address 0x00, containing (0)heartbeat, (1)current position, (2)position increment, (3)current speed in RPM, (4)current Z-index value and (5)encoder direction.

Device UART speed is 38400bps.

Connection to LinuxCNC

Go to ./linuxcnc and execute:

text
$ sudo make

This will install component into your LinuxCNC.

Then you need this component in your HAL:

text
loadrt spindle_encoder
addf spindle-encoder.0 servo-thread
setp spindle-encoder.0.ppr 4096
net spindle-heartbeat  spindle-encoder.0.heartbeat <= mb2hal.spindle-encoder.heartbeat.int
net spindle-pos-in     spindle-encoder.0.pos-in <= mb2hal.spindle-encoder.pos-in.float
net spindle-pos-out    spindle-encoder.0.pos-out => motion.spindle-revs
net spindle-speed-rpm  spindle-encoder.0.speed-rpm <= mb2hal.spindle-encoder.speed-rpm.int
net spindle-speed      spindle-encoder.0.speed-rps => motion.spindle-speed-in
net spindle-index      spindle-encoder.0.index-in <= mb2hal.spindle-encoder.index.int
net spindle-index-ena  spindle-encoder.0.index-enable <=> motion.spindle-index-enable
net spindle-dir        spindle-encoder.0.direction <= mb2hal.spindle-encoder.direction.int

Also you'll need to load mb2hal module into userspace:

text
loadusr -W mb2hal config=modbus_config.ini

Copy modbus_config.ini from ./linuxcnc into your lathe configuration directory. Write your serial port device to SERIAL_PORT option in that ini file. Correct SERIAL_DELAY_MS if you need.

Parts

35
QtyValueFootprintReferences
64K7Resistor_SMD:R_0805_2012MetricR4, R5, R6, R7, R8, R9
410KResistor_SMD:R_0805_2012MetricR1, R10, R11, R12
3BZX84CxxDiode_SMD:D_SOT-23_ANKD3, D4, D5
2100uFCapacitor_SMD:CP_Elec_6.3x5.3C4, C5
21KResistor_SMD:R_0805_2012MetricR2, R3
222pFCapacitor_SMD:C_0805_2012MetricC1, C2
10,1uFCapacitor_SMD:C_0805_2012MetricC6
10.1uFCapacitor_SMD:C_0805_2012MetricC3
116MHzCrystal:Crystal_SMD_HC49-SDY1
1ADDRESS_SWButton_Switch_THT:SW_DIP_SPSTx04_Slide_9.78x12.34mm_W7.62mm_P2.54mmSW1
1ATTINY2313-SPackage_SO:SOIC-20W_7.5x12.8mm_P1.27mmIC1
1CONN_01X04Connector_JST:JST_XH_S4B-XH-A_1x04_P2.50mm_HorizontalP3
1CONN_01X06Connector_JST:JST_XH_S6B-XH-A_1x06_P2.50mm_HorizontalP1
1CONN_02X03Connector_PinHeader_2.54mm:PinHeader_2x03_P2.54mm_VerticalP2
1DDiode_SMD:D_1206_3216MetricD6
1L7805Package_TO_SOT_SMD:TO-252-2U1
1LED_REDLED_SMD:LED_1206_3216MetricD1
1LED_YELLED_SMD:LED_1206_3216MetricD2
1MAX483EPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU2
1Screw_Terminal_01x02TerminalBlock:TerminalBlock_bornier-2_P5.08mmJ2
1Screw_Terminal_1x02TerminalBlock:TerminalBlock_bornier-2_P5.08mmJ1

The 34 most common of 35 parts.

Questions

How big is the Interface PCB?

It measures 43.2 × 64.1 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Interface use?

35 parts, built around the L7805 and MAX483EPA+. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Interface KiCad files?

From the futurelink/linuxcnc-spindle-encoder repository on GitHub, at the commit this page was made from: the board is device/v1.3/interface.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Interface design in my own project?

Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

More from futurelink/linuxcnc-spindle-encoder

1
  • 2 layers43.2 × 64.1 mmInterface, the printed circuit board in 3D

    Interface

    futurelink/linuxcnc-spindle-encoder

    A small AVR controller and a component to connect high precision encoder to LinuxCNC via Modbus RTU

    41 parts19GPL-3.0

Similar boards

  • 2 layers33.5 × 58 mmRS485 HAT, the printed circuit board in 3D

    RS485 HAT

    f0sse/eenx16-modbus-rs485

    Kod för ett kandidatarbete, där ett delmoment var att kommunicera med ABB A43 över Modbus och RS-485.

    10 partsGPL-2.0
  • 2 layers40.6 × 110 mmEuropi surface mount, the printed circuit board in 3D

    Europi surface mount

    Allen-Synthesis/EuroPi

    EuroPi: A reprogrammable Eurorack module based on the Raspberry Pi Pico

    92 parts584CC0-1.0
  • 2 layers132.1 × 45.7 mmIPoS, the printed circuit board in 3D

    IPoS

    peterheinrich/InternetOverSpaghetti

    Transmitting IP packages over a pair of spaghetti thus demonstrating how media independent IP really is.

    42 parts342
  • 2 layers59.7 × 57.5 mmFunBox, the printed circuit board in 3D

    FunBox

    GuitarML/FunBox

    Stereo guitar pedal platform using Daisy Seed.

    61 parts289MIT
  • 2 layers90.8 × 35.6 mmERCF easy brd, the printed circuit board in 3D

    ERCF easy brd

    Tircown/ERCF-easy-brd

    More informations on how to reset for flashing:\ https://wiki.seeedstudio.com/Seeeduino-XIAO/#enter-bootloader-mode

    28 parts195GPL-3.0
  • 2 layers111.3 × 106.4 mmSuper Sixteen v1, the printed circuit board in 3D

    Super Sixteen v1

    matthewcieplak/super-sixteen

    Code and schematics for the Super Sixteen Eurorack sequencer

    141 parts171
  • 2 layers91.4 × 71.1 mmPico w rover, the printed circuit board in 3D

    Pico w rover

    NikodemBartnik/Mini-Mars-Rover

    Educational robotic platform made to look like a mini mars rover

    20 parts143MIT
  • 2 layers144.1 × 182.2 mmSHVC CPU-01, the printed circuit board in 3D

    SHVC CPU-01

    starlightk7/OpenSFC

    OSHW Reproduction Parts related to the Super Famicom / Super Nintendo game console

    498 parts114CERN-OHL-S-2.0