How to design microgrids and microgrid controls for small and medium sites