Hello Guest it is March 28, 2024, 12:37:36 PM

Author Topic: Spindle at Speed  (Read 4292 times)

0 Members and 2 Guests are viewing this topic.

Re: Spindle at Speed
« Reply #20 on: May 09, 2018, 05:02:06 PM »
Hi Allan,
if I understand Steve's suggestion has a fixed delay whereas the mc.SignalWait() solution delays
ONLY until a signal from the VFD comes good. That was the intent and desire of Hakan, the bloke
I was helping at the time. Current OP, Helmut, needs the same solution.

Both Helmut and Hakan were bemused, even annoyed, that ISIG_SPINDLE_AT_SPEED and ISIG_SPINDLE_AT_ZERO
have no action despite the signal being defined within Mach's core.
Secondly they were annoyed, with some justification, that the documentation lags the reality.
I confess some exasperation that a very simple one line addition to the API.chm which would rectify
the matter has been ignored.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Spindle at Speed
« Reply #21 on: May 09, 2018, 06:50:59 PM »
If you are using the stock spindle wait, there is no return code because no m3 script exists.  I did increase the wait timeout to 20 seconds because it may take longer than 10 seconds to bring a 20K RPM spindle up to speed.  

If you are are using a m3 script, mcSpindleSetDirectionWait() will now return MERROR_TIMED OUT and the API docs reflect this.  I juuuuuuust fixed this and it will be in the next build.  

Also, the mcSignalWait() function will wait on ALL input signals instead of just the 64 general input signals for quite some time now.  As it was always supposed to.  So the docs do not mention a limitation, as there wasn't supposed to be one.  The issue was that the function was incorrectly ignoring the rest of the inputs.  

If you want more control over the spindle waits using signals, and don't want to wait up to 20 seconds for a timeout, then using the mcSignalWait() API function on ISIG_SPINDLE_AT_SPEED and AT_ZERO may be what you need.

I have been using the stock spindle wait with the signals on my personal machine since the beginning of Mach 4 time without issue.  The reason those signals are there is because I WANTED them for my machine! :)  I don't use any custom M3, M4, or M5 scripts.  In fact, I don't think I have ANY custom scripts other than M6 to run the tool changer.  The machine is a Matsuura MC500.  I installed Mach 4, wired my VFD outputs to some inputs and mapped the "at speed" and "at zero" input signals, and enabled them.  No drama at all.  It was intuitive.  I could run that very complex industrial machine (with all of the safety bells and whistles) with Mach 4 "out of the box" with no scripting required if I didn't want to use the tool changer.  

So when people complain about Mach 4 being difficult because you HAVE learn LUA to program it, I just don't get it.  If you THINK you need something custom, then either you have a Rube Goldberg device or something that just can't be shrink wrapped.  Tool changers are pretty much the only thing that falls into this category.  Otherwise, you may need to take a step back and think about if you have made a fundamental flaw in the retrofit or machine design.  VFDs can get a bit more complicated if you are using modbus.  But 99.9% of the hobby AND industrial milling machines really should not need much scripting at all.  It is when you want something SPECIAL that scripting is needed.

Steve
Re: Spindle at Speed
« Reply #22 on: May 09, 2018, 08:02:24 PM »
HI Steve,
kool, as I say the mc.SignalWait() restriction tripped me up back then, sounds like that limitation has
been addressed, good stuff.

Quote
If you want more control over the spindle waits using signals, and don't want to wait up to 20 seconds for a timeout, then using the mcSignalWait() API function on ISIG_SPINDLE_AT_SPEED and AT_ZERO may be what you need.

Yes, that was the exact reason that Hakan wished to pursue that idea and we did get it to work.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Spindle at Speed
« Reply #23 on: May 10, 2018, 12:49:02 AM »
Hi Steve,
almost all the custom code that has turned up in my installation has got there as a result of me
trying to help someone else do something specific rather than me needing, or even once I've
completed the code, actually using it.

I change tools manually and therefore have little need for M6's.

Some code I have written is actually more about file processing, I might run a Gcode file through
a Lua script to change or correct the code before commiting it to the machine. I have another script I have
written is for coil winding, pretty simple but effective.

The truth is that there is really nothing about my setup that requires custom code to run.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Spindle at Speed
« Reply #24 on: May 10, 2018, 05:22:15 AM »
Excellent news Steve. Sounds like all should be good very soon.

Allan