This paper introduces an online counter-electromotive-force (CEMF) estimation method for controlling a permanent magnet synchronous machine (PMSM) in a standard drive. The accuracy of the CEMF is crucial for achieving optimum performance, high efficiency, and accurate torque generation in PMSM motors. The proposed method utilizes a simple observer and ensures adaptive control to changes in the CEMF, enabling the motor to operate efficiently and deliver good performance even in field weakening conditions. The approach is easily applicable in common microcontrollers due to its simplicity. Both simulation and experimental results demonstrate the method's high accuracy, robustness, and insensitivity to other motor parameters.