Skywalker, the AL... | [322] |
Second attempt, T... | [28] |
Please take this ... | [11] |
Baratza Preciso u... | [6] |
UN WHO SARS-CoV C... | [5] |
Frequency for ON/OFF AC-relay heater
|
|
zamunda |
Posted on 07/04/2021 9:27 AM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
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 |
Posted on 07/04/2021 12:49 PM
|
Administrator ![]() Posts: 3935 Joined: February 23, 2010 |
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 |
Posted on 07/04/2021 2:22 PM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
Thank you! |
|
|
renatoa |
Posted on 07/05/2021 12:59 PM
|
![]() Administrator ![]() Posts: 3308 Joined: September 30, 2016 |
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 |
Posted on 07/07/2021 7:42 PM
|
![]() 1 1/2 Pounder ![]() Posts: 1189 Joined: November 21, 2010 |
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 |
Posted on 07/08/2021 10:05 AM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
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 |
Posted on 07/08/2021 11:17 AM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
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 |
Posted on 07/09/2021 11:05 AM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
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 |
Posted on 07/09/2021 3:02 PM
|
![]() Administrator ![]() Posts: 3308 Joined: September 30, 2016 |
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 |
Posted on 07/10/2021 2:22 AM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
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:
|
|
|
renatoa |
Posted on 07/10/2021 4:51 AM
|
![]() Administrator ![]() Posts: 3308 Joined: September 30, 2016 |
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 |
Posted on 07/10/2021 6:30 AM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
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 |
Posted on 07/10/2021 10:43 AM
|
![]() Administrator ![]() Posts: 3308 Joined: September 30, 2016 |
The SSR codes, did a search in the manufacturer data, and found the fire type. |
|
Jump to Forum: |