Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: DaveCVI on January 20, 2012, 10:25:56 PM

Title: Lathe - set max RPM for CSS?
Post by: DaveCVI on January 20, 2012, 10:25:56 PM
Hi,
I'm playing with mach lathe -

1) is there a newer gcode language doc for lathe than what is in the old mach 1.84 manual?

2) G96 is not in the 1.84 manual - but I see that the mdi line accepts G96 S~
What is the syntax spec for mach's G96?

3) How do / can you set a max RPM for G96 mode?

Dave

Title: Re: Lathe - set max RPM for CSS?
Post by: Hood on January 21, 2012, 11:18:43 AM
1. No, nothing new in turrn since the first day it was released I would say ;D
2. CSS doesnt work correctly
3.G48S**** is how you set max RPM when in G96.
Hood
Title: Re: Lathe - set max RPM for CSS?
Post by: DaveCVI on January 21, 2012, 12:05:40 PM
Hood,
1) is there a summary of the issues with css?
2) is there a repository of lathe lore where I can find things like G48 and G96 - that are not in the Gcode section of the 1.84 manual?

Dave
Title: Re: Lathe - set max RPM for CSS?
Post by: Hood on January 21, 2012, 02:20:54 PM
Issues with CSS are as far as I recall when testing. Feed per rev increases/decreases when spindle speed changes. Feed one way on X and it takes a lot lot longer than if feeding the opposite X direction, this BTW is going from point A to B or B to A so its not as if the distance or dia are different. You will probably find more details if you search the forum as its been a long time since I personally gave up testing it ;)

Dont know of anywhere with the info, not much about for Turn except whats in members heads I supect.
Hood
Title: Re: Lathe - set max RPM for CSS?
Post by: thosj on January 21, 2012, 08:16:30 PM
So there are issues with CSS, G96. Does it not work at all, or is it goofy somehow?

Does Feed per revolution work correctly? I tried it, and when potting my speed override, the feed did not seem to change. I haven't tried any of this actually cutting, just in the air, so don't know if feed changes and just doesn't show on the screen.

Kind of too bad Mach Turn doesn't have the usage, hence fixing, that mill has. Would be nice!!
Title: Re: Lathe - set max RPM for CSS?
Post by: Hood on January 22, 2012, 08:41:45 AM
G95 works very well.
FRO works fine as well and if I recall the DRO changes on my screenset but I may be using a different DRO than the standard lathe screenset as I seem to have it in my mind that I had noticed it not changing on te standard screenset.
Hood
Title: Re: Lathe - set max RPM for CSS?
Post by: chrisjh on January 23, 2012, 06:11:55 AM
Hi All,

My experience is that Mach3 Turn responds to G94, G95, G96, and G97 well, if you follow the syntax structure as described in Smid’s CNC Programming Handbook. For example:

G96 S45 M3 G95 F0.1 (Turn on CSS @ 45m/sec and @ a Feed Tool @ a rate of 0.1mm/rev)

G97 S900 M3 G94 F100 (Cancel CSS and run Spindle @ 900rpm, Feed Tool @ a rate of 100mm/min)

I haven't had any experience with setting maximum rpm with G48, as my lathe maximum rpm is limited by my VFD settings, but I suspect that G48 would respond successfully if tested.

There is an example of G code that works successfully towards the end of the document at this link:
http://www.cjh.com.au/Gang%20Tool%20Block%20Offsets%20for%20CNC%20Lathes%20under%20Mach3%20Control.pdf

This link shows a part being turned using a method that switches various operations between CSS (G96) and normal rpm (G97), as well as feed/rev (G95) and feed/min (G94):
http://www.machsupport.com/forum/index.php/topic,14282.msg94797.html#msg94797

Hope this helps.

Regards
Chrisjh
Title: Re: Lathe - set max RPM for CSS?
Post by: Hood on January 23, 2012, 06:29:29 AM
Chris, it is quite hard to be sure from that vid, due to the short distances being travelled, but looks to me that the X travel is constant. Surely if you were in CSS and G95 then when the spindle speed increased the axis feed should also increase to keep the feed per rev constant?

If you have time and are willing to test it would be nice to know.
Can you run some code cutting air  in CSS as a test, what would be good is if you run from largest Dia you can turn into almost the centre and observe if the axis feed per rev stays constant as the spindle speed increases, ie the axis actually travels faster because the spindle is going faster. Also would be good if you can time that operation. Next reverse the operation, ie start from centre and work your way to largest dia and see if it behaves correctly and also see if there is a difference in the time it takes.

I will try when I get to the workshop later on, unfortunately I am stuck at home doing my tax but it gives me a good excuse to go down to the workshop later and forget about tax for a while ;D
Hood
Title: Re: Lathe - set max RPM for CSS?
Post by: Hood on January 23, 2012, 07:41:43 AM
Ok just tested
G0X200
G48S1000
G96S200M3
G1X100F.1

Feed starts at 0.1mm/rev and as the x moves towards the 100mm dia the feed decreases steadily with spindle speed increase, goes down to 0.05mm/rev. Time taken is 1min 35 seconds


G1X200F.1

Feed starts at 0.1mm/rev and as X moves to 200mm dia the feed increases steadily with spindle speed decrease, goes up to 0.2mm/rev. Time taken is 47 seconds.

To me that is totally wrong, FPR should stay constant and axis velocity should increase when spindle speed increases and decrease when spindle speed decreases.
Maybe I am wrong? Is what I am expecting not correct? Is what actually happens correct?

Hood
Title: Re: Lathe - set max RPM for CSS?
Post by: Hood on January 23, 2012, 07:45:26 AM
Oh also Chis, the G48 is not for restricting max spindle speed of your machine as such, the reason it is used is you may have say a 300mm Dia lump in the chuck and you are facing it in CSS, you would want to limit the RPM to what you would consider safe. That way when you hit the centre of the move the spindle is not whizzing that 200Kg lump of steel at 5000rpm :)
Hood
Title: Re: Lathe - set max RPM for CSS?
Post by: chrisjh on January 23, 2012, 06:15:59 PM
Hi Hood,

Very informative.  Thanks for the test results.

I am thinking through your observations.  Too much for my tiny brain this early in the morning.

Question "did the G48 S1000 command limit work as intended?"

If so, I may look at using the G48 Limit in the future if the opportunity presents itself.  Right now most of the parts I make are very small.

Regards

Chrisjh
Title: Re: Lathe - set max RPM for CSS?
Post by: Hood on January 23, 2012, 06:24:05 PM
Yes G48 works fine
I may try tomorrow without the G48 just in case it is that that is screwing things up, actually come to think about it I have tried in the past I am sure without the G48 so likely its not the issue. Will test anyway just in case my memory is playing tricks ;D
Hood
Title: Re: Lathe - set max RPM for CSS?
Post by: thosj on January 24, 2012, 08:07:56 AM
With this resurrected, perhaps Andrew will shot it to Brian and they will fix it!! Wouldn't that be something? CSS is one of CNC lathe's nicest things. Threading and CSS are what make a CNC lathe a wonderful thing!!
Title: Re: Lathe - set max RPM for CSS?
Post by: jastein on January 24, 2012, 03:18:54 PM
Hi Hood:

I did a test of your code on my machine. I had to create a profile for Mach to make it metric (it has inch lead screws).  I needed an excuse to have a metric profile as it could make the programing of metric threads a bit simpler.

It took the same time both directions and the actual speed of the screw is constant (at least as far and I could tell).

Here is the code"

%
(01/23/12 - Pin_mm.tap)
 
 N1 ( od turn )
 G0 G40 G18 G21 G80 G50 G90 G95
 G0 G53 Z-50.0
 T101 M6
 G0X150
 G48S1800
 G96S200M3
 G1X50F.1
 G1X150
 G97 S400
 M9
 M5
 M30
%

See video of operation.   http://youtu.be/5n8QdBuvfbw

Let me know if this helps.

Jim
Title: Re: Lathe - set max RPM for CSS?
Post by: Hood on January 24, 2012, 03:30:25 PM
Ok thanks for that, not seen the vid yet as its taking a long time to load properly for some reason.
So from what you say it seems to be working better for you but still not correctly as the X axis should increase in velocity with RPM increase or decrease with RPM decrease to keep the FPR as programmed.
I wonder why there is a difference, I had asked previously in other threads whether things worked right with the parallel port and it seemed it didnt but maybe its just different. I am using the SmoothStepper (ESS now) are you using the parallel port?
Hood
Title: Re: Lathe - set max RPM for CSS?
Post by: jastein on January 24, 2012, 03:53:26 PM
Hi Hood:

Yes, I tested this way back and got diffferent speeds as I recalled.  I was using inch per rev. feedrates at that time.

This machine is using parallel port.

I will mess with the G98 Feed/Min and the G99 Feed/Revolution and see what I find. 

Jim
Title: Re: Lathe - set max RPM for CSS?
Post by: Hood on January 24, 2012, 03:55:45 PM
Ok Thanks, BTW its G94 F/MIN and G95 F/Rev

Hood
Title: Re: Lathe - set max RPM for CSS?
Post by: jastein on January 24, 2012, 09:20:45 PM
Hood: 

Right.  G95 is the feed per rev.  That was actually set in the modal set line.   I was looking at the Smid book where he uses G98 / G99.

You can actually see the screen showing feed per rev change as the X axis moves toward the spindle center. When the rpm is doubled, the feedrate shown is exactly half. 

More testing.

Jim
Title: Re: Lathe - set max RPM for CSS?
Post by: Hood on January 25, 2012, 04:49:11 AM
Ok just done some more tests and now I get the axis travel time the same in both directions, things are still wrong however.
Ok first how I get the axis times the same was a clue I got from Jims code, I had noticed he only called the feed rate once, I had called it on each move. So what is happening is X moves to min and feed/rev has halved, previously I was calling  F0.1 and then moving out again so CSS then reset the FPR as 0.1 and as the axis moved out then it doubled it as spindle slowed. With not calling the F0.1 again then the move was starting at F0.05 so by the time it got to X max it had ended back at the F0.1.

Now this is still totally wrong as what Mach is doing is keeping the velocity constant(FPM), when in FPR mode that should not be happening as it kind of defeats the purpose of using G95.
What should happen is the FPR stays constant and the velocity (FPM) increase with spindle increase or decrease with spindle decrease.

Hood
Title: Re: Lathe - set max RPM for CSS?
Post by: DaveCVI on January 25, 2012, 02:30:44 PM
I think I'm confused again (happens easily) -

Playing with MDI and the gcode mode status line...

G94 give me a G94 (F/min ) mode - OK
G95 gives me a G95 (F/rev) mode indication - OK
G96 S********* give me G96 - in addition to the G94 or G95.... huh?
So it seems I can get these combinations:
G94
G95
G94 + G96   - a constant F/Min with CSS ??
G95 + G96   - ??

Once you've turned on CSS via G96, how do you turn it off?
I found G97 - that seems to be accepted on the MDI line, but no matter what I do, I still have the G96 in the mode status line...
I can't seem to get back to a non-G96 state.

Dave



Title: Re: Lathe - set max RPM for CSS?
Post by: Hood on January 25, 2012, 02:37:31 PM
G97S***  should turn it back off.
Not sure what you are asking with the other questions.
 To my mind the only really useful CSS is when in G95 as it wiil, or rather should if it was working, keep the chip load constant whilst at the same time keep the surface speed constant.

Hood
Title: Re: Lathe - set max RPM for CSS?
Post by: DaveCVI on January 25, 2012, 03:30:36 PM
Intuitively, I expected G94, G95 and G96 to be mutually exclusive modes - any one of the three.
OK. I can wrap my head around 4 mode combinations:
G94 xor G95 and then G96 xor G97

but I still can't get G97 to turn G96 off.....
G97 is accepted by itself on the MDI line w/o error, but the G96 mode indicator does not change.
I've noticed that the mode line can lag state changes, so I looked up LED 107 which is CSS mode.

here is my test sequence results so far:
G96 S400 - LED 107 goes on, mode line shows G96
G97 - led 107 stays on, mode line still says G96

start over and try this:
G96 S400 - LED 107 goes on, mode line shows G96
G97 s400 - led 107 goes off, mode line still says G96

the try this:
G96 S400 - LED 107 goes on, mode line shows G96
G97 S0 - led 107 goes off, AND mode line changes back to G97

I am confused as to what is really happening...


G97 S0 seems to turn off G96 but not just a plain G97 - that leads to more questions:
it seems that maybe G97 requires an s word? 

Since G97 is not in the mach lathe gcode document, I can't look up what the correct syntax is.
Is
1) G97 S00 a single Gcode prep command that takes a S word and the S word has to equal 0 to get G96 turned off?
OR
2) is G97 S0 two separate things in one block? i.e. a pre-gcode G97 command that turns it back to constant RPM mode and the S0 independently sets the target RPM to 0?

if 1), then what is the logic of needing to set G97 RPM to 0...?
If 2) then, I'd expect G97 w/o a sword to work (does not seem to for me).

I hate having to reverse engineer mach due to a simple absence of current documentation....  :'(

Dave
Title: Re: Lathe - set max RPM for CSS?
Post by: Hood on January 25, 2012, 04:17:02 PM
Doing the G97 only you should get an error message, it requires the S word, did you not get that?. The G96 seems to hang in the mode line until you do some other command after the G97S**, can be anything such as M5 or a G1 or whatever, I suspect calling a G97S0 is the same as calling the G97S** and a M5 after so that will be why it changes with the G97S0.

Hood
Title: Re: Lathe - set max RPM for CSS?
Post by: DaveCVI on January 31, 2012, 01:15:23 PM
Given that G48, G96 and G97 are not in the mach turn 1.84 manual gcode section, I've tried to gather the info I could find re these codes to create a draft addendum.

I've attached the single page and would appreciate any review comments to make it correct.

Dave
Title: Re: Lathe - set max RPM for CSS?
Post by: Hood on January 31, 2012, 05:46:51 PM
I would say G48 without S word is pointless as your spindle would be limited to max by Mach anyway.

I would say that a feed called whilst in G96 and no spindle feedback (spindle not turning) should throw an error and axis should not move. It seems to at the moment but then again if in G95 and a feed is called and no spindle feedback is seen it will still move. Shouldnt do IMO but does, well at least I think it does, not at machine to test to be 100% certain.
Hood