K40 Whisperer: Open source software to control the stock K40 controller board

K40 Whisperer: Open source software to control the stock K40 controller board. (EDIT: Only stock boards that work with LaserDRW.)
http://www.scorchworks.com/K40whisperer/k40whisperer.html

K40 Whisperer does not required the use of the USB key (dongle) or any of the standard software that comes with the laser cutter (i.e. LaserDRW, Corel Laser). It will work under Windows, Linux and MAC (MAC is un-tested). K40 Whisperer accepts SVG and DXF files as input.

124676b65c6d9ebf7c92e7e79d003453.png

Interesting … so you have reverse engineered the communications protocol with the Moshi controller?
Is that communications Gcode or proprietary?

#K40ControlSoftware

Yes, I reverse engineered the communication between LaserDRW and the K40.

I didn’t think the board they use with LaserDRW was the same as the board used with Moshidraw. Can you run LaserDRW with a laser cutter that came with MoshiDraw?

The communication format is proprietary. It is called “LHYMICRO-GL” (no relation to HPGL) If you save a EGV file from LaserDRW you can see the format. (at least some of it)

Well done!

@Scorch​ - mine came with a Nano board (M2) and LaserDRW. I think Moshi board machines came with MoshiDraw but I haven’t kept up in the past year if they came out with something else for Moshi board based machines.

@Scorch​ will it be open source?---- It’s Python. YAY! @cprezzi another protocol to the lab!

to make it clear to all, your stock board is a Nano. and you don’t know if it work with a Moshi.

What great news. I’ve seen the @Scorch​​​ blog before and was much impressed, but this project is a real treat!

I’ve already downloaded his source code, and have much to learn there. On his blog and video he mentions needing to test on other versions of the controller board, so I hope others will step up for that. (I can’t wait to get my machine back online.)

Even with a few limitations that he mentions, this is a very capable start. It’s such a delight to see work presented in the true spirit of community and open source.

Congratulations!

Nice job. Great alternative for those who don’t want to make the leap into a whole different controller board and the electronics needed for that conversion.

@Jorge_Robles ​ can this be added to LW?

Will! I guess :slight_smile:

@StephaneBUISSON whoops I meant Nano

So a Gcode to LHYMICRO-GL module would be interesting then all CNC software would work with it???

We will explore the idea

Testing it with the newer HT Master 5 & 6 controllers that comes in the newer type of K40´s soon, to confirm if it works with the software or not.
Just have to convert from Cohesion3d back to original again :slight_smile:

Really like this idea! Changes the need for Corel or LaserDrw completely, all thumbs up!

@Scorch I have a semi-functional nano board I can send you if you need one for offline testing. Everything works except power control to the laser. (not getting a good ground on L)

@Jorge_Robles Yes, it is open source (GPL)

@HalfNormal No thanks, A semi-functional board would be fun to play with but I don’t think I would ever get around to it.

Thanks for doing this ! It makes no sense to me that these controller boards should be closed source and locked.

I tried to run it under Debian and found it reporting ‘no PIL loaded’. In one place you’ve got a specific workaround for Debian, but I found it also necessary to make a similar change in svg_reader :

try:
    from PIL import Image
    from PIL import ImageTk
    from PIL import ImageOps
    import _imaging
except:
    try:
        from PIL.Image import core as _imaging # for debian jessie
    except:
        PIL = False
        print "PIL not loaded in svg_reader"

I’m not sure why this doesn’t get loaded by the similar code in K40_whisperer.py - I’m no great expert at python, so there might be a better fix.

@artag
Actually the better fix would be to remove / comment out the lines in svg_reader.py that load tk specific items.
from PIL import Image
# from PIL import ImageTk
from PIL import ImageOps
# import _imaging

There is some cleanup to be done in some of the code. Be aware I am highly suspect of that fix for Debian. I was trying something and I accidentally left in in the code. If your system is using that “fix” Python PIL may need to be removed/reinstalled.

Does the Raster image display correctly for you when you open an SVG file?