Originally shared by Frank Herrmann
Mission accomplished
Please check this video with the new XATCv04 running. The Design is realy improved also i switched from Chilipeppr/Javascript/macro to my new REST Service @ http://xpix.eu:8080.
This means, i use now complete pure g-code. Here you can check this with follow url: http://xpix.eu:8080/xatc/replace/xatcv4/tinyg/M6%20T1/2
Read the url so, use xatc replace process and the model is xatcv4 on a tinyg Board. Put the Tool Nr.2 back and get Tool Nr.1.
Now we can use this on another CNC-Controllers like grbl, Smoothie and so on. But we need the commands M4 (rotate spindle in ccw direction) and M8/M9 (switch coolant on/off) to control servo (block/unblock) Spindle.
This Sketch on a normal arduino nano check coolant pin from tinyg and control the servo via interrupt. Works as designed https://create.arduino.cc/editor/xpix/184c2dd7-aec1-40ef-8518-096d754b3f2c/preview
To control the spindle with full power i found this DC-Controller ( 3-36v Dual 15a H-bridge DC Motor Driver 30a for Robot & Car Arduino Compatible for sale online | eBay ) and put this in my 48V Power-supply enclosure, i change the output to ~41V. The Mosfet’s of this device can handle up to 52 Volt and we don’t have a battery, this means no spikes on the input and we can drive this board with higher voltage. Signals are wired:
TinyG GND => DC Controller GND
TinyG SpDir => DC Controller DIR
TinyG PWM => DC Controller PWM
TinyG 3.3V => DC Controller 5V (works also with 3.3V)
To drive this Spindle i changed my TinyG $p1 Config:
$p1frq=10000
$p1csl=100
$p1csh=12000
$p1cpl=0.05
$p1cph=0.95
$p1wsl=100
$p1wsh=12000
$p1wph=0.95
$p1wpl=0.05
$p1pof=0
So, i’ll write a Chilipeppr Widget for the XATC and hope we can use this also for other standard CNC controllers.
Please send me your opinion and comments, thanks!
Frank