Spindle Speed Control

I’m running a 500w Chinese spindle with the included power supply. Max speed of 12,000 rpm. It has the capability of pwm speed control. Has anyone out there successfully been able to hook this speed control up to the ramps board? I am seeing significant differences in cuts by getting the spindle speed set just right. I would love to hook it up to be controlled by the gcode and get consistent speeds for each tool defined in estlcam. I have done searching and information seems slim and hard for me to understand. Has anyone done this? If so can you please explain how you done it? Thanks in advance.



You can adjust the speed very easily, but you don’t actually know how fast it is going. You need something like superpid to have true control. That will give you any RPM whether you are not cutting yet or full depth into some walnut. It checks the physical RPM and adjusts the current to compensate.

I understand something like superpid would be optimal but not really necessary for me at the moment. I would like to just be able to come up with some numbers in estlcam through experimentation that set my speed as if I was turning the potentiometer to the exact same place every time. Even if it’s an arbitrary number that doesn’t relate to real life rpm. Many people are obviously running a set speed through an entire job without worrying about load on the bit as you go deeper etc. so I’m not to worried about that. I would set up different spindle speeds for different material as necessary. Where do I connect the pwm control to the Ramps board, and will I need to make changes to the firmware? Or any other changes?




Do you know what voltage range the PWM input is?


D8-D10 are capable of 0-12V there are other pins available for 0-5V.


Doesn’t this schema from Christian Knuell do what you need ? https://www.v1engineering.com/forum/topic/estlcam-with-experimental-arduino-mega2560-ramps-1-4-support/page/9/#post-34256

Im assuming the firmware would have to be changed in order for the spindle speed commands from the gcode to tell D8 or D10 what to do? Am i correct in this? I have found this information on the rep rap forum Link. This applies to a degree, but he is using the servo pins. Which as you mentioned Ryan are 0-5V, so it really doesnt apply to me. I also found this Link that does explain what i want to do as well, but is mapping to D9. I have not done any firmware modification yet. Can anyone lead me in the right direction on editing marlin to use D8 or D10 as my spindle speed control. Any and all help is greatly appreciated.



It should just use the fan port D9 and be controlled by m106 to turn it on and m107 to turn it off. Making sure to go no higher than m106 s213 (10V I think). The S value should change the speed. Just look up the jtech laser control, same deal.

I do not have anything to test this with. So I am not sure how much help I can be. I hesitate to even try and help as this might ruin your tool. generally I stay out of it unless I can test it first.

I really really prefer to have manual control over the speed. You can hear when things are wrong and some cuts need a bit more or less speed to get rid of the resonance.

Setting it to 213 is going to be an average of 10V, but it’s using a PWM, which will oscillate from input voltage (12V) to 0V.

It switches quickly, but if it’s advertised as 10V-0V, I wouldn’t do that.

Since there’s no current, you can use a simple resistor voltage divider. a 10kOhm and a 2kOhm would drop it, although the input voltage is rarely actually 12V, which is why anything sensitive, like the Arduino, has a regulator.

You could also only connect regulated 10V as input. That might be harder or easier, IDK.

We tried the voltage divider with the Leo laser and it didn’t work. Didn’t spend too much time on it so maybe we did something wrong.