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

More than 8ch #24

Closed
kleurbleur opened this issue Aug 14, 2021 · 27 comments
Closed

More than 8ch #24

kleurbleur opened this issue Aug 14, 2021 · 27 comments
Labels
bug Something isn't working reproducible

Comments

@kleurbleur
Copy link

I'm using three RobotDyn 4ch dimmer boards all getting their power from a MeanWell 5V 3.4A power supply. Since they're connected to the same 230V 50Hz power outlet they also all have their zero-cross connected to the Ardiuno Uno GPIO 2.

In total I have 12 channels and if I mix the channels around spread across the boards the first 8 of the list work. I tested this by putting the last not working 4 channels in the beginning of the list and vice versa. Result was that the ones that did not work worked, and the others didn't.

Now I checked the source code and changed the on line 95 in file dimmable_light.h from 8 to 12, but to no avail. Does anybody know how to raise the limit of the maximum amount of channels?

@kleurbleur
Copy link
Author

I have to run some extra tests, but the test above seems to run good now. I raised the number of maximum lights to 12 by adjusting static const uint8_t N = 8; to 12 on line 91 in thrystor.h

@bcelary
Copy link

bcelary commented Mar 20, 2023

would be great to know if this limit could be increased to 16. I am using Arduino Mega and was hoping to get up to 16 dimmers. not sure if anyone has tried increasing to this max number...?

@fabianoriccardi
Copy link
Owner

Technically there is no limit (leaving out the memory and pins) to the number of dimmers.

Just change the "soft" limit to the desired value here:

static const uint8_t N = 8;

and here:

static const uint8_t N = 8;

@bcelary
Copy link

bcelary commented Mar 21, 2023

Glad to hear that. Maybe it is worth adding this in a comment so when others look at the limitation, they are going to be less concerned with making a change. Or perhaps maybe make it adjustable at the compile time?

I have cloned the repo anyway as I think I might need to also be able to retrieve the pin number from the thyristor class. This is handy when I have an array of dimmers.

@fabianoriccardi
Copy link
Owner

I have never tested more than 8 dimmers, so I didn't want to document what it is not tested. However, if you have succeeded, I will add a note and eventually I can add an easier way to increment the max number of dimmers.

@Mangata42
Copy link

Hey @kleurbleur @bcelary , did you manage to go up to 16 lights?
I've changed the lines mentionned in the lib but to no success, I'm having a lot of flickering issues above 8 lights. It's worth mentionning that I'm using a 5v5A power unit.
Thanks!

@kleurbleur
Copy link
Author

I did not test it above 12, but flickering can happen if the zero cross is not good.
Are all the lamps the same?
Do they use the same power source?
What happens if you swap them around?

@Mangata42
Copy link

@kleurbleur Wow, first of all thank you for your fast answer even after 2years!
The lamps are all the same indeed, and they use the same power source. Swapping them around does not change anything.
I think that it might be the fact that only one RoboDyn dimmer board is connected to the Zero-Cross pin of the Arduino, but overall it's a mechanism with 4 dimmer boards all connected to one Arduino. I should try this tomorrow.

@kleurbleur
Copy link
Author

How I read my opening post I all different boards should have their zero-cross connected to the same Arduino pin indeed. Otherwise the board doesn't know when to do the dimming and you get flickering.

@fabianoriccardi
Copy link
Owner

Which board are you using?
I don't think using a single ZC pin is an issue, since I guess your lamps are all connected to the same AC network, hence they share the same AC frequency and phase.

Do the lamps work properly with a single board (4 lamps)?

@Mangata42
Copy link

I'm using the RoboDyn 4CH board. My lights are all on the same AC indeed.
Yes, your code works perfectly with up to two dimmable boards together, so 8 lights, but above that, it flickers an awful lot.
I'm trying to achieve 4 dimmable boards, so 16 lights bulbs all controlled by one Arduino.
I might try connecting all of the zero cross to the Arduino but logically speaking I guess one is enough.

Thank you for your help :)

@fabianoriccardi
Copy link
Owner

That's fine. Which Arduino board are you using? Arduino UNO, Arduino mega, or other? I need to know at least the generic platform you are working with.

Moreover, if you control only 9 lamps, do they run smoothly?

@Mangata42
Copy link

Sorry forgot to mention the board!
I'm using Arduino Mega 2560. It works fine with 8 but starts flickering with 9. Might be software related?

@fabianoriccardi
Copy link
Owner

I guess, but I have to give it a closer look.

@Mangata42
Copy link

I'll try connecting all of the Z-C to the Arduino tomorrow and see if that changes anything. I'll keep you updated.
Thank you, you're a saint.

@fabianoriccardi
Copy link
Owner

For now, I can tell I can replicate issue.

@Mangata42
Copy link

Mangata42 commented Nov 1, 2023 via email

@Mangata42
Copy link

Hello again.
I just tried to connect all of the zero-cross of each dimmable light boards to the Arduino, but still the same issue unfortunately above 8 lights, violent flickering.
@kleurbleur How did you manage to go up to even 12? I feel like the only difference in our circuitry would be the Arduino (I have a mega) but still.
Thanks!

@kleurbleur
Copy link
Author

I was using an ESP32 so maybe that's the difference? But this is al a long time ago for me and the company I made it for got bankrupt in the end so I salvaged most parts and took my loss. I don't have documentation of it I'm afraid.

@Mangata42
Copy link

@kleurbleur Holy shit lol that's a story on it's own. It's alright, thank you anyway! Hope you're doing good now.

@fabianoriccardi
Copy link
Owner

May you post a MCVE sketch that makes the lamps flicker?

@Mangata42
Copy link

May you post a MCVE sketch that makes the lamps flicker?

Sure, here you go: Gist Code

@fabianoriccardi
Copy link
Owner

fabianoriccardi commented Nov 4, 2023

This is not exactly an MCVE since it requires the device that sends the messages through Ethernet.

However, I have investigated a bit and I have found an issue that introduces the flickering when many dimmers are controlled.

@Mangata42
Copy link

That's great news! Is it something you can fix?

@fabianoriccardi
Copy link
Owner

I hope so. I have pushed a possible fix to branch https://github.com/fabianoriccardi/dimmable-light/tree/fix-16-dimmers . Can you test it on your setup?

@Mangata42
Copy link

Thank you Fabiano. Sure, I'll give it a go as soon as I can and let you know how it went. Thanks a lot!

@fabianoriccardi fabianoriccardi added the bug Something isn't working label Nov 12, 2023
@fabianoriccardi
Copy link
Owner

Closing as v1.5.2 (which includes the fix) is out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working reproducible
Projects
None yet
Development

No branches or pull requests

4 participants