In this paper, the development of a novel controller for a bidirectional buck and boost converter is studied to implement an active capacitance. To this end, an averaging method is used to obtain a nonlinear state-space model of the converter in the Continuous Conduction Mode (CCM) for buck and boost configurations, separately. These models are then combined into a state-space representation for the whole range of operation. Using the obtained model, a controller is designed to track a desired input current based on the applied input voltage such that the circuit exhibits a capacitive effect between the input terminals. The converter along with its proposed control method is a suitable replacement for the commonly used electrolytic capacitors in different applications. Simulation results are presented that demonstrate performance of the proposed current control method. Experimental verification is currently under investigation.