Working with Cheap Chinese Laser Engravers

I recently bought this piece of rubbish on Ebay: http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=130185718374&ssPageName=ADME:X:AAQ:US:1123

It is a 40W CO2 laser engraver which supposedly speaks HPGL. After many hassles (such as the unit constantly resetting itself, and the software unable to control the unit, both solved by replacing the shonky parallel cable supplied with the machine), I have now managed to get it working, but unfortunately, it doesn't work as an HPGL/2 printer, so I can't drive it directly from Windows. This means that I have to use the godawful Moshidraw software that came with it, which, as a CNCZone.com member puts it, is barely a step up above an Etch-a-Sketch. The version that shipped with the unit could not even start (it GPFs trying to access unallocated memory), but I found a slightly newer version at http://iehk.net/download/dl_IE300_01.html. It is still a pretty lousy product, but at least it starts.

What I really want to do with it is cut vectors, unfortunately, the Moshidraw software can only import HPGL files, so importing directly from CAD or drawing packages is out of the question. After some data massaging, I created a sample file in the format it likes, and loaded it as an image into Moshidraw. What happened next is beyond belief:

When Moshidraw imports HPGL files, it does not import them as vectors, instead, it renders it to a bitmap and loads the bitmap. When cutting the file as vectors (as opposed to raster scanning), it then traces (poorly) the bitmap and cuts the resulting vectors!

Of course, this is grossly inaccurate, and the poor tracing routines result in messy output that bears little resemblence to the original.

A couple of others have dealt with this situation by attacking the hardware. One option is to replace the controller with one which recognises step/direction pulses for the stepper motors, and also passes additional IO lines for home/limit switches, and laser control (use a transistor or triac rather than a relay to control it though!). This can then be controlled with Linux EMC or Mach3. Another is to replace the controller with the controller from a pen plotter. Another person has replaced his controller with the control board from a Roland plotter.

I am taking a different approach, and am attacking the software. Moshidraw outputs a restricted subset of HPGL. These are the commands that Moshidraw outputs:

  • IN;
  • PD;
  • PU;
  • VS;
  • SP;

In order to generate a suitably simply HPGL file, I installed a generic HPGL/2 print driver under Windows, and set it to output to a file. The output of that file can then be run through hp2xx to convert it to simplified HPGL. Its not quite right as it uses floasts instead of integers, and sends a lot of PA; commands. Running it through sed removes the unnecessary data.

hp2xx -m hpgl -f- test.prn | sed 's/^SP1;SP0;SP0;SP1;SP1;/IN;VS12;SP1;/; s/PA;//g; s/\.[0-9]*//g;' > output.prn

The result is something that matches Moshidraw's PLT file output.

Unfortunately, it is still not quite enough. Outputting this file to the engraver causes it to reset continuously, as does outputting a PLT file generated by Moshidraw itself! My guess is that there is some scrambling going on. I don't think the PC is bit-bashing the IO lines on the printer port to give step/direction pulses, as the engraver continues to work if it is unplugged during engraving.

My next step is to snoop the printer port on the PC and try to make sense of the results.

3 March 2008 Update:

I have given up trying to snoop the data. The software is accessing the printer port directly, so I am unable to use Portmon to snoop the traffic under Windows XP. I have tried running the software in VMWare, so I can grab the data in Linux, but the software can't see the USB dongle used for copy protection (who would want to spend money copy protecting a steaming pile like Moshidraw I don't know).

I have picked up a 3 Axis CNC control board on Ebay for < USD$100, and have just finished hacking it into my engraver. All I need now is the right cable to connect up the parallel port, and I can use Linux EMC instead! *yay*

24 April 2008 Update:

I had issues with the laser staying permanently on when trying to drive it from the parallel port. As it turns out, the laser expects 0V for on, and +24V or high impedance for off. I built a small transistor switcher to allow the parallel port (0V - 3.3V) to toggle the line between 0V & 24V, and it now works properly. As a bonus, the software can generate a PWM signal for the laser, so I now have power control of the laser. This means you can reduce the laser power as the head slows, so you are always using the same power density.

AttachmentSize
laserdriver.sch44.62 KB

Comments

you might be interested

ran across your experience while seeing if i could find manufacturers rather than dealers/resellers of laser engravers.
would be interested in which machine you purchased. the ebay link you provided is out of date.

while searching found redsail in the shandong province. sounds like they actually manufacture.

their downloads page is http://www.hflaser.com/download.html. haven't dug in yet. but the listing looks interesting. don't know if anything would be of interest to you or be a help. at least i have seen mentioned artcut before.

did find your experience interesting. and your ability to solve.....for lack of a better description....inspiring. almost no problem impossible. sometimes frustrating. but solutions are there for those that seek and try.

good luck

dick

Settings?

I own a very similar piece of junk that I'm trying to upgrade in the same way. I'd like to know what settings you use for the number of steps per inch in your control software. Any info you could give me would be much appreciated.

Determining the steps

The resolution is dependant on a number of factors, including the mechanism used (note that these can vary between machines) and the controller (does it do microstepping?).

To determine the resolution, I took a rough guess @ 1000dpi, then sent commands through Linux EMC's MDI console to move 10cm, using the test button to manually fire the laser at the start and end of the movement. I then measured the distance between the two points using a vernier caliper, and adjusted the values accordingly.

I haven't yet fully calibrated it, but as it stands, with my controller set to 8 microsteps, I have:
Steps/rev: 48
Microsteps: 8
Leadscrew Pitch: 38.8mm