Control spindle RPM through RAMPS

I’ve ordered 600W spindle with this 600W power supply:

Wow! That’s a big link! Hopefully it will get you to the item in question.

There is also a picture of the power supply attached.

Potentiometer (speed governor) comes in the package so some control of the spindle speed is possible and thing can be connected to the MACH3 controller so PWM speed control is also possible.

Since I’m a complete noob regarding RAMPS and cnc controllers, could someone explain to me how could this be connected to RAMPS (if even possible) and what to do in Estlcam to utilise RPM control through software?

Would I need some RPM meter attached or is current controlled through RAMPS/Estlcam like with speed governor that comes with it?

As I said, I’m a complete noob so if you draw me a picture, that would probably help a lot. :slight_smile:

Thank you!
Regards,
Walter

You can hook the PWM input on the controller up to the servo pins on the RAMPS. You’ll need to make some changes to marlin too. The link below has everything you’ll need.

http://forums.reprap.org/read.php?146,317303

OK, I understand now how to connect it.

Since I’ll be using Estlcam which uploads its own firmware onto arduino, real question would be if Estlcam uses same pin to control RPM?

UPDATE:

I found out which pin does Estlcam use for spindle control.

Could you post your findings along with what spindle and power supply you are using?

When you open Estlcam CNC Controller settings and choose Ramps from Pin layout you get list under Overview

photo EstlCamRAMPSpin_zps3xjkfa3a.jpg

I’ll be using this power supply:

https://www.aliexpress.com/item/600w-engraving-machine-dc-spindle-speed-control-power-supply-support-mach3-ontrol-110v-or-220v-spindle/32751323069.html?spm=2114.01010208.3.27.llUj9X&ws_ab_test=searchweb0_0,searchweb201602_1_10065_10068_433_434_10136_10137_10138_10060_10062_10056_10055_10054_302_10059_10099_10103_10102_10096_10052_10053_10050_10107_10051_10106_10084_10083_10119_10080_10082_10081_10110_10111_10112_10113_10114_10078_10079_10073_10070_10122_10123_10120_10126_6000000_10124-10120,searchweb201603_4,afswitch_1_afChannel,ppcSwitch_5,single_sort_0_default&btsid=c5923a7f-420f-432c-8cae-7f177094620f&algo_expid=bb7580d4-8825-4cfc-b5df-6f38bafd6b15-3&algo_pvid=bb7580d4-8825-4cfc-b5df-6f38bafd6b15

and this spindle:

I’m not certain about this wiring:

photo Spajanje napajanja_zpsr8lyvqcw.jpg

Half of the sellers show that potentiometer should be wired on 5V side, other half show that it should be wired on 10V side
I’m afraid that I won’t get any readable manual with the power supply so I hope I won’t burn it up trying to connect it.

You pictures are not working. I am having a hard time geting pin d23 to output full power to trip a laser relay.

Please clarify:

What version of Estlcam CNC Controller you showing here? Have Estlcam 11.108

only showing Arduino Mega, not Mega 2560/Ramps 1.4, unless there is a difference between registered version and evaluation version.

Also, what pins on Ramps 1.4 are you using, cannot find anything difinative on web.

Christian stopped support of the mega/ramps stack. It didn’t work very well to begin with anyway.

Did you ever get the RPM controls working? I am thinking about ordering this 600W spindle that Ryan has linked in the build instructions: https://www.amazon.com/Daedalus-Brushless-brushless-Switching-Engraving/dp/B083XQ9NF1/

I would like to control it with the SKR Pro1.2.

Spindle control through RAMPS board was the hardest nut for me to crack in my MPCNC project.

I saw this post many times in my searches but eventually tracked down a few things that may help others.

I am using two RAMPS boards, 1.4 and 1.6. I discovered that the V1Engineering dual endstop (and also default Marlin code) use pin 4 to PWM control the spindle speed. On my RAMPS boards that is the SECOND set of servo pins from the Reset button.

But I also discovered that alone was not enough.

You also have to enable it in the firmware. Spindle control is disabled by default. This involves uncommenting the line #define SPINDLE_FEATURE in Configuration_adv.h in Marlin 2.0.7.x

And once I was there I saw there was 3 ways to specify the spindle speed…
PWM255 (the default, using M3 S0 through M3 S255 to set from off to full)
PERCENT (using M3 S0 through M3 S100 to set from off to full)
RPM (using M3 S0 through M3 S50000) to set from off to full…)

I opted for RPM since that looked like the obvious… and nothing worked… went back to PWM255 and worked fine so I set my tools to use RPM from 0 to 255 (lazy fix) until I could figure it out…

Well another day of debugging and I did figure it out… its a bug in marlin in 8 bit controllers as far as I can tell. In src>>features>>spindle_laser.h there is a section called class SpindleLaser and in there the following line has an issue:

return unitPower ? round(100 * (cpwr - SPEED_POWER_FLOOR) / (SPEED_POWER_MAX - SPEED_POWER_FLOOR)) : 0;

I found a reference on the Marlin github to the following change that worked for me… its just adding the float (as I commented):

return unitPower ? round(100 * float(cpwr - SPEED_POWER_FLOOR) / (SPEED_POWER_MAX - SPEED_POWER_FLOOR)) : 0; //TJ added float

Hope that saves others the same grief I suffered.

Followup to the above…

I started having random milling errors. It would random detour… so far the way I have resolved these is to disable the spindle control. My current working theory is that spindle control is probably fine IF you are using PWM255 mode on an 8 bit RAMPS/mega256 setup but the RPM mode may be causing corruption elsewhere even thought RPM seems to be working… So for now I would hold off on the RPM fix and use PWM255 until I confirm.

I saw you replied to my thread too, but I’ll keep it here because this is where you have the marlin fix documented.

I haven’t had any issues in the few days I’ve been running my machine with spindle rpm control, with the floating decimal fix. I set the max to 12000 because that’s what my spindle can do, and I’m able to use M3 S0 through S12000 perfectly. I have an RC filter to smooth out the PWM to a constant DC.

What do you mean my detour? There would be random spindle speed changes while running a job?

How long has your setup been working before it started behaving strangely?

1 Like