prusa3d / Prusa-Firmware-ESP32-Cam

Firmware for ESP32 Cam modules to be used in Prusa Connect
GNU General Public License v3.0
97 stars 10 forks source link

ESP32 flash Hz bar artefacts #38

Closed Simon7381 closed 5 days ago

Simon7381 commented 1 month ago

There seems to be a Hz interference with the LED used for the flash. Please note, I have rotated the image 270d, so these are horizontal banding lines with the print bed to the right and extruder at the bottom.

I'm in the UK with 50Hz electricity, with ESP32 from https://amzn.eu/d/54PickP I've tried different USB power supplies, including a battery to eliminate the 50Hz mains frequency.

I guess this is the LED on the board, but is it I've got a bad board or is this some LED driver pulsing the flash, is there any setting that can be done to eliminate or tune out this interference banding?

johnyHV commented 1 month ago

Hello @Simon7381. I am in the EU and also have 50Hz electricity. I haven't seen this problem yet. Currently, you need to manually change the setting in the code, in the mcu_cfg.h file, and variable

`

define FLASH_ON_STATUS 205 ///< PWM intensity LED for ON. limitation to 80%. 2^FLASH_PWM_RESOLUTION * 0.8% = 204

define FLASH_PWM_FREQ 2000 ///< frequency of pwm [240MHz / (100 prescale * pwm cycles)] = frequency

`

In the future I can added new parameter on the WEB page, for settings PWM intensity. Can you test change at first step FLASH_ON_STATUS ?

Simon7381 commented 1 month ago

Hello @Simon7381. I am in the EU and also have 50Hz electricity. I haven't seen this problem yet. Currently, you need to manually change the setting in the code, in the mcu_cfg.h file, and variable

`

define FLASH_ON_STATUS 205 ///< PWM intensity LED for ON. limitation to 80%. 2^FLASH_PWM_RESOLUTION * 0.8% = 204

define FLASH_PWM_FREQ 2000 ///< frequency of pwm [240MHz / (100 prescale * pwm cycles)] = frequency

`

In the future I can added new parameter on the WEB page, for settings PWM intensity. Can you test change at first step FLASH_ON_STATUS ?

I had been lazzy and used the binnary to upload, so will give me an excuse to get the arduino setup on Monday 😀 Will let you know, thanks

Simon7381 commented 4 weeks ago

@johnyHV Hi, so dropping the FLASH_PWM_FREQ to 500 has shown a great improvement: snapshot-prusa-esp32cam-1717417279

So would be a case of finding the right setting to eliminate the PWM interference, btw is there any reason why FLASH_ON_STATUS has a 80% limitation, didn't want to try 100% and break something as I would assume this will eliminate any Freq scan lines.

johnyHV commented 2 weeks ago

Hi @Simon7381 . LED diode on the PCB don't have resistor for the current limitation. So currently is for testing changed PWM to 80%. Maybe this "solution" should be help extend LED diode life time. Can you try use original PWM frequency, and 100% PWM ?