240VAC to 240VDC

When a 240 Vrms mains voltage is rectified with a bridge rectifier and reservoir capacitor, the output voltage becomes 340 VDC, on average. Then, I would put a buck converter that oscillates at 20 kHz (say) and step it down back to 240V. But how would you regulate that 340V down at 240V AND eliminate (all or as much as possible) that resultant high-frequency ripple?

What components would you add?

• the output voltage becomes 340 VDC, on average - How did you get this? – Eugene Sh. Jul 4 '17 at 20:37
• The 240V sine wave gives 240 Vrms, but the peak-to-peak voltage is actually about 340V. – El Ectric Jul 4 '17 at 20:38
• So where is this average came from? The average of a half-sine wave of an amplitude of 340V is about 220V. – Eugene Sh. Jul 4 '17 at 20:41
• @EugeneSh. Not with a filter cap on there (which the OP mentions). – marcelm Jul 4 '17 at 21:27
• Knowing why you need ultra-pure 240VDC would help us help you. The short answer could be, add a lowpass filter. How much current we talking? – rdtsc Jul 4 '17 at 23:19

When a 240 Vrms mains voltage is rectified with a bridge rectifier and reservoir capacitor, the output voltage becomes 340 VDC, on average.

Correct, if smoothing capacitor added.

Then, I would put a buck converter that oscillates at 20 kHz (say) and step it down back to 240V. But how would you step that 340V down to 240V AND eliminate (all or as much as possible) that resultant high-frequency ripple?

You wouldn't. You'd use a 240 V AC to 240 V DC switched mode power supply and do it in one step. Figure 1. Switched mode power supply block diagram.

What components would you add? And what should be the base voltage to the switching transistor?

You generally wouldn't use a BJT transistor. I suspect you've picked up some terminology somewhere but don't have enough understanding at present to do this project. Pick something at low voltages first.

The 240V sine wave gives 240 Vrms, but the peak-to-peak voltage is actually about 340V.

Almost right. $240 \sqrt 2 = 340 \; V_{peak}$. The peak to peak voltage of the AC is double that.

You could simply place a step-down transformer or auto-transformer (to 170VAC) between the 240VAC supply and the bridge rectifier / Capacitor(s).

The old-school way to do this is to use a choke (large inductor) in between the output of the bridge rectifier and the reservoir capacitor. Depending upon the desired current and how much ripple you can tolerate, the choke value is typically 5 to 25 Henries. simulate this circuit – Schematic created using CircuitLab

Values shown are for example only - you will need to calculate (or estimate) the values appropriate for your needs

This old-school approach has several benefits: much lower peak current in the rectifier diodes, much better filtering, output DC voltage similar in magnitude to the RMS AC input voltage.

The downside is the cost, weight, size of the choke inductor.