The trapezoidal back-emf synchronous motor which is called brushless DC (BLDC) motor is receiving wide attention for industrial applications because of its high torque density, high efficiency and small size. This kind of electrical motors is a typical example of highly coupled, nonlinear systems. In the first part of this paper an intelligent agent based on Adaptive Neuro-Fuzzy Inference System (ANFIS) is developed to perform Non-linear Auto-Regressive Moving Average with eXogenous input (NARMAX) system identification of BLDC motor. At first we used exhaustive search technique to select the ANFIS inputs, and then by using Fuzzy C-Means (FCM) algorithm, an ANFIS has been performed to approximate the motor characteristics. In the second part, an optimized Proportional-Integral-Derivative (PID) controller has been developed. Particle Swarm Optimization (PSO) has been used as an optimization algorithm to tune the parameters of the controller. All steps simulated by MATLAB resulted in notable performance.