Automatic pause when spindle is started

More
6 years 6 months ago #162904 by Todd Zuercher
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.)
The following user(s) said Thank You: tommylight

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

More
6 years 6 months ago #163740 by clunc

tommylight wrote: 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:
Code:
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"
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"

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

More
6 years 6 months ago #163741 by clunc
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.

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

More
6 years 6 months ago #163771 by tommylight
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.053 seconds
Powered by Kunena Forum