Hello Guest it is March 28, 2024, 10:23:52 PM

Author Topic: SystemWaitFor(INDEX) ...will it work?  (Read 14510 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 #20 on: November 14, 2012, 03:50:12 PM »
Good evening TP,

Thanks again for your support. Lets see what happens!
Will report in 15 minutes.

Sweep

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #21 on: November 14, 2012, 04:26:31 PM »
It has worked but only intermittantly. I have tried increasing the look time from 5 to 20seconds, to allow the spindle speed to stabilise at 20rpm, but this hasn't improved things.
I have had one r two instances where the spindle has stopped right on the proximity but this has only happened around 10% of the times I have run the cycle. Most of the time I am getting the 'time out' message.
I have also tried utilising a seperate INPUT instead of INDEX but the effect is the same.
I will try have another go with the C axis idea using the DIR output to control the relay.

Sweep

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #22 on: November 14, 2012, 04:29:03 PM »
Question for tomorrow WHat drives your spindle drive  PWM, +10v,step dir, ???

The spindle drive is by the PWM output from Mach3 converted to the 0-10v required by the DC controller by a homemade circuit board.
Using the closed loop spindle control I get speeds that are normally +/- 1rpm from that requested all the way from 20 to 3000rpm. There is a bit of an overspeed when the spindle first starts but this will stabilise within 3 or 4 seconds as the PID learns.

...Sweep
« Last Edit: November 14, 2012, 04:31:46 PM by Sweep »

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #23 on: November 14, 2012, 04:42:40 PM »
I think time for a brain try to see IF it can see it.

(;-) TP

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #24 on: November 14, 2012, 05:08:34 PM »
OK Brains  on this VISTA machine do not work.

You may want to try it on your machine. It is a very simple brain it looks for 2 things the userdro(2000) to be off and the index signal to be ON. IF it sees it it will turn the UserLED(2000) on.

You must have the UserLed(2000) where you can see it . ONCE on it stays on so make sure you turn it off before testing.

(;-) TP

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #25 on: November 14, 2012, 05:34:29 PM »
What are Brains?

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #26 on: November 14, 2012, 05:37:10 PM »
Here is another thought that may be easier than the flipping of a relay from the dir channel. When the Crefhome trips the switch it SETS a LED on.

When you rehome c it looks for a switch,revs dir then looks for the closing of the switch then STOPS and turns ON the LED.

In your case you call the C refhome and as soon as it sees the signal it does its thing AND the passing lug that trips the switch has moved away and the switch resets which should allow the LED to set on.

ALL WE have to do to watch for the LED to go active IF it does(;-)

SO you would activate the spindle to 20 rpm let stabilise then call the C refhome  (Use the CB version not the Gcode version)
IF the LED goes active then Dostopspin()

(;-) TP

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #27 on: November 14, 2012, 07:47:33 PM »
OK this works here as best I can simulate it. You need to activate the C axis then set Chome input the same port/pin as the spindle index input.

Place the code in a test button. AND give it a whirl.

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

DoSpinCW()
Sleep(2000)            'Adjust for stable RPM
RefCombination(32)

Do While  GetOemLED(812)  And GetUserDro(2001)<6
SetUserDro(2001,(GetUSerDro(2001)+1))
Sleep(1000)
If GetUSerDro(2001) >5 Then
DoSpinStop()
Message"Spindle Detect Timeout"
End
End If
Loop

Sleep(1000)             'Adjust for Spindown Stop point
DoSpinStop()
Message"Ready For Tool Change"

End 


(;-) TP         

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #28 on: November 16, 2012, 01:01:45 PM »
Good Evening TP,

Tried the latest solution last night but without success, although I was very tired so I am going to have another go now.
Having watched the Brains videos it seems that may offer a faster reacting solution but I have never used them before.
I thought I could insert a phantom output in the toolchange macro which Brain would recognise, say output 6, and then have the brain terminate with button press 110 Spindle on/off when it sees Spindle Index change state. Something like:

SetOEmDro(817,20)
DoSpinCW()
Sleep(5000)
SetTimer(11)
ActivateSignal(OUTPUT6)
While GetOEmDro > 0
          Sleep(1000)
Else DeActivateSignal(OUTPUT6)
If GetTimer(11) >10 Then
          Message ("Spindle alignment not achieved")
          Exit Sub
End If
Wend

I'm not sure how correct that is as I don't know if I've got the While, Else, and Ifs in the right order.
As far as the Brain is concerned I need to do an And that only executes it if Spindle speec is >0 and Output6 is =1

What are your thoughts?

...Sweep

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #29 on: November 16, 2012, 01:31:14 PM »
The brains will NOT be faster at detecting the signal than the last routine I used. That routine ran at kernal freq to detect the index signal. HERE I could not outrun it as it looks for the signal at 25,000 times per sec.

The brains will run fast interally BUT STILL have a 10hz loop to read and write the I/O.

SO on the last routine I posted what failed to happen ?

(;-) TP