Introduction: Closed-loop control of deep brain stimulation (DBS) is beneficial for effective and automatic treatment of various neurological disorders like Parkinson's disease (PD) and essential tremor (ET). Manual (open-loop) DBS programming solely based on clinical observations relies on neurologists' expertise and patients' experience. Continuous stimulation in open-loop DBS may decrease battery life and cause side effects. On the contrary, a closed-loop DBS system uses a feedback biomarker/signal to track worsening (or improving) of patients' symptoms and offers several advantages compared to the open-loop DBS system. Existing closed-loop DBS control systems do not incorporate physiological mechanisms underlying DBS or symptoms, e.g., how DBS modulates dynamics of synaptic plasticity. Methods: In this work, we propose a computational framework for development of a model-based DBS controller where a neural model can describe the relationship between DBS and neural activity and a polynomial-based approximation can estimate the relationship between neural and behavioral activities. A controller is used in our model in a quasi-real-time manner to find DBS patterns that significantly reduce the worsening of symptoms. By using the proposed computational framework, these DBS patterns can be tested clinically by predicting the effect of DBS before delivering it to the patient. We applied this framework to the problem of finding optimal DBS frequencies for essential tremor given electromyography (EMG) recordings solely. Building on our recent network model of ventral intermediate nuclei (Vim), the main surgical target of the tremor, in response to DBS, we developed neural model simulation in which physiological mechanisms underlying Vim-DBS are linked to symptomatic changes in EMG signals. By using a proportional-integral-derivative (PID) controller, we showed that a closed-loop system can track EMG signals and adjust the stimulation frequency of Vim-DBS so that the power of EMG reaches a desired control target. Results and discussion: We demonstrated that the model-based DBS frequency aligns well with that used in clinical studies. Our model-based closed-loop system is adaptable to different control targets and can potentially be used for different diseases and personalized systems.