Cycle start/resume pause and external buttons problem (Mesa 7i76e card)

More
01 Aug 2022 08:06 #248778 by raychar
Hello guys,

I experience a weird thing in my LinuxCNC. When the machine is idle, the external cycle start buttons always activate itself while the pause/resume button will then wait for me to activate. The program is listed as in below 1).
The situation becomes worse when I added more external buttons. They are connected to the ports on two expansion connectors on Mesa 7i76e  card. They are controlled through the MDI commands. Those settings and HAL program are listed in below 2)
However, when I commented out those lines(marked #), the problem gone (that is it no longer happens), Can anybody help me to solve the problem

Thanks in advance

1) In custom file
#External Program Pause/Resume Button
net pause-resume-btn and2.0.in0 and2.1.in0 <= hm2_7i76e.0.7i76.0.0.input-09
net pause-on toggle2nist.0.is-on and2.0.in1 <= halui.program.is-paused
net run-on and2.1.in1  <= halui.program.is-running
net pause-sig or2.0.in0  <= and2.0.out
net resume-sig or2.0.in1 <= and2.1.out
net toggle-ok  toggle.0.in <= or2.0.out
net togglesig toggle2nist.0.in <= toggle.0.out
net toggleon halui.program.pause <= toggle2nist.0.on
net toggleoff halui.program.resume <= toggle2nist.0.off

#External Program Cycle Start Button
net cycle-start-btn and2.2.in0 <= hm2_7i76e.0.7i76.0.0.input-08
net idle-on and2.2.in1 <= halui.program.is-idle
net run-sig halui.mode.auto halui.program.run <= and2.2.out

net run-on => hm2_7i76e.0.7i76.0.0.output-00
net pause-on => hm2_7i76e.0.7i76.0.0.output-01

2) In config setting (.ini) file

[HALUI]
#MDI_COMMAND = M6T0
#MDI_COMMAND = M6T1
#MDI_COMMAND = M6T2
#MDI_COMMAND = M6T3
#MDI_COMMAND = M6T4
#MDI_COMMAND = M6T5
#MDI_COMMAND = M6T6
#MDI_COMMAND = custom command

In HAL file

# MID commands
#net toolchange-0 halui.mdi-command-00 <= hm2_7i76e.0.gpio.028.in 
#net toolchange-1 halui.mdi-command-01 <= hm2_7i76e.0.gpio.031.in
#net toolchange-2 halui.mdi-command-02 <= hm2_7i76e.0.gpio.043.in
#net toolchange-3 halui.mdi-command-03 <= hm2_7i76e.0.gpio.044.in
#net toolchange-4 halui.mdi-command-04 <= hm2_7i76e.0.gpio.045.in
#net toolchange-5 halui.mdi-command-05 <= hm2_7i76e.0.gpio.046.in
#net toolchange-6 halui.mdi-command-06 <= hm2_7i76e.0.gpio.048.in
 

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

More
01 Aug 2022 13:00 #248787 by cmorley
Can you explain more about what 'activates it's self' means?
It means you are doing some fancy things here please explain how ut is supposed to work.

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

More
01 Aug 2022 13:50 #248788 by raychar
That is I haven't touch anything on the machine, the cycle start button will turn on (and its lamp lids) by itself, sometimes some axis will travel a short distance as well, so it is dangerous, even in some cases, the tool collide with workpiece and broke.

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

More
01 Aug 2022 13:54 #248789 by cmorley
Please explain what your code is supposed to do.

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

More
01 Aug 2022 14:24 #248790 by raychar
Part 1, is external cycle start and resume/pause buttons
Part 2, they are a small portion of the programs for the added seven external buttons, they are for the selection of 7 tools for tool changing operations

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

More
01 Aug 2022 15:36 #248794 by PCW
1. I would trace the signals with halshow or halscope to see what is happening (noise triggering cycle start?)

2. I would never use raw expansion port pins for switch inputs without at the minimum some
EMI filtering/protection.

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

More
02 Aug 2022 15:47 #248848 by raychar
Here are three attachments for the hallscope captured 4 signals (start button input pin..input-00, idle-on, run-on and run-sig)  when the machine starts itself: 
Attachments:

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

More
02 Aug 2022 16:22 #248852 by PCW
So at a quick glance it looks like that this is unrelated to the 7I76E signals and just
an issue with the logic.

(you might check at a lower time per division to make sure you are not missing a
~1 servo cycle glitch)

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

More
02 Aug 2022 16:39 #248853 by raychar
Here is an attachment for the photo of the probed 8 signal for :
 run-on
 hm2_7i76e.0.gpio.028.in
 hm2_7i76e.0.gpio.031.in
 hm2_7i76e.0.gpio.043.in
 hm2_7i76e.0.gpio.044.in
 hm2_7i76e.0.gpio.045.in
 hm2_7i76e.0.gpio.046.in
 hm2_7i76e.0.gpio.048.in
Attachments:

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

More
02 Aug 2022 22:43 #248877 by andypugh
It does look like the GPIO is detecting some noise.
I think that you need better electrical installation, but you can probably mask this with a debounce function in HAL.

It isn't 100% clear, but is something happening that should happen if a button is pressed, but without a button being pressed?

As PCW says, wiring direct to FPGA pins is rarely a good idea.

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

Moderators: cmorley
Time to create page: 0.289 seconds
Powered by Kunena Forum