Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 28, 2012, 10:02:24 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
General Mach Discussion
I can't get the G95 feedrate to work properly in Macro
Pages:
1
2
»
Go Down
« previous
next »
Author
Topic: I can't get the G95 feedrate to work properly in Macro (Read 369 times)
0 Members and 1 Guest are viewing this topic.
rwskinner
Active Member
Offline
Posts: 50
I can't get the G95 feedrate to work properly in Macro
«
on:
November 02, 2011, 10:38:56 AM »
I took some snipits from the forum here and was trying to use a macro for tapping but it's not working.
When done in a sub, it works fine, when in a macro, the feed barely moves.
Subroutine that works:
G20 (Units: Inches)
G40 G90
(Set Editable Parameters)
#1=0.36 (Set Thread Depth)
#2=16.0 (Set Thread Pitch in Turns per Inch)
#3=400 (Set RPM)
#4=0.1 (Set Rapid Height)
(Internal Parameters)
#103=0.91 (Underfeed, 0.91 -> 9 %)
#104=[#103 * 1.0/#2] (feed rate adjusted for under feed)
G0 X0 Y0
G0 Z#4
M98 P1
M5 M9
M30
O1
G95 F#104
S#3 M3 M8
G4P4
G1 Z[#103 * #1/-1]
S#3 M4
G4P0.5
G1 Z#4
G94
M99
Macro Doesn't work:
'M975.m1s Tapping Macro
'
'Set Editable Parameters in Main Program
'#1=0.36 (Set Thread Depth)
'#2=16.0 (Set Thread Pitch in Turns per Inch)
'#3=400 (Set RPM)
'#4=0.1 (Set Rapid Height)
(Internal Parameters)
OrigFeed = GetOEMDRO(55)
CODE "#103=0.91" 'Underfeed, 0.91 -> 9 %
CODE "#104=[#103 * 1.0/#2]" 'feed rate adjusted for under feed
CODE "G95 F#104"
CODE "S#3 M3 M8"
CODE "G4 P4"
CODE "G1 Z[#103 * #1/-1]"
CODE "S#3 M4"
CODE "G4 P0.5"
CODE "G1 Z#4"
CODE "G94"
CODE "F" & OrigFeed
Logged
BR549
Active Member
Online
Posts: 2,557
Re: I can't get the G95 feedrate to work properly in Macro
«
Reply #1 on:
November 02, 2011, 12:40:24 PM »
COde looks ok here . HOW have you got your Spindle setup? do you have an index to show true RPM, do you have the spindle synced to feedrate?
(;-) TP
Logged
rwskinner
Active Member
Offline
Posts: 50
Re: I can't get the G95 feedrate to work properly in Macro
«
Reply #2 on:
November 02, 2011, 01:05:16 PM »
No, I have all delays set to Zero. But I do not have spindle feedback. (Floating tapping head)
The G95 works okay in the sub routine though.
Richard
Logged
BR549
Active Member
Online
Posts: 2,557
Re: I can't get the G95 feedrate to work properly in Macro
«
Reply #3 on:
November 02, 2011, 01:13:21 PM »
The macro may be outrunning the Gcode side. You may have to add wait states to keep things in sync between the CB side and the Gcode side.
'M975.m1s Tapping Macro
'
'Set Editable Parameters in Main Program
'#1=0.36 (Set Thread Depth)
'#2=16.0 (Set Thread Pitch in Turns per Inch)
'#3=400 (Set RPM)
'#4=0.1 (Set Rapid Height)
'(Internal Parameters)
OrigFeed = GetOEMDRO(55)
CODE "#103=0.91" 'Underfeed, 0.91 -> 9 %
CODE "#104=[#103 * 1.0/#2]" 'feed rate adjusted for under feed
CODE "G95 F#104"
While Ismoving()
Wend
CODE "S#3 M3 M8"
CODE "G4 P4"
CODE "G1 Z[#103 * #1/-1]"
While Ismoving()
Wend
CODE "S#3 M4"
CODE "G4 P0.5"
CODE "G1 Z#4"
While Ismoving()
Wend
CODE "G94"
CODE "F" & OrigFeed
(;-) TP
Logged
BR549
Active Member
Online
Posts: 2,557
Re: I can't get the G95 feedrate to work properly in Macro
«
Reply #4 on:
November 03, 2011, 10:54:53 AM »
I have run it 10 ways to sundays here and it works fine every time.
What version of mach3 are you running?
If you look in the mode line does it show switching to G95??
Are you sure you have your #vars set before you run the Macro?
(;-) TP
Logged
rwskinner
Active Member
Offline
Posts: 50
Re: I can't get the G95 feedrate to work properly in Macro
«
Reply #5 on:
November 03, 2011, 11:40:34 AM »
I'm running the latest stable release from the website three weeks ago.
Are you running my code or the code after you modified it?
I will check the mode and make sure it's changing.
Here is the code that calls the macro.
(Tapping Test Program)
G40 G80 G90
(Set Editable Parameters in Main Program)
#1=0.500 (Set Thread Depth)
#2=16.0 (Set Thread Pitch in Turns per Inch)
#3=400 (Set Tapping RPM)
#4=0.1 (Set Rapid Height)
G0 X0 Y0
G0 Z0.0
M975
M30
Logged
BR549
Active Member
Online
Posts: 2,557
Re: I can't get the G95 feedrate to work properly in Macro
«
Reply #6 on:
November 03, 2011, 11:42:33 AM »
I was running your code I will test with your Gcode program call.
(;-) TP
Logged
BR549
Active Member
Online
Posts: 2,557
Re: I can't get the G95 feedrate to work properly in Macro
«
Reply #7 on:
November 03, 2011, 11:51:07 AM »
It failed on the Gcode file call from your file. The problem is a Sync problem with CB and Gcode inside the macro .
To fix add in a wait state after the G95 call Forcing Mach3 to WAIT until it has completed the G95 call update. NOW you may have to add more or less wait states with YOUR system. It seems to be CPU related as to the waits required.
IF it were my code I would use the WhileIsmoving() Wend after each Code"" line to make SURE it stays in sync.
THAT is why I recommended you use a Gcode SUB routine call. It does NOT have the sync problems, But some of the latest version did have a bug that created a loop in the subs. DOn't know if that ever got fixed.
'M975.m1s Tapping Macro
'
'Set Editable Parameters in Main Program
'#1=0.36 (Set Thread Depth)
'#2=16.0 (Set Thread Pitch in Turns per Inch)
'#3=400 (Set RPM)
'#4=0.1 (Set Rapid Height)
'(Internal Parameters)
OrigFeed = GetOEMDRO(55)
CODE "#103=0.91" 'Underfeed, 0.91 -> 9 %
CODE "#104=[#103 * 1.0/#2]" 'feed rate adjusted for under feed
CODE "G95 F#104"
While Ismoving()
Wend
CODE "S#3 M3 M8"
CODE "G4 P4"
CODE "G1 Z[#103 * #1/-1]"
CODE "S#3 M4"
CODE "G4 P0.5"
CODE "G1 Z#4"
CODE "G94"
CODE "F" & OrigFeed
«
Last Edit: November 03, 2011, 11:57:33 AM by BR549
»
Logged
rwskinner
Active Member
Offline
Posts: 50
Re: I can't get the G95 feedrate to work properly in Macro
«
Reply #8 on:
November 03, 2011, 01:01:43 PM »
Let me give it try. I appreciate it very much!!!!
Richard
Logged
rwskinner
Active Member
Offline
Posts: 50
Re: I can't get the G95 feedrate to work properly in Macro
«
Reply #9 on:
November 04, 2011, 08:17:29 AM »
Yep, That fixed it here to. The sub routine does actually work a lot smoother and faster but then it has to be copied over to each one of my files each time. It just seems like a "cleaner" approach to use the macro.
Once I got it working I could tweak it and get it working exactly the way I wanted to. Cat's meow.
It's kind of a shame the the canned routines like the G84 tapping can have some sort of configuration were we can customize to our on machine. That seems like it would work well.
Thanks for all the help.
Richard
Logged
Pages:
1
2
»
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...