Hello Guest it is December 21, 2024, 07:08:51 AM

Author Topic: M3 speed control issue on startup  (Read 4802 times)

0 Members and 1 Guest are viewing this topic.

M3 speed control issue on startup
« on: January 26, 2016, 11:07:56 PM »
When I run a gcode file, when the first M3 S*********x is issued, the spindle goes to full speed.  On following M3 commands, I goes to approximately the correct speed.

Any ideas as to what is happening?

Thanks

Offline rcaffin

*
  •  1,066 1,066
Re: M3 speed control issue on startup
« Reply #1 on: January 27, 2016, 03:31:38 AM »
You do not say what version of Mach3 you are running, or whether you are talking about Mill or Lathe, or what interface you are using.

Anyhow, I have seen similar problems. It seems that there might be a bug in Mach3 (or several maybe?) that causes it to ignore any speed calibration you might have done until after you have issued the first M3.

Have you tried starting with S100, and then going to S1000?

Cheers
Roger
Re: M3 speed control issue on startup
« Reply #2 on: January 27, 2016, 07:49:22 PM »
I am running version 3.043.066 on a new Shopmaster MillTurn.  The issue is in both mill and lathe mode.

I was a bit mistaken as the spindle does not go to max speed.  My initial speed was fairly close to max speed and it was bumping into it.  What is really happening is that on the first m3 command, the speed goes and stays significantly higher than set point.  M3 S3000 will go to about 3700 RPM.  A second M3 command of 3000 it will come down to 3000.  I can resolve it with my post processor by putting an M3 S0 in the initialization lines. 

However, the issue is also present when pressing the spindle start button on the screens.  If I have a set point of 3000 and hit the start spindle button, it goes to 3700.  If I retype 3000 in the set point box while it is running, it comes down to 3000.

Thanks for any ideas.

Offline rcaffin

*
  •  1,066 1,066
Re: M3 speed control issue on startup
« Reply #3 on: January 27, 2016, 10:38:29 PM »
Ah - I think that bug can be handled. It'sa bit silly, and indeed Mach has a bug in it. However, per Peter Homann's advice, I was able to conceal the problem. The following is what I THINK is happening.

Mach should but does not read the Linearity.dat file before the first M3 is executed. A bug.
Mach does NOT know what speed the spindle can do at full power either. You have no way of telling Mach about this afaik.
Mach does read the pulley speed you have set up, and the first time it scales the requested speed to this value.

So ... if you tell Mach that Pulley 1 has a top speed of 3000 RPM, and then you request 3000 RPM, Mach will output a full-scale signal to the spindle. However, if 'full scale' really gives 3700 RPM, that's what you will get.

So, first find out what the max spindle speed is. You may have to rev the system a bit to get this.
Then tell Mach that the max speed for Pulley 1 is that speed, NOT what you want as top speed. In the case above, you tell Mach that the max pulley speed is 3700 RPM.

Now, when you fire up with S3000, you should actually get about 3000 RPM.

There can be another problem here. If you have told your spindle driver electronics to only go to a lower output than it can manage, the high end of the range is going to be a bit confused. In my case, the peak driver output voltage is around 200V DC, but the motor is only rated to 180 V DC. so the driver output will ramp up towards 200 V DC but it will get clipped at 180 V DC. That makes setting the peak speed a bit more tricky. You will have to try requesting speeds of (say) 1000, 2000 & 3000 RPM from the MDI line and noting the results. If actual speed comes out a bit high, by (say) 5%, push the Pulley speed up by 5%. A couple of cycles of this will get you close enough.

Cheers
Roger
Re: M3 speed control issue on startup
« Reply #4 on: January 28, 2016, 12:04:54 AM »
Roger,  I'm not sure I followed 100%, but here's a bit more info.

I have a VFD and set the max frequency at 120 HZ which equates to 5000 RPM on the mill spindle.  I have 5000 set in the pulley 1.  After the first M3 in a gcode file, the frequency is quite close.  It's just that first one that is ~20% or so high.  I had attempted to use the autocal routine to create a linearity.dat file, but that was not accurate at all.  I read on this forum that that feature had bugs and to delete the linearity.dat file.  After I did that, the speed is very close.

Its easy for me to fix the issue in a program by putting a M3 S0 in the initialization block of the c ode,.  I edited my post processor so that it sticks it in automatically.

The biggest nuisance now that I have that resolved is when I want to manually turn the spindle on.  I guess if I knew how to write screen code, I could have the spindle button put the M3 S0 in.  As it is now, I have to start the spindle with the button and retype the desired speed in the setpoint to get the correct speed.  I can also click the down arrow % adjustment and then the up arrow. 

Do all versions have this bug?

Offline rcaffin

*
  •  1,066 1,066
Re: M3 speed control issue on startup
« Reply #5 on: January 28, 2016, 02:32:42 AM »
Just for LOLs, try setting the pulley to 6000 and then see what the FIRST M3 does.

I have used the spindle calibration routine to create a new linearity.dat file, after deleting the old one. It worked OK for me, in .062 .

Is it just .066 with this bug? Certainly not. It seems a bit widespread.

Cheers
Roger
PS: putting S0 in first is a good trick. I have done that too, but with S200.
Re: M3 speed control issue on startup
« Reply #6 on: January 28, 2016, 08:50:44 AM »
Seems like a bug like that would be pretty easy to fix.  I'm pretty new at Mach 3.  Are there official bug lists for the different versions of Mach?

Offline rcaffin

*
  •  1,066 1,066
Re: M3 speed control issue on startup
« Reply #7 on: January 28, 2016, 04:29:44 PM »
Not as far as I know.
Some of the bugs are structural, and cannot be fixed. That's why Mach4 was started.

Cheers
Roger

Offline Vogavt

*
  •  260 260
Re: M3 speed control issue on startup
« Reply #8 on: February 06, 2016, 10:56:52 AM »
you might look at this thread as well. Look at posts 13 & 14

http://www.machsupport.com/forum/index.php/topic,8289.10.html
Re: M3 speed control issue on startup
« Reply #9 on: February 06, 2016, 12:56:38 PM »
Vogavt,
Thanks, I'll give it a try when I return home next week.  One interesting thing I discovered last week is that in lathe mode ( I have a combination machine) Mach does not have this problem.  It goes to the correct speed on the first M3.