Background: Respiratory motion causes thoracic movement and reduces targeting accuracy in radiotherapy. Objective: This study proposes an approach to generate a model to track lung tumor motion by controlling dynamic multi-leaf collimators. Material and Methods: All slices which contained tumor were contoured in the 4D-CT images for 10 patients. For modelling of respiratory motion, the endexhale phase of these images has been considered as the reference and they were analyzed using neuro-fuzzy method to predict the magnitude of displacement of the lung tumor. Then, the predicted data were used to determine the leaf motion in MLC. Finally, the trained algorithm was figured out using Shaper software to show how MLCs could track the moving tumor and then imported on the Varian Linac equipped with EPID. Results: The root mean square error (RMSE) was used as a statistical criterion in order to investigate the accuracy of neuro-fuzzy performance in lung tumor prediction. The results showed that RMSE did not have a considerable variation. Also, there was a good agreement between the images obtained by EPID and Shaper for a respiratory cycle. Conclusion: The approach used in this study can track the moving tumor with MLC based on the 4D modelling, so it can improve treatment accuracy, dose conformity and sparing of healthy tissues because of low error in margins that can be ignored. Therefore, this method can work more accurately as compared with the gating and invasive approaches using markers.