Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: saschko on October 07, 2017, 09:05:39 AM

Title: Spindle RPM and Threading Problem
Post by: saschko on October 07, 2017, 09:05:39 AM
Hello everyone, and sorry for my probably bad English.
I have some problems with Mach 3 Turn and more with the Threading Cycle to be specific.
I am retrofitting a Guildemeister NEF 480 Turn which used to run with some old Fanuc CNC that we couldn't start up so we decided to use Mach 3 because it is cheaper then a new CNC.
I've placed my old desktop PC inside with freshly installed Windows XP and Mach3 R3.043.066.
Removed the old Fanuc DC Drives and placed new one that run with step/dir signals.
I am using K845P optocoupler for the inputs so i can use the original 24V power supply.
The spindle is controlled by two contactors (one for M3 and other for M4) and there are two solenoids changing between two gears (N1 and N2 - slower and faster). It also has mechanical levers for different gears that you change before starting the mottor. I am activating the contactors manual (Mach has no control on them). The solenoids however are connected to outputs of Mach and when no one of them is active a brake is activated inside the gearbox. I assigned inputs for the contactors , so when i turn one of them either M3/M4 Mach 3 knows that the Spindle Motor is active, after this with Joystick Plugin i have buttons that trigger the solenoids and after one of them is activate Mach receives a M3/M4 command. Only the mottor is turning until a solenoid is activated, then the Spindle stars rotating. Something that i find strange is that if I type M3/M4 in MDI Line it instantly puts some RPM's in the DRO ( In this moment the Spindle is not spinning and the Index Signal is '0') . I've set the index debounce to 0 but even when it was higher it still counted the RPM's. Now when i type in the G76 thread cycle for example:
Code: [Select]
G76 X-1 Z-10 P1.25 H2 I29 C2 Mach moves the X and Z axes a little bit and stops whithout any message or anything and stays there forever. In the diagnostic screen of the Turn i could see a LED "Wait fot Trigger" wich turns on in the moment when i start the cycle and turns off almost immediately ( This should be the moment when the Spindle Index signal is arriving i guess? ) and then the LED "Currently Threading" lights up and that's it.

Now for counting the RPM's i am using a inductive sensor placed over a nut that is tightened on the back of the spindle (Picture Here (https://imgur.com/a/9AISj)) so the ratio is 1:1 as I've set it in Spindle Pulleys setting. So my questions are:
Why the cycle is not going?
Why when i type in M3/M4 it gets RPM reading when there is no one?

Thanks in advance.  :)
Title: Re: Spindle RPM and Threading Problem
Post by: ministeam on October 07, 2017, 02:25:30 PM
hi
the version of mach 3 you are using is no good for threading ,you will find threading works better with an older version of mach 3 , i use 062 & have never had a problem with threading
robert
Title: Re: Spindle RPM and Threading Problem
Post by: joeaverage on October 08, 2017, 01:09:05 AM
Hi,
you've got a lot of things on the go, no wonder you're getting confused. Start with getting the spindle to run then worry about other stuff.

When you manually turn on either of the contactors does Mach see the input signals? You should see the LEDs for the inputs you've used on the
machine diagnostics page. When you MDI either an M3 or M4 are the solenoids coming on as they are meant to? Does the spindle start to
rotate and does it eventually come up to speed?

I think what's happening when you MDI an M3 or M4 the spindle speed DRO is reading the current S command, that is to say the speed that the spindle
should get to not its actual speed.

If you turn the spindle manually does the index signal show on the machine diagnostics page? Once you get the index to work and work out how to
get Mach to read the actual spindle speed THEN start thinking about threading....threading without all these other things working is a joke.

Craig
Title: Re: Spindle RPM and Threading Problem
Post by: saschko on October 08, 2017, 07:34:51 AM
The spindle motor is turned on by hand, and the solenoid is activate by Mach. The spindle runs after it is activated by the solenoid. And all the inputs are read correctly. When i turn on the contactor the input is read and after i push the joystick button for the solenoid it activates and sends a M3/M4 command to Mach. All LEDs are working, i can see the spindle index signal, the inputs and everything. Something that i'm not sure if it is correct is that i cannot see the index on every single rotation of the spindle. But i am not sure if the diagnostic leds are enough fast or something like that, because if it's missing pulses then why it counts the RPM correctly. There is no S command, cause i am sending only M3, mach has no control on the RPM.
Title: Re: Spindle RPM and Threading Problem
Post by: ministeam on October 08, 2017, 11:32:38 AM
hi
is the spindle speed you are getting very steady , something in the range of + or - 1 rpm  deviation if this ok then that is a part of the threading cycle
please find the type of program i use for doing thread programs for my machine
this program is for a M14 x 1mm pitch external thread , this is a hand coded program

G95
M6 T0505 (external threading tool 60 deg)
G0 X14.00 Z10.00
M3 S600
G76 X12.780 Z-6.80 Q1 P1.00 J0.010 L45 H0.300 I29 C0.250
G0 X40.00 Z50.00

all the best
robert
Title: Re: Spindle RPM and Threading Problem
Post by: joeaverage on October 08, 2017, 12:23:09 PM
Hi saschko,
Mach may not have control of the speed and you or your program may not have specifically issued an Snnn command but there is a variable
inside Machs core that it will use whether you chose to update it or not.

Craig
Title: Re: Spindle RPM and Threading Problem
Post by: saschko on October 08, 2017, 05:58:23 PM
@ministeam: Yes the spindle speed is steady, it takes it probably a second until the spindle accerelates and once it reaches it's speed the DRO isn't floating arround, it stays constant.

@joeaverage:
When it will use this variable and for what? I think i am missing your point, shouldn't it synchonise the axes feed depending on the RPM that it counts from the Spindle Index input.
Title: Re: Spindle RPM and Threading Problem
Post by: joeaverage on October 08, 2017, 06:19:47 PM
Hi,
Mach has a variable that it uses as its commanded speed, even if you don't set its still there.
Just as an experiment try setting S to some funny number, 15995, for instance. If this number
crops up on Machs screen then you will know whether its using the index and measuruing the
speed or just reporting the programmed speed. It can do both.

Craig
Title: Re: Spindle RPM and Threading Problem
Post by: joeaverage on October 09, 2017, 01:38:44 AM
Hi saschko,
Quote
shouldn't it synchonise the axes feed depending on the RPM that it counts from the Spindle Index input.
yes it should, but is it?
Isn't that the whole point of the post?

You need some way of confirming that Mach is ACTUALLY reading the spindle index. While it needs it to calculate its current speed it is in fact more
important than that, it synchronises the start of the thread when doing multiple cuts.

Do you have or can you borrow an oscilloscope? The picture showed what I called a proximity sensor. They are pretty lethargic, it may not be fast
enuf to send individual pulses. Do you have any specs for the sensor? I have seen some that are good to several hundred Hz, easily good enuf but others
that can only manage 10 Hz, and they wouldn't.

Craig
Title: Re: Spindle RPM and Threading Problem
Post by: saschko on October 17, 2017, 12:10:09 PM
I had doubt in the proximity sensor too, but i've checked that with the oscilloscope and it is working, i can't see every single pulse in Mach, but it should be there, because it measures the RPM correctly.
If i type "M3 S100" on the screen i can see a DRO with label 'S' wich aquires the value i entered. However in the STrue DRO  are the real RPM that Mach counts through the SpindleIndex Input. Still it doesn't thread, it is moving the axes, just a little bit and then nothing. I tried with the other version of Mach (062) but it's the same.
Title: Re: Spindle RPM and Threading Problem
Post by: joeaverage on October 17, 2017, 01:50:43 PM
Hi,
Ok, sounds like you have proven the difference between the S commanded speed display and the true rpm display.

May I suggest that you offer the spindle to some load to see if it slows down a wee bit. So using some other Gcode than threading
take a cut in a piece of steel and monitor the true speed, you would expect it to slow a little. The reason I suggest this is that its not impossible
that the sensor is producing pulses for a period of time but then ceasing and Mach is just retaining the true speed display as is rather than
a continuous update.

Craig
Title: Re: Spindle RPM and Threading Problem
Post by: saschko on October 18, 2017, 05:37:43 AM
Okay, but mach has no control on the Spindle speed...i should give it a command every time when i spin it no matter that mach has no control on it?
Title: Re: Spindle RPM and Threading Problem
Post by: joeaverage on October 18, 2017, 06:23:37 AM
Hi,
I don't know. I operated my mill with manual control of the spindle for quite a period of time. For simple handcoded or teach jobs I still operate
that way. Unless your Gcode uses speed, commanded or actual, I don't think it matters. Whether some of the canned cycles in lathe ops rely on
S, commanded or actual, is more than I can say.

I saw something in another thread today which may be related to your problem and may be worth investigating. Config/Ports and Pins/Spindle Setup
in the Special Functions panel check 'Use Spindle Feedback In Sync Mode' and 'Spindle Speed Averaging'. Haven't yet found any documentation about
what those settings mean but they sound promising! May be try them and see what happens.

Craig
Title: Re: Spindle RPM and Threading Problem
Post by: saschko on October 18, 2017, 07:13:50 AM
I have already checked these options. Well, i actually tried giving an S100 command and at the same time rotated the spindle with 100 RPM. There is a bit difference, i mean that the RPM's that Mach counts are 108. Even this way the thread cycle is not working
Title: Re: Spindle RPM and Threading Problem
Post by: RICH on October 18, 2017, 07:15:47 AM
Graig,

Quote
'Use Spindle Feedback In Sync Mode' and 'Spindle Speed Averaging'. Haven't yet found any documentation about what those settings mean
Use Spindle Feedback In Sync Mode - required for lathe  threading as Mach will then use the index to change from G94 to G95 to sync for the multiple threading paths.
The time it takes to read and implement the change can be affected by index debounce and spindle speed averaging.

Spindle Speed Averaging - Used by Mach in threading and averages the rpm
 ( out to 4 decimal places ) over 8 revolutions ( from what I remember when testing ) during a path and uses the result for the the next path. There is more to this and would need find and look at more than 300 pages of notes. This is internal to Mach and you have no access to it. I would just check it and forget about it.

A simple test of the spindle sync would be to use a thin disc and see the scribed
mark made by the tool on the disc's cirmference. It's also a good test to see if ones lathe is capable of doing multiple start threading.  Same old remark, threading only as good as your lathe SYSTEM.

RICH
Title: Re: Spindle RPM and Threading Problem
Post by: RICH on October 18, 2017, 08:02:39 AM
If the index sensor is working and  appropriate for rpm range (  look at the specs of your sensor ) then the real time true rpm shown in the DRO  is more accurate than you will probably be able to measure  ( at least I know that for a fact and use the PP ).

Quote
Something that i'm not sure if it is correct is that i cannot see the index on every single rotation of the spindle.

The LED won't / can't  update fast enough to indicate each time the index is read.
Just consider it a visual that the index is working  since it's blinking randomly.
BUT
You will see the LED change from Waite for Trigger to Threading and Mode indication
from G94 to G95 via LED's every time when threading.

The problem is that the generic screen just sucks both functionally and  if your trying to monitor some things
amd that is why I use  a custom screen set.

RICH
Title: Re: Spindle RPM and Threading Problem
Post by: saschko on October 21, 2017, 07:10:03 AM
The LED won't / can't  update fast enough to indicate each time the index is read.
Just consider it a visual that the index is working  since it's blinking randomly.
BUT
You will see the LED change from Waite for Trigger to Threading and Mode indication
from G94 to G95 via LED's every time when threading.

I also tought that the LED can't respond so fast, but i've decided to share that. Yes i see the LED's for G94/G95, and it is changing when i start the G76 cycle. I also see the Wait for trigger LED light up and then it goes down and Threading LED lights up, in that moment the axes start to move and almost immediately stop. The Threading LED is still up. If i stop the Spindle and turn it on again it moves again a bit and stops. Maybe i should upload some of my configuration so u can see better what i did.
Title: Re: Spindle RPM and Threading Problem
Post by: RICH on October 21, 2017, 08:19:02 AM
Have you tried using Mach version 062  as 066 is problematic?

Post the G76 code that you used for your last post. Are you allowing  distance equal to about 3 to 5 dia of the thread
so the  z axis can accelerate to the start of the thread. If you use the threading wizard it will tell you if acceleration is adequate.

Post the xml file that you are using and maybe someone will have a look at it.

RICH

Title: Re: Spindle RPM and Threading Problem
Post by: saschko on October 24, 2017, 07:25:06 AM
Yes, i have tried version 062 and it is the same. Anyway i left it with 062.
No matter what code i type it does the same. But let's say that this is it:
Code: [Select]
G76 X-1 Z-10 P1.25 H2 I29 C2I zero the axes where the start of the thread will be and just start the cycle. I do all this in the air, i am still testing the functions, so i can see that everything works fine. Maybe i should really try to move it a little bit fаrther away and try to start it from there, by inputting the start positions of the thread for X and Z.

Here is my XML (https://drive.google.com/open?id=0B3hB5AsBMcDhU3g5eTJlYWxHWUU) and my macro (https://drive.google.com/open?id=0B3hB5AsBMcDhNl9HTzRBVTlEemM) for the JoyPad Plugin with wich i input M03/M04 commands. Input 1 and Input 2 come from the contactors that rotate the spindle. After this i engage the solenoids for fast or slow gear from Mach.
 
Title: Re: Spindle RPM and Threading Problem
Post by: RICH on October 24, 2017, 08:29:54 AM
There is a simple answer to your threading problems.

Don't use a PIRATED LICENSE . Purchase a license!

You have nerve to make a fool out of me and others.   >:(

Take Care,

RICH
Title: Re: Spindle RPM and Threading Problem
Post by: saschko on January 24, 2018, 02:29:58 AM
I'm really sorry, first for the very late response, i moved to new place and it took time to get back to this, and second for fooling you arround with this. I found this license on an old disk and didn't pay attention if it is the true paid license or not. After i found my paid license everything works fine but i can't figure out why every pass starts from different position, and in the end of the cycle it looks like the coordinates have moved. For example: i place the tip of the tool on the tip of the detail. I set Z to 0, and X to 12, then i move Z to +1 and start the cycle:
Code: [Select]
G76 X9.861 Z-10 Q1 P1.75 J0.1 H0.316 I0.0 L45 C2. B0.02
it looks good, but if i place a test indicator on Z in plus direction, on every pass it moves, i mean it doesnt start from where i putted it, and in the end of the cycle Z0 is not the tip of the detail..it is moved somehow..i can't figure out what exactly happens. It looks like the cycle is working somehow different from what i've expected. Thanks for the support and again sorry for fooling you, i didn't meant to.
Title: Re: Spindle RPM and Threading Problem
Post by: RICH on January 24, 2018, 07:21:47 AM
Have a read of  "Threading On The Lathe " write up as it covers most of what you need to know.

RICH