-->
Page 1 of 3

PWM sync AC Light Dimmer Flicker need help.

PostPosted: Sat May 07, 2016 11:39 pm
by forlotto
people have eluded to PWM sync possibly being a problem when using pwm based dimming boards...

So here is a question I have is the sync a hardware issue with esp8266 or is sync a hardware issue with the module itself.

I am trying to pin down the "random filicker" problem in my dimming applications.

I have wasted quite a bit of cash already trying to nail it down however there are a few things I need to test and learn about hardware I suppose.

PWM signal for instance being that my LED light on board is also hooked to D4 on the nodemcu I am curious if this could be causing the flicker because of the draw causing fluctuations on the same pin from the led being tied to it.

Other things would be smoothing out the signal with caps I have yet to have a definitive explanation on what hardware at what values to use and on what pins to place these on while I have a great idea on how to do this it would be nice for a little guidance here while I am sure I could figure something out if you know share why not save me a bit of research if the answer is right there in your mind taking up valuable space.

If the esp8266 is the culprit what would be the cheapest and smallest fix to have a solid signal which would not cause flickering but still allow me to dim via pwm based zcd module. So possibly a module where I could set PWM on this module without sync issues I have seen a couple of people talk about pwm sync issue when talking on esp8266 projects so I am wondering if it is the other hardware that is having the sync problem or esp8266 itself that has the issue that causes flicker in my light dimming possibly?

Re: PWM sync AC Light Dimmer Flicker need help.

PostPosted: Sun May 08, 2016 3:21 am
by schufti
if you have wifi enabled, esp8266 definitively is the culprit.
The fw on the esp is kind of "multitasking" an only intermittently running "your" application whenever internal tasks (wifi, ip-stack, etc) allow; even pwm is lower priority. This manifets itself by the allways present watchdog that fires if your task doesn't return in time for the internal routines to commence.

Re: PWM sync AC Light Dimmer Flicker need help.

PostPosted: Sun May 08, 2016 5:45 am
by Barnabybear
Hi, I found the same thing all be it with DC dimming and went for a standalone PWM option. This ended up with 16 channels DC and 15 channels AC (not tested yet), I’m not sure it would be viable cost wise as a single channel, but my give you some ideas.
The basic concept is that you output via I2C the time settings to a PCA9685 PWM IC, and this then takes over the PWM side of things until you need to change its settings so the ESP can do whatever it wants with no disruption the PWM. The bit that makes things slightly more complicated is that there is no way for the PCA9685 to maintain its sync with the mains, so you have to check every second or so and adjust the timings. The maths says that it shouldn’t drift more than 0.25% per second.
Anyway the DC project can be found in the link below (better schematic link at the end of the second post) & the proposed AC modification in the link below that:
http://www.esp8266.com/viewtopic.php?f=152&t=8814&p=43214&hilit=entrant+77#p43214
http://doityourselfchristmas.com/forums/showthread.php?42352-First-time-with-Eagle-and-SMD-all-comments-welcome-before-I-order-these/page4
The PCA9685 data sheet is not the easiest to work through, but once you work out which bits you need it’s cool to work with. If this looks any good to you and you need some help, shout up (It's difficult to know the skill set of people when posting).

Re: PWM sync AC Light Dimmer Flicker need help.

PostPosted: Sun May 08, 2016 4:26 pm
by martinayotte
If the PWM signal is not in sync with a AC zero-crossing detection, it will always do some flickers with the AC.