Transformerless inverter from 20*12V batteries
It is possible but awkward.  180 VAC RMS will have peaks of 254 V.  It would be much simpler if your DC was at least that.  If it were, you could use direct drive via PWM with some filtering.

Since 240 V isn't enough for the full excursion of even your minimum output, a more expensive, costly, and less efficient method will need to be used.  There are various topologies for that, but without knowing constraints and tradeoffs of your particular case it is pointless to recommend something.  One method boosts the DC to what is needed for the peaks, then uses direct drive from there.  Another does the high frequency chopping into a transformer like a switching power supply, but the regulation level is the much slower 50 or 60 Hz desired output.  Yet another way is to direct drive to whatever sine you can manage, then run that thru a transformer at the output frequency to get what you want.