@EvilDeece
LinuxCNC For Fun & Profit
(now with deadly lasers)
Alastair D’Silva
@EvilDeece
LCA 2016
@EvilDeece
Water Cooling
@EvilDeece
Buy one now
for only $540!
@EvilDeece
Original control board
@EvilDeece
Parallel Port breakout board
@EvilDeece
Motor control
@EvilDeece
FlexPCB interface
@EvilDeece
End stops
@EvilDeece
G0 X0 Y0
(fire laser)
G0 X100 Y0
(fire laser)
G0 X100 Y100
(fire laser)
G0 X0 Y100
(fire laser)
Measure and update the millkins config with the skew
Calibration
a b
c
cos(ϴ/2) = ((b/2)2
+ c2
- (a/2)2
) /
bc
ϴ
@EvilDeece
Interfacing the laser
PSU
@EvilDeece
Configure Pulse Per Inch (PPI) mode
@EvilDeece
Demo
@EvilDeece
Problems
@EvilDeece
Invert laser control so it is off while the computer is
booting
Raster Scans
Coolant Temperature/Flow & Lid interlocks
Add Replicape support to MachineKit & move to
Beaglebone Black
Webcam Monitoring
Jog controls
Future
@EvilDeece
Slide 3 http://www.ebay.com.au/itm/CO2-LASER-ENGRAVER-
CUTTER-ENGRAVING-CUTTING-MACHINE-CARVING-40W-
LASER-PRINTER-/321808036566
Slide 5 www.ebay.com.au/itm/5-axis-CNC-Breakout-Board-
with-optical-coupler-For-Stepper-Motor-Driver-
MACH3-/172045790779
Slide 6 http://www.aliexpress.com/item/M542-Leadshine-256-
Microstep-driver-2-phase-4-2A-DC18-48V-fit-57-86-motor-
for/32341077087.html
Slide 11 http://www.buildlog.net/blog/2011/12/getting-more-
power-and-cutting-accuracy-out-of-your-home-built-laser-
system/
Credits
@EvilDeece
Twitter @EvilDeece
Email alastair@d-silva.org
Questions?
Background:
Currently an open source developer with IBM's
Ozlabs, this talk does is not endorsed by IBM and
does not reflect their opinions
One of the co-founders of MHV
Hobby business “Crankybot” making science based
jewllery
Preparing for christmas markets, building lots of
stock. Water cooling failed.
This is why – the adapter connecting the hose was
hot-glued in, and the water got warm enough (after
a day of operation) to soften the hotglue and the
adapter popped out.
Cooling of the tube failed, and the tube current
dropped from 12mA to 0.
Needed a replacement in a hurry, found a similar
replacement shipped from Sydney for $540.
We tried the software it came with (CorelLaser +
pirated Coreldraw). Rastered well, but there was no
power control of the laser through software, so we
could not vector engrave.
Decided to go back to LinuxCNC which we were
running on the original machine.
LinuxCNC is a framework, with a couple of typical
applications that are used, but is completely
extensible.
Can drive simple 2-3 axis machines, lathes, 5 axis,
multidimensional robots. Can drive steppers,
servos, DC motors + position feedback.
First thin to do is get the machine talking to the PC.
LinuxCNC can't use USB for the realtime
components, so the parallel port is the typical
method for cheap machines.
Can also use FPGA boards for faster step rates, or
use MachineKit on the Beaglebone Black to
leverage the PRU microcontrollers for much higher
step rates.
Limiting factor on the step when bit-bashing steppers
is the latency jitter from realtime linux. Some tricks
to reduce it, such as tying interrupt handling to 1
core and running applications on another.
Once you have data flowing out, need to get it into a
motor.
Microstepping controller synthesizes virtual steps by
moving the motor between it's physical steps.
Increases resolution, but trades off torque and
linearity. We use it to get smoother curves.
Take step and direction pulses, and increment the
stepper motor position accordingly. To correlate it
correctly, you need to know how many steps per
unit distance is required. First approximation by
looking at the belt pitch, motor gear teeth, and
microsteps per revolution.
Problem: X motor & end-stop interfaced via flex-pcb.
Fabricate an interface on protoboard using 28 gauge
wire-wrap wire soldered directly to the flexpcb.
Tell the machine when an axis is at the limit of travel.
Commonly a microswitch or photointerruptor.
Next we calibrate the motion of the machine.
Manually cut 2 points 100mm apart, then measure
the distance and update the config to correct for the
error.
Next, cut 4 points on the corners of a square, use a
bit of trig to calculate the skew of the machine, and
use the “millkins” kinematics module to correct the
skew. This maps the logical coordinates that the g-
code refers to, to physical positions on the machine
axes.
The computer needs to be able to fire the laser.
There are 2 lines on the PSU to do this, one is ative
high and one is active low.
Used an SMD optocoupler with a pullup resistor to
drive the active-low line to ground when the line
from the parallel port goes high.
Motion requires acceleration, which means that you
have varying speeds. On a laser, this means that if
the laser power is held constant, you end op with
varying power per unit area, with more power
delivered at the start/end of cuts when the head is
under acceleration.
Use a plugin to configure PPI mode, where the user
nominates power per area (as pulses per mm),
rather than raw constant power to the laser.
@EvilDeece
Demo
Big problem: some parallel outputs come up high,
which leaves the laser on until LinuxCNC is started
and takes control.
Laser parked over a hole in the bottom of the
machine, burnt a hole through the table and set it
on fire.
Fix the laser state on powerup!
Test raster scanl
Add interlocks for coolant temperature & flow, safety
interlock on the lid
Add support for Replicate to Machinekit so I can use
the TMC2100 stepper controllers for quieter/faster
operation
Webcam monitoring
Jog controls
@EvilDeece
Slide 3 http://www.ebay.com.au/itm/CO2-LASER-ENGRAVER-
CUTTER-ENGRAVING-CUTTING-MACHINE-CARVING-40W-
LASER-PRINTER-/321808036566
Slide 5 www.ebay.com.au/itm/5-axis-CNC-Breakout-Board-
with-optical-coupler-For-Stepper-Motor-Driver-
MACH3-/172045790779
Slide 6 http://www.aliexpress.com/item/M542-Leadshine-256-
Microstep-driver-2-phase-4-2A-DC18-48V-fit-57-86-motor-
for/32341077087.html
Slide 11 http://www.buildlog.net/blog/2011/12/getting-more-
power-and-cutting-accuracy-out-of-your-home-built-laser-
system/
Credits
@EvilDeece
Twitter @EvilDeece
Email alastair@d-silva.org
Questions?

LinuxCNC for Fun & Profit

  • 1.
    @EvilDeece LinuxCNC For Fun& Profit (now with deadly lasers) Alastair D’Silva @EvilDeece LCA 2016
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
    @EvilDeece G0 X0 Y0 (firelaser) G0 X100 Y0 (fire laser) G0 X100 Y100 (fire laser) G0 X0 Y100 (fire laser) Measure and update the millkins config with the skew Calibration a b c cos(ϴ/2) = ((b/2)2 + c2 - (a/2)2 ) / bc ϴ
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
    @EvilDeece Invert laser controlso it is off while the computer is booting Raster Scans Coolant Temperature/Flow & Lid interlocks Add Replicape support to MachineKit & move to Beaglebone Black Webcam Monitoring Jog controls Future
  • 15.
    @EvilDeece Slide 3 http://www.ebay.com.au/itm/CO2-LASER-ENGRAVER- CUTTER-ENGRAVING-CUTTING-MACHINE-CARVING-40W- LASER-PRINTER-/321808036566 Slide5 www.ebay.com.au/itm/5-axis-CNC-Breakout-Board- with-optical-coupler-For-Stepper-Motor-Driver- MACH3-/172045790779 Slide 6 http://www.aliexpress.com/item/M542-Leadshine-256- Microstep-driver-2-phase-4-2A-DC18-48V-fit-57-86-motor- for/32341077087.html Slide 11 http://www.buildlog.net/blog/2011/12/getting-more- power-and-cutting-accuracy-out-of-your-home-built-laser- system/ Credits
  • 16.
  • 17.
    Background: Currently an opensource developer with IBM's Ozlabs, this talk does is not endorsed by IBM and does not reflect their opinions One of the co-founders of MHV Hobby business “Crankybot” making science based jewllery Preparing for christmas markets, building lots of stock. Water cooling failed.
  • 18.
    This is why– the adapter connecting the hose was hot-glued in, and the water got warm enough (after a day of operation) to soften the hotglue and the adapter popped out. Cooling of the tube failed, and the tube current dropped from 12mA to 0.
  • 19.
    Needed a replacementin a hurry, found a similar replacement shipped from Sydney for $540.
  • 20.
    We tried thesoftware it came with (CorelLaser + pirated Coreldraw). Rastered well, but there was no power control of the laser through software, so we could not vector engrave. Decided to go back to LinuxCNC which we were running on the original machine. LinuxCNC is a framework, with a couple of typical applications that are used, but is completely extensible. Can drive simple 2-3 axis machines, lathes, 5 axis, multidimensional robots. Can drive steppers, servos, DC motors + position feedback.
  • 21.
    First thin todo is get the machine talking to the PC. LinuxCNC can't use USB for the realtime components, so the parallel port is the typical method for cheap machines. Can also use FPGA boards for faster step rates, or use MachineKit on the Beaglebone Black to leverage the PRU microcontrollers for much higher step rates. Limiting factor on the step when bit-bashing steppers is the latency jitter from realtime linux. Some tricks to reduce it, such as tying interrupt handling to 1 core and running applications on another.
  • 22.
    Once you havedata flowing out, need to get it into a motor. Microstepping controller synthesizes virtual steps by moving the motor between it's physical steps. Increases resolution, but trades off torque and linearity. We use it to get smoother curves. Take step and direction pulses, and increment the stepper motor position accordingly. To correlate it correctly, you need to know how many steps per unit distance is required. First approximation by looking at the belt pitch, motor gear teeth, and microsteps per revolution. Problem: X motor & end-stop interfaced via flex-pcb.
  • 23.
    Fabricate an interfaceon protoboard using 28 gauge wire-wrap wire soldered directly to the flexpcb.
  • 24.
    Tell the machinewhen an axis is at the limit of travel. Commonly a microswitch or photointerruptor.
  • 25.
    Next we calibratethe motion of the machine. Manually cut 2 points 100mm apart, then measure the distance and update the config to correct for the error. Next, cut 4 points on the corners of a square, use a bit of trig to calculate the skew of the machine, and use the “millkins” kinematics module to correct the skew. This maps the logical coordinates that the g- code refers to, to physical positions on the machine axes.
  • 26.
    The computer needsto be able to fire the laser. There are 2 lines on the PSU to do this, one is ative high and one is active low. Used an SMD optocoupler with a pullup resistor to drive the active-low line to ground when the line from the parallel port goes high.
  • 27.
    Motion requires acceleration,which means that you have varying speeds. On a laser, this means that if the laser power is held constant, you end op with varying power per unit area, with more power delivered at the start/end of cuts when the head is under acceleration. Use a plugin to configure PPI mode, where the user nominates power per area (as pulses per mm), rather than raw constant power to the laser.
  • 28.
  • 29.
    Big problem: someparallel outputs come up high, which leaves the laser on until LinuxCNC is started and takes control. Laser parked over a hole in the bottom of the machine, burnt a hole through the table and set it on fire.
  • 30.
    Fix the laserstate on powerup! Test raster scanl Add interlocks for coolant temperature & flow, safety interlock on the lid Add support for Replicate to Machinekit so I can use the TMC2100 stepper controllers for quieter/faster operation Webcam monitoring Jog controls
  • 31.
    @EvilDeece Slide 3 http://www.ebay.com.au/itm/CO2-LASER-ENGRAVER- CUTTER-ENGRAVING-CUTTING-MACHINE-CARVING-40W- LASER-PRINTER-/321808036566 Slide5 www.ebay.com.au/itm/5-axis-CNC-Breakout-Board- with-optical-coupler-For-Stepper-Motor-Driver- MACH3-/172045790779 Slide 6 http://www.aliexpress.com/item/M542-Leadshine-256- Microstep-driver-2-phase-4-2A-DC18-48V-fit-57-86-motor- for/32341077087.html Slide 11 http://www.buildlog.net/blog/2011/12/getting-more- power-and-cutting-accuracy-out-of-your-home-built-laser- system/ Credits
  • 32.