Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: axilleas on November 06, 2006, 02:08:57 AM
-
I am using M functions to activate and deactivate an output (output4) in my 2.5D machine. Everything works fine but there is a delay of some milliseconds (>350ms) from the execution of the M function to the next G command and from a G command to a M function.
Sample code:
N0440 X153.8415 Y44.6080 I5.1038 J-3.4409
N0450 X92.5577 Y69.9926 I-39.1988 J-7.9659
N0460 X90.8241 Y61.4619 I3.3986 J-5.1321
N0470 M17<----------------------------------------------------- (machine stops, M function deactivates output after some ms)
N0480 G00 X131.1282 Y101.9559
N0490 M18<----------------------------------------------------- (M function activates signal but the movement starts after a while)
N0500 G01 X104.6245
N0510 X123.8448 Y121.1526
N0520 X127.6986 Y126.9220
N0530 X129.6661 Y130.8300
M17 code:
DeActivateSignal(Output4)
M18 code:
ActivateSignal(Output4)
There is a liquid running from the .5 axis and as a result of the delay I get a big dot in the beginning and in the end of the contour.
Do I need a faster PC?
Because I had to modify the hardware and the postproseccor I did not try the "Z is 2.5D on Output #6" on config->state... window. Do you thing that it will make any difference?
What else do you recommend?
Thank you
-
Hey Axil,
I don't know if this will have any bearing but, what is your debounce set at?
-
I think this is an input parameter...
I have both "debounce interval" and "index debounce" set to 0 (zero).
-
I am using M functions to activate and deactivate an output (output4)
What is this output controlling?
-
a valve
-
What speed is your PC, Version of Mach? operating system. I'm pulling at straws to be honest. I'm mainly trying to get info. for the experts. ;D I will help all I can though.
Brett
-
What Version of Mach are you using?
-
CPU speed: 1400Mhz
Mach version: 1.90.027
OS: win2k
-
That's kind of an older version, I would upgrade to the 2.0 ver for starters.
-
Take out the Mcodes :) they are WAY to slow for what you are looking to do :(
Try using E1 P1 for external activation 1 ON
and E1 P0 to turn it off
I think that is how it works... there is an example on the forum some place... The E1P1 needs to be on it own line btw
Thanks
Brian
-
I have seen your example but as DrStein99 said E4 P1 (or E1 P1) does NOT trigger the output...
http://www.machsupport.com/forum/index.php?topic=1072.0
Updated to Mach version: 2.0.008
-
That is odd I have tested it here a few times :( Coudl you post an example Gcode and I will see what is going wrong.
Thanks
Brian
-
Sample:
N0010 (Post processor: Copy of Mach2.post)
N0020 (Date: 25/9/2006)
N0030 G21 (Units: Metric)
N0040 G40 G90
N0050 F1
N0060 (Part: ΒΑΣΙΛΟΠΙΤΑ 3a)
N0070 (Process: No offset LAYER0, Mill/Router, 0,1 mm diameter, 0 mm Deep)
N0080 M6 T0 (Mill/Router, 0,1 mm diameter)
N0090 G43 H0
N0100 G00
N0110 M04
N0120 X90.8241 Y61.4619
N0130 E4 P1
N0140 G03 X101.9983 Y63.6845 I5.1321 J3.3986 F30000.0
N0150 X55.0938 Y110.5891 I-39.2634 J7.6412
N0160 X61.4018 Y101.1485 I1.1759 J-6.0421
N0170 X36.0172 Y162.4322 I-33.3505 J22.0850
N0180 X38.2323 Y151.2963 I-1.2258 J-6.0321
N0190 X38.2323 Y217.6293 I-22.3603 J33.1665
N0200 X36.0172 Y206.4934 I-3.4409 J-5.1038
N0210 X61.4018 Y267.7771 I-7.9659 J39.1988
N0220 X55.0938 Y258.3365 I-5.1321 J-3.3986
N0230 X101.9983 Y305.2411 I7.6412 J39.2634
N0240 X92.5577 Y298.9331 I-6.0421 J-1.1759
N0250 X153.8415 Y324.3176 I22.0850 J33.3505
N0260 X142.7055 Y322.1025 I-6.0321 J1.2258
N0270 X209.0386 Y322.1025 I33.1665 J22.3603
N0280 X197.9026 Y324.3176 I-5.1038 J3.4409
N0290 X259.1864 Y298.9331 I39.1988 J7.9659
N0300 X249.7457 Y305.2411 I-3.3986 J5.1321
N0310 X296.6503 Y258.3365 I39.2634 J-7.6412
N0320 X290.3423 Y267.7771 I-1.1759 J6.0421
N0330 X315.7268 Y206.4934 I33.3505 J-22.0850
N0340 X313.5118 Y217.6293 I1.2258 J6.0321
N0350 X313.5118 Y151.2963 I22.3603 J-33.1665
N0360 X315.7268 Y162.4322 I3.4409 J5.1038
N0370 X290.3423 Y101.1485 I7.9659 J-39.1988
N0380 X296.6503 Y110.5891 I5.1321 J3.3986
N0390 X249.7457 Y63.6845 I-7.6412 J-39.2634
N0400 X259.1864 Y69.9926 I6.0421 J1.1759
N0410 X197.9026 Y44.6080 I-22.0850 J-33.3505
N0420 X209.0386 Y46.8231 I6.0321 J-1.2258
N0430 X142.7055 Y46.8231 I-33.1665 J-22.3603
N0440 X153.8415 Y44.6080 I5.1038 J-3.4409
N0450 X92.5577 Y69.9926 I-39.1988 J-7.9659
N0460 X90.8241 Y61.4619 I3.3986 J-5.1321
N0470 E4 P0
N2220 G00 X0 Y0
N2230 G49
N2240 M200
N2250 M05 M30
Thanks for your reply
-
It works here (after I took the time to hook the test rig up again :) ) You need to have the E number one less then the output that you would like to run :( SO if you would like to turn on and off external output #4 Use "E3 P1" and "E3 P0" .
Thanks
Brian
-
Thank you Brian
-
So did it work for you :)
-
After some tests I found that Ex Px was not able to solve my problem, partly because of the command itself and partly because the problem is more complex than I expected.
Sample code.
G00 X100 Y100
G01 X110 Y110 <------ From the G00 to the G01 movement there is a stop (accelerations-deccelerations)
G00 X200 Y200
E3 P1 <------ Output4 is not activated
G04 P1000 <------ Wait one second
G01 X300 Y300 <------ Output4 is activated together with the movement
E3 P0 <------ Output4 is deactivated with the start of the next G00
G00 X400 Y400 <----- Bacause of the stop (G01->G00) and the fact that Ex Px is activated with the next move command I still get a dot.
I also get a few liquid outside of my contour because of the valve response time and the liquid that is "flying".
M18 <----- M seems to work better with my semifluid liquid. The time delay of the M gives the liquid time to touch the surface
G01 X495 Y495
E3 P0
G01 X500 Y500 <----- This was my last trick. I close the valve some mm before the end of the movement. There is no acc/decc from
G01->G01 and the "flying" liquid (from the valve to the surface) is placed well on the contour.
I am using Sheetcam and I don't know if I will be able to implement this trick to the postproseccor. (freehand contours!)
Is it possible to know when I am getting to the deceleration phase and deactivate my output from inside Mach :o