Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: derekbpcnc on June 27, 2009, 04:03:35 PM

Title: Lathe spindle brake
Post by: derekbpcnc on June 27, 2009, 04:03:35 PM
Hi ll,
I am upgrading a Colchested CNC Lathe to Mach.
The sindle has a magnetic brake and I am wondering how I synchronise the brake with the M3.
i.e i would like the brake to be realease and the after a short time delay, give the M3.
on stop, I would like to send the M5 and after a time (say 0.5 sec) switch on the brake.

any pointers would be appreciated .

ATB

Derek
Title: Re: Lathe spindle brake
Post by: Hood on June 27, 2009, 04:09:12 PM
Write custom macros for M3, M4 and M5 and use an output for the brake.
M3 would go something like this


ActivateSignal(OutPut2)
Sleep(500)
DoSpinCW()


Hood
Title: Re: Lathe spindle brake
Post by: derekbpcnc on June 28, 2009, 05:03:31 AM
Hi Hood,

Thanks for the reply, I have not looked at macros before, so I'm starting right from scratch.....
I imaging my application is a nice easy introduction to macros......now where is my manual.
I'll give it a go, I always find this the best way to learn.
Thanks

Derek
Title: Re: Lathe spindle brake
Post by: Hood on June 28, 2009, 05:11:17 AM
One important thing to remember is that the macros you want to change are the ones within the folder of the profile you use. What I mean is there is a C:\Mach3\Macros folder and that will have a load of macros in it but there will also be folders there which are the macro folders for the different profiles. So for instance if you are using the standard Lathe profile then it will be C:\Mach3\Macros\Mach3Turn that you want to  change the macros.
 Another thing though is if you are going to change macros then it is best to set up a custom profile, that way when you update Mach revisions the custom macros will not be overwritten by standard ones.
Hood
Title: Re: Lathe spindle brake
Post by: derekbpcnc on August 17, 2009, 04:12:39 PM
Hi
Hood,

I have edited the M3 and M5 macros to:-


ActivateSignal(9)
Sleep(100)
DoSpinCW()

DoSpinStop()
Sleep(100)
DeActivateSignal(9)

The macros work but do not control the brake output.
I see the delays working.

(I have mapped pin 9 to output 9 in ports and pins)
If I toggle the active hi/low, this confirms that the brake is working electrically, but appears the macro does not.

Prob something I have missunderstood.
Any help would be appreciated, I 've been faffing for about 3 hrs now and admit defeat ;D

ATB
Derek

Title: Re: Lathe spindle brake
Post by: Hood on August 17, 2009, 04:28:39 PM
You missed out the OutPut, try this,

ActivateSignal(OutPut9)
Sleep(100)
DoSpinCW()

DoSpinStop()
Sleep(100)
DeActivateSignal(OutPut9)

Hood
Title: Re: Lathe spindle brake
Post by: derekbpcnc on August 17, 2009, 05:09:57 PM
Thanks Hood,

I'll give that a try tomorrow.

ATB
Derek
Title: Re: Lathe spindle brake
Post by: derekbpcnc on August 19, 2009, 02:59:59 PM
Hi Hood,

I have tried this and still no joy. ???

I have noticed that if I type M3 into the MDI the macro performs the correct delay but if I click the spindle start icon the delay is ignored.
Either method does not control the OP of the brake.

The brake OP does work if I toggle the ports and pins "active hi active low" selection.
Strange.

Regards
Derek.
Title: Re: Lathe spindle brake
Post by: Hood on August 19, 2009, 03:45:16 PM
Ok if you open the macro in the editor and press the green arrow does it work?
 If yes then check you have it in the correct folder, it needs to be in the macro folder for the profile you are using so if Mach3Turn profile it would be C:\Mach3\Macros\Mach3Turn

Hood
Title: Re: Lathe spindle brake
Post by: NosmoKing on August 19, 2009, 04:45:30 PM
You did not mention what kind of spindle motor/controller it is?
Did it previously brake to a stop, or was it just a holding brake?
If it was a holding brake, there must have been some method or signal to indicate zero speed?
Nosmo.
Title: Re: Lathe spindle brake
Post by: Hood on August 19, 2009, 04:52:29 PM
You did not mention what kind of spindle motor/controller it is?
Did it previously brake to a stop, or was it just a holding brake?
If it was a holding brake, there must have been some method or signal to indicate zero speed?
Nosmo.

I think it was just a brake that was spring loaded so when you shut off the power to the  spindle the electromagnet  lost power and the brake clamped, that is the normal way on the Colchester manual lathes anyway.

Hood
Title: Re: Lathe spindle brake
Post by: NosmoKing on August 19, 2009, 05:39:29 PM
So it sounds like just braking a normal uncontrolled AC spindle motor. What is the reason for the time delay if the original worked OK?
Nosmo.
Title: Re: Lathe spindle brake
Post by: Hood on August 19, 2009, 06:08:42 PM
Maybe Derek better clarify what actually hapens as I was thinking it was a manual lathe he was converting but reading again it seems it was a CNC originally.
 I was thinking he had fitted a VFD and needed the delay so that the brake didnt aply too soon thus tripping the VFD.
 As it seems to be working correctly (toggle Active setting) then I think it must just be the macro is in the wrong place for the profile, either that or its not correctly named..
Hood
Title: Re: Lathe spindle brake
Post by: NosmoKing on August 19, 2009, 09:20:53 PM
On a VFD that has configurable outputs , I have set one for 'At Zero Speed' this can be used as a software input or switch hardware direct.
Nosmo.
Title: Re: Lathe spindle brake
Post by: keithmech on August 19, 2009, 10:25:54 PM
What bob are you using?Are you starting the spindle from relays on the bob or from a plc?
Title: Re: Lathe spindle brake
Post by: derekbpcnc on August 20, 2009, 02:43:31 AM
Hi All,

Thanks for the help....

It is a CNC lathe that myself and brother are upgrading. (Old anilam crusader control)
The brake originally released and came back on in time with the spindle start signal. The spindle motor control was just a contactor / DOL system and now has a VFD so I wanted to get the VFD to apply its share of braking (softer deceleration than applying the brake at full chat) and also as Hood stated prevent the drive from tripping.

I am 'sure' (as I can be) that I am using the correct macro, I can set the delay to say 3000 (3s) and I see a delay in the start, set this to 100 and I see a much shorter delay. Also I deleted all the other profiles to be sure.
Profile I am using is Colchester - C:\Mach3\Macros\Colchester

BOB is a PMDX122 ( I have fitted this type to my BP mill and Orac lathe - good kit, the PMDX)
The spindle start signal from the BOB feeds a Homan Designs DC-06 speed controller. The relay on the DC-06 starts the spindle - this works fine.
An output from the BOB feeds a SSR that operates the brake. The SSR has a LED to show operation, this switches on as I toggle the ports and pins active hi/low but wont be controlled by the macro.

Just a point, might be unrelated, I did have the charge pump working but now I can't get the charge pump relay to operate - "fixed with a chock block for now" (my Estops still work :o)
Haven't tried this yet  if you open the macro in the editor and press the green arrow does it work?

On a positive note, I got the viper 200 drive powered up on the Z axis, and can talk to the drive to tune the parameters - motor holds position - at least no expensive smoke  ;)
I have not been able to command a move yet, drives are not getting or ignoring the step signal...it was late last night when I tested this and thought best to have a rest and have a fresh go in the morning.
I will get a scope on the OP of the BOB to see if there is a pulse train.

I'm sure when we get to the bottom of this, there will be a need to "issue an idiot alert warning" as its bound to be me that has done something silly :-[

ATB
Derek.
Title: Re: Lathe spindle brake
Post by: Hood on August 20, 2009, 03:44:53 AM
If you want to attach your xml and also the macros I will have a look here and see if I can find a problem. You will be best to xip them in one folder just in case it is a naming problem.
Hood
Title: Re: Lathe spindle brake
Post by: derekbpcnc on August 20, 2009, 05:12:47 PM
Hi Hood,

Looks like the PC is throwing a wobbly.
Got the Z axis vipers working and the machine moving and did a bit of tuning but the motion was lumpy as hell.
I ran the driver test and the performance is terrible.... and crashed twice.
Also crashed when exiting the Config table.
So this could be the problem. I'm sure this is the cause of the charge pump not brining in the relay too.

Quickly coppied the xml to another PC, motion now smoooooth ( didn't check the Charge pump relay)

Me brother is going to re-install everything / check latest drivers and we'll give it another go.
Hope this will fix the macro problem too...

ATB
Derek
Title: Re: Lathe spindle brake
Post by: derekbpcnc on August 21, 2009, 01:35:58 PM
Hi,

The PC has a problem.
Everytime running the driver test - it says "pulsing too fast" then "pulsing too slow" and then the PC hangs.
The PC runs mach "OK" buit motion very lumpy.

It is a 1.6GHZ MSI KM2M -
Fresh install of XP with SP3
512Mb ram
The MOBO drivers have been updated / reinstalled
LAN disabled
USB enabled /disabled
Parallel port tried in every BIOS setting
No virus SW running
Windows update off
Task manager shows 99% idle
Was using onboard graphics and now fitted a Radion 9600 - no change.
Gone through the optimisation.

Any suggestions?......I'll start -

1) bin the MOBO

ATB
Derek.


Title: Re: Lathe spindle brake
Post by: Hood on August 21, 2009, 02:29:11 PM
You tried the optomisation steps detailed on the downloads page?
Hood
Title: Re: Lathe spindle brake
Post by: derekbpcnc on August 22, 2009, 03:32:07 AM
You tried the optomisation steps detailed on the downloads page?
Hood
Hi Hood,

I went through the optimisations steps - I'll run thro again in case I missed anything.

A more positive note - using another PC, the Viper 200s are working well. I have done as much tuning of the PID as I can just cutting air.
Generaly, it is looking very good, just need to sorth the "blasted" PC :-)


ATB
Derek
Title: Re: Lathe spindle brake
Post by: derekbpcnc on August 23, 2009, 10:33:14 AM
You tried the optomisation steps detailed on the downloads page?
Hood

Hi Hood,

Went throught the optimisation steps again (properly this time!) and set the PC option to Standard PC in device manager.....ta darrrr !
Now works fine.
The M3 M5 macro to control the brake was stil not working so I reloaded mach and this is now functioning perfectly. (must have scrambled something when I had a few crashed running the driver test.

Entering M3 or M5 in the MDI line works fine too.

The only thing I have noticed is that the brake is not released if I start the spindle using the icon (in manual or auto screen) and ignores the delay I have programmed in the M3 macro. However the stop spindle icon does control the brake as required.
Does the icon run a different macro from that used by M3?

We have run a quick test to cut some "real metal" 
Don't you just love it when a plan comes together :-)
Thanks for your help, we're chuffed to bits!

ATB
Derek

Title: Re: Lathe spindle brake
Post by: Hood on August 23, 2009, 10:49:58 AM
:) yep its great when everything works out.
 Not sure about the button for start, would have thought it would just use the M3 macro but maybe not. Easy to fix by opening the screenset in screen4 and double clicking on the button and changing it to a VB button.  Best to save the screenset with a different name as if you dont and upgrade Mach your changes will be overwritten. After that then go into Mach and View menu then load screens and choose your renamed screen. Next Operator menu then Edit Button Scripts, that button should be flashing, click on it and then enter the VB you want into the button and close and it should now work as planned :)
Hood

Oh forgot to say you will need to change the start button on the other pages as well.
Title: Re: Lathe spindle brake
Post by: derekbpcnc on August 23, 2009, 12:59:30 PM
Easy to fix by opening the screenset in screen4 and double clicking on the button and changing it to a VB button. 
After that then go into Mach and View menu then load screens and choose your renamed screen.
Next Operator menu then Edit Button Scripts, that button should be flashing, click on it and then enter the VB you want into the button and close and it should now work as planned :)
Hood

Hi hood,

I'll have a go at that once I have worked out what I am going to have a go at!

ATB
Derek
Title: Re: Lathe spindle brake
Post by: derekbpcnc on August 29, 2009, 08:52:14 AM
Bit more to do, mainly to the homing limits.
I might try to use the Z channel from the encoder in "series" with the slide switch to provide an accurate home / reference position.

Here is a quick photo.
http://img42.imageshack.us/img42/9465/img6551.jpg (http://img42.imageshack.us/img42/9465/img6551.jpg)
ATB
Derek
Title: Re: Lathe spindle brake
Post by: Hood on August 29, 2009, 09:10:15 AM
Looks good.
Does that tool post index or is it just a standard dickson?
Is the lathe based on a Student? Looks a bit smaller than a Triumph.

Hood
Title: Re: Lathe spindle brake
Post by: derekbpcnc on August 29, 2009, 12:47:27 PM
Looks good.
Does that tool post index or is it just a standard dickson?
Is the lathe based on a Student? Looks a bit smaller than a Triumph.
Hood

Hi Hood,

The Lathe is a Master 600 (ex college with very low milage)
the tool post is a standard Dickon (manual change jobbie)
I have an indexer from an automated assembley machine that I might have a go at fitting as a tool turret now it's been upgraded to mach. The indexer is solid and very accurate.
It has 6 positions, so I can fit 6 turning tools + 6 boring / drills + possible to fit gang toling in some positions.... (thinks crawl first before running ;-) )

ATB
Derek
Title: Re: Lathe spindle brake
Post by: BluePinnacle on August 29, 2009, 01:57:41 PM
Not sure if it helps but my mill has a pure hardware braking solution - the brake (1)  contactor has a delay module on top which waits 250 ms when triggered, so the brake comes off, and 250ms later the spindle contactor (2) is triggered to start the spindle. The brake reapplies instantly if the spindle is shut off.

Reversing is similar, the reversing contactor (3) is triggered by an output, and as it closes it triggers the brake contactor (1) which triggers the spindle contactor (2) as normal and completes the circuit.

This way at least you can keep the software side simple and rely on dumb mechanical stuff to do the essentials.
Title: Re: Lathe spindle brake
Post by: Hood on August 29, 2009, 02:32:54 PM
The auto changer will make a huge difference, I couldnt imagine using my lathe without it ( or should I say them ;) )
 I dont have it yet but I am getting another turret from my friend who is scrapping a bullard lathe, I will replace the front toolpost so I will end up with front and rear turrets :)

Hood
Title: Re: Lathe spindle brake
Post by: derekbpcnc on September 10, 2009, 12:37:31 PM
The auto changer will make a huge difference, I couldnt imagine using my lathe without it ( or should I say them ;) )
 I dont have it yet but I am getting another turret from my friend who is scrapping a bullard lathe, I will replace the front toolpost so I will end up with front and rear turrets :)

Hood

Hi Hood / Blue Pin'

I think I will try controlling the brake via the VFD... although it is disconnected at the moment and the VFD is not complaining.

Picked up a tool turret this week. 8 position Duplomatic. I will make a small PLC control for this and select the tool number using I/O from a Pokeys expansion board.
Duplomatic sent me a pdf of the tech manual - the wiring looks simple enough.

I'l post a few picks on a new thread .
ATB
Dekre.
Title: Re: Lathe spindle brake
Post by: Hood on September 10, 2009, 01:21:38 PM
I did a PLC ladder and a macro a while back for a guy with a duplomatic turret on his lathe. Not sure if its the same setup as yours but if I remember correctly it was a 12 station one.
Hood