NEWS
LinuxCNC 2.5.2 Release
LinuxCNC 2.5.2 Update Released (changelog).
 
LinuxCNC 2.5.1 Release

LinuxCNC 2.5.1 Update Released (changelog). If the Package Manager does not prompt you to upgrade see this page.

 
LinuxCNC 2.5.0 Release
New major release (changelog). See the instructions to update your system from EMC 2.4 to LinuxCNC 2.5.
 

Welcome, Guest
Username: Password: Remember me
Use subroutines with caution

TOPIC: conversational input

Re:conversational input 01 Jul 2011 08:02 #11041

  • dgarrett
  • dgarrett's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 37
  • Thank you received: 3
  • Karma: 32
It may help to know that you can also start with multiple
tabs for the same subroutine, for example:

...
NGCGUI_SUBFILE = /tmp/tmpngc/one.ngc
NGCGUI_SUBFILE = /tmp/tmpngc/two.ngc
NGCGUI_SUBFILE = /tmp/tmpngc/one.ngc
...

These tab pages will be named: "one", "two", and "one-1"

With this configuration, you could create multiple features for each tab
and then arrange the order of the tabs. If you order them
one-1, two, one
then all the features for "one-1" will be executed, then the features
for "two", then the features for "one"

Avoid the use of _globals within subroutines or use them with
much caution.
Last Edit: 01 Jul 2011 08:09 by dgarrett.
The administrator has disabled public write access.

Re:conversational input 01 Jul 2011 12:07 #11045

  • M4MazakUser
  • M4MazakUser's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 76
  • Karma: 6
-which is why i will eventually have to come up with another gui, i have 16 tabs on my screen -Right now!

....and that is just for od cycles..... :s
The administrator has disabled public write access.

Re:conversational input 17 Oct 2011 20:59 #14004

  • M4MazakUser
  • M4MazakUser's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 76
  • Karma: 6
following is a acme threading cycle for external/external threading, usung a squre sided grooving tool.
if not used with the "conversational cycles" i use, you will have to add a tool number input and drop the tool change code.

HAVE FUN!

(info: ACME threading with sq tool)
o<acme> sub
; some random notes
#<ToolNumber> = #1 (= 25 Tool Num)
#<Speed> = #2 (= 300 Rpm)
#<Thd_Dia> = #3 (= 25.0 Final Dia)
#<Drv_Dia> = #4 (= 30.0 Start Dia)
#<Pitch> = #5 (= 6.35 Pitch)
#<Thd_Angle> = #6 (= 29.0 Inc Angle)
#<Cut_Depth> = #7 (= 0.1 Cut Depth)
#<Tool_Width> = #8 (= 1.6 Tool Width)
#<z_start> = #9 (= 5.0 Z Start)
#<z_end> = #10 (= -15.0 Z End)
#<Coolant> = #11 (= 8 9 is off)

(LOGOPEN,AcmeLog)
; internal/external calc
O120 if [#<Thd_Dia> LT #<Drv_Dia>] ; External thread
#<Thd_Type> = 1
#<Thd_Height> = #<Drv_Dia> / 2] - [#<Thd_Dia> / 2 ; height of thd
#<Cut_Dia> = [#<Drv_Dia> - [#<Cut_Depth> * 2]]
#<Drv_Dia> = [#<Drv_Dia> + 0.2]
O120 else ; Internal Thread
#<Thd_Height> = #<Thd_Dia> / 2] - [#<Drv_Dia> / 2 ; height of thd
#<Thd_Type> = 0
#<Cut_Dia> = [#<Drv_Dia> + [#<Cut_Depth> * 2]]
#<Drv_Dia> = [#<Drv_Dia> - 0.2]
O120 endif

; do tool width error calc and depth ratio

#<Ratio_calc_1> = [#<Thd_Angle> / 2] ; half of thread included angle
#<Ratio> = tan[#<Ratio_calc_1>] ; tan value

(log,TanRatio = #<Ratio>)
#<Ratio_calc_2> = [#<Ratio> * #<Thd_Height>] ; width of 1 side relative to total depth.
#<Bottom_width> = [#<Pitch> - [#<Ratio_calc_2> * 2]/2]

O121 if [#<Tool_Width> GT #<Bottom_width>] ; tool is too wide
(MSG,Tool is too #<Tool_Width>Wide!)
(log,ToolWidth = #<Tool_Width>)
(log,BottomWidth = #<Bottom_width>)
M30
O121 else ; All is well!

O121 endif

; Tool change
O122 if [#<_Tool:Number> NE #<ToolNumber>]
; Change Tool
M09 ; coolant off
O123 if [#<_Tool:Number> LT 20] ; front turret
G00 Z#<_Frontchange:Z>
G00 X#<_Frontchange:X>
O123 else ; Rear turret
G00 Z#<_Rearchange:Z>
G00 X#<_Rearchange:X>
O123 endif
G49 ; cancel toolength offset
T#<ToolNumber> M06
G43 G7 G97 S#<Speed>
M03
M#<Coolant>

#<_Tool:Number> = #<ToolNumber>
O122 else ; No tool change -continue.
G43 G7 G97 S#<Speed>
M03
M#<Coolant>
O122 endif

; Toolpath stuff below here

O127 if [#<Thd_Type> EQ 1] ; Thread is external
o101 while [#<Cut_Dia> GT #<Thd_Dia>]
#<mod_Z_start> = [[#<Cut_Dia> - #<Thd_Dia>]/2]
#<mod_Z_start> = [#<mod_Z_start> - #<Thd_Height>]
#<mod_Z_start> = [#<mod_Z_start> * #<Ratio>]
G00 X#<Cut_Dia>
#<Mod_Z_point> = [#<z_start> + #<mod_Z_start>] ;modZstart is negative
Z#<Mod_Z_point>
(log,Zpoint #<mod_Z_point>)
G33 Z#<z_end> K#<Pitch>
G00 X#<Drv_Dia>
G00 Z#<z_start>
(log,Zstart #<mod_Z_start>)
#<Current_Width> = #<Pitch> + [#<mod_Z_start> * 2/2]
(log,CurrentWidth = #<Current_Width>)

G00 X#<Cut_Dia>
#<Z_fin> = [[#<z_start> - #<Current_Width>] + #<Tool_Width>]
G01 Z#<Z_fin> F0.3
(log,Zfin #<Z_fin>)
G33 Z#<z_end> K#<Pitch>
G00 X#<Drv_Dia>
G00 Z#<z_start>

#<Cut_Dia> = [#<Cut_Dia> - [#<Cut_Depth> * 2]]
O125 if [#<Cut_Dia> LT #<Thd_Dia>] ; maximum cut
#<Cut_Dia> = #<Thd_Dia>
O125 else

O125 endif

o101 endwhile
O127 else ; Thread is internal
o102 while [#<Cut_Dia> lt #<Thd_Dia>]
#<mod_Z_start> = [[#<Cut_Dia> - #<Thd_Dia>]/2]
#<mod_Z_start> = [#<mod_Z_start> - #<Thd_Height>]
#<mod_Z_start> = [#<mod_Z_start> * #<Ratio>]
G00 X#<Cut_Dia>
#<Mod_Z_point> = [#<z_start> + #<mod_Z_start>] ;modZstart is negative
Z#<Mod_Z_point>
(log,Zpoint #<mod_Z_point>)
G33 Z#<z_end> K#<Pitch>
G00 X#<Drv_Dia>
G00 Z#<z_start>
(log,Zstart #<mod_Z_start>)
#<Current_Width> = #<Pitch> + [#<mod_Z_start> * 2/2]
(log,CurrentWidth = #<Current_Width>)

G00 X#<Cut_Dia>
#<Z_fin> = [[#<z_start> - #<Current_Width>] + #<Tool_Width>]
G01 Z#<Z_fin> F0.3
(log,Zfin #<Z_fin>)
G33 Z#<z_end> K#<Pitch>
G00 X#<Drv_Dia>
G00 Z#<z_start>

#<Cut_Dia> = [#<Cut_Dia> - [#<Cut_Depth> * 2]]
O125 if [#<Cut_Dia> LT #<Thd_Dia>] ; maximum cut
#<Cut_Dia> = #<Thd_Dia>
O125 else

O125 endif
(log,CutDia = #<Cut_Dia>)

o102 endwhile

O127 endif

M09
(LOGCLOSE)
o<acme> endsub
The administrator has disabled public write access.

Re:conversational input 06 Nov 2011 13:41 #14618

  • M4MazakUser
  • M4MazakUser's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 76
  • Karma: 6
An updated set of lathe cycles, with many bugfixes.

Feel free to remove the auto toolchange calc, and use as a standalone cycle.

only works with 2.5 -due to tool nose radius calcs, and auto calc of toolchange point. (variables)

- i use these cycles daily, but! always check toolpath, -Trust nothing!
Attachments:
  • Attachment This attachment is hidden for guests. Please log in or register to see it.
Last Edit: 06 Nov 2011 15:21 by M4MazakUser. Reason: error in sub
The administrator has disabled public write access.

Re:conversational input 06 Nov 2011 15:22 #14620

  • M4MazakUser
  • M4MazakUser's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 76
  • Karma: 6
-had an error in the taper rough/finishing sub, here is the fixed version. This attachment is hidden for guests. Please log in or register to see it.
Attachments:
  • Attachment This attachment is hidden for guests. Please log in or register to see it.
The administrator has disabled public write access.

Re:conversational input 10 Nov 2011 18:20 #14753

  • M4MazakUser
  • M4MazakUser's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 76
  • Karma: 6
a new update, now rough/finish cycles do both boring/turn od, the material diamater vs the diameter for final size determines boring/od. This attachment is hidden for guests. Please log in or register to see it.
Attachments:
  • Attachment This attachment is hidden for guests. Please log in or register to see it.
The administrator has disabled public write access.
Moderators: Rick G
Time to create page: 1.039 seconds
Powered by Kunena Forum
© 2013 LinuxCNC.org
Joomla! is Free Software released under the GNU General Public License.