Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: ewidance on December 28, 2011, 06:04:42 AM

Title: Ref all Axis ... and activate output while homing.
Post by: ewidance on December 28, 2011, 06:04:42 AM
Hi Forum Users !

I’ve fixed optical switchfor homing my 3 axis Borch9060 from cncdiy. Those switches got a 0V, +5V, and open collector output. A electronic debbouncing circuit is integrated in the switch. They work fine, but when VFD spindle is on, there’s a lot of EMI noise carried by the homing cables to my USB board. There’s so much noise, I can have supplementary steps on the controller…. I’ve tried a lot of things to shield cables (VFD, switches, etc..), without success.

When I disconnect power (0V, +5V) from USB board to the switch, everything works fine, and there's no more mess on steppers. I tried to shield as much i could (cables, machine, etc..), but VFD is REALLY noisy... and noise is still present even if attenuated.

Workaroud: Instead of shielding, I’ve inserted a 2 contacts relay to cut homing switch power when they are not used.  The relay is driven by ‘output3’ via a buffering transistor. Default state is 'off' for relay and power. The idea is to connect power signal during homing, and disconnect elsewhere.

To make a test, I’ve made a macro containing folowing commands :


Code: [Select]
'power on the optical home detector and wait 500 ms before homing
ActivateSignal(Output3)
Sleep (500)
' home 3 axis
DoButton(24)
DoButton(23)
DoButton(22)
'cut power on the optical home detector
DeActivateSignal(Output3)

When I step into that code with the debugger, that works, powering optodetector just before homing, and cutting power after. But when I launch it with the ‘home all axis’ button, it appears the “DoButton(24)” cut my power!!! (and maybe all the other output, I did not verify). I can heard the relay activated as asked on script line2, and disactivated  ½ s after.

Do you have any idea on why the “DoButton” switch off output in real run mode, and not in debugging?

Title: Re: Ref all Axis ... and activate output while homing.
Post by: Graham Waterworth on December 28, 2011, 06:16:25 AM
Try it like this

'power on the optical home detector and wait 500 ms before homing
ActivateSignal(Output3)
Sleep (500)
' home 3 axis
DoButton(24)
DoButton(23)
DoButton(22)
while ismoving()
wend
'cut power on the optical home detector
DeActivateSignal(Output3)

Graham
Title: Re: Ref all Axis ... and activate output while homing.
Post by: ewidance on December 28, 2011, 07:44:06 AM
Hi Graham,

I just tested and it works perfectly... Thanls a lot. I did not understood events were processed in parallels, and scripting continued...

Again, thanks a lot and hapy new year!

JPC