Automatic pause when spindle is started
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5008
- Thank you received: 1441
18 Feb 2016 13:28 #70340
by Todd Zuercher
Replied by Todd Zuercher on topic Automatic pause when spindle is started
Is there a reason that you did not want to use the "motion.spindle-at-speed" pin? I like the way it works. When this pin is false, Linuxcnc will wait until it is driven true before starting any cutting move (but it will still make a G0 positioning move. It is especially nice if you can get an at speed signal back from your VFD. This way at the beginning of your file you can command a spindle start, then G0 to the first cut, if the spindle is up to speed by the time it gets there, it starts right in, but if it is still accelerating the program will pause, at the first G1(or G2, G3, or other canned function) and wait for the spindle to finish starting. This is how I've set up several machines. If you really can't spare an input to use for the signal from your VFD. You could use the "motion.spindle-at-speed" pin with the time delay component to give the "motion.spindle-at-speed " a true signal X seconds after starting like this:
loadrt timedelay count=1
addf timedelay.0 servo-thread
setp timedelay.0.on-delay 5
net spindle-on => timedelay.0.in
net spindle-timer <= timedelay.0.out
net spindle-timer => motion.spindle-at-speed
The following user(s) said Thank You: Rubenv
Please Log in or Create an account to join the conversation.
29 Feb 2016 13:14 - 29 Feb 2016 13:15 #70807
by Rubenv
Replied by Rubenv on topic Automatic pause when spindle is started
Hi Todd
I finally had some time at the CNC. this worked 100%, thanks. it is a bit scary seeing it running on G00 but all good.
Thanks for all the other contributors.
Ruben
I finally had some time at the CNC. this worked 100%, thanks. it is a bit scary seeing it running on G00 but all good.
Thanks for all the other contributors.
Ruben
Last edit: 29 Feb 2016 13:15 by Rubenv.
Please Log in or Create an account to join the conversation.
- EvilKnivel
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
06 Apr 2020 08:31 #162870
by EvilKnivel
Replied by EvilKnivel on topic Automatic pause when spindle is started
Hello,
I'm looking as well for an automatic pause when spindel starts.... Becuase no input left on Parallel port and currently no R485 comunication....
If I do understand right, this is the solution i'm looking for.
"setp timedelay.0.on-delay 5" do i read this line correct that it waits for 5 seconds?
And the much more important question: Where do I have to add this code?
Does it also pause after a tool change and spindle start?
Regards
Christoph
I'm looking as well for an automatic pause when spindel starts.... Becuase no input left on Parallel port and currently no R485 comunication....
If I do understand right, this is the solution i'm looking for.
"setp timedelay.0.on-delay 5" do i read this line correct that it waits for 5 seconds?
And the much more important question: Where do I have to add this code?
Does it also pause after a tool change and spindle start?
Regards
Christoph
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19226
- Thank you received: 6443
06 Apr 2020 10:33 #162884
by tommylight
Replied by tommylight on topic Automatic pause when spindle is started
Adding G04 P5 after every M3 should do what you need.
That is in gcode, not in hal or ini.
That is in gcode, not in hal or ini.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5008
- Thank you received: 1441
06 Apr 2020 12:46 #162904
by Todd Zuercher
Replied by Todd Zuercher on topic Automatic pause when spindle is started
Ideally you would use some kind of feedback from the spindle to connect to the spindle at speed hal pin (either a digital at speed signal from your VFD, or actual speed from a spindle encoder.) But if you don't already have some form of spindle speed feedback, or can't spare an input pin to connect to a spindle at speed signal, adding all the lines of hal code I posted above in post #70340 in your hal file should add a 5 second delay after a spindle start command before the first cutting move (G0 positioning moves will not wait).
Alternatively you can add the pause manually in G-code like Tommy suggested.
Where those lines of hal code should go in your hal file is a bit arbitrary. And other than the loadrt line and the addf line their location doesn't really matter. The loadrt line and addf lines should probably be near the top of the hal file with the other similar hal lines so they can be placed in proper order with your other similar hal commands. (But these commands would still work fine if they were all at the end or in a secondary hal file.)
Alternatively you can add the pause manually in G-code like Tommy suggested.
Where those lines of hal code should go in your hal file is a bit arbitrary. And other than the loadrt line and the addf line their location doesn't really matter. The loadrt line and addf lines should probably be near the top of the hal file with the other similar hal lines so they can be placed in proper order with your other similar hal commands. (But these commands would still work fine if they were all at the end or in a secondary hal file.)
The following user(s) said Thank You: tommylight, EraDim
Please Log in or Create an account to join the conversation.
12 Apr 2020 11:09 #163740
by clunc
And it might be put into the G-code automatically.
My CAM software, the venerable MeshCAM, permits me to define a customized 'post' (post-processor) file by which I can affect how certain G-codes are implemented and effect pre-ambles and post-ambles to G-code programs.
For example, if the code MeshCAM is outputting uses a roughing and finishing tools, this part of the .CON file:inserts all this code in the output at the toolchange. [I added the parts after #<RPM>. #<> denote variables in MeshCAM and the spindle speed is one of the things that has to be specified before MC will construct a G-code for the model.
Incidentally, I've also got the following START/END lines to record how long a job takes. They rely on a custom M144 M-code that does nothing more than exec Linux 'date', format it and append it to a file.
START = "[N] M144 Pnnn Q1 ; user-m-code to log start-time in same dir as ngc"
END = "[N] M144 Pnnn Q0 ; user-m-code to log stop-time in same log file as start-time in same dir as ngc"
Replied by clunc on topic Automatic pause when spindle is started
Adding G04 P5 after every M3 should do what you need.
That is in gcode, not in hal or ini.
And it might be put into the G-code automatically.
My CAM software, the venerable MeshCAM, permits me to define a customized 'post' (post-processor) file by which I can affect how certain G-codes are implemented and effect pre-ambles and post-ambles to G-code programs.
For example, if the code MeshCAM is outputting uses a roughing and finishing tools, this part of the .CON file:
TOOLCHANGE = "[N] M6 [T]"
TOOLCHANGE = "[N] M3 S#<RPM>"
TOOLCHANGE = "(Tool Changed to: TP=[TP] [TOOLDESC])"
TOOLCHANGE = "(MSG, Un-pause when spindle reaches speed.)"
TOOLCHANGE = "M0"
Incidentally, I've also got the following START/END lines to record how long a job takes. They rely on a custom M144 M-code that does nothing more than exec Linux 'date', format it and append it to a file.
START = "[N] M144 Pnnn Q1 ; user-m-code to log start-time in same dir as ngc"
END = "[N] M144 Pnnn Q0 ; user-m-code to log stop-time in same log file as start-time in same dir as ngc"
Please Log in or Create an account to join the conversation.
12 Apr 2020 11:13 #163741
by clunc
Replied by clunc on topic Automatic pause when spindle is started
I recall at one point learning that the 'vi' editor had the ability to run its own "scripts" that could find and replace strings in a file. The thing was, even after MeshCAM outputs NGC files, there's a small amount of editing that needs to be done (M144 needs to know the "project number", nnn, for example.)
Maybe an M3 line could be replaced by the line, followed by an M0.
Maybe an M3 line could be replaced by the line, followed by an M0.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19226
- Thank you received: 6443
12 Apr 2020 15:16 #163771
by tommylight
Replied by tommylight on topic Automatic pause when spindle is started
All of the simple text editors that are pre-installed with Linux have a search and replace feature, just press Ctrl+h.
Please Log in or Create an account to join the conversation.
Time to create page: 0.090 seconds