Hello Guest it is May 18, 2022, 04:33:19 PM

Author Topic: Variable offset in Mach4  (Read 1361 times)

0 Members and 1 Guest are viewing this topic.

Lather

• 6
Variable offset in Mach4
« on: December 26, 2018, 12:45:26 PM »
Hi, I am new to CNC but want to retrofit a 30 year old lathe. I would like to know if Mach4 can do the following:

I want to build a shaft with a diameter 200.01mm. The bed of the lathe ist worn out and so the shaft will be 200.10 at one end, 199.90 in the middle and 200.15 at the other end. (Just an example, no real measure).
Programm #1 says X=200.01 all the way and Programm #2 has an X- value which changes and that not even constantly. So there would be two active programs at one time with different values in X.

Is there a solution?

Cheers   Frank

MN300

• 287
Re: Variable offset in Mach4
« Reply #1 on: December 27, 2018, 07:59:25 AM »
Hi Frank,

If there is too much backlash on the cross slide leadscrew and nut it may not be possible to compensate for that error.
Also, typically a leadscrew is more worn in the middle so the amount of backlash changes with position.

John

Lather

• 6
Re: Variable offset in Mach4
« Reply #2 on: December 27, 2018, 03:52:48 PM »
Hi John,

thanks for Your answer but in my case it is clearly the worn out bed.

Since that error is always the same I would like to write a program which compensates that error. And that program should be an appendix to the "real" program. E.g. If the "real" program says: Make a diameter 200.01 at z=100 and the appenix-program says: Go 0.1mm smaller in diameter at z=100, then the "real" programm should do an 199.91mm and the finished part will be 200.01mm.

But I don't know if that is possible with Mach4.

Frank

joeaverage

• 6,885
Re: Variable offset in Mach4
« Reply #3 on: December 27, 2018, 11:36:44 PM »
Hi,
yes you could write a correction program. The way I am thinking is that if you run your Gcode file through the
correction program it would rewrite the code with the X axis 'corrected' with a figure (plus or minus) from a table
with vertical ordinate in Z.

As an example, lets say you measure your lathe to get this table:

Z Axis    Correction
0             0
50           0
60            0.005
70            0.006
80            0.01
90            0.01
100          0.012
110          0.01
130          0.009
140          0.008
150          0.005
160          0.004
170          0

With Gcode like this:

G1 X50 Z170
G1 X50 Z160
G1 X50 Z150

would become:
G1 X50 Z170
G1 X50.004 Z160
G1 X50.005 Z150

etc.
The program you write would have to apply the correction. There are a number of points that would require some careful programming.
For instance, let say your machine is at X=50 Z=200 and you wish to take a cut to X=50 Z=75, ie a cylindrical cut of 125mm from Z=200
to Z=75. That could be coded:
G1 X50 Z75.

But the code you would have to run would be:
G1 X50 Z170
G1 X50.004 Z160
G1 X50.005 Z150
G1 X50.008 Z140

etc. That is that one move (G1 X50 Z75) would be required to be split into smaller moves so that a varying correction can be applied.

It would require some serious programming on your behalf. Are you up for it?

Craig
My wife left with my best friend...
and I miss him!

Lather

• 6
Re: Variable offset in Mach4
« Reply #4 on: December 28, 2018, 04:12:04 PM »
Hi Craig,
thanks a lot for that good example!
Quote
It would require some serious programming on your behalf. Are you up for it?
Well, not yet but I'll learn!

Frank

joeaverage

• 6,885
Re: Variable offset in Mach4
« Reply #5 on: December 28, 2018, 06:54:54 PM »
Hi Frank,
I use a software utility called Autoleveller. It is primarily designed for use when isolation routing of circuit boards.

Any variation in Z height due to either machine inaccuracy or PCB blank warp/bow/twist causes a very great loss of quality of the
finished job. Autoleveller causes the PCB blank to be probed at close intervals AND THEN uses that height variation data to modify
the Gcode, in particular introduces small variations in Z to match the bow/warp of the blank. It breaks large linear moves into smaller
moves to apply a varying correction, much like I have suggested your lathe correction program would be required to work.

There are some similarities between Autoleveller and what you want to do.

Autoleveller is open source so you can easily see how they have done it. It is written in Java.

http://www.autoleveller.co.uk/

Craig
My wife left with my best friend...
and I miss him!

Lather

• 6
Re: Variable offset in Mach4
« Reply #6 on: January 12, 2019, 10:08:03 AM »
Hi Craig,
thanks again! A lathe-autoleveller might be exactly what I want. I asked in his forum but did not receive an answer yet.

Frank

joeaverage

• 6,885
Re: Variable offset in Mach4
« Reply #7 on: January 12, 2019, 12:46:49 PM »
Hi,
ye I noticed that you had posted a question on the Autoleveller site. The Autoleveller software utility is meant for a mill,
I doubt you will get much assistance trying to apply it to a lathe.

The software is open source so you can download it and see how it works. It might give you some idea on how to implement

Craig
My wife left with my best friend...
and I miss him!

Lather

• 6
Re: Variable offset in Mach4
« Reply #8 on: January 13, 2019, 02:52:09 AM »
Hi Craig,
I'm sorry but that exceeds my abilities.

Frank

smurph

• 1,482
• "That there... that's an RV."
Re: Variable offset in Mach4
« Reply #9 on: January 13, 2019, 09:43:27 PM »
When the next release comes out, we will have that capability.  We call it table mapping.  I should do the same for the lathe.  You can have a map for a table that isn't level.  Or a bed that isn't straight.  And then also layer maps on top of that if you need them!  Say a warped PCB on top of a table that isn't level.  The sky is the limit!

Steve