Hello Guest it is December 05, 2024, 10:59:11 AM

Author Topic: Mach holding spindle speed  (Read 10373 times)

0 Members and 1 Guest are viewing this topic.

Mach holding spindle speed
« on: December 05, 2017, 07:46:51 PM »
Hello All,
I'm running the brain attached with a Hitachi WJ200. Spindle is controllable with M3 and M5 commands and the speed is controllable
with the S.... Command.
The Problem:
If the spindle is turned on and a speed is set with the M3 S12000 command all is well and the program runs.
Enter the M5 command at the end of the program and the spindle stops, the run light on the VFD goes out and all is well.....UNTIL
If you enter a M3 command on the command line without the S following, the spindle will turn on and go back to the previous 12000 rpm number.
It appears Mach is holding on to that number, not the brain and not Modbus. Checking the registers on the modbus yields a 0 rpm.

Is there a setting on Mach that I am missing?? Why is Mach holding that speed?

The only work around I have found it to include S0 after the M5 command in the running program.

Any Ideas???
Thanks
Art

Offline ger21

*
  • *
  •  6,295 6,295
    • The CNC Woodworker
Re: Mach holding spindle speed
« Reply #1 on: December 05, 2017, 09:12:12 PM »
When you set the spindle speed with the S word, that speed remains in effect until you change it.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Mach holding spindle speed
« Reply #2 on: December 05, 2017, 09:29:00 PM »
CamBam generates the G-code with the m3 S commands. Other than adding a footer to set M5 S0 is there a setting in Mach to tell it to set S to 0 when the M5 command is initiated?

Offline ger21

*
  • *
  •  6,295 6,295
    • The CNC Woodworker
Re: Mach holding spindle speed
« Reply #3 on: December 05, 2017, 10:08:16 PM »
No, if you want to change the speed, you need to have the g-code change it.

Why do you want the speed set to 0 anyway?
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Mach holding spindle speed
« Reply #4 on: December 06, 2017, 09:01:38 AM »
Just as a safety precaution. If Mach is running and an inadvertent M3 command is issued, or if the spindle start button is activated the spindle will turn at the previous rate.

Offline Tweakie.CNC

*
  • *
  •  9,262 9,262
  • Super Kitty
Re: Mach holding spindle speed
« Reply #5 on: December 07, 2017, 02:07:09 AM »
Quote
is there a setting in Mach to tell it to set S to 0 when the M5 command is initiated?


Hi Art,

In the folder C: / Mach3 / macros / Mach3Mill (or whatever Profile you are using) add the line   Code("S0")   to the file   m5.m1s  then save the file.

Tweakie.
PEACE
Re: Mach holding spindle speed
« Reply #6 on: December 07, 2017, 08:33:58 AM »
Thanks!!
That's exactly what I was looking for!!
Much appreciated
Re: Mach holding spindle speed
« Reply #7 on: December 25, 2017, 11:50:29 AM »
i am also facing same of alevitt53 its change back to previous rate. what to do now did i have to change code set to o or so?
Re: Mach holding spindle speed
« Reply #8 on: December 25, 2017, 12:19:15 PM »
I found the easiest way to solve this problem is to edit the g-code and just add an S0 command after the M5 command.
There is also a field in the general setup that you can add an S0 command on every E-Stop. That will set the speed to 0 whenever there is an E-Stop and the program has not reached the S0 command.
Re: Mach holding spindle speed
« Reply #9 on: December 25, 2017, 12:24:01 PM »
thanks for quick reply.