Searching \ for '[EE] Looking for tutorials about PWM.' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/io/pwm/index.htm?key=pwm
Search entire site for: 'Looking for tutorials about PWM.'.

Exact match. Not showing close matches.
PICList Thread
'[EE] Looking for tutorials about PWM.'
2010\04\10@122942 by Massimo Gaggero

flavicon
face
I would design a control panel with analog indicators driven by PWM
outputs of a PIC. Does anyone can suggest me a easy/friendly tutorial
about PWM theory?
I would prefer to know the theory and then follow to PIC implementation
instead of start coding and then asking why it doesn't work as I would :)

Massimo.

--
  ____  ____  ____  _  _
 / ___)| __ \/ ___)/ /| | Dott. Massimo Gaggero
| (___ |    /\___ \\__  | Expert Software Engineer
 \____)|_|\_\(____/   |_| Advanced Computing and Communications -
Distributed Computing
E-mail: spam_OUTmaxTakeThisOuTspamcrs4.it       Phone: +39 070 9250 329

2010\04\10@132747 by Tamas Rudnai

face picon face
Hi Massimo,

I think this might help you:

http://www.mikroe.com/en/books/picmcubook/ch5/

<http://www.mikroe.com/en/books/picmcubook/ch5/>Tamas


On Sat, Apr 10, 2010 at 5:29 PM, Massimo Gaggero <.....maxKILLspamspam@spam@crs4.it> wrote:

{Quote hidden}

> -

2010\04\10@153539 by Michael Watterson

face picon face
Massimo Gaggero wrote:
> I would design a control panel with analog indicators driven by PWM
> outputs of a PIC. Does anyone can suggest me a easy/friendly tutorial
> about PWM theory?
> I would prefer to know the theory and then follow to PIC implementation
> instead of start coding and then asking why it doesn't work as I would :)
>
> Massimo.
>
>  
1) repeat rate has to be high enough that leds etc don't flicker.  Below
12Hz is very flickery. Above 20Hz isn't bad (Film used to be 24, but
they show each frame twice to give 48). I recommend 50Hz or 60Hz
depending on local mains, then if pictures are taken and camera is set
for local mains frequency, quality is better.

2) duty cycle sets the brightness. 1 on in 256 is dim, 255 on in 256 is
bright. (or vice versa if LED driven the other way)

3) Resolution sets the steps of brightness (8 is plenty). the PWM
counter one bit time is 256 x repeat rate.

4) Using PIC HW PWM register is optional. You can also use a 50 Hz x 100
(or 60Hz times) timer interupt and a software counter used to count mark
and space times. Count  Low + Count High = 100, for 100 steps of brightness.



2010\04\11@100839 by Olin Lathrop

face picon face
Massimo Gaggero wrote:
> I would design a control panel with analog indicators driven by PWM
> outputs of a PIC. Does anyone can suggest me a easy/friendly tutorial
> about PWM theory?

This is very basic stuff that anyone who can spell EE can easily figure out
from first principles.  Analog meters are slow mechanical systems, so they
will display the average value of the PWM pulse wave.  For examle, a 0 to 5V
square wave will look like 2.5 volts to the meter.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2010\04\11@101602 by Olin Lathrop
face picon face
Michael Watterson wrote:
> 1) repeat rate has to be high enough that leds etc don't flicker.  Below
> 12Hz is very flickery. Above 20Hz isn't bad (Film used to be 24, but
> they show each frame twice to give 48). I recommend 50Hz or 60Hz
> depending on local mains, then if pictures are taken and camera is set
> for local mains frequency, quality is better.

That will noticably flicker for most people.  LEDs have sharp on and off.
You need a few 100 Hz to get them to look steady, especially at low duty
cycles.  Then the flicker will still be visible as the eyes pan accross the
light.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2010\04\11@103618 by Michael Watterson

face picon face
Olin Lathrop wrote:
> Michael Watterson wrote:
>  
>> 1) repeat rate has to be high enough that leds etc don't flicker.  Below
>> 12Hz is very flickery. Above 20Hz isn't bad (Film used to be 24, but
>> they show each frame twice to give 48). I recommend 50Hz or 60Hz
>> depending on local mains, then if pictures are taken and camera is set
>> for local mains frequency, quality is better.
>>    
>
> That will noticably flicker for most people.  LEDs have sharp on and off.
> You need a few 100 Hz to get them to look steady, especially at low duty
> cycles.  Then the flicker will still be visible as the eyes pan accross the
> light.
>  
The faster you pan, the more noticeable the flicker. Even a few 100Hz is
noticeable if it's moving.  There are moving stick/wheels with LED rows
that use this to draw flickery text.

Using the series resistor at the PIC and a suitable capacitor, then
wires to the LED will reduce flicker and RFI.

Same applies to driving moving coil/iron physical meters. at lower
frequency you may see the needle blur and may hear a buzz. So some sort
of basic RC filter incorporating the R the meter or LED needs may be a
good idea.

I use PWM to vary brightness of an LCD back light. Perhaps because it's
a larger area, the flicker effects being accentuated by movement are
less. I will check what frequency it is.


2010\04\12@071308 by Russell McMahon

face picon face
> This is very basic stuff that anyone who can spell EE can easily figure out

The immediately following posts suggests that there appears to be more
to spelling  ee / eE / EE /  Ee / eieio than may at first meet the eye
:-). Or the ear. The comments on eg mux rate and visible flicker would
be new to many. The comment on motion effect on mux rate flicker also.
Meter hum as opposed to needle flicker may not occur to people.

I also thought that the initial question was a perhaps less good one
than it could have been. And I was agreeably surprised at the amount
of generally useful comment it elicited.

Some years ago I implemented microstepping of a stepper motor to
achieve smooth variable speed slow motion rotation of a pointer for a
disability aid. PIC with software PWM used AFAIR. Lots of fun. Audio
resonances of the stepper motor and needle system gave some
interesting results. The end result was agreeably smooth. I used a
stepper motor available from RS components because product volumes
were modest and motor availability on demand was more important than
lowest price. On subsequently trying some other stepper motors I found
that the RS motor performed substantially better than the available
alternatives and that I had had a lucky break. I could very probably
have optimised the result for the other steppers but was fortunate in
not having to do so.


                 Russell

More... (looser matching)
- Last day of these posts
- In 2010 , 2011 only
- Today
- New search...