PWM dimming, delay, decreasing??

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
bastibasti
Normal user
Posts: 25
Joined: 31 Jul 2018, 11:41

PWM dimming, delay, decreasing??

#1 Post by bastibasti » 02 Apr 2019, 22:53

Hi,

I'm trying to convert an old avr dimmer to esp8266 with espeasy. So far, hardware works as expected... However, it seems like, when setting the pwm, for example

pwm=12,1024,1000 -> ok nice and smooth
pwm=12,100,1000 -> it goes to 0 and then starts to increase to 100, instead of decreasing from 1024
if you set
pwm=12,0,1000 -> immediately off

is this intentionally or a bug??

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: PWM dimming, delay, decreasing??

#2 Post by ThomasB » 03 Apr 2019, 05:09

I reviewed _P001_Switch.ino to see if there is an explanation. As written, PWM (with optional duration function) is configured to "increase" the PWM value (e.g., brighten effect). It does not offer a traditional fade. But it will wrap around to a lower PWM value when the new PWM value is smaller than the previous. This matches what you are seeing.
is this intentionally or a bug??
I would label it as an intentional bug. :)

- Thomas

bastibasti
Normal user
Posts: 25
Joined: 31 Jul 2018, 11:41

Re: PWM dimming, delay, decreasing??

#3 Post by bastibasti » 07 Apr 2019, 23:14

what a mess.

mega-20181028 is able to slowly dim down.

are there any notes, why the behaviour was changed?

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: PWM dimming, delay, decreasing??

#4 Post by ThomasB » 08 Apr 2019, 01:46

The switch plugin went through some changes a few weeks ago. There was some discussion on it doing too much. Then it was reverted after things broke. I'm surprised you see it working differently than before.
- Thomas

bastibasti
Normal user
Posts: 25
Joined: 31 Jul 2018, 11:41

Re: PWM dimming, delay, decreasing??

#5 Post by bastibasti » 12 Apr 2019, 21:07

also, while I'm complaining like an old woman.... an option to set the pwm frequency would be great. like pwmfreq=100 for 100hz

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: PWM dimming, delay, decreasing??

#6 Post by Domosapiens » 13 Apr 2019, 00:46

PWM,<GPIO>,<duty>,<duration>,<frequency>
https://espeasy.readthedocs.io/en/lates ... hlight=pwm
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

Rampler
Normal user
Posts: 92
Joined: 31 Dec 2016, 07:13

Re: PWM dimming, delay, decreasing??

#7 Post by Rampler » 13 Apr 2019, 17:36

This is a known bug !!
Use a version with Core 2.4.1, all is fine ...
I use ESPEasy_mega-20180506 and PWM is working.

bastibasti
Normal user
Posts: 25
Joined: 31 Jul 2018, 11:41

Re: PWM dimming, delay, decreasing??

#8 Post by bastibasti » 13 Apr 2019, 23:05

Rampler wrote: 13 Apr 2019, 17:36 This is a known bug !!
Use a version with Core 2.4.1, all is fine ...
I use ESPEasy_mega-20180506 and PWM is working.
No it isn't.... dimming down doesnt work on the 20190413 core241 i just loaded

bastibasti
Normal user
Posts: 25
Joined: 31 Jul 2018, 11:41

Re: PWM dimming, delay, decreasing??

#9 Post by bastibasti » 15 Apr 2019, 12:36

oh,

and I want to add:

/control?cmd=pwm,2,512,7000,500

-> I cannot find any release, where the pwmfreq is set to 500 either

its broken.

Rampler
Normal user
Posts: 92
Joined: 31 Dec 2016, 07:13

Re: PWM dimming, delay, decreasing??

#10 Post by Rampler » 20 Apr 2019, 15:25

bastibasti wrote: 13 Apr 2019, 23:05
Rampler wrote: 13 Apr 2019, 17:36 This is a known bug !!
Use a version with Core 2.4.1, all is fine ...
I use ESPEasy_mega-20180506 and PWM is working.
No it isn't.... dimming down doesnt work on the 20190413 core241 i just loaded
As a said, try ESPEasy_mega-20180506 and all is fine ..

bastibasti
Normal user
Posts: 25
Joined: 31 Jul 2018, 11:41

Re: PWM dimming, delay, decreasing??

#11 Post by bastibasti » 23 Apr 2019, 09:29

I decided to go a different route. I'm currently making a wemos d1 shield with an avr that handles the pwm. (the easyesp also cannot simultaneously dim)

:-(

jbishop129
New user
Posts: 5
Joined: 04 Jan 2018, 17:05

Re: PWM dimming, delay, decreasing??

#12 Post by jbishop129 » 10 Jul 2019, 21:13

I can confirm this is still an issue. I can fade up just fine, but cannot fade down. I can also confirm that loading the much older 2018-05-06 version, fading down works just fine. What's the deal with getting this fixed, since this seems to be a regression from over a year ago?

fra290
New user
Posts: 4
Joined: 30 Jun 2018, 15:51

Re: PWM dimming, delay, decreasing??

#13 Post by fra290 » 19 Jul 2019, 16:01

bastibasti wrote: 02 Apr 2019, 22:53
... So far, hardware works as expected...
I'm interested to have the Hardware project, can you share?
MArco

bastibasti
Normal user
Posts: 25
Joined: 31 Jul 2018, 11:41

Re: PWM dimming, delay, decreasing??

#14 Post by bastibasti » 29 Jul 2019, 14:50

... so far still making changes and adjusting. might need a little change in hardware if i cannot adjust the speed correctly. I will reply to you later

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: PWM dimming, delay, decreasing??

#15 Post by TD-er » 04 Aug 2019, 15:35

This issue was caused by the pin state monitor which has been changed a while ago.
This tried to store the current PWM value in a parameter of only a few bits.
I just created a fix for this and it will be merged later today (and thus included in tomorrow's build)

Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests