Hello Dear John
At first step , about grounding :
At these circuits we will have to type of ground ! 1st , is Digital ground (logic) , and the other is analogue ground . so those grounds should connect together , with star arrangement .
and you'de better , try to use polygon as your ground . ( to prevent from some problems)
And for next step , about AC line , i think your mean is EMI filter. , so it will use to avoid from interference between switching harmonics and power line . it's impedance instead of AC is very negligible , and instead of switching component will be about infinite ( it is like a high order filter ) .
and , you should prevent to connect your AC input ground to the case , because , it can become the cause of some injures and it is dangerous.
And the reason of using opto couplers at these circuits is that , we dont want any electrical connection between AC ground and out put , because it will be dangerous for your health , my mean is that , if your power supply isn't isolated , and suppose it's out put voltage is about just 5 volt . but if you touch it's ground , and if the place of phase wire and null wire is changed , thus creator should help you !!!!!!!!!!!! :wink:
Good luck
Goldsmith