Looking for: PWM "driven" Voltage Regulator for Spindle with Linear DC output

Signal: 24V PWM
Supply: 24V 500W
Output: Variable (ideal 9-24)

To be clear, I am not looking for a common PWM driver. I already have that.
The issue is that driving a spindle that is meant to be run at linear DC/CC, on PWM is noisy, very noisy. The motor can be run this way but it is jut not designed for it.

I am looking to upgrade a 2000RPM RATTM branded brushed spindle on a Vevor CNC kit. I am using a BTT SKR E3 V3 Controller. The heated bed and fan MOS are more than enough to run the spindle. But it is way more noisy than the GRBL based controller I removed.
-depending on what I can get I might stick with this spindle or upgrade to a brush less with 5kg torq.

I see the simplest path as being to use the PWM output from the controller to retain speed control. But the PWM itself will no longer do any of the work. Instead it will act as signaling. So the PWM needs to be READ, or averaged, and used as a DigiPot of sorts. Whatever cleverness might exist for this kind of thing. Now the resulting signal controls a variable voltage regulator.

Another project I am looking for much the same thing but with I2C as the source signal, input 16V 9A, output 0-24V. Typical 9-13.5V 3A.

I need to adjust voltage to a series of LED. No, not light strips. Something more complex. I need the MCU, an ESP32 to be able to adjust the voltage to the LED on the fly.

I know I could use a ssr and external supply with variable control. that would work but I would have to manually adjust speed. There are many other things that I could do. But they aren’t what I am looking for.

I would think an ssr would turn on and off if driven by a pwm signal…

I used one of these boards… from Amazon.

it didn’t work with a 12V supply… it wouldn’t quite reach 10V dc output…

Good luck


I just installed that exact board from Amazon on a 3018 and while it works for my purpose (driving a cheapo 12k RPM spindle) it does seem a bit meh about reaching max power. Better than nothing, though.

I ended up running it off 24V… it’s rated input maxes out at 30V


Before I moved to a three-phase spindle with a VFD, I got:

That’s out of stock now, but this one looks about the same:

Looks like it might work, but the input is rated for 10v. The driving pwm signal will be 24v.

Some really negative reviews too. Possibly they just don’t know how this device works?

Oh, yeah, I don’t know whether this one will work for your application. Sorry!

Note though, that you can put any positive voltage you want on the positive side, as the power MOSFETs are switched on the low (negative) side. This means you can probably put a power regulator and/or buck converter on the positive side. Does that make sense?

Ya there is probably a way to force this work, if indeed it regulates the output voltage as a constant via the PWM pulses. ie high frequency = high voltage, lower frequency = lower voltage.

I might put a power divider between the control input and the PWM. This should make a good bridge.

Though still hopeful something more pops up.

I edited the post to reflect that although the goal is to Quiet the spindle I have now. I am considering to purchase a 12000 rpm, torque 5kg, brush less spindle. From the reaction of my coworkers it seem that the brushed and brush less need different drivers.
-If only only the firmware supported just shoving a stepper into the spindle slot…

Do you mean a voltage divider? This is probably true, since the port on the spindle controller should be high impedance.

A DC motor needs to be commutated somehow… A brushless DC motor is basically a three-phase motor with a built-in VFD. Most of the brushless spindles I’ve seen are explicitly a three-phase spindle with a separate VFD controller.

For example, take a look at this example package on Amazon (not a purchase recommendation, just a reference):

Look at the connections here:

The motor connections are three phases labelled U, V, and W. It has position sensing with hall effect sensors labelled HU, YV, and HW that it uses to control the electronic commutation between the phases.

On this kit, 10V on the 0-10V connection is 20,000 RPM, but the spindle is a 12,000 RPM unit, so I believe you would actually need to limit to 0-6V range (or, probably, 0-60% duty cycle PWM) on the SV control input.

If you want to run quiet, consider liquid-cooled instead of air-cooled. You don’t need a huge chiller. You can use a CPU water cooler radiator; that’s what @Eclsnowman did on at least his latest CNC router and it’s quite the beast. :smiling_face:

The issue right now is vibration. The motor seems to make far more on the Marlin controller than the GRBL that came with the kit. So far no one is willing to volunteer why this might be. But to me it’s clear. Voltage regulation versus PWM.

Chiller would be great if I were really using it enough to justify. But the compressor and pumps might just generate more vibration than I am reducing and now I have three motors instead of one.

This is the motor I have been looking at and comparing against what I find on Amazon, the long black ones. I have not measured to confirm if I need a new bracket but I probably do.

@mcdanlj I Spent some time this morning looking at the supply variant you showed me and to see if there were others like it. Unfortunately it looks like there is only one MFG with many sellers. So its a WYSIWYG. The same issue was true for the module linked by @jkwilborn. There thwere were at least 3 versions all had a 10-12V cut off for the driving side.

Can you adjust the PWM base frequency for the mosfet pin?

What you are describing could be caused by a low PWM frequency, if it is fairly low (50Hz-1KHz) then the on/off cycles pulse the spindle shaft at a frequency that will come out as a really noticible vibration+noise.

Even at higher frequencies you may hear a whine from the motor if they are at audible harmonics.

I have encountered this with 3d printer fans, upping the partcooler PWM frequency from 5KHz got rid of an incredibly irritating occasional whine from my printer…

Since it is common for bed heaters to be default-configured to a low frequency by default, this is something to check. Marlin should have configuration options for this.

Alternatively, a big 35V or higher capacitor in parallel with the motor should help, along with a discharge resistor and ideally a diode to guard against reverse voltages (which can be generated by the motor itself while spinning down).

Edit: If it is a frequency issue it should disappear at full speed, and be most obvious at low speeds under load.

1 Like

Good point but I dont think this is adjustable. At least not in Marlin.

I may be misunderstanding but fans, extruders and motors all seem to be tied to gether in a common clock cycle. Probably to maintain consistency and reduces cycles. But the result is that when you use PWM smoothing to say reduce fan noise, it effects extruders and other functions. I can redefine the spindle and give Marlin a different description. But I feel like that would just make it spin at the wrong speeds. I do need a tachometer to see if it’s even doing what I think it’s doing. But it also needs more torque. So thats something else to deal with.

I suspect the advice on controllers above is probably better than trying the ‘fix’ the current setup.

It can be changed in Marlin, but only by recompiling the firmware. If you are using spindle mode the default PWM frequency is 2.5KHz, it can be set independently of the fan pwm freq. For bed heating it often runs at 8Hz, spindle+laser mode allows this to change.

With PWM the frequency does not change, only the on/off ratio of signal varies to change the power (forgive me if you know this already) so things should be smooth at full power since the supply is fully on. But at half speed (50% pwm) you are basically driving it with a 2.5Khz square wave, and that 2.5K frequency will become noticeable.

GRBL allows you to set this with the $33 setting, and it is often defaulted to 5K for laser controllers. I think this is why you would see the vibration worsen just by changing controllers.

I’m not a big fan of Marlin for CNC / Laser use, part of this is that you need to recompile just to change basic settings. There are STM32 versions of GRBL and RepRap firmware available, but getting them running and configured on your board might be tricky even for the experienced… :wink:

GRBL-Hal has been my favorite and what I put on some diode lasers I have but it does requires a 128K or greater version of the STM32 chips. grblHAL · GitHub

1 Like

Sounds interesting, can you tell me more…
ESP32 PWM can be adjusted on the fly… but I would need to know way more of what exactly you want to do

All the 32bit controllers do much better than ATMEGA based ones since they typically have more flexible IO mappings, more timers, etc. Plus they have the performance to do software PWM where appropriate too.

For the ESP32 you need to use a twin-core dev board, add a SD card reader, then run FluidNC, (which evolved from GRBL-ESP32, but is now it’s own beast).

I’ve promoted FluidNC here before, I use it at home in my mini CNC and think it is great. It’s still evolving too and can now run multi-axis machines via I2C drivers etc…

  • All configuration is in a config file on the SD card, which you can edit by hand, including via the web interface.
  • You can have multiple config files for different machine configurations.
  • As a result the firmware can be installed / upgraded as a binary blob, no compilation needed.
  • The original $$ grbl config still exists, but is mapped to a much more capable config system that allows all your hardware, modes, etc to be modified from the terminal, which is part of the built in web interface.
  • It uses one core for movement, another for the web UI and SD access / queue / terminal etc…

that sounds quite interesting, I will check that out. GRBL is nice ,but to be honest the ATMEGA328p also does not really do it for me there… Having an ESP32 to do that could be an option in the long run, especially if I decide to do a fully custom controller board

1 Like