Script/GCode interface

C Scripting questions and answers
Vangoth
Old Timer
Posts: 8
Joined: Fri Mar 16, 2018 2:49 am

Re: Script/GCode interface

Post by Vangoth »

Good night, a question my auggie does not activate the spindle with the M3 code. Should I add it?
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Script/GCode interface

Post by ArtF »

Hi:

  Have you turned on the spindle libraries? The default one turns on a laser, so you may want to change that so it only turns on a relay. The GCode library calls
the SetSpindleState macro, you will find the laser example of that macro that may be modified.

Art
Vangoth
Old Timer
Posts: 8
Joined: Fri Mar 16, 2018 2:49 am

Re: Script/GCode interface

Post by Vangoth »

yes sir, I have it activated but when I load the code g and start doing the movement, it locks up when it finds the M3 code. and create a new script only with the option to turn on and off plasma with relay # 3 and it does not work either. Here I leave you the scrip that you wrote and the error that appears when the machine finds the M3

global SpindleOn = function ()
{
Pokeys1.SetRelay (3,1);
print ("Plasma Spindle RT Engaged");
 
};
 
global SpindleOff = function ()
{
Pokeys1.SetRelay (3,0);
print ("Plasma Spindle RT dis-engaged");
 
};


Attachments
error m3.jpg
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Script/GCode interface

Post by ArtF »

Hi:

  The messages seem to show the script being called, can you press the log button at that point and send me a copy of the log? Does an ESTOP happen when you do this or does the spindle just not come on?

Art
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Script/GCode interface

Post by ArtF »

Hi:

One other test to make, in your SCRIPT tab, enter the following..

Pokeys1.SetRelay(3,1);

and press RUN on thge screen. Does the relay turn on? You should hear it
click on the board. Try

Pokeys1.SetRelay (3,0);

and again press RUN, doe the relay turn off?

Art
Vangoth
Old Timer
Posts: 8
Joined: Fri Mar 16, 2018 2:49 am

Re: Script/GCode interface

Post by Vangoth »

yes sir I did the test and the relay is turned on with: Pokeys1.SetRelay (3,1); and it shuts down with Pokeys1.SetRelay (3,0); .

When I run the G code when I reach the M3, the program turns on the N (3) relay and the system locks and the error LED on the screen turns on. Annex image of the error.

I appreciate your help.
Attachments
error.jpg
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Script/GCode interface

Post by ArtF »

Hi:

It sounds like maybe an error or typo is in the script.
Can you use the LocalEdit button in the lib to load the
Laser-Spindle Script into the script editor and show me
what the SetSpindleState macro looks like now?

  There may be soem error in there.

Thx
Art
Ya-Nvr-No
Old Timer
Posts: 188
Joined: Wed Sep 08, 2010 11:15 am

Re: Script/GCode interface

Post by Ya-Nvr-No »

it looks like the G4 X command is the error
G4 is a pause/dwell command followed by a P time value there are some controllers that use an X just not sure Auggie does

Side Note:
it is a standard practice to have the spindle M call on and S speed on the same line
most industrial controllers will also fault on if a G1 feed move is called before the feed rate is set.
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Script/GCode interface

Post by ArtF »

Hi:

As YaNvrNo pointed out  the G04X line is an error.

G04 is a dwell but doesnt use X, remove that line and see if the error goes away..
Thx to "YaNvrNo" for pointing this out.

Thx
Art
Vangoth
Old Timer
Posts: 8
Joined: Fri Mar 16, 2018 2:49 am

Re: Script/GCode interface

Post by Vangoth »

yes sir thank you very much, indeed the error was the code G4. edit it and it works

Does that mean that I must change the postprocessor for one that does not generate a g4?
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Script/GCode interface

Post by ArtF »

Hi:

yes, or edit the files afterwards. The G04 is allowed, but it has to be in the form of G04P.5 for example as a .5 second dwell.
Plasma usually uses this to wait for fire..

Art
Vangoth
Old Timer
Posts: 8
Joined: Fri Mar 16, 2018 2:49 am

Re: Script/GCode interface

Post by Vangoth »

yes sir, I am in the task of looking for and testing a postprocessor that will probe in the Z axis before turning on the torch and then turn on the torch with M3 and pause for 1 second depending on the thickness of the metal so that the Fire penetrate the material and start the cut.

MUCHAS GRACIAS POR SU AYUDA
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Script/GCode interface

Post by ArtF »

You should probably just hook up a home switch on the Z that homes downwards till the switch hits the material and sets it as home.
You just tell Auggie to home the Z then. That can probably be done with a macro call or a simple macro script. Ill check into the GCode
command for telling an axis to home to switch.. I think I added it but Im not sure..

Art
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests