Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 09:42:55 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  Ref all Axis ... and activate output while homing.
Pages: 1   Go Down
Print
Author Topic: Ref all Axis ... and activate output while homing.  (Read 278 times)
0 Members and 1 Guest are viewing this topic.
ewidance
Active Member

Offline Offline

Posts: 5


View Profile
« 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:
'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?

Logged
Graham Waterworth
Administrator
*
Online Online

Posts: 1,665


West Yorkshire, England



View Profile WWW
« Reply #1 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
Logged

G-Code is on the cutting edge

Autovalues Engineering, CNC machining specialists, Bradford, England
ewidance
Active Member

Offline Offline

Posts: 5


View Profile
« Reply #2 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
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!