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.

07/24/2021 2:58 AM
welcome cup Danny

07/21/2021 3:00 AM
Welcome RoastedRight

07/18/2021 3:06 AM
Welcome to darkbrew, carl1961 and vitor !

07/17/2021 4:30 PM
Welcome Skin Destination AND Timberline

07/16/2021 3:10 AM
Welcome to callmejohn and axissolutions !

In Memory Of Ginny
Donations

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

Members Online: 0

Total Members: 7,257
Newest Member: Danny

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
Popper gets really hot after only a few seconds of heater on Dataloggers/Controllers/Rate of Rise Meters 19 04/28/2021 8:59 AM
Modifying DASH 1400W Popper with TC4 + Transistor DC Relay Building a Coffee Roaster 36 02/23/2021 12:28 PM
RobotDyn Transistor DC Relay Module Dataloggers/Controllers/Rate of Rise Meters 2 01/14/2021 3:41 AM
Heater Protection via Arduino Fluidbed Roaster 5 09/21/2020 9:41 AM
Build a roaster with a forced air propane heater! Fluidbed Roaster 17 01/14/2020 8:32 AM
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 © 2021 PHP-Fusion Inc
Released as free software without warranties under GNU Affero GPL v3
Designed with by NetriX