Fig.5 Flowchart of switching control.