Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output pin uncertain state #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Mesmer88
Copy link

Between the two if branches at the end, the state of output pin is inconsistent.
Changed this:

Added else clause
Set timer counter to 32, in order to cover time between zero cross on 50Hz
Increase pulse width to 10

This solved for me the issues with flickering and bad load control.

Between the two if branches at the end, the state of output pin is inconsistent.
Changed this:

Added else clause
Set timer counter to 32, in order to cover time between zero cross on 50Hz
Increase pulse width to 10

This solved for me the issues with flickering and bad load control.
@Mesmer88 Mesmer88 mentioned this pull request Apr 19, 2019
@raduangelescu
Copy link

I tested the fix, and it indeed fixes all the problems I had with blinking and inconsistent controll. Thanks Mesmer88

@Mri007
Copy link

Mri007 commented May 6, 2019

Any Idea about the fix with ESP8266?

@Mesmer88
Copy link
Author

Mesmer88 commented May 6, 2019

I think it should also work fro ESP8266.
You just need to do the same edits in the different header library.

Basically this one:

RBDDimmer/src/esp8266/RBDmcuESP8266.cpp

@Mri007
Copy link

Mri007 commented May 6, 2019

Yeap I tried. But the problem is i can only change the pulse width to 10. And not sure about "Set timer counter to 32,"

There are no option like esp32, "timerAlarmWrite(timer, 32, true)"

@Mesmer88
Copy link
Author

Mesmer88 commented May 6, 2019

Actually that part is not that important. During my own calculations i thought that the original ones was a bit off, but it shouldn't matter much.

Can you try just changing the PIN loop to this one??

Replace

		if (dimCounter[k] >= dimPulseBegin[k] )
		{
			digitalWrite(dimOutPin[k], HIGH);	
		}

with

		if (dimCounter[k] >= dimPulseBegin[k] )
		{
			digitalWrite(dimOutPin[k], HIGH);	
		} else 
			digitalWrite(dimOutPin[k], LOW);

On line 185 for ESP8266 file?

@Mri007
Copy link

Mri007 commented May 6, 2019

Sure, will try.

@Mri007
Copy link

Mri007 commented May 7, 2019

Update:: Doing so didnt solve flickering :(

@raduangelescu
Copy link

while the fix fixed flickering on esp32 for my lamp when I tested it with a heater element it seems that it still doesn't work properly. Setting the power level to 0 seems to not shut down AC on the load, so I am guessing the light thing is just fortunate but the actual range of output is not covered.

@ChristopherJBarr
Copy link

I just tried the changes you recommended with the ESP8266 and still got mad flickering (it's probably best if you mute before watching, the robot vacuum was buzzing around me):

https://www.dropbox.com/s/67gne6dozlg0s8e/Video%2017-05-2019%2C%2017%2027%2041.mov

For context, I have a capacitive touch lamp that I'm modding to be a smart lamp. The touch/light level logic is all working fine (tested with an LED), that's what you can see in the serial monitor. It doesn't matter what level I set it to, it's chaos. Even setting it to 0 causes flashing. Here's the slightly different flashing with the original version of the code:

https://www.dropbox.com/s/9bd4i49j05g0xrk/Video%2017-05-2019%2C%2017%2039%2037.mov

I'm going to keep digging into RBDmcuESP8266.cpp, try to understand it more and see if there's anything I can tweak. If anyone has any ideas though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants