LinuxCNC stops during process

More
04 Oct 2013 17:04 #39532 by maexbecks
Hi,

I have a problem with a machine of mine. It runs on Ubuntu 8.04 and LinuxCNC 2.3.5 with
all new updates for that system.

I let the system start by an output from another machine, which I declared in the HAL File:
newsig autoRun bit
linksp autoRun parport.0.pin-15-in
linksp autoRun halui.mode.auto
linksp autoRun halui.program.run

The program starts mostly without any problems, but sometimes like every 1000. time the
program just stops and creates this output:

can't do that (EMC_TRAJ_SET_TELEOP_ENABLE) in auto mode with the interpreter waiting

After you push the start button in the GUI, or with the output from the other machine, the
program continues from the point where it stopped. It also mostly stops in the same line,
but again for like 999 times the program runs perfectly fine.

What is the problem here?

This is the program where it infrequently stops, but I don't know exactly in which line anymore:
o100 sub
M114 ; rot aus
	o101 if [#100 GT 14.0]
		M111 ;gruen auf blau
	o101 else
		M112 ;blau auf gruen
	o101 endif	
	o102 if [#100 LT 15.0]
		G54	
		#100 = [#100 + 0.003] ; Zustellung
		S1000 M03
		M103
		G01 X[109.0 + #100] Z47.0 F1000
		G01 Z55.0 Y12 F200
		G01 X[110.2 + #100]  Z59.0 Y24 F200
		G01 X[109.7 + #100]  Z62.0 Y36 F200
		G01 X[109.5 + #100]  Z65.0 Y48 F200
		G01 X[103.0 + #100]  Z68.2 Y60 F200
		G01 X[100.0 + #100]  Y72 F200
		G01 Z79.0 Y84 F200
		G01 X[105.8 + #100] Y96 F200
		G01 X[100.0 + #100] Y108 F200
		M05
		G4P3
		S1000 M04
		G01 X[105.8 + #100] Y96 F200
		G01 X[100.0 + #100]  Y84 F200
		G01 Z70.5 Y72 F200
		G01 X[103.0 + #100] Z68.2 Y60 F200
		G01 X[109.5 + #100] Z65.0 Y48 F200
		G01 X[109.7 + #100] Z62.0 Y36 F200
		G01 X[110.2 + #100] Z59.0 Y24 F200
		G01 Z47.0 Y12 F200
		G01 X[109.0 + #100]Z47.0 Y0 F200
		M05
		G01 X0 Z0 F1000
		M104
	o102 else
		M113
		(MSG, Buerste abgelaufen!)
		M103
	o102 endif
o100 endsub
o100 call
M30

Please Log in or Create an account to join the conversation.

More
04 Oct 2013 19:19 #39540 by andypugh

newsig autoRun bit
linksp autoRun parport.0.pin-15-in
linksp autoRun halui.mode.auto
linksp autoRun halui.program.run
The program starts mostly without any problems, but sometimes like every 1000. time the
program just stops and creates this output:

can't do that (EMC_TRAJ_SET_TELEOP_ENABLE) in auto mode with the interpreter waiting


I think what may be happening is that you are pressing the button between the system polling mode.auto and program.run.
The parallel port updates on a fixed schedule in the real-time thread, which interrupts the user-interface code.

The solution is probably to test that the mode is correct before setting run. Even with this there is then a small chance of setting auto-mode and then releasing the button before run...
loadrt and2 name=runbutton
...
addf runbutton servo-thread
...
net autoRun parport.0.pin-15-in =>   halui.mode.auto runbutton.in0
net run-mode halui.mode.is-auto => runbutton.in1
net start-run runbutton.out => halui.program.run

If you already have some and2 functions loaded then you will need to edit the quantity of them and either give them all names, or use and2.5 (or whatever) in place of runbutton in the above.
The following user(s) said Thank You: maexbecks

Please Log in or Create an account to join the conversation.

More
04 Oct 2013 20:37 - 04 Oct 2013 21:06 #39543 by maexbecks
Thank you for your response. I will try that.
Is there another possibility to start the program with an external signal on the parallel port?

Even with this there is then a small chance of setting auto-mode and then releasing the button before run...


But here the only problem would be that the programm would not start at all? So I could give the signal as long as I know
that the program was started and this problem would be gone?
Last edit: 04 Oct 2013 21:06 by maexbecks.

Please Log in or Create an account to join the conversation.

More
05 Oct 2013 05:46 #39562 by andypugh

Even with this there is then a small chance of setting auto-mode and then releasing the button before run...

But here the only problem would be that the programm would not start at all? So I could give the signal as long as I know
that the program was started and this problem would be gone?


Yes, as long as you press the button until the program starts, it is all good.

It is just that once every seldom, if you press "run" then change your mind you will find the machine is unresponsive until you press "stop"

Please Log in or Create an account to join the conversation.

More
05 Oct 2013 12:39 #39572 by cmorley
There was some discussion that halui and a GUI can occasionally fight for the NML messages.
This may be showing up here.

There was nothing that could be done at this time, if this is what the problem is.

Chris M
The following user(s) said Thank You: maexbecks

Please Log in or Create an account to join the conversation.

More
05 Oct 2013 13:36 #39573 by maexbecks
@andypugh I tought about your suggestion today, but since the program stops while the program is
already started, I think it must be something else.

It also seems that the downloadable image of Ubuntu 8.04 with LinuxCNC 2.3.0 doesn't have this
problem.
If there is no other solution I would have to setup the machines with an old version again, I guess.

Please Log in or Create an account to join the conversation.

More
05 Oct 2013 18:52 #39578 by andypugh

There was some discussion that halui and a GUI can occasionally fight for the NML messages.
This may be showing up here.


Is the problem possibly due to noise on the parport line?

Maybe a combination of the and2 (to get the sequence correct) and a long (2mS) debounce would help?
The following user(s) said Thank You: maexbecks

Please Log in or Create an account to join the conversation.

More
05 Oct 2013 18:56 - 05 Oct 2013 19:49 #39580 by maexbecks

Maybe a combination of the and2 (to get the sequence correct) and a long (2mS) debounce would help?


This may be... how can i make the debounce in hal? :huh:

Edit: Got it. Lets see how it will work out... Thanks for your help.
Last edit: 05 Oct 2013 19:49 by maexbecks.

Please Log in or Create an account to join the conversation.

Time to create page: 0.204 seconds
Powered by Kunena Forum