Hello Guest it is August 22, 2019, 06:53:31 PM

Author Topic: HELP g-code command lines and coordinates not synchronized  (Read 464 times)

0 Members and 1 Guest are viewing this topic.

Offline axia

*
  •  11 11
    • View Profile
Hi can i get some hint on the problem below:
I have a hobby cnc running on mach3, with USB controller NVUM.

When load a g-code it works fine, as I have a standalone manual controlled spindle. Unless when i want to use the cnc for laser, then it could be realized the command lines flow faster than the coordinates or the motion. The motion is actually synchronized with coordinates so I guess my motors are correctly tuned. The issue could be seen e.g. when I try to draw a square with laser, the command is already shifted to the 2nd line when the 1st line is not yet finished, at its 90% maybe. Then the g-code command will come to the end about 2 seconds before the machine moves to the end point, together with its coordinates.

The machine will move as per the g-code, only thing is the laser control commands come together with the command line shifted to it. If I replace the laser commands with Z-axis movement then the machine will do them in the correct sequence, although the command line still flows ahead. I.e. the problem is always there, one only feels it when using output. My laser is controlled by M3/M5, also tried user command M113/M115 to control the output #1 directly.

Not sure if I have made myself understood. If yes is this a real problem?

Computer is Win7, also tried to install WinXP on the same machine but with exactly the same effect.

Offline reuelt

*
  •  444 444
    • View Profile
Re: HELP g-code command lines and coordinates not synchronized
« Reply #1 on: May 11, 2019, 05:14:04 PM »
For Laser,
maybe try toggling the CV Mode button OFF
(see attached)
"the gift of God is eternal life through Jesus Christ our Lord"

Offline Tweakie.CNC

*
  • *
  •  7,885 7,885
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: HELP g-code command lines and coordinates not synchronized
« Reply #2 on: May 12, 2019, 01:19:00 AM »
Hi Axia,

For laser use the M3 / M5 commands are not really suitable because of their inherent delay. To resolve this issue the commands M11Px / M10Px (for Mach3) and M62Px / M63Px (for Mach4) were created to synchronize the Output# switching ON / OFF in time with the commencement of axis movement.

There is a little more explanation here; http://hobbycncart.com/publ/cikkek/mach3_temaju_cikkek/switching_a_laser_under_mach_control/8-1-0-29

Tweakie.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.

Offline axia

*
  •  11 11
    • View Profile
Re: HELP g-code command lines and coordinates not synchronized
« Reply #3 on: May 12, 2019, 02:30:24 AM »
For Laser,
maybe try toggling the CV Mode button OFF
(see attached)
Hi Reuelt,

Thanks! I did try this CV mode and exact stop mode, from general configuration, it does help to reduce the corner rounding, but does not show visible difference in the delay between the coordinates/motor to the command lines.

But appreciate the help, I will try to capture some screen or video to explain this issue better.

Offline axia

*
  •  11 11
    • View Profile
Re: HELP g-code command lines and coordinates not synchronized
« Reply #4 on: May 12, 2019, 02:39:39 AM »
Hi Axia,

For laser use the M3 / M5 commands are not really suitable because of their inherent delay. To resolve this issue the commands M11Px / M10Px (for Mach3) and M62Px / M63Px (for Mach4) were created to synchronize the Output# switching ON / OFF in time with the commencement of axis movement.

There is a little more explanation here; http://hobbycncart.com/publ/cikkek/mach3_temaju_cikkek/switching_a_laser_under_mach_control/8-1-0-29

Tweakie.

Hi Tweakie,

Thanks will try it today. I'm using Mach3 so will be M11P1/M10P1.

Not sure what will happen if I attach to my machine a controlled spindle. As the spindles are also controlled by M3/M5 commands. I can imagine if the M5 command was issued after lifting Z-axis it could avoid this problem. But if the M5 command was issued to spindle without lifting Z-axis, e.g. at the end of a toolpath, then the spindle would be stopped before the toolpath reaches its end. At least this is what happens to me when trying to make a full square with laser and only got an open-square with the last part missing.

Will try the M11P1/M10P1 and let you know.

Offline Tweakie.CNC

*
  • *
  •  7,885 7,885
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: HELP g-code command lines and coordinates not synchronized
« Reply #5 on: May 12, 2019, 02:49:08 AM »
Hi Axia,

I have just noticed that your NVUM controller does not support the M11 / M10 command set so please disregard my earlier post.

Tweakie.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.

Offline axia

*
  •  11 11
    • View Profile
Re: HELP g-code command lines and coordinates not synchronized
« Reply #6 on: May 12, 2019, 04:21:43 AM »
Here is the screen shot I hope to help explain the issue better.

The g-code was generated in Artcam for spindle. I manually changed the Z-axis movement to laser on/off. The machine makes the move completely following the square, however each next step is loaded a little bit before end of  the last movement. As a result, the lagging accumulates to some 8/9 mm in the end, and laser/spindle would be turned off inside the toolpath. I don't think this is correct.

Tried to set the motor acceleration to lower value, it helps to reduce the lagging. But at the lowest acceleration possible there is still a little lagging.

Tried to add a g1 Z0 before the M115 command, while my Z is already at 0. It does not help. The command line flows still quicker to its end, then M115 turns of output#1, then when Y reaches 0, Z axis "moves" to 0. It actually means the axis movement commands are excuted in sequence, but output command was excuted when the command line is "pre-loaded".

Offline Tweakie.CNC

*
  • *
  •  7,885 7,885
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: HELP g-code command lines and coordinates not synchronized
« Reply #7 on: May 12, 2019, 05:09:23 AM »
Could you perhaps .zip and attach your Gcode file ?

Tweakie.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.

Offline axia

*
  •  11 11
    • View Profile
Re: HELP g-code command lines and coordinates not synchronized
« Reply #8 on: May 12, 2019, 05:23:12 AM »
This g-code in the screen shot is a test, it is almost the full list. ;D ;D

Anyway the tap file is attached, appreciate Tweakie.

Offline Tweakie.CNC

*
  • *
  •  7,885 7,885
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: HELP g-code command lines and coordinates not synchronized
« Reply #9 on: May 12, 2019, 06:11:45 AM »
Absolutely nothing wrong with your Gcode.
Here, the m113 executes before the X axis starts to move and the m115 executes after the Y axis has returned to zero.

Could be that the problem lies within your NVUM controller software plugin but I have no way of testing or confirming this.

Tweakie.

Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.