Hello Guest it is April 19, 2024, 11:48:54 AM

Author Topic: M code Pauses Machine while running G-code  (Read 8631 times)

0 Members and 1 Guest are viewing this topic.

M code Pauses Machine while running G-code
« on: September 17, 2011, 03:32:18 PM »
I am stumped as to how to find a work around for a problem I am facing.

When I run my g-code that contains custom M-codes that trigger solenoids on the toolhead I am getting a delay with every mcode... if the machine is making a movement when a Mcode is read, it pauses movement for about a second in order to run the macro.  Normally this would be fine, but I am controlling solenoids which cause a liquid to be sprayed along the toolpath... so it makes a large Dot where the pause happens.

Any ideas as to how to avoid this?

I have only a little scripting experience and I have never used the Brains route... Would that be a possible work around?

Thanks for any advice.
All in all I am really pleased with the Pokeys Platform.  PoppaBear was a huge help getting things up an running with basic operations... now I am getting down tweaking the setup that I have.

Attached is a bit of test g-code.  The M-codes basically just send a signal out that triggers relays to turn on or off. 
 :)


Re: M code Pauses Machine while running G-code
« Reply #1 on: September 22, 2011, 12:02:19 AM »
Well I see there have been a lot of people that have read my post, but no takers on offering advice... I will take this to mean that I have asked a difficult question that doesn't have a easy answer... or at least an easy explanation as to why the question is not so simple.
From further research, it looks as though this pausing to process a mcode may be unavoidable in Mach3.  This may come down to the way that Windows is built from what I have read, but I am not sure.
I know there are some real experts out there that haven't bitten at my request for info... I have been told that I could move to EMC2  to do what I need, but
hopefully there is still a way to hack something together with Mach3... because I really like the software for regular Milling (which is obviously what it is designed for).

I know I am trying to do something that is outside of the area that Mach3 is designed, but I would love to find a workaround for this problem.

Any takers for sharing some expert advice?  I could really use it.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: M code Pauses Machine while running G-code
« Reply #2 on: September 23, 2011, 01:52:47 AM »
The way that is done in the real world is to set up a phantom axis say C. Then use the direction pin as the trigger to turn the sprayer ON or off. This method is used by the laser group to do HIGH speed control of the ON/OFF of the laser WITH no delays. AS the code is part of the loaded buffer it runs at the speed of the Gcode with NO delays.

Mach USED to have a useable High speed output function BUT it is broken.

(;-) TP
Re: M code Pauses Machine while running G-code
« Reply #3 on: September 28, 2011, 10:41:30 AM »
TP,
Thanks for the reply. That really helps give me an route figuring out a work around.  Unfortunately I have been building a system where I will need to turn on 22 different solenoids.  I have this working fine with custom Mcodes and the Pokeys 55T, except for the delay when turning off solenoids during movement.

I wonder if it would be possible to use a phantom axis as you suggest... and have it trigger 22 solenoids.

For example have the phantom axis move to C +.0001 for solenoid 1 ON

Move to C -.0001 for solenoid 1 OFF
Move to C+.0002 for solenoid 2 ON
Move to C- .0002 for solenoid 2 OFF
and on and on for all 22 solenoids.

I will give this some more thought and look into the laser group.
That is cool that Mach USED to have a High speed output function... It would be even cooler if it still worked.  I wonder if there are plans to fix it?

Thanks again!

Would I then use Brains to then link the C movements to output to SetUserLED high or low whatever the case.

 

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: M code Pauses Machine while running G-code
« Reply #4 on: October 11, 2011, 10:36:58 PM »
NOPE that wont work you only have 1 set of pins to trigger whatever you do. AS soon as you add in a macro code to detect or manipulate the signal you get ???? YEP the delay.

What you need to work with is the brains they have a higher prioirty and better access to the internals of mach3. Now can you make them do what YOU need ???

Good Question, (;-0 TP

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: M code Pauses Machine while running G-code
« Reply #5 on: October 11, 2011, 10:51:34 PM »
OK thinky aboput this some more here is what you face. Mach is a CNC machine controller. IT is also a buffered system as the gcode is preplanned and stacked up in the que to run. MACH cannot prep the macro to load into the buffere because the CB subsystem is a seperate function so it has to run the buffer empty then call the macro function and then load the buffer again.

Once the buffer is full and running you also cannot just interject something into the que at random for MACH to process

I don't think this can be made seemless as you would need to be able to include as many outputs as you need. Perhaps a high speed PLC running under MACH3 would be the answer it would be plenty fast enough to handle the ouput functions based on mach3 instructions.

BUT you would have to develope a plugin to allow mach3 to talk directly to the PLC without the need of a macro. THE gcode/macro function is the problem. It has always been there.BUT that is not really a problem in NORMAL CNC machining.

What you really need is a high speed motion controller like galil that can handle all the high speed I/O on ITS side.

Good Luck, (;-) TP