CNC Router - How to find/set spindle maximum speed

Hello fellow makers -

I’m learning about spindle speeds, and am curious about the maximum speed of my CNC router.

Using g-code “m3 s1000” seems to be the fastest it goes. When I set it to “m3 s5000” it’s the same speed as s1000. Seems like 1000 rpm is the fastest…

The router manufacture’s documentation implies the spindle is 500 watts, and can run at 12,000 rpm. In the Amazon description, it says maximum velocity is 5000 rpm.

Can someone check this out and help let me know what to expect?

Name: LUNYEE 4040 Turbo CNC Router Link: Machine

I remember reading somewhere (perhaps in Kiri-moto), that you can set project-based overrides, limiting speeds/feeds/jogs, so I’m curious about that. Seems like running a “m3 s(speed)” g-code directly would override the override :slight_smile:

Thank you!

// Jonathan

I had the a similar problem.

I found that my spindle driver did not provide the correct PWM for the programmed value. i.e. a programmed value of 50% did not provide a 50% square wave.

I have a new driver in design because I have not found one that has perfect fidelity.

You can check the maximum speed by connecting the motor supply directly to the motor and measure the speed. *

Make sure the DC supply is running at the max voltage for that spindle. It could be that they are not driving it at full-rated voltage.

I think I have the same spindle and it runs at 12,000 @48VDC @100%.

*A tachometer is a necessary tool. NEIKO 20713A Digital Tachometer, Noncontact Laser Photo Sensor with 2.5 to 99,999 RPM Accuracy, RPM Gauge Marker with Batteries Included: Digital Tacometer For Measuring: Amazon.com: Industrial & Scientific


As an Amazon Affiliate, I earn from qualifying purchases.

1 Like

As @donkjr says, you really need a tachometer to truly judge spindle speed.

As usual with this sort of product listing there is no mention of the controller. I’m guessing it is a GRBL based machine? if so look at the values for $30 and $31.

  • These are the Maximum and Minimum spindle speeds.
  • The PWM signal from the controller will be 100% at $30 and 0% at $31, and proportional between the two.
  • If $30 = 1000 then setting speeds above 1000rpm will have no effect; the PWM is already maxed out.
1 Like

Thank you - the system is GRBL based. How can I see these values ($30, $31). I used $G to show the system state, but it did not show the 3- values.

[GC:G1 G54 G17 G21 G90 G94 M3 M M9 T0 F1000 S5000]

Send the $$ command to dump the current configuration

Thank you for teaching me that @mcdanlj .

>>> $$
$0 = 10    (Step pulse time, microseconds)
$1 = 25    (Step idle delay, milliseconds)
$2 = 0    (Step pulse invert, mask)
$3 = 1    (Step direction invert, mask)
$4 = 0    (Invert step enable pin, boolean)
$5 = 0    (Invert limit pins, boolean)
$6 = 0    (Invert probe pin, boolean)
$10 = 1    (Status report options, mask)
$11 = 0.010    (Junction deviation, millimeters)
$12 = 0.002    (Arc tolerance, millimeters)
$13 = 0    (Report in inches, boolean)
$20 = 0    (Soft limits enable, boolean)
$21 = 1    (Hard limits enable, boolean)
$22 = 1    (Homing cycle enable, boolean)
$23 = 3    (Homing direction invert, mask)
$24 = 25.000    (Homing locate feed rate, mm/min)
$25 = 1000.000    (Homing search seek rate, mm/min)
$26 = 250    (Homing switch debounce delay, milliseconds)
$27 = 2.000    (Homing switch pull-off distance, millimeters)
$30 = 1000    (Maximum spindle speed, RPM)
$31 = 0    (Minimum spindle speed, RPM)
$32 = 0    (Laser-mode enable, boolean)
$33 = 0   
$34 = 0   
$35 = 0   
$36 = 0   
$37 = 0   
$38 = 10   
$39 = 0   
$100 = 800.000    (X-axis travel resolution, step/mm)
$101 = 800.000    (Y-axis travel resolution, step/mm)
$102 = 800.000    (Z-axis travel resolution, step/mm)
$103 = 800.000   
$110 = 5000.000    (X-axis maximum rate, mm/min)
$111 = 5000.000    (Y-axis maximum rate, mm/min)
$112 = 2000.000    (Z-axis maximum rate, mm/min)
$113 = 2000.000   
$120 = 200.000    (X-axis acceleration, mm/sec^2)
$121 = 200.000    (Y-axis acceleration, mm/sec^2)
$122 = 100.000    (Z-axis acceleration, mm/sec^2)
$123 = 100.000   
$130 = 1500.000    (X-axis maximum travel, millimeters)
$131 = 1500.000    (Y-axis maximum travel, millimeters)
$132 = 1000.000    (Z-axis maximum travel, millimeters)
$133 = 1000.000   
ok
1 Like

If you set the max to 12000 then it will nominally match your spindle speed. In practice, though, spindle response isn’t exactly linear. So it’s just an approximation. All it really means is the range of numbers that are mapped to duty cycle of the PWM signal sent to the motor.

It’s possible to characterize and build custom firmware with more complex speed curves to be more accurate. Probably most people just wing it… :slightly_smiling_face:

I have played with setting $30=5000 and $30=12000 - I think you are right, it just seems to scale what range of numbers 0-100% is. When $30 was set to 1000, the sound of m3 s1000 is the same of when $30=5000 and I set m3 s5000 - I guess I have found my machine’s maximum speed - but will need a measuring tool to understand how fast it is…

If not familiar with them it is well worth looking at the GRBL settings doc here:

It’s elderly, but so is GRBL, so it is all still current.

As you have found the ‘spindle min/max’ rpm values are really just a way of setting the range in which the PWM will go from 0 to 100%. It needs calibrating for each machine; although as @mcdanlj says most people just ‘wing it’. I have my system set with $30=10000, $31=0 because my 775 spindle is nominally 10,000rpm @36v. But I dont believe that at all…

  • For some work knowing the RPM is super important so you can calculate cutting speeds etc. But for the light pcb and wood working I do I tend to use max speed for any small bit,
  • Eg; I have learned the settings that produce best results on my system. But I dont think of it as the ‘rpm’, just as the ‘setting I need’

Finally; when GRBL is used as Laser controller the whole notion of ‘rpm’ is mute. But all laser control software asks for the GRBL ‘min and max’ speed values so that it can reverse map the power level (0-100%) for a requested cut back to the values it needs to give for S commands in Gcode.

2 Likes

Hah! - That’s interesting - laughing to myself about “laser RPMs”.

2 Likes

The other point here is that you often have a non-linear speed curve (as mentioned by @mcdanlj too)

PWM varies power (which is not thee same as speed), and it is very good at this; 50% pwm provides exactly half the power of 100%.
But then mechanics start to cut in, especially if the spindle is under load. Power, force and speed have an ‘inverse square’ relationship (*); it may take 4x the power to double the RPM.

Advanced Spindle speed controllers take care of this; they use feedback to match the actual RPM to the input. And some controllers have mapping functions so you can calibrate a range of speeds with more accuracy.

Something similar happens when using pwm to control LED lighting; the pwm value / luminosity curve is very non-linear. Years ago I made a rough-n-ready aquarium light controller; and eventually added a led control library that handled this mapping for me so that the lights looks ‘smooth’ when fading up and down.

(*) Yes, Yes, ‘sort of’, I know this isnt strictly true but you get the idea… things are not linear.

2 Likes

I have this exact tachometer. I seem to remember my spindle doing 10,000RPM
at max speed. I’ve been doing cuts in thin aircraft aluminum with a tiny 1/16" carbide bit at max speed - keeping the feeds slow. It works great, and I haven’t broken one yet. Which surprised me.