Lathe Macros

More
04 Jun 2016 12:09 #75483 by RotarySMP
Replied by RotarySMP on topic Lathe Macros
Thanks Andy,
Guess that rules it out for the Boley, which has manual belt changes and a two speed motor.

I also have little 7x Lathe I converted years ago. It has a VFD on it, but I never got around to replacing the speed pot with the interface widget to control it from LinuxCNC. Guess I need to set that machine back up and use it to try out your macros.

In the mean time I guess I'll set up NGCGUI or features.
Mark

Please Log in or Create an account to join the conversation.

More
04 Jun 2016 12:24 #75484 by andypugh
Replied by andypugh on topic Lathe Macros

Thanks Andy,
Guess that rules it out for the Boley, which has manual belt changes and a two speed motor.


Each operation is a simple bit of G-code. You just need to edit the G-codes to suit your machine.

Do you have a spindle encoder?

Please Log in or Create an account to join the conversation.

More
04 Jun 2016 23:21 - 04 Jun 2016 23:22 #75512 by BigJohnT
Replied by BigJohnT on topic Lathe Macros
I have isolated digital potentiometer intended for spindle control at my store.

Jt
Last edit: 04 Jun 2016 23:22 by BigJohnT.

Please Log in or Create an account to join the conversation.

More
06 Jun 2016 07:11 #75542 by RotarySMP
Replied by RotarySMP on topic Lathe Macros
Thanks Andy and JT,

I have a spindle encoder already installed and working. I was just dry running the controller away from the machine, getting to know it.

Mark

Please Log in or Create an account to join the conversation.

More
08 Aug 2016 22:52 #78505 by oscarconde6
Replied by oscarconde6 on topic Lathe Macros
Hello everyone, I am new to the forum, I am Spanish and I have to translate to speak here, to thank the people who do these jobs are very good.
I read a lot of information these last weeks to motorize my around with linux cnc and it seems that I managed to move with a TB6560 and two step-step motors card, yet not I have encoder for the spindle but I'm starting. I linuxcc 2.7.0 and I installed lathemacros3 as I read in the download but when pressed the play and accept the tool lathe makes the first political movement and then stays in play but not continuous, took several days and do not get a solution my level of programming is very low, someone could help me, thank you very much, have if you understand me with this translation,

Please Log in or Create an account to join the conversation.

More
09 Aug 2016 00:53 #78509 by andypugh
Replied by andypugh on topic Lathe Macros
If you don't have a spindle encoder then you will need to edit the G-code routines to not use Constant Surface Speed or Feed-per-revolution G-codes. And you will not be able to thread.
But that's just G-code, and you need to learn that to do CNC

Please Log in or Create an account to join the conversation.

More
09 Aug 2016 20:14 - 09 Aug 2016 20:14 #78541 by Rick G
Replied by Rick G on topic Lathe Macros
Might want to look here...
forum.linuxcnc.org/forum/lathe-subroutines-library
Some of the subs such as
forum.linuxcnc.org/forum/lathe-subroutin...26977-odtaper-lathe3
Do not use constant surface speed so may run for you and serve as a starting point.

Rick G
Last edit: 09 Aug 2016 20:14 by Rick G.

Please Log in or Create an account to join the conversation.

More
09 Aug 2016 22:50 #78548 by oscarconde6
Replied by oscarconde6 on topic Lathe Macros
thanks for the quick reply, do what you tell me I will try to learn a little more and forums have mirare I can do. I'm one. little lost with the codes g. Thank you

Please Log in or Create an account to join the conversation.

More
10 Aug 2016 08:56 - 10 Aug 2016 08:57 #78564 by andypugh
Replied by andypugh on topic Lathe Macros

thanks for the quick reply, do what you tell me I will try to learn a little more and forums have mirare I can do. I'm one. little lost with the codes g. Thank you


The lathe macros include a set of G-code routines, for example turning.ngc looks like this:
;Turning

O<turning> sub

G8 ; Radius mode (easier maths)
G18 ; XZ Plane
G21 ; Metric Units
G90 ; Absolute Distance
G91.1 ; but not for arcs

M6 T#8 G43

#1 = [#1 / 2] ; because of radius mode
#14 = [#<_x>] (starting X)
#13 = #<_z> (starting Z)

#20 = [#6 * SIN[#7]]
#21 = [#6 * COS[#7]]
#22 = [#6 / COS[#7]]
#23 = [#5 + #6 - #20]
#24 = [[#13 - #23] * TAN[#7]]

G96 D1500 S#2 ; Constant Surface Speed Mode
m3 ;Start Spindle
g95 F#4 ; Feed-Per-Rev Mode


g4p1 ; Wait to reach speed

/	(debug, Turning finish rad #1 start  rad #14 start length #13 finish length #5)
/	m1
	O100 WHILE [#14 GT [#1 + #3 / 2]]
        g0 X #14
	#14=[#14-#3 / 2]
	G1 X #14
	G1 Z #23 X[#14 + #24]
        O101 IF [#6 GT 0]
                G2 Z#5 X[#14 + #24 + #21] I#21 K#20
		G1 X[#14 + #24 + #21 + #3/2]
        O101 ELSE
	        G1 X[#14 + #24 + [#3 * .6]]
        O101 ENDIF
	O104 IF  [#7 LT 0]
		G0 X#14
	O104 ENDIF
	G0 Z[#13]
	O100 ENDWHILE

	G0 x#1
	G1 Z #23 X[#1 + #24]
        O102 IF [#6 GT 0]
                G2 Z#5 X[#1 + #24 + #21] I#21 K#20
		G1 X[#1 + #24 + #21 + #3]
        O102 ELSE
	        G1 X[#1 + #24 + #3]
        O102 ENDIF
	O106 IF  [#7 LT 0]
		G0 X#14
	O106  ENDIF
	G0 Z #13
	G0 X #1 ; For touch-off
        M5
	G7
O<turning> endsub
M2

The important parts are the lines
G96 D1500 S#2 ; Constant Surface Speed Mode
m3 ;Start Spindle
g95 F#4 ; Feed-Per-Rev Mode

You would need to change those (in each of the routines) to
G97 S#2 ; Constant RPM Mode
linuxcnc.org/docs/2.7/html/gcode/g-code.html#gcode:g96-g97
m3 ;Start Spindle
g94 F#4 ; Feed-Per-Minute
linuxcnc.org/docs/2.7/html/gcode/g-code.html#gcode:g93-g94-g95

Then the boxes in the macro tabs are feed-per-min and rpm.

You will find that the surface-speed adjustment does not allow big enough numbers to be a RPM input. So you will need to modify the "Adjustment" properties of the UI. You could do that in the Glade editor, but it it probably easier to do it with a text editor and alter the numbers directly. For example, for turning RPM look for
<object class="GtkAdjustment" id="TurnSFAdj">
and change the limits and step size. Then work through the other adjustments making them suit too. Unfortunately I have just noticed that I got lazy at giving the adjustments meaningful names. :blush: This means you need to look through the code to find that the "face.sf" control for the facing routine is constrained by "adjustment10"
Last edit: 10 Aug 2016 08:57 by andypugh.

Please Log in or Create an account to join the conversation.

More
10 Aug 2016 15:42 #78578 by oscarconde6
Replied by oscarconde6 on topic Lathe Macros
many andy thanks, I followed your instructions and I've got a routine run but very slow, if I change in routine f # 4 and put f50 for example routine runs at that speed, I could not set the variable # 4 to use the tab macro, I achieved that value can be modified until 1000 but when I run the routine does not raise the speed I have to change a few lines but which are not put file photo that allegedly have to modify for use eyelash correct speed. Thank you

from what I understand is that I have to change some lines of these images I think the problem is that I have to translate the issues and not translated into 100% and only understand a few things. have if I'm on track. thanks for the patience

Please Log in or Create an account to join the conversation.

Time to create page: 0.125 seconds
Powered by Kunena Forum