A method and a device for controlling an electric motor (9), in particular for moving an endodontic instrument. The device has a first sensor (8) and a control unit (2). The control unit (2) has a drive unit (4), a second sensor (6) and a processing unit (3). The processing unit (3) is configured to cause the endodontic instrument (7) to perform a sequence of movements (M1, M2). The sequence of movements (M1, M2) includes a continuous forward movement (M1) and at least one alternating movement (M2). The sequence may include an additional alternating movement (M3) and/or a reverse movement (M4). The number and order of movements to be performed in a sequence depends on a set of predefined threshold values reflecting the torque load applied to the instrument, as measured by one of the sensors.