This paper proposes a decentralized optimal secondary controller for frequency regulation and accurate active power sharing in autonomous microgrids. This optimal controller does not require any communication network. Unlike most of the existing works, a systematic approach of secondary controller design is introduced based on a quadratic cost function in the form of a linear quadratic regulator (LQR) solution. The design procedure only depends on the cut-off frequency of the power calculation filter. Decentralized behavior, simplicity, optimality based on a quadratic cost function, and straight forward design procedure are the main advantages of this approach. Using the proposed solution, frequency can be restored immediately following any disturbance in the system, without need of any event-driven and time-dependent protocol. Experimental results validate the effectiveness of the proposed controller