topbanner.gif
Login
Username

Password




Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Shoutbox
You must login to post a message.

allenb
04/23/2024 7:01 PM
Paul Kalb Welcome

renatoa
04/23/2024 4:34 AM
Coffee_Rabbit_Hole
and Michaelion, welcome cup

renatoa
04/21/2024 2:35 AM
compactjack and GreenGenie coffee drink ?

allenb
04/19/2024 8:27 AM
eximwind Welcome

renatoa
04/18/2024 12:36 AM
bijurexim, greyberry2, N C, welcome2

In Memory Of Ginny
Donations

Latest Donations
dmccallum - 10.00
JackH - 25.00
snwcmpr - 10.00
Anonymous - 2.00
Anonymous - 5.00
Users Online
Guests Online: 2

Members Online: 0

Total Members: 8,223
Newest Member: Paul Kalb

View Thread

Who is here? 1 guest(s)
 Print Thread
Frequency for ON/OFF AC-relay heater
zamunda
Hello,

I have now my popcorn roaster connected with 2 probes and an AC-relay.
With my Raspberry Pi I can see both ET and BT and switch on-off the heater by means of a Button and/or Event.

However, what frequency for switching ON/OFF should I apply to the resistance if for instance I want to achieve a heat of 70% of its maximum power (1200Watt) during a certain period of my roast?

For example, a cycle of 7 seconds ON/3 seconds OFF would be good/efficient or should that be fe. 0.7 seconds ON/0.3 seconds off?

Hope you get my point. Any hints will be appreciated!

Regards,
 
allenb
For tubular heating elements, the lower frequency cycle rate is fine but for coiled resistance wire for heating a convection air stream, go with the 1 second time base to prevent convection air temp fluctuations during each cycle.
1/2 lb and 1 lb drum, Siemens Sirocco fluidbed, presspot, chemex, cajun biggin brewer from the backwoods of Louisiana
 
zamunda
Thank you!
 
renatoa
Too fast cycle will bring another issue than fluctuations: losing control resolution.
That's because the smallest quota of power you can on off is given by the period of the sine wave.
So if you want 1% change of the slider to be 1% change in heat, then you should use 2 seconds for 50 Hz mains, or proportionally less for 60 Hz mains.
 
greencardigan

Quote

renatoa wrote:

Too fast cycle will bring another issue than fluctuations: losing control resolution.
That's because the smallest quota of power you can on off is given by the period of the sine wave.
So if you want 1% change of the slider to be 1% change in heat, then you should use 2 seconds for 50 Hz mains, or proportionally less for 60 Hz mains.


I thought it was 1 second at 50Hz to allow 1% resolution. The sine wave crosses zero volts twice in each cycle giving the SSR 100 opportunities to switch each second?
 
zamunda
Hello,

This is my python script which works from the command line: "./heatercontrol.py 30"
...cycles the heater 0.3 secs on and 0.7 secs off.

However, if I run it from Artisan by means of the slider, it works the first time moving the slider, but if I move the slider again, the script does not kill the previous cycle and starts the new one...so I end up with several cycles running simultaneously.

This is because of the "while" statement which does not get interrupted by the sliderevent.
How should I rewrite the while so Artisan resets the cycle correctly?

Hope you get my point!

Thanks and regards


#!/usr/bin/python3

# importeer de GPIO bibliotheek.
import time
from time import sleep
import RPi.GPIO as GPIO
from sys import argv
import max6675

#Zet de heater aan
def heaterON():
GPIO.output(ACPin,True)

#Zet de heater uit
def heaterOFF():
GPIO.output(ACPin,False)

def calculate_on_off_time(cycle):
#Loop door aan/uit heater
# Invalid slider argument
if cycle not in range(0, 100):
print("Incorrect slider argument. Exiting now. ")

# Calculate on- and offtime
ontime = cycle/10
offtime = (100-cycle)/10

# read temperature connected at CS 22
et = max6675.read_temp(cs1)
# read temperature connected at CS 29
bt = max6675.read_temp(cs2)

return ontime, offtime

if __name__ == "__main__":
# driver code
# ===== SETTINGS =====
# in this case there are two sensor. one is connected to 22 with CS, the other is connected to 29 with CS
#ET
cs1 = 22
#BT
cs2 = 29
sck = 18
so = 16

# max6675.set_pin(CS, SCK, SO, unit) [unit : 0 - raw, 1 - Celsius, 2 - Fahrenheit]
max6675.set_pin(cs1, sck, so, 1)
max6675.set_pin(cs2, sck, so, 1)

# Zet de pinmode op Broadcom SOC.
GPIO.setmode(GPIO.BOARD)
# Zet waarschuwingen uit.
GPIO.setwarnings(False)
#Pin number (fysiek) voor aanzetten relay
ACPin = 35
# Zet de GPIO pin als uitgang.
GPIO.setup(ACPin, GPIO.OUT)

try:
cycle = int(argv[1])
timeON, timeOFF = calculate_on_off_time(cycle)

while True:
heaterON()
sleep(timeON)
heaterOFF()
sleep(timeOFF)

except KeyboardInterrupt: # trap a CTRL+C keyboard interrupt
GPIO.cleanup() # resets all GPIO ports used by this program
 
zamunda
Found this solution, that is, writing the latest slidervalue to a file check on this value within the "while"...
It works but I am not very experienced with Python and I suppose there must be more elegant solutions...

Thanks in advance!
...
# write the cycle slider value to slidervalue.txt
cycle = int(argv[1])
sliderfilepath = "/home/pi/Roaster/Scripts/slidervalue.txt"
sliderfile = open(sliderfilepath, "w")
sliderfile.write(str(cycle))
sliderfile.close()

try:
# get the time OFF and ON
timeON, timeOFF = calculate_on_off_time(cycle)
# while this file has the latest cycle value
latestcycle = True
while latestcycle:
# check if this is not the newest process
newestcycle = get_slidervalue(sliderfilepath)
if newestcycle != cycle:
latestcycle = False
break
# set heater ON and OFF for desired time
heaterON()
sleep(timeON)
heaterOFF()
sleep(timeOFF)
...
 
zamunda
Hello,

Just to inform that I tested with the 1 second base (fe 0.7 seconds on, 0.3 seconds off) for 70% power and works very well IMHO.

Regards!
 
renatoa
What you mean by works very well ?
How do you measure 70% pwm translates into proportional less heat ?
Did you compared with heat at 69 or 71%, to see if temperature follows power ?
The most important detail... is the SSR instant fire or zero cross ?
 
zamunda
Hello Renatoa,

I have these 2 types of SSRs, to be honest, I have not looked whether these are zero-cross or random fire since I hadd these laying around. Can you tell from the pics what type these are?
zamunda attached the following images:
bbb.jpg aaa_1.jpg
 
renatoa
Zero cross both, you are good !
What is this factor important?

With an instant fire SSR, there are two issues: you have always a variable width incomplete wave slice at that start of the ON PWM pulse, that can lead to a beating phenomenon, i.e. variable fluctuation power in one percent band, that led to about 3C degrees air fluctuations, even your PWM pulse is rock solid... and second issue, much more annoying, when the PWM pulse goes ON at the summit of sine wave, you have a sharp.edge voltage/current increase, from 0 to 380V ( for 230V mains) that could produce serious perturbations/interference in a normal house equipment sensible to EMI.

With a ZC SSR, the relay opens starting with the next sine wave after the moment when PWM pulse goes ON, so the above issues dow not exist, and you are guaranteed to have a complete wave switched regardless of the moment when your PWM signal change status.
 
zamunda
Hello Renatoa

Thanks for this info, great that i'm fine with these!
What on the pics tells you these are zero cross?

Thanks and regards!
 
renatoa
The SSR codes, did a search in the manufacturer data, and found the fire type.
 
Jump to Forum:

Similar Threads

Thread Forum Replies Last Post
Solid State Relay Question Dataloggers/Controllers/Rate of Rise Meters 11 11/27/2023 9:16 AM
Artisan PID turns heater back on during cool down Dataloggers/Controllers/Rate of Rise Meters 2 07/03/2023 12:31 PM
Air Popper Heater Popcorn Popper roasting 39 08/29/2022 2:50 PM
Artisan heater control issue Dataloggers/Controllers/Rate of Rise Meters 9 07/03/2022 8:13 AM
Rewire 230V popcorn machine fan & heater Popcorn Popper roasting 134 02/21/2022 1:40 PM
Homeroasters Association Logo, and all Content, Images, and Icons © 2005-2016 Homeroasters Association - Logos are the property of their respective owners.
Powered by PHP-Fusion Copyright © 2024 PHP-Fusion Inc
Released as free software without warranties under GNU Affero GPL v3
Designed with by NetriX
Hosted by skpacman