I'm using an S.S.Relay to drive a heater in a coffee boiler. The SSR does zero voltage switching of AC mains. I'm using PWM on a GPIO to vary the heater power. I just got round to looking at the PwM on an oscilloscope and I see it is 1Khz!!!!
Is there a way to reduce the PWM frequency or a cunning way to implement a low frequency PWM in Rules?
Much appreciated, as always,
Tony
PWM with Solid State Relay
Moderators: grovkillen, Stuntteam, TD-er
Re: PWM with Solid State Relay
See the PWM command: https://espeasy.readthedocs.io/en/lates ... ernal-gpio
It does mention a minimum frequency of 100 Hz, but not sure if that's an actual limit or perhaps more a practical limit for dimming.
However keep in mind the net frequency isn't exactly 50 Hz (or 60 in US and Japan for example)
So I guess it may be very hard to sync the PWM as the solid state relay will turn on at a zero-crossing, but not sure if it will actually turn off between zero-crossings.
Since the heating element is quite slow, maybe it is better to use longpulse and looptimer?
For example run the looptimer every 2 sec and then using looptimer_ms to set the pulse width between 20 msec and 2 sec.
The looptimer will be quite accurate as is the longpulse_ms.
Code: Select all
PWM,<GPIO>,<duty>,<duration>,<frequency>
However keep in mind the net frequency isn't exactly 50 Hz (or 60 in US and Japan for example)
So I guess it may be very hard to sync the PWM as the solid state relay will turn on at a zero-crossing, but not sure if it will actually turn off between zero-crossings.
Since the heating element is quite slow, maybe it is better to use longpulse and looptimer?
For example run the looptimer every 2 sec and then using looptimer_ms to set the pulse width between 20 msec and 2 sec.
The looptimer will be quite accurate as is the longpulse_ms.
-
- Normal user
- Posts: 57
- Joined: 28 Sep 2020, 13:58
Re: PWM with Solid State Relay
Thank you
-
- Normal user
- Posts: 57
- Joined: 28 Sep 2020, 13:58
Re: PWM with Solid State Relay
Just an observation here,
Pulse,0,1,([INT#30])*10
Kills the webserver when uploaded to Rules:
192008: GPIO : port#0: set to 0
192020: ACT : oledframedcmd,2,3%
192199: Upload: START, filename: rules1.txt
192321: Upload: WRITE, Bytes: 1999
192322: Upload: END, Size: 1999
192496: Webserver 1 Arguments: 0: 'enctype' length: 19
192509: CRC : SecuritySettings CRC ...OK
>> Failed to fetch <<
>> Failed to fetch <<
>> Failed to fetch <<
>> Failed to fetch <<
Pulse,0,1,([INT#30])*10
Kills the webserver when uploaded to Rules:
192008: GPIO : port#0: set to 0
192020: ACT : oledframedcmd,2,3%
192199: Upload: START, filename: rules1.txt
192321: Upload: WRITE, Bytes: 1999
192322: Upload: END, Size: 1999
192496: Webserver 1 Arguments: 0: 'enctype' length: 19
192509: CRC : SecuritySettings CRC ...OK
>> Failed to fetch <<
>> Failed to fetch <<
>> Failed to fetch <<
>> Failed to fetch <<
Re: PWM with Solid State Relay
Can you check if there are any irregular characters (invisible? characters) in your Rules file? Possibly caused by copy/pasting from somewhere else into the Rules editor.
/Ton (PayPal.me)
-
- Normal user
- Posts: 57
- Joined: 28 Sep 2020, 13:58
Re: PWM with Solid State Relay
I did paste from a text editor; but the when I tried on another board, I typed it directly into the Rules - so don't think it's special characters.
Re: PWM with Solid State Relay
You should use longpulse
pulse is blocking, longpulse does schedule an action to switch the pin back to its old state.
pulse is blocking, longpulse does schedule an action to switch the pin back to its old state.
Who is online
Users browsing this forum: Bing [Bot] and 2 guests