Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: SimonRafferty on July 11, 2010, 07:40:19 AM

Title: Mentor2 Spindle Drive - Using 'Speed Achieved'
Post by: SimonRafferty on July 11, 2010, 07:40:19 AM
I'm in the process of Mach-converting a Bridgeport Interact 1Mk2 which has a Mentor2 Spindle VFD.

The spindle motor has a tacho output which connects directly to the Mentor2.  It appears the way the Bridgeport used it was to send the Mentor a voltage (0 to 10v as usual) and when the Mentor achieved the requested speed, it closed a relay - allowing the CNC controller to move to the next line.

Since the Mentor's PID parameters are nicely tuned to the machine - it makes sense to use it in this mode.

Can Mach accept a 'speed achieved' input instead of a spindle tacho?

Alternatively, would I be better just fitting another tacho and connecting that to Mach as normal?

Si
Title: Re: Mentor2 Spindle Drive - Using 'Speed Achieved'
Post by: Hood on July 11, 2010, 11:09:08 AM
I am thinking it may be possible to use a M3/M4 macros to look at the signal and loop until its seen.

Hood
Title: Re: Mentor2 Spindle Drive - Using 'Speed Achieved'
Post by: SimonRafferty on July 11, 2010, 11:17:39 AM
Thanks Hood - that was kind of the conclusion I was coming to.

How would it react if I wired it up as a limit switch / end-stop?  Presumably that would stop any of the axes moving until it had achieved the requested speed?

Si
Title: Re: Mentor2 Spindle Drive - Using 'Speed Achieved'
Post by: Hood on July 11, 2010, 11:21:44 AM
Not a good idea I dont think, would cause an E-Stop in Mach if you did that.
Having the M3/M4 macros loop until the signal is seen would stop any movement until the macro completes, so thats the way I would go.
Hood
Title: Re: Mentor2 Spindle Drive - Using 'Speed Achieved'
Post by: BR549 on July 11, 2010, 11:31:38 AM
Justa thought, mach has a feature that prevents the Gcode from running if a safety input is active(door open)

I would  use a brain to

If spindle is active AND waittimer for 3secs and IF input from VFD is NOT active then apply  Mach safety to prevent the machine from running code.

That would stop the Gcode from running IF the M3/M4 was active AND after 3 secs the VFD does not give the OK signal to move

I would also map the function on out to a BIG yellow LED to show the state of the control for trouble shooting down the road.  It would be like the out of lube function we use to stop the machine function if the lube is LOW. Hard to remember without that LED flashing at ya

Title: Re: Mentor2 Spindle Drive - Using 'Speed Achieved'
Post by: SimonRafferty on July 11, 2010, 12:29:50 PM
Not a good idea I dont think, would cause an E-Stop in Mach if you did that.
Having the M3/M4 macros loop until the signal is seen would stop any movement until the macro completes, so thats the way I would go.
Hood

Maybe I meant home switches rather than limit?  It cannot eStop on these as you use them to reference the axes?  I wouldn't swear to this as I can't remember the last time I homed the axes on my Lathe (previous Mach conversion).

Although doing it in software is straightforward - If possible I'd like it to be hardware simply because, several years down the line when I have to rebuild the PC - or worse still, it's next owner does - I would like it to work with a fairly standard copy of Mach.  Then it will run with only the ports & pins set.

Si
Title: Re: Mentor2 Spindle Drive - Using 'Speed Achieved'
Post by: Hood on July 11, 2010, 01:01:50 PM
Your idea with home switch wouldnt work as far as I can see. A home switch is used for homing and that is all, it doesn't prevent the axis from moving if it is active and Mach only pays attention to it when you are doing a homing move, all other times its ignored..
You need to put the input into Mach and either have a brain look at it like Terry has said or have your M3/M4 macro do the looking, either of these will work.
No problems with swapping computers or users in the future as long as you keep a backup of the brain/macro for future use.
Hood
Title: Re: Mentor2 Spindle Drive - Using 'Speed Achieved'
Post by: SimonRafferty on July 11, 2010, 01:04:48 PM
Fair enough - thanks for your help.

I'll just modify the macros and see how it goes.

Si
Title: Re: Mentor2 Spindle Drive - Using 'Speed Achieved'
Post by: BR549 on July 11, 2010, 03:14:59 PM
Carefull in the Macro that you don't create an endless loop if the VFD does not trip the signal some wait for loops are hard to get out of(;-) you need an escape route if it happens.

The brains are 100 times faster and take up no real CPU time with wait for loops. VB can hogg resources if you are not carefull.

Just a thought, (;-)
Title: Re: Mentor2 Spindle Drive - Using 'Speed Achieved'
Post by: SimonRafferty on July 11, 2010, 04:13:32 PM
I've only written a couple of macros for things like peck drilling on my lathe - in VB.  I'll watch out for resource hogging though.

I had figured on something like testing every couple of seconds to see if the speed has been reached.  If it has not after say 6 sec, then terminate the program.

Si
Title: Re: Mentor2 Spindle Drive - Using 'Speed Achieved'
Post by: BR549 on July 11, 2010, 05:24:42 PM
This may help when you get to that part in your project. It is a simple routine to test conditions and either continue or stop and message user. I would test your spindle to time it from stop to full RPM to establish a wait time

Sub Main()

Line# = GetDro(16)               'GetCurrent line#
DoSpinCW()                'Start Spindle
Sleep(3000)               'Wait for spindle to spool

If GetOemDro(11) = 1 And Isactive(input2) Then  GoTo 2   'Check inputs if good then else

 Message" Spindle Failed To SPOOL UP"
 GoTo 3

2:
 Message"Spindle Good for M3 start"
   GoTo 4

 3:
 DOButton(1)               'Feedhold
 DoButton(3)               'Stop
 DoButton(2)                 'Rewind
MSGBOX ("Spindle Failed To Spool Up On Line#") &  Line#     'Message to
Goto 4                                                                                                                                                                                                                 

4:           
 End Sub
 End
Title: Re: Mentor2 Spindle Drive - Using 'Speed Achieved'
Post by: SimonRafferty on July 12, 2010, 09:01:57 AM
Thanks - that's great.  I'll give it a go in a few days once the mill + PC is a bit more together!

Si
Title: Re: Mentor2 Spindle Drive - Using 'Speed Achieved'
Post by: Hood on July 13, 2010, 04:19:16 AM
Not great with VB but thinking you may need a few
While IsMoving()
Wend
In there.
Hood
Title: Re: Mentor2 Spindle Drive - Using 'Speed Achieved'
Post by: BR549 on July 13, 2010, 09:38:24 PM
Sub Main()
Line# = GetDro(16)               'GetCurrent line#
DoSpinCW()                'Start Spindle
Sleep(3000)               'Wait for spindle to spool
If GetOemDro(11) = 1 And Isactive(input2) Then  GoTo 2   'Check inputs if good then else
 Message" Spindle Failed To SPOOL UP"
 GoTo 3
2:
 Message"Spindle Good for M3 start"
   GoTo 4
 3:
 DOButton(1)               'Feedhold
While Ismoving()
Sleep(1000)
Wend
 DoButton(3)               'Stop
 DoButton(2)                 'Rewind
MSGBOX ("Spindle Failed To Spool Up On Line#") &  Line#     'Message to
Goto4                                                                                                                                                                                                         
4:           
 End Sub
 End


(;-) GOOD catch Hood , yep need to WAIT until the feedhold stops motion.