EATC-120 toolchanger driver

The EATC-120 module is almost finished !



This is a driver for the EmcoTurn 120/220 original 8 positions ATC.
This design is derived from the excellent Toolerator 3000 USB controlled driver.
EATC-120 is adding MODBUS capabilities for easy integration with an industrial environment.
Single 24V power supply with embedded 5V DC/DC converter.
The “brain” of the module is an Arduino Micro.
The motor is driven by an LMD18245T providing current control.
The lock status is automatically detected by measuring the peak current when the motor stalls.
Everything is reported in MODBUS registers.
Integration with Machinekit/LinuxCNC is easy thanks to “mb2hal” HAL component.

I have found a nice empty DIN rail enclosure and designed a special PCB to fit with it.



I need to finalize integration and test with my Emco lathe before publishing.

Stay tuned !

Control panel bracket

Just built a strong bracket for the control panel.
The door can slide freely under the panel.
Nest step is electrical cabling of the link between the control panel and the motor controllers.Control panel installed 01 Control panel installed 02 Control panel installed 03


Motor drivers

VFD and stepper drivers installed in the electrical box.
Vexta driver autotest feature shows that motors are in good condition and 5 phases cabling is ok.
Need to integrate the control panel for further validation.

Adding velocity estimation in hal_pru_generic encoder

I needed this feature for my lathe control panel project. The goal is to drive the jog steps size by the rotation speed of the jog wheels.

The algorithm has been validated from 5 Hz to 100 kHz.
Maximum measurement error is 1%. See curves below.

The patch is available here:


HAL configuration

loadusr -w ../

loadrt threads name1=servo-thread period1=1000000
loadrt hal_pru_generic prucode=$(HAL_RTMOD_DIR)/xenomai/pru_generic.bin pru=0 num_encoders=1 num_pwmgens=1 pru_period=2500 halname=hpg
addf hpg.update servo-thread
addf hpg.capture-position servo-thread

setp hpg.encoder.00.chan.00.A-pin 7 #925 ENCxI
setp hpg.encoder.00.chan.00.counter-mode 2 #Up Counter (counts rising edges on A, always counts up, B ignored)

setp 921 #PWM1
setp hpg.pwmgen.00.out.00.enable 1
setp hpg.pwmgen.00.pwm_period 1000000
setp hpg.pwmgen.00.out.00.value 0.5

loadusr -w sleep 1
loadusr -w python


import subprocess
import time
import os

def readpin(p):
 r = subprocess.check_output('halcmd -s show pin ' + p + '|head -1',shell=True) 
 lst = r.split()
 return lst[3]

def setpin(p, v):
 subprocess.check_output('halcmd -s setp %s %d' % (p, v), shell=True)

freq = 5.0
prev_freq = 0.0
maxerror = 0
f = open('result.csv', 'w')
line = 'in(Hz), out(Hz), err(%), latency(ms)'
print line
f.write(line + '\n')

while freq < 100e3:
 period = int(1e9/freq/2500) * 2500 # because pru_period=2500
 real_freq = 1e9/period
 if (real_freq <> prev_freq):
 prev_freq = real_freq
 setpin('hpg.pwmgen.00.pwm_period', period)
 measured_freq = float(readpin('hpg.encoder.00.chan.00.velocity'))
 latency = float(readpin('hpg.encoder.00.chan.00.latency')) * 1e-6
 error = abs(real_freq / measured_freq - 1.0)
 maxerror = max(maxerror, error)
 line = "%8.1f, %8.1f, %4.2f, %3.0f" % (real_freq, measured_freq, error*100.0, latency)
 print line
 f.write(line + '\n')
 freq = 1.1*freq

print "Max error %.1f%s" % (maxerror*100.0, '%')

Emco Turn 120P Machinekit control panel

Brainstorming, CAD, CAM, simulation, wood, machining, gluing, sanding, HIPS … the control panel is almost ready!

The structure of the control panel is made of 5mm plywood. The red color is coming from a 1mm sheet of HIPS. Everything machined on my CNC-6040 router with 3.17mm carbide endmill.

The touchscreen is a Beetronics 12″ model. Connected through HDMI to the BeagleBone Black board. Easy configuration: there is native support for the touchscreen USB pointing device in the Machinekit Linux image!20160320_231247


Step by step manufacturing of the control panel.

First step was CAD design with ViaCAD software.CompatWindow_2016-03-10_00-55-18

Some 3D rendering with ViaCAD.CompatWindow_2016-03-12_17-06-53 CompatWindow_2016-03-12_17-07-45

High quality CG rendering and compositing with DAZ3D Carrara 8.5.On the real machine, I will add a frame to hang the panel above the sliding door area.
EMCO 120P Fake Control panel

CAM done with BobCAD-CAM. Below a simulation to check everything before machining.BobCAD-CAM - [Emco120 Control Panel V14 Cover]_2016-03-20_13-56-58

Plywood panel machined with 3.17mm carbide endmill. Some pockets to have 2mm thickness for industrial buttons fixture.



Gluing all parts together, and waiting 2 hours before removing clamps.20160320_185541Final result!20160320_231303

MPG and lights will be managed by an Arduino UNO. Stay tuned …

Emco Turn 120P retrofit

My new project is the retrofit of an Emco Turn 120P CNC lathe.

For the motion controller, I have chosen Machinekit running on a Beaglebone Black board. 12″ touchscreen with Gmoccapy GUI. A Controllino PLC to manage all non-realtime I/O such as the pneumatic chuck, the tailstock, the pumps, etc …

The original 5-phases stepper motors has been kept. They are driven by two Vexa UDK5128N drivers. Need 110V AC source for them, coming from an auto-transformer.

The original spindle DC motor has been replaced by a 3 kW AC motor driven by an Hitachi NE-S1-022 VFD. This VFD is controlled over MODBUS by the Machinekit controller through the PLC. I have patched the standard MODBUS over TCP stack to have a gateway to the RS485 bus.

Here is the global schematic diagram of the electronics.

Emco120 Machinekit Electronics V03

Next step is the modification of the Probotix PBX-BB cape to give access to the eQEP2 quadrature encoder for the spindle position sensor.

Wino-board adapter for 2.54mm pitch

The Wino-board is very interesting for IoT home projects. It is an Arduino tiny board including Wifi interface.

The pitch of the connectors is 2mm to optimize the footprint. But this is not so easy to use with 2.54mm pitch common breadboards. So, I have designed a small adapter to convert from 2mm to 2.54mm pitch.

TARGET 3001! V17 light - [1 PCB XprojectswinoboardAdapterWinoboard adapter _2015-12-21_21-28-56

Here is the PCB machined on my CNC-6040. The label is not finished because the mill broke during the engraving.20151221_204749

The fully assembled adapter board with the Wino-board device soldered on the top.20151221_212625


Full project including Gerber files and Target 3001! design : Winoboard adapter