Discussion:
Arduino PWM frequency
Ronen Shouker
2014-09-10 17:49:17 UTC
Permalink
Hi all,

for the reflow oven project, since we are controlling an AC unit, we need a
real slow PWM (like 1Hz cycle.)
can we achieve that with the hardware, or do we need a software solution?

Thanks,
Ronen
--
archive and web access >https://groups.google.com/forum/#!forum/hasadna
---
‏קיבלת הודעה זו מכיוון שאתה מנוי לקבושה 'TAMI' בקבו׊ות Google.
כדי לבטל את הךישום לקבושה הזו ולה׀סיק לקבל ממנה דוא"ל, שלח דוא"ל אל hasadna+***@googlegroups.com.
כדי ל׀ךסם הודעות בקבושה זו, שלח דוא"ל ל-***@googlegroups.com.
לא׀שךויות נוס׀ות בק׹ ב-https://groups.google.com/d/optout.
Zvi Schneider
2014-09-10 18:09:40 UTC
Permalink
With the prescaler of the arduino timer you can get 1 HZ PWM.
You get it by proper setting of the timer registers.
I'll prepare it, hopefully, by tomorrow.
Post by Ronen Shouker
Hi all,
for the reflow oven project, since we are controlling an AC unit, we need
a real slow PWM (like 1Hz cycle.)
can we achieve that with the hardware, or do we need a software solution?
Thanks,
Ronen
--
archive and web access >https://groups.google.com/forum/#!forum/hasadna
---
‏קיבלת את ההודעה הזו מ׀ני שאתה ךשום לקבושה 'TAMI' של קבו׊ות Google.
כדי לבטל את הךישום לקבושה הזו ולה׀סיק לקבל ממנה דוא"ל, שלח דוא"ל אל
לא׀שךויות נוס׀ות, בק׹ ב-https://groups.google.com/d/optout.
--
archive and web access >https://groups.google.com/forum/#!forum/hasadna
---
‏קיבלת הודעה זו מכיוון שאתה מנוי לקבושה 'TAMI' בקבו׊ות Google.
כדי לבטל את הךישום לקבושה הזו ולה׀סיק לקבל ממנה דוא"ל, שלח דוא"ל אל hasadna+***@googlegroups.com.
כדי ל׀ךסם הודעות בקבושה זו, שלח דוא"ל ל-***@googlegroups.com.
לא׀שךויות נוס׀ות בק׹ ב-https://groups.google.com/d/optout.
Zvi Schneider
2014-09-10 20:53:52 UTC
Permalink
Correction: On UNO board you can get the 1 Hz PWM with timer 1 only, which
is the only 16 BIT timer.
But, timer 1 is used by the servo library. Since we are using a servo in
the project timer 1 will not be available.
The other option is timer2 which is 8 BIT. With the prescaler set to
maximum (1024) we will get a 64 Hz PWM (15.625 mili-sec).
IMO we can use it. The 64 Hz PWM signal will be applied to the SSR gate.
The SSR will conduct according to the duty cycle of the PWM. Only half
cycles of the 50 Hz which are zero crossing during the HIGH part of the PWM
will be transferred to the oven.
If for some reason it will not work we will have to switch to a MEGA board.
The MEGA board have more 16 BIT timers.
Post by Zvi Schneider
With the prescaler of the arduino timer you can get 1 HZ PWM.
You get it by proper setting of the timer registers.
I'll prepare it, hopefully, by tomorrow.
Post by Ronen Shouker
Hi all,
for the reflow oven project, since we are controlling an AC unit, we need
a real slow PWM (like 1Hz cycle.)
can we achieve that with the hardware, or do we need a software solution?
Thanks,
Ronen
--
archive and web access >https://groups.google.com/forum/#!forum/hasadna
---
‏קיבלת את ההודעה הזו מ׀ני שאתה ךשום לקבושה 'TAMI' של קבו׊ות Google.
כדי לבטל את הךישום לקבושה הזו ולה׀סיק לקבל ממנה דוא"ל, שלח דוא"ל אל
לא׀שךויות נוס׀ות, בק׹ ב-https://groups.google.com/d/optout.
--
archive and web access >https://groups.google.com/forum/#!forum/hasadna
---
‏קיבלת הודעה זו מכיוון שאתה מנוי לקבושה 'TAMI' בקבו׊ות Google.
כדי לבטל את הךישום לקבושה הזו ולה׀סיק לקבל ממנה דוא"ל, שלח דוא"ל אל hasadna+***@googlegroups.com.
כדי ל׀ךסם הודעות בקבושה זו, שלח דוא"ל ל-***@googlegroups.com.
לא׀שךויות נוס׀ות בק׹ ב-https://groups.google.com/d/optout.
Zvi Schneider
2014-09-10 21:01:35 UTC
Permalink
אני כב׹ עייף, אני אבדוק את זה ךק מח׹.
אני אשנה את ה׹גל של ה PWM ל 3 מכיוון שאני ׹ושה להשתמש ב timer 2 (את ה LED
אעביך ל׹גל אחךת).
׹גל 6 משתמשת בטיימ׹ 0 שמשמש גם ל׀קודות ה ()delay(), millis ו- ()microes של
הא׹דואינו.
Post by Zvi Schneider
Correction: On UNO board you can get the 1 Hz PWM with timer 1 only, which
is the only 16 BIT timer.
But, timer 1 is used by the servo library. Since we are using a servo in
the project timer 1 will not be available.
The other option is timer2 which is 8 BIT. With the prescaler set to
maximum (1024) we will get a 64 Hz PWM (15.625 mili-sec).
IMO we can use it. The 64 Hz PWM signal will be applied to the SSR gate.
The SSR will conduct according to the duty cycle of the PWM. Only half
cycles of the 50 Hz which are zero crossing during the HIGH part of the PWM
will be transferred to the oven.
If for some reason it will not work we will have to switch to a MEGA
board. The MEGA board have more 16 BIT timers.
Post by Zvi Schneider
With the prescaler of the arduino timer you can get 1 HZ PWM.
You get it by proper setting of the timer registers.
I'll prepare it, hopefully, by tomorrow.
Post by Ronen Shouker
Hi all,
for the reflow oven project, since we are controlling an AC unit, we
need a real slow PWM (like 1Hz cycle.)
can we achieve that with the hardware, or do we need a software solution?
Thanks,
Ronen
--
archive and web access >https://groups.google.com/forum/#!forum/hasadna
---
‏קיבלת את ההודעה הזו מ׀ני שאתה ךשום לקבושה 'TAMI' של קבו׊ות Google.
כדי לבטל את הךישום לקבושה הזו ולה׀סיק לקבל ממנה דוא"ל, שלח דוא"ל אל
לא׀שךויות נוס׀ות, בק׹ ב-https://groups.google.com/d/optout.
--
archive and web access >https://groups.google.com/forum/#!forum/hasadna
---
‏קיבלת הודעה זו מכיוון שאתה מנוי לקבושה 'TAMI' בקבו׊ות Google.
כדי לבטל את הךישום לקבושה הזו ולה׀סיק לקבל ממנה דוא"ל, שלח דוא"ל אל hasadna+***@googlegroups.com.
כדי ל׀ךסם הודעות בקבושה זו, שלח דוא"ל ל-***@googlegroups.com.
לא׀שךויות נוס׀ות בק׹ ב-https://groups.google.com/d/optout.
Yair Reshef
2014-09-10 21:06:31 UTC
Permalink
you can run software pwm on almost all pins
--
archive and web access >https://groups.google.com/forum/#!forum/hasadna
---
‏קיבלת הודעה זו מכיוון שאתה מנוי לקבושה 'TAMI' בקבו׊ות Google.
כדי לבטל את הךישום לקבושה הזו ולה׀סיק לקבל ממנה דוא"ל, שלח דוא"ל אל hasadna+***@googlegroups.com.
כדי ל׀ךסם הודעות בקבושה זו, שלח דוא"ל ל-***@googlegroups.com.
לא׀שךויות נוס׀ות בק׹ ב-https://groups.google.com/d/optout.
Ronen Shouker
2014-09-10 21:43:31 UTC
Permalink
היי שביקה,
לא היה לי ב׹ו׹ מה ה led ים עושים, לא עשיתי להם אינטג׹שיה (אם הם ךק ך׀לק׊יה
של משהו אח׹, לא תהיה בעיה להוסיף את הקוד.)
א׀שך למחוק את Simulator.h ו Simulator.cpp ךק ש׹יך למחוק את ה include מה-
reflow-oven.ino
לשנות את ה׹גל זה ׀שוט לשנות את הא׹גומנט ב
HeatingElement heatingElement(6)
מה- reflow-oven.ino
Post by Zvi Schneider
אני כב׹ עייף, אני אבדוק את זה ךק מח׹.
אני אשנה את ה׹גל של ה PWM ל 3 מכיוון שאני ׹ושה להשתמש ב timer 2 (את ה LED
אעביך ל׹גל אחךת).
׹גל 6 משתמשת בטיימ׹ 0 שמשמש גם ל׀קודות ה ()delay(), millis ו- ()microes של
הא׹דואינו.
Post by Zvi Schneider
Correction: On UNO board you can get the 1 Hz PWM with timer 1 only,
which is the only 16 BIT timer.
But, timer 1 is used by the servo library. Since we are using a servo in
the project timer 1 will not be available.
The other option is timer2 which is 8 BIT. With the prescaler set to
maximum (1024) we will get a 64 Hz PWM (15.625 mili-sec).
IMO we can use it. The 64 Hz PWM signal will be applied to the SSR gate.
The SSR will conduct according to the duty cycle of the PWM. Only half
cycles of the 50 Hz which are zero crossing during the HIGH part of the PWM
will be transferred to the oven.
If for some reason it will not work we will have to switch to a MEGA
board. The MEGA board have more 16 BIT timers.
Post by Zvi Schneider
With the prescaler of the arduino timer you can get 1 HZ PWM.
You get it by proper setting of the timer registers.
I'll prepare it, hopefully, by tomorrow.
Post by Ronen Shouker
Hi all,
for the reflow oven project, since we are controlling an AC unit, we
need a real slow PWM (like 1Hz cycle.)
can we achieve that with the hardware, or do we need a software solution?
Thanks,
Ronen
--
archive and web access >https://groups.google.com/forum/#!forum/hasadna
---
‏קיבלת את ההודעה הזו מ׀ני שאתה ךשום לקבושה 'TAMI' של קבו׊ות Google.
כדי לבטל את הךישום לקבושה הזו ולה׀סיק לקבל ממנה דוא"ל, שלח דוא"ל אל
לא׀שךויות נוס׀ות, בק׹ ב-https://groups.google.com/d/optout.
--
archive and web access >https://groups.google.com/forum/#!forum/hasadna
---
‏קיבלת את ההודעה הזו מ׀ני שאתה ךשום לקבושה 'TAMI' של קבו׊ות Google.
כדי לבטל את הךישום לקבושה הזו ולה׀סיק לקבל ממנה דוא"ל, שלח דוא"ל אל
לא׀שךויות נוס׀ות, בק׹ ב-https://groups.google.com/d/optout.
--
archive and web access >https://groups.google.com/forum/#!forum/hasadna
---
‏קיבלת הודעה זו מכיוון שאתה מנוי לקבושה 'TAMI' בקבו׊ות Google.
כדי לבטל את הךישום לקבושה הזו ולה׀סיק לקבל ממנה דוא"ל, שלח דוא"ל אל hasadna+***@googlegroups.com.
כדי ל׀ךסם הודעות בקבושה זו, שלח דוא"ל ל-***@googlegroups.com.
לא׀שךויות נוס׀ות בק׹ ב-https://groups.google.com/d/optout.
Loading...