Hello Guest it is March 28, 2024, 08:05:45 PM

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

0 Members and 1 Guest are viewing this topic.

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
SystemWaitFor(INDEX) ...will it work?
« on: September 24, 2012, 06:05:26 PM »
I am wanting to stop my spindle as it passes the speed monitoring proximity switch, which is assigned as "index" on the ports and pins screen, to align the drive dogs of the spindle with those of the tool mounted in the carousel.
I will, of course, have dropped the speed to, say, S60 to reduce the effects of inertia over-run.
Is the statement SystemWaitFor(INDEX) sensible or will I have to duplicate my input pin to a true Input# for it to work, e.g. SystemWaitFor(INPUT1), and does this command look for a high or low state?
I was going to use IsActive(INDEX) or IsActive(INPUT1) but I don't know how to leave the command 'open' and looking for the state of the input to change as it would be only chance that the proximity was active when the script line was processed.

thanks again ...Sweep

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #1 on: September 24, 2012, 07:14:07 PM »
you could do a while isactive() loop and check any input, if you have a servo spindle you could do swapaxis(x,y) and do a home command to find the signal.

Graham
Without engineers the world stops

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #2 on: September 24, 2012, 07:31:22 PM »
With a servo drive as Graham says with a VFD use the jog feature of the VFD to slowly rotate the Spindle and have MAch3 watch for the signal then stop and use DC brake of the VFD to lock the rotor. OR use a simple spring loaded  shaped cam to move the spindle into position after it has stopped

Just a thought, (;-) TP

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #3 on: November 12, 2012, 05:13:52 PM »
isn't it annoying when you type out a long post and the system times out before you submit it. grr

Anyway, I have been away from playing with my machine for a few weeks due to work commitments and have now started to complete the missing link of my toolchanger macro, namely the spindle dog alignment.
I have tried various combinations of If and While commands but have failed at every step and I am coming perilously close to causing some serious damage after crashing the carousel into the still spinning spindle on more than one occasion. ouch!
What I am trying to do, as mentioned in the original post, is to run the spindle at a very low speed, say 60rpm, and then switch off the spindle relay as the INDEX proximity passes the detector. As the detector is about 90degrees off from the correct dog position i am also trying to put in a Sleep delay so I can 'tune' the position. If this is impractical I could physically move the proximity to perfectly align with the dog position which might be better.
As I wasn't getting much success with IsActive(INDEX) I have duplicated the Index port and pins for a seperate input so I can use IsActive(INPUT2). Whilst I can get the spindle running, Code "M3 S60", I don't seem to be able to figure how to get the thing to stop before the program steps further into the macro and sends the carousel into the spindle.
I don't suppose it really matters at what early point in the macro the spindle alignment commmands are executed, be it before or after the table moves safe (Code "G00 G53 Z" & z etc), so please feel free to make any suggestions.
I am just worried that if I carry on 'trying' to get it right i'm going to detroy my machine in the process.

As always, your assistance would be greatly appreciated ...Sweep

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #4 on: November 12, 2012, 06:15:11 PM »
Are you using a VFD to run the spindle ?

Does it have an index feature built in?

Does it have a creep feature ?

Can your VFD do DC injection?

With a rotating mass IF you hit stop at a certain place inertia will carry the load on to an unknown position. Not possible to garrantee the same spot every time.

Some Machines use a stop pin as the spindle CREEPS into position the pin fires and locks the spindle at the same point every time.

Just a thought, (;-) TP

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #5 on: November 12, 2012, 06:26:25 PM »
Normally you would do a stop and confirm that motion has stopped .

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #6 on: November 12, 2012, 07:22:28 PM »
Hi TP,
The spindle drive is a DC motor and Lynx 08 DC controller which is a pretty basic. Both motor and controller are the original equipment of the machine and are probably 20+ years old.
I appreciate that the inertia will carry the the spindle beyond the switch off point, hence the point about the delay for tuning the stop position, but there is also quite a lot of friction in the system as there is also a 1:1 timing belt between the motor and the spindle. This is also the reason why I have dropped the speed down to 60rpm to reduce the affect of the inertia to a minimum. At this speed I am witnessing maybe a 1/4 turn of the spindle when the relay disengages.
There is also a mechanical self-aligning mechanism in the spindle which will take up around +/- 15degrees misalignment when the air operated tool holder release is operated.
The system that i am suggesting is really the same that was installed with the machine from new. The only thing that I am doing is operating it from Mach as opposed to the obsolete motherboard.

...Sweep

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #7 on: November 12, 2012, 07:46:50 PM »
I found an old video of the original machine sequence which I am trying to replicate. Is there any way that I can post it on here as it will show better than words what's happening?
 
...Sweep

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #8 on: November 12, 2012, 08:27:42 PM »
yOu could upload it to YouTube and give us the link.

Love a good movie, (;-) TP

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: SystemWaitFor(INDEX) ...will it work?
« Reply #9 on: November 13, 2012, 02:56:48 AM »
Ladies and Gentlemen, for your entertainment and edification this evening I proudly present ...a video of an old milling machine

http://pictures.pollz.co.uk/#8.
There are two videos in a album called Denford Triac.
The site is my daughter's in case anybody was wondering!

Everything has been programmed except the spindle stop position. When I have donetool changes with the spindle isolated and manually positioned with the drive dog in the correct position I have never once had a toolchange failure. The last tricky bit is to align the drive dog from a spinning spindle before the carousel starts moving. I chose 60rpm as the speed as it looks pretty close to what the original on-board controller was using, is not too slow to become lumpy, and pretty much gets rid of most inertia overun with either a light tool (centre drill) or heavy tool (face mill).

...Sweep
« Last Edit: November 13, 2012, 02:58:54 AM by Sweep »