Author Topic: Sieg X2 converted to CNC and trying to use Laser & Flexmod P3 driver  (Read 18509 times)

0 Members and 1 Guest are viewing this topic.

Offline MrJoshua

  • Holding
  • Posts: 2
    • View Profile
Hi guys

A while ago I converted my X2 (that I've had for many years now) into a cnc machine loosely following other various conversions etc.  I haven't done any cnc work with it yet due to lack of time to learn properly (apart from trying out the writing wizard to make the machine write with a pen on some paper).
What I'm currently trying to do though is to get the mill and Mach3 to work with a laser setup for Engraving, as it will be mega useful for a hobby I do of turning wooden pens.  Being able to lase names onto them would be brilliant, so I've accumulated the parts needed and got it all wired up, but am having trouble making mach 3 control the laser itself.

I have a 3w diode, which is connected to a Flexmod P3 driver board as they seem to be very popular drivers for this sort of laser.
In Mach3, I have port 17 set as the spindle control (was a spare output pin on the DB25 break out board), with port one as step port, and the PWM input on the Flexmod driver is connected to this, with a separate 8v power supply to it for the diode.

I have used the Jtech plugin for inkscape to try generating some basic gcode to try it out with, and after some initial hassle getting settings right, I now have it working so it can burn writing onto a workpiece and turn the laser on & off as required by sending a percentage of available PWM output to the output pin, the percentage being specified in Inkscape before generating the code, along with the speed etc.

Now here's the issue I have currently.  I am using M3 and M5 to turn the laser on & off as the spindle controls, and this works, but something is happening that I don't understand (I'm very new to CNC sorry!), which is that every time it gets to the start or end of a letter it is 'writing', the machine pauses effectively (regardless of whether the laser is on or off), and I have to hit the big green Go button at that point.  I don't know why this is, but I presume there are codes in there that perhaps should not be.

Here's a sample of the code from the beginning - if someone could have a glance and suggest why it's stopping and making me have to start it between each section I'd be grateful thanks, as I'm so close to having it working correctly that it's getting quite exciting now!

Code: [Select]
M5 S0

G90
G21
G0 F500
G0 X36.9992 Y15.1254
G4 P0
M3 S127
G4 P100
G0 F200.000000
G0 X36.9441 Y15.1254
G3 X36.7113 Y15.1729 I-0.8515 J-3.5762
G3 X36.4921 Y15.2026 I-0.5363 J-3.141
G3 X36.2766 Y15.2222 I-0.3729 J-2.9074
G3 X35.9795 Y15.2301 I-0.2971 J-5.5244
G3 X35.5121 Y15.1766 I0. J-2.0667
G3 X35.0534 Y15.0152 I0.4994 J-2.1514
G3 X34.6236 Y14.7792 I1.6431 J-3.5023
G3 X34.1935 Y14.4695 I2.4216 J-3.8158
G0 X34.1935 Y10.0983
G0 X33.1573 Y10.0983
G0 X33.1573 Y16.2554
G0 X34.1935 Y16.2554
G0 X34.1935 Y15.3459
G2 X34.8323 Y15.8066 I4.7322 J-5.8889
G2 X35.2794 Y16.0459 I1.6975 J-2.6332
G2 X35.7643 Y16.2039 I1.0209 J-2.3106
G2 X36.2441 Y16.2554 I0.4797 J-2.2092
G2 X36.5138 Y16.2497 I-0. J-6.3881
G2 X36.6354 Y16.2389 I-0.0553 J-1.3083
G2 X36.7563 Y16.2251 I-0.2463 J-2.707
G2 X36.9992 Y16.1893 I-1.4944 J-10.9593
G0 X36.9992 Y15.1254
G0 X36.9992 Y15.1254
G4 P0
M5 S0
G0 F500
G0 X31.5863 Y13.0694
G4 P0
M3 S127
G4 P100
G0 F200.000000
G0 X27.0498 Y13.0694
G3 X27.0975 Y12.5109 I3.2906 J-0.
G3 X27.2207 Y12.0772 I2.0977 J0.3613
G3 X27.4306 Y11.6856 I1.9637 J0.801
G3 X27.6892 Y11.3882 I1.3798 J0.9383
G3 X27.9974 Y11.1599 I1.2077 J1.3083
G3 X28.3672 Y10.9913 I1.0102 J1.7257
G3 X28.7698 Y10.8944 I0.7667 J2.3004
G3 X29.2381 Y10.859 I0.4683 J3.0834
G3 X29.8552 Y10.9191 I-0. J3.2002
G3 X30.5004 Y11.1071 I-0.7251 J3.69
G3 X31.1176 Y11.3964 I-2.0638 J5.2047
G3 X31.4099 Y11.6031 I-0.7394 J1.3556
G0 X31.465 Y11.6031
G0 X31.465 Y10.4732
G2 X30.9352 Y10.2704 I-3.3356 J7.9214
G2 X30.3957 Y10.1038 I-2.7806 J8.0513
G2 X29.8448 Y9.9935 I-1.0785 J3.9541
G2 X29.2491 Y9.955 I-0.5957 J4.5884
G2 X27.8138 Y10.196 I0. J4.3938
G2 X26.8569 Y10.7818 I0.8531 J2.4682
G2 X26.2478 Y11.7205 I1.7359 J1.7934
G2 X25.997 Y13.141 I3.8974 J1.4206
G2 X26.2331 Y14.5589 I4.3755 J0.
G2 X26.8183 Y15.5388 I2.6101 J-0.894
G2 X27.751 Y16.1829 I1.9311 J-1.7991
G2 X28.9901 Y16.4263 I1.2391 J-3.0323
G2 X30.1433 Y16.2149 I0. J-3.2519
G2 X30.9083 Y15.6987 I-0.7144 J-1.8835
G2 X31.3849 Y14.8918 I-1.5952 J-1.4864
G2 X31.5863 Y13.6316 I-3.842 J-1.2602
G0 X31.5863 Y13.0694
G0 X31.5863 Y13.0694
G4 P0
M5 S0
G0 F500
G0 X30.5776 Y13.8631
G4 P0

Thanks very much, and look forward to learning more on here!  :)
Jim

Offline MrJoshua

  • Holding
  • Posts: 2
    • View Profile
Re: Sieg X2 converted to CNC and trying to use Laser & Flexmod P3 driver
« Reply #1 on: June 19, 2015, 03:53:14 AM »
I see that the G4 codes relate to Dwell, with the P figure being milliseconds to wait.  I think possibly it is hitting these points and waiting, but possibly since it is zero just stopping rather than waiting for a set amount of time.  Would this be possible?
I read on the page explaining the different codes in Mach3, but it didn't specify if that is the case or not, but I know many programs if you feed them a zero value for something they treat it as infinite to all intents & purposes. 

Could that be the case with this?

Offline Graham Waterworth

  • Administrator
  • *
  • Posts: 1,837
  • West Yorkshire, England
    • View Profile
    • Autovalues Engineering
Re: Sieg X2 converted to CNC and trying to use Laser & Flexmod P3 driver
« Reply #2 on: June 24, 2015, 06:02:38 PM »
Do you have the dwell set to milliseconds in the config as it can also be set as seconds?
G-Code is on the cutting edge

Autovalues Engineering, CNC machining specialists, Bradford, England