Page 1 of 1

Some little questions about PWM

Posted: Wed Feb 03, 2010 9:56 pm
by pitcelica
Hi, I have some questions for you and I think that some other people might find your answers really useful.

1- How the duty cycle precision is calculated vs PWM and freqency?
2- Is there some disadvantage to run a really high output frequency on a PWM valve? (example : 19.5hz MS settings and a 256 multiplier = 4992 hz output to PWM valve) Can I burn a PWM idle valve because of a too high frequency?

Thanks in advance!


Re: Some little questions about PWM

Posted: Thu Feb 04, 2010 12:05 am
by jbelanger
Do you mean the duty cycle precision in the MS or in the PWM converter? If you meant in the MS, that is dependent on the CPU and the code. If you meant in the PWM converter, it will depend on the input frequency and the multiplier. Without going into too many details, let's just say that the period of the signal is captured with a 16-bit timer and that this period is divided by the multiplier and used to generate the output signal.

And the disadvantage of running at a too high frequency is that you will generate more noise and heat and you might overwhelm the flyback diode. This probably won't hurt the valve but you may burn the transistor. That might be helped by another diode type but unless it's needed, there is no point.


Re: Some little questions about PWM

Posted: Thu Feb 04, 2010 7:00 pm
by pitcelica
I meant the duty cycle resolution in the MS (what is logged with Megalogviewer). I'm using v3.0 board and MS2Extra code (2.1.0). I'll switch to 3.0.3 soon.

Thanks for the input on the PWM valve frequency, I'll check for too much noise and too much heat when I'll try to find the best multiplier to use.