Switching from bang-bang to pid for a dual zone 1500w AC heater
-
Hi guys,
I have a large custom 520x520mm 1500w 230V AC - dual zone silicon heater for my printbed that I run through two independent ZG3NC-325B zero crossing SSR's.
The inner zone for smaller prints is 200x200mm - (300W) connected to "bedtemp" pin
The outer zone is the rest of the heater (1200W) - connected to "e1temp" pinSo far, I have been running it in bang bang mode, but since it is suboptimal for stable temperatures, I would like to try to switch to PWM to be able to PID autotune it properly.
ZG3NC-325B is a zero crossing SSR rated at 25A and from it's datasheet I can see it's on/off time is ≤10ms, so I think it can hadle PWM up to 100Hz, but I figure 10Hz is plenty for much more stable temperatures.
This is my current gcode (with bang bang) :
**; BED - ZONE 01 HEATER (CENTER) M308 S0 P"bedtemp" Y"thermistor" T100000 B3950 ; configure sensor 0 as thermistor on pin bedtemp M950 H0 C"bedheat" T0 ; create bed heater output on bedheat and map it to sensor 0 M307 H0 B1 S1.00 A97.3 C230.7 D2.8 S1.00 V24.2 ; enable bang-bang mode for the bed heater and set PWM limit M140 H0 P0 ; map heated bed to heater 0 M143 H0 S120 ; set temperature limit for heater 0 to 120C M570 H0 S200 ; Set maximum heating time (Snnn, in seconds). ; BED - ZONE 02 HEATER (EDGE) M308 S2 P"e1temp" Y"thermistor" T100000 B3950 ; configure sensor 2 as thermistor on pin e1temp M950 H2 C"e1heat" T2 ; create bed heater output on bedheat and map it to sensor 0 M307 H2 B1 S1.00 A166.8 C910.6 D2.8 V24.2 ; enable bang-bang mode for the bed heater and set PWM limit M140 H2 P1 ; map heated bed to heater 1 M143 H2 S120 ; set temperature limit for heater 0 to 120C M570 H2 S200 ; Set maximum heating time (Snnn, in seconds).**
Can you please suggest the correct procedure and initial GCODE for 10Hz PWM, so I can run the PID tuning for both zones at the same time (since that is what I usually mostly use).
I guess I should first just turn bang bang off, remove the current calibration parameters and set the PWM frequency, but since I haven't done this before - can you please help on the proper procedure and gcode.
I have the DUET 2 ETHERNET and run the latest RRF 3.5 BETA 3.
Thanks a lot in advance.
-
@omni you can't tune both heaters at the same time, and if you could then the tuning of them would likely interact and become unstable.
I suggest you start by tuning the inner bed heater with the outer one turned off. Then tune the outer one, with the inner one maintaining the target temperature.
When using a zero crossing AC mains SSR the quoted on/off times are not very relevant, because the SSR will turn on and off at the next zero crossing that occurs after the control signal changes. This can lead to the actual PWM achieved varying depending on where the on/off transitions occur within the mains cycle. For example, if you have 50Hz mains and 10Hz PWM, if the PWM is e.g. 8% then the PWM on time is less than half a cycles of mains. This means that you will either get a half cycle of mains (10% PWM) or none (0% PWM) depending on the relative phases of the mains and the PWM. Similarly, with 45% PWM you will get 40% or 50% depending on the phase relationship. I've not found this to be a problem (my printers both use 10Hz PWM), however it might be better to use e.g. 9Hz or 11Hz so that the phase relationship between the PWM and mains is changing constantly, and the average PWM you get over a second is correct.
-
@dc42 Thank you so much for the explanation, it makes sense.
Can you please suggest the inital config.g g-code for M307, and after I tune them both as you suggested, I will add the calibration parameters.
I can't seem to find the PWM frequency parameter in the docs, was it Q? And since I am not using VIN as power supply, but only for PWM should I exclude the V parameter from the M307?
-
@omni the PWM frequency is specified in the M950 command that you use to create the heater.
-
Ah thanks,... my bad, I was looking in the wrong place. I thought it was in the M307.
So initially it should look like this, if I am not mistaken :
; BED - ZONE 01 HEATER (CENTER) M308 S0 P"bedtemp" Y"thermistor" T100000 B3950 ; configure sensor 0 as thermistor on pin bedtemp M950 H0 C"bedheat" T0 Q11 ; create bed heater output on bedheat and map it to sensor 0 with PWM frequency of 11Hz M307 H0 B0 S1.00 ; disable bang-bang mode for the bed heater 1 and set PWM limit M140 H0 P0 ; map heated bed to heater 0 M143 H0 S120 ; set temperature limit for heater 0 to 120C M570 H0 S200 ; Set maximum heating time (Snnn, in seconds). ; BED - ZONE 02 HEATER (EDGE) M308 S2 P"e1temp" Y"thermistor" T100000 B3950 ; configure sensor 2 as thermistor on pin e1temp M950 H2 C"e1heat" T2 Q11 ; create bed heater output on bedheat and map it to sensor 2 with PWM frequency of 11Hz M307 H2 B0 S1.00 ; disable bang-bang mode for the bed heater 2 and set PWM limit M140 H2 P1 ; map heated bed to heater 1 M143 H2 S120 ; set temperature limit for heater 0 to 120C M570 H2 S200 ; Set maximum heating time (Snnn, in seconds).
Then when I do the calibration, I should add the calibration parametars to M307?
Thanks again.
-
@omni said in Switching from bang-bang to pid for a dual zone 1500w AC heater:
Then when I do the calibration, I should add the calibration parametars to M307?
Or just use M500 to save them to config-override.g and add M501 to the end of your config.g.