A method to detect and evaluate movement patterns and pen positions of an electronic pen (100, 200, 300) with inertial measurement sensors during writing on a two-dimensional writing substrate (108, 205) comprising: initially specifying two axes X, Y (101, 102, 201, 202), that are orthogonal to each other on the writing substrate, and an axis Z that is perpendicular to the two-dimensional writing substrate (108, 205), whereby the X-axis (101, 201) defines the predominant writing direction; a compensation of undesired drift in the pen position signal to be output, comprising: a moving average process over a predefined time interval and a predefined frequency of the pen movements on the writing substrate (108, 205), determined by the inertial measurement sensors during writing through integration of the sensor data of the measurement sensors, along both axes X, Y (101, 102, 201, 202) that are orthogonal to each other; a periodic comparison of currently determined moving average values with initial average values and/or with previously determined moving average values; a subtraction of deviations, arising during said comparison between the currently determined moving average values and initial average values and/or deviations between currently determined moving average values and previously determined moving average values, from a pen position signal to be output, and whereby the sensor data is cleared up with a high-pass filter and a low-pass filter around the frequencies above and below the writing movement frequency of the user prior to the integration of the sensor data for the determination of a location signal of the electronic pen (100, 200, 300) and the extraction of its movement in the writing direction. initially specifying two axes X, Y (101, 102, 201, 202), that are orthogonal to each other on the writing substrate, and an axis Z that is perpendicular to the two-dimensional writing substrate (108, 205), whereby the X-axis (101, 201) defines the predominant writing direction; a compensation of undesired drift in the pen position signal to be output, comprising: a moving average process over a predefined time interval and a predefined frequency of the pen movements on the writing substrate (108, 205), determined by the inertial measurement sensors during writing through integration of the sensor data of the measurement sensors, along both axes X, Y (101, 102, 201, 202) that are orthogonal to each other; a periodic comparison of currently determined moving average values with initial average values and/or with previously determined moving average values; a subtraction of deviations, arising during said comparison between the currently determined moving average values and initial average values and/or deviations between currently determined moving average values and previously determined moving average values, from a pen position signal to be output, and whereby the sensor data is cleared up with a high-pass filter and a low-pass filter around the frequencies above and below the writing movement frequency of the user prior to the integration of the sensor data for the determination of a location signal of the electronic pen (100, 200, 300) and the extraction of its movement in the writing direction. a moving average process over a predefined time interval and a predefined frequency of the pen movements on the writing substrate (108, 205), determined by the inertial measurement sensors during writing through integration of the sensor data of the measurement sensors, along both axes X, Y (101, 102, 201, 202) that are orthogonal to each other; a periodic comparison of currently determined moving average values with initial average values and/or with previously determined moving average values; a subtraction of deviations, arising during said comparison between the currently determined moving average values and initial average values and/or deviations between currently determined moving average values and previously determined moving average values, from a pen position signal to be output, and whereby the sensor data is cleared up with a high-pass filter and a low-pass filter around the frequencies above and below the writing movement frequency of the user prior to the integration of the sensor data for the determination of a location signal of the electronic pen (100, 200, 300) and the extraction of its movement in the writing direction.