Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: peter81 on April 29, 2019, 12:41:31 PM

Title: Dust hood
Post by: peter81 on April 29, 2019, 12:41:31 PM
Hello all,

on my router I have a pneumatic dust hood. I have two M codes to activate and deactivate it in G code. Also in screen I've made a button so I can raise and lower it in the middle of the program if I want to. But there is a problem. When I start the program (any program that I have) dust hood is activated but then suddenly the output is deactivated in the middle of the program. Sometimes this happens after a minute, sometimes after 10 minutes. Then I have to push the button to activate it again. Any help would be appreciated.
Here is the codes:

function m101()
   
   inst = mc.mcGetInstance()

   local hSig, rc = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT5)
   mc.mcSignalSetState(hSig, 1)
   
end

if (mc.mcInEditor() == 1) then
   m101()
end

----------------------------------------------------


function m102()
   
   inst = mc.mcGetInstance()

   local hSig, rc = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT5)
   mc.mcSignalSetState(hSig, 0)
   
end

if (mc.mcInEditor() == 1) then
   m102()
end

-------------------------------------------------------


-- Dust hood button script


inst = mc.mcGetInstance()

local hSig, rc = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT5)
local state, rc = mc.mcSignalGetState(hSig)

if state == 1 then
    mc.mcSignalSetState(hSig, 0)
else
    mc.mcSignalSetState(hSig, 1)
end


Regards,
Peter
Title: Re: Dust hood
Post by: joeaverage on April 29, 2019, 02:40:24 PM
Hi,
I would guess that the button script is triggering when it shouldn't.

Try putting a wxMessageBox line of code in the button script, it may well indicate false triggering.

Craig
Title: Re: Dust hood
Post by: KatzYaakov on May 02, 2019, 02:39:38 AM
which hardware you use?
 
Title: Re: Dust hood
Post by: peter81 on May 02, 2019, 04:27:52 AM
Hi,

I'm using ESS (plugin version v233) with C32 board. Mach4 build 4124.

Peter
Title: Re: Dust hood
Post by: joeaverage on May 02, 2019, 07:42:13 AM
Hi,
I still suspect electrical noise is causing a false trigger event on your input ISIG_INPUT5.

A wxMeesageBox line in your button script would catch it.

On the ESS PinConfig page add some debounce filtering. You might also consider fitting a 100nF capacitor between the
input terminal and 0V at your BoB.

Craig
Title: Re: Dust hood
Post by: peter81 on May 02, 2019, 02:44:15 PM
Hi,

today i've tried a wxMessageBox line in my button script and It didnt trigger the output. The message box didn't appeared on the screen. So the next thing I will try is the debounce filtering the next time I'll be in my work shop. Thanks.

Peter
Title: Re: Dust hood
Post by: joeaverage on May 02, 2019, 02:58:17 PM
Hi,
the wxMessageBox is meant to detect if the button script has triggered or not. It does not cause the button to trigger or
in any other way affect the button or its action.

If noise is affecting the input I would expect the button to trigger, as evidenced by the MessageBox, every once and awhile.

If the fault is occurring  but WITHOUT the MessageBox then the fault is not the button input or its scrit.

The purpose of the wxMessagebox is to help you determine whats going on.

Craig
Title: Re: Dust hood
Post by: reuelt on May 03, 2019, 07:33:11 AM
Hello all,

on my router I have a pneumatic dust hood. I have two M codes to activate and deactivate it in G code. Also in screen I've made a button so I can raise and lower it in the middle of the program if I want to. But there is a problem. When I start the program (any program that I have) dust hood is activated but then suddenly the output is deactivated in the middle of the program. Sometimes this happens after a minute, sometimes after 10 minutes. Then I have to push the button to activate it again. Any help would be appreciated.


Perhaps try using a 24Volts (higher voltage less affected by noise) Bistable (self-locking) relay (only a short pulse required to switch states).
(see attached)
Will reduce draining of power from the C32 board when dust hood activated.
Title: Re: Dust hood
Post by: peter81 on May 03, 2019, 09:18:18 AM
Hi,

I am using 24V. This setup has been working whithout any problem for 8 years with mach3. If I run my cnc with mach3 the dust hood is working as it should. When run by mach4 I have this problem when output is suddenly turned off.

Peter
Title: Re: Dust hood
Post by: joeaverage on May 03, 2019, 04:56:31 PM
Hi,
the fact that the line of wxMessageBox code does not occur suggests that it is not a software error.

If the dust hood is triggering it is doing so without being instructed to it suggests EMI noise.
Even 24V signaling is subject to noise if the circuit impedance is high.

If for instance the on state current is 100 uA at 24 V for a power of 2.4mW and impedance of 240kOhm. Therefore a noise impulse
averaging 2.4mW could falsely trigger the circuit.

If the on state circuit current is 10mA at 24V for a power of 240mW and impedance of 2.4kOhm then a very much
larger noise impulse, 240mW, is required to trigger the circuit.

A higher signaling voltage does not in itself ensure noise free communication.

Craig
Title: Re: Dust hood
Post by: reuelt on May 03, 2019, 08:38:32 PM
Hi,

I am using 24V. This setup has been working whithout any problem for 8 years with mach3. If I run my cnc with mach3 the dust hood is working as it should. When run by mach4 I have this problem when output is suddenly turned off.

Peter

Have you tried using M7  and M9 for your dust hood just to prove that hardware is Ok?

I suspect, MACH4 GUI does not like user defined MACROS that are not written as "COROUTINES".

M6, M7, M8 and M9 are are already KNOWN to the "MACH4 GUI" modules. User defined Macros are NOT.

Title: Re: Dust hood
Post by: joeaverage on May 04, 2019, 03:40:52 AM
Hi.

Quote
M6, M7, M8 and M9 are are already KNOWN to the "MACH4 GUI" modules. User defined Macros are NOT.

This is a red herring. m6, m7, m8 and m9 are predefined.Please not the DELIBERATE use of lowercase, that's how Machs
Gcode interpreter expects all m codes to be expressed.....use lowercase or you can expect some curly errors.

When the Gcode interpreter encounters a m code call it in the first instance searches for the m code macro in the macros
folder of the current profile. If it does not find a macro that matches the call is searches up the directories until it finds
the required macro.

Lets say you program calls an m8. If you do not have an m8() macro in your macros folder Mach will use the default
NFS supplied m8() macro. If you decide for whatever reason that you want to include some custom behavior in the m8()
macro then you would write a m8() which by necessity duplicates the expected default behavior plus whatever extra functionality
you require.

My understanding is that it was not possible to write an m0(), m1(), and m2() for instance. That is no longer the case,
although why you would want to modify these m codes is beyond me.

The important point is that NO macros, be they built in or user written are co-routines.

Have you investigated the noise issue? 24V does not preclude noise, careful attention to circuit impedance is also required.
Post a circuit of the output of the BoB, including what you know about of the BoB output the output driver and the input
circuit of your dust hood mechanism.

Craig
Title: Re: Dust hood
Post by: peter81 on May 04, 2019, 04:34:32 AM
Hi Craig,

on my ESS 3rd port I have C31 bob (which is 24V) and output 5 is connected to ess port3-Pin2. I dont think it's the noise issue. Like I said this settup is excatly the same for 8 years now and if I run the machine with mach3 it's working with no problem.
I'm on vacation now and when I'll return to my workshop will go again through all of the codes to see If I missed something that could be messing with the output. Will report shortly. Thanks for all advices for now.

Peter
Title: Re: Dust hood
Post by: reuelt on May 04, 2019, 04:48:23 AM
Craig: "My understanding is that it was not possible to write an m0(), m1(), and m2() for instance. That is no longer the case, although why you would want to modify these m codes is beyond me."

There is one valid reason of some people wanting to modify m0() and m1() - i.e. to include turning of ALL the coolants in M0() and M1() just like the m0 and m1 of both FANUC (world #1) and HAAS (world #2).

If MACH4 wants to be industrial, it cannot just remain at hobbyist quality.
Title: Re: Dust hood
Post by: joeaverage on May 04, 2019, 05:28:15 AM
Hi,

Quote
If MACH4 wants to be industrial, it cannot just remain at hobbyist quality.

There's no satisfying you....in one post you are complaining that Mach4 is so configurable that is to too complex for
a hobby product...and then in the next you are saying that is survival requires better than hobbyist quality.
I wish you'd take up knitting.

Just I case you didn't notice I just said that you can modify m0, m1 etc to do as you wish and emulate Fanuc or Hass if
you want.

Craig
Title: Re: Dust hood
Post by: Tweakie.CNC on May 04, 2019, 05:52:05 AM
If MACH4 wants to be industrial, it cannot just remain at hobbyist quality.

Hi Rauel,

You don't need to concern yourself about the future of Mach4 - NFS have been in this business long enough to know exactly what they are doing.

Tweakie.
Title: Re: Dust hood
Post by: reuelt on May 04, 2019, 06:56:10 AM
I am just pointing out that MACH4's m00 and m01 does NOT STOP THE COOLANTS whereas Fanuc and Hass' m00 and m01 do.

Craig had asked why would anyone want to edit MACH4's M00 or M01.
I just said that one valid reason is to make m00 and m01 turn OFF the coolant as well.

There is no need to resort to personal attacks.
Title: Re: Dust hood
Post by: Tweakie.CNC on May 04, 2019, 07:57:05 AM
Hi Reuelt,

If you consider my posting as a personal attack then I sincerely and unreservedly apologise.
(I also apologise for  any misspelling of your name).

I have sent you a PM by way of an explanation.

Tweakie.

EDIT: My apology to Peter81 for taking his thread off-topic.
Title: Re: Dust hood
Post by: KatzYaakov on May 05, 2019, 08:04:28 AM
you need contact the hardware supplier
i also had same problem but anther supplier ,and solve was with the plugin and driver(software)
do you use external cards like eternal relays,or inputs cards ? that need communication with the main card?
 
Title: Re: Dust hood
Post by: peter81 on May 08, 2019, 03:10:57 AM
Hi,

yesterday I did some more testing on the machine. I've deleted the button on my screen so there was nothing else connected to the output only both M codes m101 and m102 which are activated from the G code run. The problem still remains - after few minutes the output is turned off. Also I've tried the same program with mach3 and after a long run there was nothing wrong with the dust hood and output5. So I think there is nothing wrong with the wiring or noise. I suspect it could be in the ESS plugin maybe like KatzYaakov mentioned.

Peter
Title: Re: Dust hood
Post by: Tweakie.CNC on May 08, 2019, 07:25:28 AM
Hi Peter,

Assuming you are using the latest plugin version then I doubt the problem is with the ESS plugin (the issue would have come up before), however, it would not do any harm to mention the problem you are having on the Warp9 forum and see if they have any suggestions. https://warp9td.com/index.php/kunena/7-general-discussion

Tweakie.
Title: Re: Dust hood
Post by: peter81 on May 08, 2019, 07:43:34 AM
Hi Tweakie,

this problem is there from beginning but I didn't realy have time to solve it till now  ::). Yesterday I've updated mach4 to build 4.2.0.4162 and ESS to 234 build. I will post in warp9 forum, but before I will do another test in friday when I'll be back in my workshop. Also I will do complete uninstall of mach4 and fresh install. Thanks.

Peter
Title: Re: Dust hood
Post by: reuelt on May 08, 2019, 03:13:49 PM
Hi Tweakie,

this problem is there from beginning but I didn't realy have time to solve it till now  ::). Yesterday I've updated mach4 to build 4.2.0.4162 and ESS to 234 build. I will post in warp9 forum, but before I will do another test in friday when I'll be back in my workshop. Also I will do complete uninstall of mach4 and fresh install. Thanks.

Peter

Just note that MACH4 ALSO disables the "CHARGE PUMP" output of the Darwin Parallel port plug-in, exactly the same way as it disables your Custom MACRO output.

That's why I had earlier suggested that you try using m7 and m9 to test.
Title: Re: Dust hood
Post by: peter81 on May 09, 2019, 01:08:38 AM
Hi Tweakie,

this problem is there from beginning but I didn't realy have time to solve it till now  ::). Yesterday I've updated mach4 to build 4.2.0.4162 and ESS to 234 build. I will post in warp9 forum, but before I will do another test in friday when I'll be back in my workshop. Also I will do complete uninstall of mach4 and fresh install. Thanks.

Peter

Just note that MACH4 ALSO disables the "CHARGE PUMP" output of the Darwin Parallel port plug-in, exactly the same way as it disables your Custom MACRO output.

That's why I had earlier suggested that you try using m7 and m9 to test.

Ok will try that too. Thanks.

Peter
Title: Re: Dust hood
Post by: peter81 on May 11, 2019, 04:38:17 AM
Hi Tweakie,

this problem is there from beginning but I didn't realy have time to solve it till now  ::). Yesterday I've updated mach4 to build 4.2.0.4162 and ESS to 234 build. I will post in warp9 forum, but before I will do another test in friday when I'll be back in my workshop. Also I will do complete uninstall of mach4 and fresh install. Thanks.

Peter

Just note that MACH4 ALSO disables the "CHARGE PUMP" output of the Darwin Parallel port plug-in, exactly the same way as it disables your Custom MACRO output.

That's why I had earlier suggested that you try using m7 and m9 to test.

Ok will try that too. Thanks.

Peter

Hi,

yesterday I've tried the m7 and m9 macros and the problem was the same.

Peter
Title: Re: Dust hood
Post by: Warp9TechDesign on May 14, 2019, 11:55:52 AM
Hi Peter,

Have you opened a log window and logged the event as it happens?  https://warp9td.com/index.php/faq/faq-mach4#LoggingInMachFour

Start logging, start a job (you don't even need to really cut anything) and wait the 1 to 10 minutes for the hood to deactivate (please note the time that it happened at in the log file and tell me.  Wait about 10 seconds and stop the program and stop logging (that makes it really easy to see all the stop event messages happening well AFTER your hood event).   The log file will tell us what happened, so save it and upload it.

It would also be helpful to see your profile too.... https://warp9td.com/index.php/faq/faq-mach4#UploadMachFourProfile

Andy
Title: Re: Dust hood
Post by: peter81 on May 14, 2019, 01:42:28 PM
Thanks Andy. I will try this next time I'll be in my workshop. I will also upload files.

Regards,
Peter
Title: Re: Dust hood
Post by: KatzYaakov on May 28, 2019, 01:03:44 AM
we had exactly same problem with other  break board brand ,they work very hard and update the plugin and the firmware
seems communication  mach3 and 4 not same, and i think you waste yours time solve it
its not at yours hand ,press yours supplier solve it or replace hardware
now after the upgrade pokeys very  very stable(i use 8 relay cards in my machine  ,mean 64 outputs)
and before have exactly same situation as you describe(its very very dangerous ,tool can release while working)
Title: Re: Dust hood
Post by: Warp9TechDesign on May 28, 2019, 07:15:32 AM
Hi KatzYaakov,

Since I don't receive reports of problems like this, I doubt it is a SmoothStepper issue.  I asked Peter for a log file, which would document what is happening and what is commanding the output change states.  My guess is that he saw the log and was able to fix the issue himself....

Andy
Title: Re: Dust hood
Post by: peter81 on May 28, 2019, 07:33:09 AM
Hi,

sorry for late reply. I've been very bussy so I didn't have time to try to do some more tests. Maybe tonight I'll have some time to run log file. I'll get back as soon as possible. Thanks.

Peter
Title: Re: Dust hood
Post by: Warp9TechDesign on May 28, 2019, 07:45:05 AM
No rush on my account, Peter!

Andy
Title: Re: Dust hood
Post by: Rob G on May 28, 2019, 04:53:24 PM
If you use the router profile that comes with Mach4, you will have outputs and macros for a dust hood already built in.
Title: Re: Dust hood
Post by: Rob G on May 28, 2019, 04:56:05 PM
The router profile that comes with Mach4, will come with  dust hood already set up in it.  there is a button on the screen with outputs, and macros in the macros folder.  You will just need to map what you have.
Title: Re: Dust hood
Post by: peter81 on May 31, 2019, 06:01:18 AM
Hi all,

yesterday I finally menaged to run log file and I found out what the problem was. On my external control panel I have a push button to release tool from spindle. This input goes to pokeys and in PMC I have a ladder code to control the valve output (ESS port3pin3 ). When the button input was not active, the PMC code was deactivating port3pin3 many times per second.
 In log file the output for dust hood was activated correctly (port3pin2), but when the output was deactivated there was no event in log file for deactivating output port3pin2.
So my guess is that when the output 3 was deactivated so many times it also at one point deactivated output 2.
I've corrected the code and for now everything works as it should. Attached is the picture of PMC code that didn' worked in my case.
Thanks everyone for helping me specialy Andy to remind me to run log file  ;D

Regards,
Peter
Title: Re: Dust hood
Post by: Warp9TechDesign on May 31, 2019, 11:14:35 AM
Hi Peter,

I am glad to hear that it was an easy fix!

Yeah, I use the log file all the time, it helps a lot to figure out what is going wrong!

Andy
Title: Re: Dust hood
Post by: KatzYaakov on May 31, 2019, 11:38:27 AM
hi
i little confuse ,before you said you use ESS  now you write pokeys
maybe mistake?
Title: Re: Dust hood
Post by: peter81 on June 03, 2019, 01:15:27 AM
Hi,

I'm using ESS board. Pokeys56u is just for external panel buttons input.

Peter
Title: Re: Dust hood
Post by: KatzYaakov on June 03, 2019, 01:20:24 AM
Why not use pokeys cnc ? Have 24 inputs ,i not work at pokeys i just use it and interesting why use ESS in that case?
Title: Re: Dust hood
Post by: peter81 on June 03, 2019, 01:34:38 AM
when I've buld my cnc 9 years ago there was no pokeys cnc board available. So I've decided to use ESS and for external panel pokeys56u.

Peter