Hello Guest it is December 06, 2019, 07:50:10 AM

Author Topic: Free G76 Macro Helping program for Mach3 Turn  (Read 27820 times)

0 Members and 1 Guest are viewing this topic.

Re: Free G76 Macro Helping program for Mach3 Turn
« Reply #40 on: March 10, 2019, 07:57:06 PM »
I had a special request and because of that, I tackled the quest of threading trapezoid or rectangular threads. For this, in most cases multiple Z passes per depth have to be cut. This could only be done by a total rework of the M1076.m1s macro, but after 40 hours of programming, the rectangular threads are working already. I still have to do some bugfixing for the trapezoid threads and after that, I have to extend my Helper program to generate the code for ACME and Tr threads. So, this functionality is coming soon if I can make the time. Even with a careful approximation, I'll need 200 more hours of programming for that.

See the attached picture: A rectangular thread with 2.5 mm groove width, cut with an 1.5 mm tool, additionally in a tapered version.
« Last Edit: March 10, 2019, 08:07:00 PM by stephanbrunker »

Offline Rimmel

*
  •  161 161
    • View Profile
Re: Free G76 Macro Helping program for Mach3 Turn
« Reply #41 on: March 11, 2019, 06:12:57 AM »
Stopped using program ages ago, for most instances it's too complicated for general use, I spent more time messing about with the tip radius setting than anything else (not actually using  the setting just trying to get numbers that worked in it for different threads). 
Re: Free G76 Macro Helping program for Mach3 Turn
« Reply #42 on: March 11, 2019, 07:29:35 AM »
Too complicated for general use …

You can use it or not … unfortunately, threads are really complicated and my approach is a very much simplified one. I didn't make all the norms about tolerances and thread profiles and allowed tip forms but tried to make it as simple as possible. Of course, you can ignore that and calculate everything per hand - which is even more complicated. Or you can cut and try until both pieces fit together. Everyone should do what he likes most.

Just now, I read an old article that the seemingly straight flanks of threads aren't really straight because the pitch angle of a thread has an influence and that angle is different on the outer and inner diameters, especially for large pitches relative to the diameters (e.g. multi-pitch-threads) . To do it perfectly, you'd need a precision grinded tool for every diameter / pitch combination …

For example, I added an calculator to make a three-wire-measurement of the flank diameter. That one is much simplified, because other calculators want an input for the deforming of the wires because of the measurement force and that small error because of the pitch angle. I ignored all that because these factors are in the range of only few 1/100 mm and less and I didn't expect to be so precise. But basically, that approach is wrong ...
« Last Edit: March 11, 2019, 07:37:10 AM by stephanbrunker »
Re: Free G76 Macro Helping program for Mach3 Turn
« Reply #43 on: June 05, 2019, 11:19:31 PM »
If any one is following this thread I could use some help.  New to the cnc game and just got mach 3.  Will be doing some simple threading and ran accross this thread.  I down loaded the zip file and pasted into mach 3 on the hard drive.  I can not seem to get it to come up in mach 3 turn.  Also can not get g76 to come up anywhere.  Thought I would try this and the wizard that is on the mach 3 turn. 

Thanks Tom
Re: Free G76 Macro Helping program for Mach3 Turn
« Reply #44 on: June 06, 2019, 06:54:03 AM »
There should be a m1076.m1s file in the /mach3/ main directory, while all the other macros are in the /mach3/macros/%yourprofile% subfolder. Just replace that macro and the g76 command should work. All I did was to improve that file.

I also just published a hotfix for that macro at 
https://sourceforge.net/projects/mach3threadinghelper/files/
because there was a nasty sign error which resulted in a wrong Z Start value.

This version of the macro also contains an extension for trapezoid threads like Tr or ACME or threads with flank angle 0° like in the attached picture which need multiple passes per increment in X. I did that because of an request for these threads by someone. Said someone also said he would sponsor that development, but he bailed after I put more than 40 hours into that code and he got the result. Because he switched to Mach4, I also rewrote the macro into a code generator for Mach4.

To fully utilize the possibilities of that macro, the GUI has to be extended as well to generate the code for that extension for a lot of Tr.. or ACME threads. But so far, I never got any positive reviews of my work which tells me that seemingly nobody needs that piece of software. Because I don't need that functionality for myself and as Jack-of-all-Trades I have more than enough projects to work on, I am reluctant to put the needed (likewise 40-100) hours into that project. I will happily work for free, but only if it gets a reasonable number of users.

Offline rcaffin

*
  •  1,007 1,007
    • View Profile
Re: Free G76 Macro Helping program for Mach3 Turn
« Reply #45 on: November 30, 2019, 09:35:55 PM »
Hi Stephan

I tried downloading the hotfix version, but it seems to still have that sign error on K. At least, as far as I can see! Certainly with K3 in the g-code, it seemed to start with -ve Z rather than with z=+3.

VERY strangely, the display under Mach3 SEEMS to have the right value, with the threading starting 3 mm away from the chuck, while the actual cutting started 3 mm towards the chuck.

Mach3, 0.062, ESS with latest driver, W7,  in Sandvik mode

Also, the Help file seems to have zero contents, despite its size.

Any chance of some help here?
Cheers
Roger
« Last Edit: November 30, 2019, 09:45:11 PM by rcaffin »

Offline rcaffin

*
  •  1,007 1,007
    • View Profile
Re: Free G76 Macro Helping program for Mach3 Turn
« Reply #46 on: December 01, 2019, 06:37:33 PM »
Hi Stephan, or anyone else who knows:

"If you are using your own screenset, the threading diag DROs have changed a little bit:
SetUserDRO 1240, StartX       
SetUserDRO 1241, EndX "

Yes, but what do these DO? Where are they defined? Why are they even in the M1076 code?
For that matter, where do the variables such as tXStart() and tEndX etc come from?
I really would like know! Is there a magic book somewhere which I have missed?

Equally, in M1076.m1s there is the following:
npass = GetUserDRO(1022)

Where is UserDRO(1022) defined?

I am sorely puzzled.
Cheers
Roger
PS: previous query about the K variable has been resolved.

Re: Free G76 Macro Helping program for Mach3 Turn
« Reply #47 on: December 02, 2019, 04:52:48 AM »
Hello Roger,

Windows Help (*.chm) showing up empty: This is due to Windows security settings. Go to the *.chm file, select properties and remove the security block.

The User DROs:
Mach3 shows all numeric output in DROs, one for every value. That might be the Feed Rate or the X-Axis Position … everything. In the screenset shipped with Mach3 (not a customized one) there is a tab "Diagnostics" with a section about threading diagnostics. What this does: It shows information about the threading like StartX, EndX, StartZ EndZ, Pitch, Taper, Total Passes, Current pass and current depth. That means: you can switch to the diagnostics tab and see on what pass you are and how many to go. And because the Gcode is "compiled" (kind of simulated) after loading it into Mach3, I needed the additional macro 1176.m1s to show the current values when the code is running because this macro is called on every pass and updates the DROs. Otherwise it would show the last value from the compiling run.

If these DRO numbers reserved for threading (1240 - 1251) are not in your sceenset, nothing happens. Simply as that. What I did was just to reorganize the DROs used by the original screenset to show the important data, so I switched these a little bit around. Because of that, I changed the screenset as well to change the labels of the DROs accordingly and included that in the package. The changes aren't critical, #1248 showed Depth of First pass before and shows now the current depth for example.

I happily answer your (relevant) questions.
Regards,
Stephan

Offline rcaffin

*
  •  1,007 1,007
    • View Profile
Re: Free G76 Macro Helping program for Mach3 Turn
« Reply #48 on: December 02, 2019, 03:25:34 PM »
Hi Stephan

For your reply many thanks. Really.

Help file now active, and extremely useful.
Your Help file is the only place so far which has explained the difference between Sandvik mode and 'ordinary' mode. Any other references for explanations? Just curious.

DROs now understood. I was using the standard screenset plus some extras. For my own use I have added some DROs at the bottom for general diagnostics - same idea. I will have to explore your version.

What I don't yet understand is why a G01 following a G32 has to wait for an Index pulse. Is this something in the Mach3 source code? If so, what was Art trying to do here??? We may never know.
Anyhow, why must one use a G01 at the end of the G32? Could one not use a G00 and simply pop out of the thread as fast as possible? That way all the worries about Retract_Dis would (mostly) go away.

Background:
I have a solid mill, not a router. I am having problems with an M4x0.5 thread in brass. The profile I am getting is not good; asymmetric and curved on one side. I don't think it is a mechanical problem because my backlash is very low and other machining is very precise, and previous work with M4x0.5 used to be nice and clean. Very strange.

I am using an ESS (W7, with .062) using the latest driver, which has been update to handle a 512-line encoder wheel on the spindle for threading. This is new, and only in the latest (last) release. It seems to work fine - I think. At the moment I am assuming that the Index pulse is passed through as fast and as reliably as before. I have not (yet) checked this as per the Mach3 Threading PDF: I may need to do so.

So I thought I would play with the M1076 macro and simplify it down to handle my normal needs: fine threads in aluminium or brass so radial infeed and  no taper (ever). Also I have changed the G01 after the G32 to a G00 to see what that does. This works fine on the screen in my office, but I have yet to see how well it works on my mill. I will update here.

Cheers
Roger Caffin
Re: Free G76 Macro Helping program for Mach3 Turn
« Reply #49 on: December 03, 2019, 04:09:11 AM »
Hello Roger,

the G32 / G01 is in the source code. I found that out only through trial and error, in that case the original M1076 macro was directly coded to interact with the Mach3 source code. More precisely: Two G32 after another unlocking the threading feature and G80 exits it. I exploited that in a way that the G32 do the same move as the G0 positioning move and then the next G1 is synchronized and does the threading. Simply put you can just use that one G1 and then a G0 to pull out. You just have to check what happens to the next G1 move because it expects to make the pullout as a G1 as well while keeping the synchronization.

I expanded the M1076 for trapezoid threads for someone and he had also issues with an encoder on the spindle axis. This seems to be deep in the interaction between the motion controllers plugin and Mach3. I don't know more about this, just that a single index pulse seems to work well, especially when the spindle speed is fixed like with an old school asynchronous motor.