I'm trying to figure out some specifics about the PWM output. No luck on the forum, so maybe this could be a reference for others.

Questions:

1. Is there a set pulse rate for the PWM? If so, what is it? Or, does it change if you change the Kernel Speed?

2. If I set Pulley #1 to 0-100, does that mean that I can vary the PWM by using S0 - S100 in a G-Code line?

3. If I set the PWM Base Frequency at 500, that is a divisor into the the Kernel Speed. So, if Kernel Speed is 25000, the I have 25000 / 500 = 50 possible speeds. What are the ins / outs of setting the Frequency higher or lower. That is, if I set this at 10 do I get smoother output? Why would I set this higher or lower?

My guesses at the moment are: 1. No clue 2. Sounds right but I don't think it actually works that way 3. I think too small will make it jumpy

1. The base frequency and the kernel speed determine the resolution of the PWM output. The resolution is the number of PWM steps you have between 0 rpm and your maximum speed.

The resolution is determined by kernel Speed/PWM base frequency. So;

For Kernel speed of say 25KHz and a PWM base frequency of say 10Hz you end up with,

25000/10 = 2500 steps. If you have a PWM base frequency of say 100Hz then you get;

25000/100 = 250 steps.

If you have a spindle maximum speed of say 10,000rpm, then the resolution will be

4 rpm per step for the 1st example, 10000/2500 = 4. for the 2nd it will be 40rpm per step.

10000/250 = 40.

The higher you set the PWM frequency, the lower the resolution you can achieve. That said, an open loop speed control would be hard pressed to use a resolution of 4 rpm.

From a practical point of view I recommend a base frequency of 50hz. I provides good response and seems to be less affected by electrical noise.

2. The PWM output is a mark/space waveform calculated as a % of the maximum spindle speed. So if you set the max pulley speed to 1000, then the PWM output ratio is calculated as; PWM = Speed/Max Pulley Speed * 100. So if you set speed to 300rpm by S300 the PWM ratio will be

300/1000 *100 = 30%

3. I have found that a higher base PWM frequency, gives better noise protection.

If you have a low base frequency, you need more filtering to keep the output ripple down.

Cheers,

Peter.