Hello Guest it is April 28, 2024, 07:07:01 AM

Author Topic: SystemWaitFor(INDEX) ...will it work?  (Read 14644 times)

0 Members and 1 Guest are viewing this topic.

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #30 on: November 16, 2012, 02:32:56 PM »
Let me try again with your last macro. 10 minutes please  :)

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #31 on: November 16, 2012, 02:55:41 PM »
Ok. Just run the macro but the stop position varies wildly.
So far I've run the macro 4 times without changing the rundown time and I've had the stop position at (approx) 90 deg past once, 180 deg past twice, and 270 deg past detection point once.  :(

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #32 on: November 16, 2012, 03:11:38 PM »
YEP that is how that approach usually ends up. You have absolutely ZERO control over the process.

Try it this way lets NOT give the spindle time to get wound up. As soon as it sees the first pass it shuts off the spindle back off.  hopefully friction will be our friend at that speed.


'M2920 Macro for spindown Point
SetOemDro(817,20)       'set RPM
SetUserDRO(2001,0)   'Clear DRO to zero

RefCombination(32)
DoSpinCW()

Do While  GetOemLED(812)  
Loop


DoSpinStop()
Message"Ready For Tool Change"

End  
« Last Edit: November 16, 2012, 03:14:05 PM by BR549 »

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #33 on: November 16, 2012, 03:41:40 PM »
The original principle seems fine, as the spindle really is creeping, but the reaction time must be affected by something that we are not considering.
I have just done a video which I am trying to upload as everything looks great except the ultimate stopping position.

...Sweep

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #34 on: November 16, 2012, 04:45:53 PM »
 :D happy, happy, happy  :D

Can't believe it. Run it 10 times with 10 perfect stop positions!!!!!
It may not be pretty or particularly fail safe, but that's something I/we can work on, but it works and works again.

SetOemDro(817,20)
DoSpinCW()
Sleep(5000)

While Not IsActive(INDEX)
Sleep(1)
If IsActive(INDEX) Then DoSpinStop()
Wend

It looks like the whole key to the problem was the Sleep prior to stopping the spindle. Now that this works I'll revisit some of your earlier, safer, macros with timeouts and see if I can get those to work. Result!
Your continued support has been, and will continue to be, much appreciated.

Thanks ...Sweep

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #35 on: November 16, 2012, 05:41:44 PM »
GOOD JOB, (;-) TP