In the previous post, I showed how I added limit switch inputs to my CNC driver box. Now its time to attach the actual switches to the machine.Saturday, April 23, 2011
Limit switches, part 2
In the previous post, I showed how I added limit switch inputs to my CNC driver box. Now its time to attach the actual switches to the machine.Thursday, April 21, 2011
Limit switches, part 1
The CNC3040 machine doesn't come with limit switches and having already crashed the machine once I thought it was high time to add ones. The problem is that the driver box doesn't have inputs for the switches. My first idea was to build a passthrough box to break out the input pins, but peeking inside the case I found a nicer solution.
Wednesday, April 13, 2011
Griffin powermate + EMC2
I'm currently designing a physical control panel for use with EMC2 and for that I needed to learn how to use the HAL. HAL is EMC's hardware abstraction layer that provides a sort of virtual breadboard for connecting components, both hardware and software, together. One great thing about it is that it's really easy to write your own userspace HAL components in python. A short tutorial from EMC's documentation shows how. Also, Just Milling Around has a great tutorial on how to interface an Arduino with EMC using a python script.
As an exercise before getting started with my control panel, I decided to write a driver script for a piece of hardware I already have: A powermate jog wheel. My script creates two HAL pins: An output pin that can be connected to axis.N.jog-counts and a boolean input pin to turn the LED on and off.
The powermate HAL script is available here: powermate.py
As an exercise before getting started with my control panel, I decided to write a driver script for a piece of hardware I already have: A powermate jog wheel. My script creates two HAL pins: An output pin that can be connected to axis.N.jog-counts and a boolean input pin to turn the LED on and off.
The powermate HAL script is available here: powermate.py
Friday, March 11, 2011
Improved image carving
JGCGen now has better support for image carving. Since the previous post, I've added two major features. The first is a roughing strategy for removing lots of material fast and in multiple passes so you can carve deeper. The second is the decoupling of image resolution from carving resolution. Stepover distance can now be smaller than a single pixel and jgcgen will interpolate the values in between. Another important change was a rather embarrassing bug fix: the tool shape profiles for flat and ballnose endmills were swapped! No wonder the previous test looked flatter than I expected...
Still on the TODO list: optimize rough path generation to minimize rapids and implement a waterline strategy.
Still on the TODO list: optimize rough path generation to minimize rapids and implement a waterline strategy.
Friday, March 4, 2011
Image carving
JGCGen now includes rudimentary support for heightmap carving. You can see the first test carving below. (source)
Currently only a simple scanning style toolpath generation strategy is implemented, but different methods can be added easily.
Current limitations are:
Currently only a simple scanning style toolpath generation strategy is implemented, but different methods can be added easily.
Current limitations are:
- No interpolation. The minimum stepover is image width or height divided by target width or height. This results in the striated look visible in the above image. A workaround is to use a higher resolution image.
- Single pass only. This limits the depth of the image to the maximum depth your bit can handle.
Tuesday, March 1, 2011
A BF interpreter in g-code
The unfortunately (but aptly) named brainf*ck is my favorite esoteric programming language. The whole language has only 8 commands, yet is Turing equivalent, meaning it has the same computational power as a Turing machine. As amazing as it sounds, this means any computable function can be computed with a BF program! A simple way to prove that a language is Turing complete is to use it to implement another which already has been proven Turing complete. Due to its simplicitly, BF lends itself well to this task.
So, here is a simple BF interpreter written in EMC's RS274 dialect:
(print, PROGRAM START)
o100 while [##<_pc> ne 0]
#1 = ##<_pc>
o101 if [#1 eq 1] (memory increment)
##<_p> = [##<_p> + 1]
o101 endif
o102 if [#1 eq 2] (memory decrement)
##<_p> = [##<_p> - 1]
o102 endif
o103 if [#1 eq 3] (pointer increment)
#<_p> = [#<_p> + 1]
o103 endif
o104 if [#1 eq 4] (pointer decrement)
#<_p> = [#<_p> - 1]
o104 endif
o105 if [#1 eq 5] (loop start)
##<_sp> = #<_pc>
#<_sp> = [#<_sp> + 1]
o105 endif
o106 if [#1 eq 6] (loop end conditional)
#<_sp> = [#<_sp> - 1]
o1060 if [##<_p> ne 0]
#<_pc> = [##<_sp>-1]
o1060 endif
o106 endif
o107 if [#1 eq 7] (print value)
#3 = ##<_p>
(print, ASCII: #3)
o107 endif
g0 x1
#<_pc> = [#<_pc> + 1]
o100 endwhile
(print, PROGRAM END)
This interpreter doesn't support the input command (but that isn't needed for Turing completeness anyway) and just prints out the output in numeric format. This is pretty boring, so I added a set of functions for carving out letters. See the complete source code.
Sunday, February 27, 2011
CNC tests: aluminum
Last time I tried how my CNC3040 machine deals with wood and plastic. Now it's time for some metal.
I tested on a piece of scrap aluminum, so unfortunately I have no idea of the alloy. The tool used was a 3mm 4-flute carbide endmill. Cutting depth was 0.4mm. For coolant I used Biltema brand "Multi-Spray".
The lower cut as seen in the picture was made with a feed rate of 50 mm/min and the one above it at 100mm/min. The faster cut looks cleaner.
I still need to do some more testing, but this machine does appear to be capable of light metalwork.
Subscribe to:
Posts (Atom)





