A method for controlling a system comprising at least one battery having at least one energy storage cell and a power tool, wherein the system comprises at least one acceleration sensor for detecting at least one acceleration value in an X, Y or Z direction, a device for measuring a voltage and a device for discharging the at least one energy storage cell having the method steps: - Determining that the system is free-falling by detecting an acceleration value in the X, Y and Z direction being equal to predetermined range; - Determining an impact of the system by detecting at least one acceleration value in the X, Y or Z direction exceeding a first predetermined threshold value; characterized by the method steps: - Determine a traveling distance between detecting an acceleration value in the X, Y or Z direction being equal to a predetermined range and detecting at least one acceleration value in the X, Y or Z direction exceeding the first predetermined threshold value; - Determining an orientation of the system at the impact by evaluating the at least one acceleration value in the X, Y or Z direction by means of a look-up table; - Determining a point of impact on a housing of the system by interpreting the orientation of the system at the impact in reference to the dimensions of the housing (7, 6) and determining a horizontal distance to a center of gravity of the system; - Detecting a first and second voltage value of the at least one energy storage cell by means of the device for measuring a voltage; and - Discharging the at least one energy storage cell by means of the device for discharging if the traveling distance exceeds a predetermined threshold value, the at least one acceleration value in the X, Y or Z direction exceeds a second predetermined threshold value, the horizontal distance is less than a predetermined threshold value, the acceleration values in the X, Y or Z direction equal predetermined values or the difference value between the first and second detected voltage value of the at least one energy storage cell is less than a predetermined threshold value. - Determining that the system is free-falling by detecting an acceleration value in the X, Y and Z direction being equal to predetermined range; - Determining an impact of the system by detecting at least one acceleration value in the X, Y or Z direction exceeding a first predetermined threshold value; - Determine a traveling distance between detecting an acceleration value in the X, Y or Z direction being equal to a predetermined range and detecting at least one acceleration value in the X, Y or Z direction exceeding the first predetermined threshold value; - Determining an orientation of the system at the impact by evaluating the at least one acceleration value in the X, Y or Z direction by means of a look-up table; - Determining a point of impact on a housing of the system by interpreting the orientation of the system at the impact in reference to the dimensions of the housing (7, 6) and determining a horizontal distance to a center of gravity of the system; - Detecting a first and second voltage value of the at least one energy storage cell by means of the device for measuring a voltage; and - Discharging the at least one energy storage cell by means of the device for discharging if the traveling distance exceeds a predetermined threshold value, the at least one acceleration value in the X, Y or Z direction exceeds a second predetermined threshold value, the horizontal distance is less than a predetermined threshold value, the acceleration values in the X, Y or Z direction equal predetermined values or the difference value between the first and second detected voltage value of the at least one energy storage cell is less than a predetermined threshold value.