Electronics > Projects, Designs, and Technical Stuff
PWM period control with rotary encoder - What does a user expect?
(1/1)
741:
I've written code to support altering PIC161x PWM period (and duty) via a rotary encoder.
For the duty it seems clear the user does indeed want to adjust duty time, so encoder movement maps simply to duty change. For the period, I am uncertain what seems natural.
As I tried adjusting PWM period, I found I actually expected control of frequency, but only to get to a ball-park value. After that, and with the 'scope timebase set appropriately, I then required good control of period.
Because f = 1/t, it takes ages to wind frequency down to minimum, but going from half to full frequency is very fast.
* Perhaps slow turns imply period-centric control, fast turns imply frequency-centric control?
rhodges:
I am currently working on a PWM project for controlling a small motor and pump. I am using a combination display and keypad, but I can easily pretend I am turning a knob.
I just picked 10khz and it looks pretty good on the scope. For my project. But as you imply (I think), it might be useful to change the PWM frequency to find what is ideal. And then, control the duty cycle. Maybe even going back and forth repeatedly.
So I would like to see a display that I can switch between duty cycle and PWM frequency. The button on the rotary encoder would be an obvious way to switch back and forth. The display would show maybe "F" and "P" (assuming a simple 7-segment module) to indicate frequency or PWM duty. Yes, it should be obvious that a 3-digit number (0% to 100%) is duty cycle and a 5-digit number is a frequency... But why not?
Navigation
[0] Message Index
Go to full version