How to stop PID controller flickering my room lights

Hi I am building an electric brewery to make the best beer in the world in my shed. I have a dedicated 32amp 240v board to the shed for the purpose. I have a 3500 Watt element in a RIMS tube the PID controller ajusts the heat by PWM the load to the element, connected to a 20amp breaker.
When it does so the florescent lights in the room which are on the 10amp lighting breaker flicker constantly.

Question is can I add a smoothing Capacitor to the lighting circuit. What size and how. But the most important question is that will it work?

No it is AC so capacitors will not help by themselves. You need an inductor as well to filter the AC. This is sometimes also called a snubber circuit. Also make sure that the wiring to the shed can handle the current.

the PID controller ajusts the heat by PWM the load to the element,

The whole system's time constant is far bigger than the pwm's period. In those cases, a simple on / off control works well and will not cause your flickering.

Essentially, if your pid returns a control variable greater than an on_threshold, turn on the heating element; if it returns a value less than an off_treshold, turn off the element. Adjust the on/off_threshold for your desired behaviors.

I would first take a AC voltage reading on the circuit feeding the lighting and see is the AC voltage is being reduced when the heater is operating. Even though they are on different circuits there may be upstream limitations causing the lighting circuit to 'sag'.

Lefty

to OP, are you getting flickering if you switch to tungsten lights? Are these old-style fluorescents
[long thin tube] or modern day curly-que fluorescent light that plugs into a tungsten bulb socket?

Thanks for the replies, I am working though your suggestions.
To dhenry I considered this when first designing the project I like the PID to limit the power to the element on start up the library allows to set upper limit this allows me to get the viscous liquid warm so as not to scorch and give off flavours, but it is the easiest solution so may risk the scorch to get the light steady.
The lights are ling tube with electronic ballast.
Incandescent bulbs do not flicker.

Maybe the PWM is reeking havoc with the ballast, although I really don't know a lot about that.

However, if you're using 3500 W elements, then I imagine the rest of the system [ie, the big brew
vat] has a huge amount of thermal inertia. This means you can probably get away with a very low
PWM frequency, like maybe 0.1-hz [10 second period] or less, rather than 500-hz. So, instead of
regular PWM, you might use a modification of the BlinkWithoutDelay code.