Hello Guest it is November 11, 2024, 08:39:00 AM

Author Topic: Changing Spindle Speed  (Read 2281 times)

0 Members and 1 Guest are viewing this topic.

Changing Spindle Speed
« on: July 10, 2018, 02:31:23 PM »
I am trying to change my spindle speed very often in my gcode (every second line) and that results in random feed accelerations and decelerations.
It seems as though the gcode execution almost stops at times.
When I look at the current line I often notice that it jumps to previous lines and then forward again.
What is going on?

Here is a code snippet :

( w gti)
#1001 = 178.29 (diametri i jashtëm)
#1002 = 65.4366 (diametri i mbrendshëm)
#1003 =  23.324 (x ZRef)
#1003 = -5.86 (z ZRef)
#1004 = 0.2 (rrezja e thikës)
#1005 =  0.1 (thellësia e prerjes)
 
G90 G18 G1
M3 S500 F100
G4 P4
 
(piket e zhvendosura per 0.1)
X178.3216  Z-2.2013
S499.78  F99.96
X178.2216  Z-2.168
S500.48  F100.1
X178.0105  Z-2.1033
S501.98  F100.4
...
X65.4202  Z-11.3926
S1300.12  F260.02
 
S500 F200
Z100
X198.29
M5
M30

I am in need of every suggestion that might help me.

Offline Tweakie.CNC

*
  • *
  •  9,250 9,250
  • Super Kitty
Re: Changing Spindle Speed
« Reply #1 on: July 11, 2018, 07:19:49 AM »
Mach4, being under development, may behave differently but...

Both the S### and F### commands will break the Constant Velocity chain so your Gcode example will not flow smoothly. Unfortunately this is a function of Mach3 and there is no direct solution. (an indirect solution for replacing the S### commands with a spare axis electronically or mechanically driving an encoder, or similar, has been used with laser systems but this may not suit your requirements).

Perhaps reconsider the way you wish to operate your machine ?

Tweakie.
PEACE
Re: Changing Spindle Speed
« Reply #2 on: July 11, 2018, 08:15:13 AM »
Would adding a small delay after changing spindle speed do any good?
I don't mind the gcode execution to take a bit longer as long as it doesn't vibrate the way it is doing now.

As an example :
"
X### Z###
S### F### G4P0.1   
".

I might as well try it out, I generate my gcode myself with some vbs programs.
I can easily add a "G4P0.1" at the end of each of those lines mentioned above.

I'll post the results later.
Indirect solutions would be a big problem in my setup. 

Offline Tweakie.CNC

*
  • *
  •  9,250 9,250
  • Super Kitty
Re: Changing Spindle Speed
« Reply #3 on: July 11, 2018, 08:47:22 AM »
If you are using Mach3 then the delay will not help - the axis motion will, I think, always be start, stop.

Tweakie.
PEACE
Re: Changing Spindle Speed
« Reply #4 on: September 08, 2018, 04:19:33 AM »
It has been a long time since I solved the problem.
I thought I'd share my solution with the forum.

I eliminated the need to use S commands.
I used one of Mach's 6 axis which I previously didn't use to sent pulses to an Arduino board.
The Arduino board then counts the pulses and outputs the right pwm signal which in turn goes to the inputs of my motor's inverter.

As per changing the feed rate, I can change that at every second line without much vibrations, it is like night and day compared to changing feed rate and spindle speed in the same line.
Might not be the most legit solution out there but it works for me.

Thank you Tweakie

Offline Tweakie.CNC

*
  • *
  •  9,250 9,250
  • Super Kitty
Re: Changing Spindle Speed
« Reply #5 on: September 08, 2018, 04:47:48 AM »
Quote
I used one of Mach's 6 axis which I previously didn't use to sent pulses to an Arduino board.
The Arduino board then counts the pulses and outputs the right pwm signal which in turn goes to the inputs of my motor's inverter.

An excellent solution. Thank you for sharing the information.

Tweakie.
PEACE