Hello Guest it is November 27, 2021, 06:17:16 AM

Author Topic: Spindle motor setup, need some coaching  (Read 67 times)

0 Members and 1 Guest are viewing this topic.

Spindle motor setup, need some coaching
« on: September 30, 2021, 02:23:34 PM »
Running Mach3 Ver R3.041 under Win Xp (Yes, it's ancient, I'm ancient.  It's working great, leave it alone)

Trying to set up a PWM output for the spindle motor on a new machine, having a struggle getting the PWM pulse width to go where I want it vs RPM.  Under ports and pins I set PWM base freq at 100 Hz.  I go over to Spindle pulley selection and set a max speed, run it with a logic analyzer on the PWM pin and look at what I am getting for PWM duty cycle.  I can run the max speed up and down and get the PWM duty cycle I want for a given spindle speed (2000 RPM) but I can't seem to get control of the delta PWM duty cycle vs RPM.  Changing to different RPM (4000 RPM) does not track the curve I need to be on. (by a bunch).

Nothing I have tried so far seems to just change the slope of the line that represents PWM duty cycle to RPM.

What can I change to be able to get (at least approximately) the PWM duty cycle to RPM profile where I need it?  What is driving the relationship from RPM to PWM duty cycle.  I thought it should be linear ( double the speed in RPM should double the PWM duty cycle.)  It doesn't seem to be working that way.

I have plowed thru the Mach install config docs several times but haven't tripped the magic button yet.  I just can't seem to get my head properly into it.

Open to any and all suggestions. (Except don't suggest Mach4).
Re: Spindle motor setup, need some coaching
« Reply #1 on: September 30, 2021, 04:45:18 PM »
Well, on second thought, never mind.  Found the problem, as usual right in front of my face and didn't see it.

Mach assumes (reasonably) that zero RPM is at zero percent PWM output.  For what ever reason (and I don't have a clue why that is, it just IS) the system I am working with requires about an 11% PWM cycle starting at zero RPM.  I actually had the data down to 500 RPM, just never plotted it out and looked at it backplotted thru zero.  Sure enough, its a straight line but it just doesn't go thru zero PWM = zero RPM, it has an offset in it.

Mach can't do that, so I am just going to set Mach to be correct at 2000 RPM (which is where about 95%+ of my G-Code runs) and make up a cheat sheet of RPM I want versus RPM I have to program into the G-code when I want some other speed. 

Lousy choice, that's as good as it gets.  I love computers.