Re: Some ideas needed
That is the function of the regulator, to keep the output constant while the input varies.
The input voltage variation may seem large, but it's not really that bad. Basically you need a 220V transformer, that has to handle +9%, -18%.
Generally +10% /-15% is the NORMAL variation to be expected, so you only need to go 3% below that. That is not a big difference. You should be able to design a transformer to cover that range.
Make sure the transformer can supply the required current without overheating, and make sure the output voltage, with 180V input, is still enough for the regulator to maintain the output voltage.
Now comes the thing I do not understand: why do you say that the voltage is exceeded when the input is 240V, while at 180 it is not sufficient?
The LM317 I suggested can go up to about 40V input. So if you have 8V minimum at 180V (at ripple valley), with 20% ripple, that is you have about 9VDC, with about 2Vpp ripple, that is the voltage is between 8 and 10V at the input of the regulator. Then at 240VAC, you will have 240/180*9=12VDC, with 20% ripple, that is the voltage will be between 11V and 13V. That is very reasonable. Many linear regulators can deal with input voltage variations MUCH larger than that.
I suspect the transformer you are using is not properly designed. Please review its design or choose a different one.
The easiest way to test what I said and find other possible problems is to power the regulator from a laboratory DC power supply. Load the regulator at 0.3A and vary the input voltage while observing the output. It should remain almost unchanged (within about 1%) for any input between about 7-8V and the maximum allowable for your regulator. If it does change by more than 1%, then you need to look at the regulator, because there is a problem. Otherwise, check the transformer, bridge, filter cap.