Rewrite 50/60 Hz detect so it works on both B-series and P-series