585,982 active members*
4,549 visitors online*
Register for free
Login
Results 1 to 19 of 19
  1. #1
    Join Date
    Feb 2007
    Posts
    532

    Spindle startup delay / dwell..

    Hi-ho...

    A question for the room.

    Is there a way to get LinuxCNC to automatically put a dwell/delay in after the M3? My old machine did, and I've got 300+ gcode files which I'd rather not have to re-visit if I can help it.

    Cheers, Chris H.

  2. #2
    Join Date
    Dec 2003
    Posts
    24221
    I assume you want to do this to simulate Up-to-speed signal.
    If for example you are using a spindle controller that has output options as is the usual case with a VFD, you can set an output as up to speed and look for it after the M3 has been issued and set the FIN(ish) input.
    Otherwise you would need a G04 dwell
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  3. #3
    Join Date
    Feb 2007
    Posts
    532
    Hmmmmmm.

    Thanks for that. I'll have to read the VFD manual... Asside from skimming it before I imported the machine I've never actually done that. :-)

    Cheers, Chris H.

  4. #4
    Join Date
    Nov 2005
    Posts
    496
    There is a way to set up axis to 'filter' the gcode in anyway you want programically.
    I'm betting having it look for M3 and adding a dwell command just before it would not be much trouble other then finding someone familiar with AXIS filters and scripting programs.

    If no one pops up an answer try the linuxcnc forum.
    Though spindle up-to-speed is very nice especially for lathes.

    oh and if your VDF doesn't have an up-to-speed signal but you have an encoder on the spindle you can make the signal using the 'near' component

    Chris M

  5. #5
    Join Date
    Feb 2007
    Posts
    532
    Quote Originally Posted by chester88 View Post
    There is a way to set up axis to 'filter' the gcode in anyway you want programically.
    I'm betting having it look for M3 and adding a dwell command just before it would not be much trouble other then finding someone familiar with AXIS filters and scripting programs.
    Hi-ho,

    I think I'll go for the hardware input option Al suggested, that way there's an extra interlock/safety on the spindle actually turning before it ploughs into the table. :-)

    I had a quick read of the manual before work this morning and by default it has an open collector output for VFD reached set frequency.

    It'd also be nice to have the revs under control of LinuxCNC, currently it's set on the VFD remote panel so I'm tihnking I might wire in the 0-10V analog at the same time, although having another active/dynamic signal on the parallel port does give me some concern about stepgen keeping up. Have to think about that one a bit.

    Cheers, Chris H.

  6. #6
    Join Date
    Dec 2003
    Posts
    24221
    I use VFD up to speed signal on both lathe and mill.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  7. #7
    Join Date
    Feb 2007
    Posts
    532
    Quote Originally Posted by Al_The_Man View Post
    I use VFD up to speed signal on both lathe and mill.
    Al.
    Hi Al...

    I've sorted the output from the VFD, but nothing is leaping out at me in the stepconf wizard to set up the input in linuxcnc.

    Reading the spindle control docs on the LinuxCNC website suggest phase outputs are required rather than a digital state output?

    Can you share a snippet from your config?

    Cheers, Chris H

  8. #8
    Join Date
    Dec 2003
    Posts
    24221
    I have not used Linux but I would assume that there is provision for a simple M code Finish signal?
    It is used in the systems I have in the same way that practically all commercial systems use, whenever any M code is issued a common confirmation signal in the form of a FINish signal is returned to the controller.
    Linux must use something similar, otherwise the controller has no way of knowing whether the M code is completed and the part program would continue without waiting?
    In this case, when the M code is issued, the controller waits for the VFD output defined as Up-to-speed to be input to whatever is assigned as the common M code finish.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  9. #9
    Join Date
    Feb 2007
    Posts
    532
    Arrrrr.

    I thought you were, so was searching the LinuxCNC site for 'fin input' and variations thereof.

    Not a worry, I imagine there is away to accept the input they probably just call it something else. I'll broaden the search a bit.

    Cheers, Chris H.

  10. #10
    Join Date
    Dec 2003
    Posts
    24221
    There have to be other M or T codes handled the same way in Linux?
    For e.g. if a T code (tool change) is issued, the part program has to halt and wait until confirmation the tool is ready to go?
    Just one example of many.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  11. #11
    Join Date
    Feb 2007
    Posts
    532
    Quote Originally Posted by Al_The_Man View Post
    There have to be other M or T codes handled the same way in Linux?
    It's got more options that I've had hot meals. :-) The trick being figuring out which one you want without getting too far down the rabbit hole. :-).


    Anyway...

    When I stopped searching for the wrong thing, I figured out the following for my custom.hal file:

    net spindle-ready <= parport.0.pin-12-in-not
    net spindle-ready => motion.spindle-at-speed

    Which works... But. And it's a big but, LinuxCNC executes a couple of lines after the M3 before pausing and waiting for the signal.

    I tried out some code from the LinuxCNC forums as well, which just gave a 10sec delay:

    loadrt timedelay count=1
    addf timedelay.0 servo-thread
    setp timedelay.0.on-delay 10
    setp timedelay.0.off-delay 0
    net spindle-on => timedelay.0.in
    net spindle-ready <= timedelay.0.out
    net spindle-ready => motion.spindle-at-speed

    Which does the same thing.. Very worrying and as always I'm glad glad I tested cutting air, not something harder.

    The start to most of my g-code looks like: (Line numbers added for illustration only)

    1 T1M6
    2 G17
    3 G0Z25.400
    4 G0X0.000Y0.000S18000M3
    5 G0X48.301Y32.549Z9.000
    6 G0Z7.000
    7 Z0.050F1200.0
    8 Z9.000
    9 G0X155.301
    10 G0Z7.000

    The machine pauses after line 6, not line 4 as I expected.

    I changed line 6 in this file as a test to G0 to Z0,00 and it did the full plunge and then paused... If that happened with material in the machine it'd be a bit expensive on cutting tools after a while.

    Anyone got any clues?

    Cheers, Chris H.

  12. #12
    Join Date
    Apr 2012
    Posts
    79
    kiwichris

    Do you have spindle feedback going into linuxcnc as you could use the near command and the machine would not feed until it reaches say 95% spindle speed or what ever you set it to.

    Lee

  13. #13
    Join Date
    Feb 2007
    Posts
    532
    Hi-ho,

    At this stage I've just got an open collector output from the VFD which gives a 'reached frequency' indication. The examples for near that I've seen use the motion.spindle-at-speed a well so I'm not sure the would fix the problem?

    My concern right now is that LinuxCNC executes some commands after the M3 even when I've linked spindle-ready & motion.spindle-at-speed to an input which is not active.

    I expected all motion after the M3 to stop until the input was satisfied.

    Scratching my head a bit, it's been a long time since I dealt with hal commands...

    Cheers, Chris H.

  14. #14
    Join Date
    Apr 2012
    Posts
    79
    Kiwichris

    The code you posted has not got any G1 commands in it only rapids. The spindle at speed command only works on feed commands. I assume this is so the machine will rapid while the spindle accelarates to save time.

    Lee

  15. #15
    Join Date
    Dec 2003
    Posts
    24221
    The proper G code protocol should be is that all M,S & T codes will wait until completion before the part program or next command executes.
    I would be surprised if this is not already done somehow in Linux?
    Commands that do not require a confirmation of completion just return a completion immediately.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  16. #16
    Join Date
    Feb 2007
    Posts
    532
    Quote Originally Posted by Lomach View Post
    The code you posted has not got any G1 commands in it only rapids. The spindle at speed command only works on feed commands. I assume this is so the machine will rapid while the spindle accelarates to save time.
    Well spotted Lee... I'd not made that link at all. I've only read the bits of the integration PDF I needed to test it.

    Makes good sense though, so I'll wire it up properly and do a bit of testing to make myself happy that it's doing what I expect and go from there.

    Cheers, Chris H.

  17. #17
    Join Date
    Feb 2007
    Posts
    532
    Just to round off this thread...

    Using the code:

    net spindle-ready <= parport.0.pin-12-in-not
    net spindle-ready => motion.spindle-at-speed

    In the custom.hal file is what I've gone with. Per the previous couple of posts it continues to execute G00's but halts on the first G03/02/01 command until the spindle comes up to speed.

    It is a bit nervous watching it the first few time as in a lot of cases I have the plunge/approach height set to 1mm above the material top surface and it races up to the material with the spindle only just starting to turn.

    I've not had any issues with it, and every little bit helps when trying to save time in the shop at the moment.

    Cheers, Chris H.

  18. #18
    Join Date
    Oct 2007
    Posts
    9
    Hi

    I need some help please!! Is there a way to implement the timer, timedelay, to wait say 10 seconds for spindle to spin up without the "net spindle-ready => motion.spindle-at-speed". The spindle I am working with has no feedback and motion.spindle-at-speed places the program into an infinite wait loop.

    Thanks in advance

    Piet

    -------------------------
    Not to worry, I got it sorted

    loadrt timedelay count=1
    addf timedelay.0 servo-thread
    setp timedelay.0.on-delay 6
    setp timedelay.0.off-delay 0
    net spindle-on => halui.program.pause
    net spindle-on => timedelay.0.in
    net spindle-ready <= timedelay.0.out
    net spindle-ready => halui.program.resume

    Use at own risk

  19. #19
    Join Date
    Nov 2005
    Posts
    496
    Quote Originally Posted by PietVR View Post
    Hi

    I need some help please!! Is there a way to implement the timer, timedelay, to wait say 10 seconds for spindle to spin up without the "net spindle-ready => motion.spindle-at-speed". The spindle I am working with has no feedback and motion.spindle-at-speed places the program into an infinite wait loop.

    Thanks in advance

    Piet

    -------------------------
    Not to worry, I got it sorted

    loadrt timedelay count=1
    addf timedelay.0 servo-thread
    setp timedelay.0.on-delay 10
    setp timedelay.0.off-delay 0
    net spindle-on => timedelay.0.in
    net spindle-ready <= timedelay.0.out
    net spindle-ready => motion.spindle-at-speed
    It would make more sense to use spindle-at-speed - something like above:

    Chris M

Similar Threads

  1. Reducing Spindle & Coolant dwell times
    By WMD in forum Tormach Personal CNC Mill
    Replies: 1
    Last Post: 07-20-2010, 07:03 AM
  2. A axis (slaved to Y) startup delay
    By Dean448 in forum Mach Software (ArtSoft software)
    Replies: 4
    Last Post: 01-18-2010, 03:11 AM
  3. Chinese 2.2Kw spindle startup ccw
    By Ed Williams in forum DIY CNC Router Table Machines
    Replies: 1
    Last Post: 11-26-2009, 05:10 PM
  4. Spindle delay
    By mkc2 in forum Mach Mill
    Replies: 3
    Last Post: 01-06-2009, 01:56 PM
  5. mach 3 spindle delay
    By mike10 in forum Mach Mill
    Replies: 0
    Last Post: 05-10-2008, 05:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •