Method for automatically controlling the movement of at least one joint (L1-L6) of a robotic arm, wherein the robotic arm has multiple members (G1-G7), which can be adjusted relative to one another by the movements of the joints (L1-L6) of the robotic arm, and the at least one joint (L1-L6) comprises a transmission which is designed to adjust the at least one joint (L1-L6), specifically by automatically controlling an electric motor (M1-M6) of the robotic arm connected to the transmission, comprising the steps of: - detecting the motor positions (q), the motor speeds (q') and/or the motor accelerations (q") of the electric motor (M1-M6) at specific points in time (t) over the course of time, - measuring the respective joint moment (τ) at the specific points in time (t) over the course of time, - calculating the respective model-based joint moments (τ ref) at the specific points in time (t) over the course of time by means of the inverse dynamics of a dynamic model of the robotic arm from the detected motor positions (q), motor speeds (q') and/or motor accelerations (q"), - determining estimated moment ripples (τ ripple) in the form of a periodic function with the amplitude and the phase (φ) in dependence on the motor positions (q), wherein - the amplitude and the phase (φ) of the periodic function are adapted by means of an optimizing procedure, in that - the deviation between the respectively measured joint moments (τ) and the respectively calculated model-based joint moments (τ ref) is used as a remainder (r) for the optimization, and - adapting the setpoint values (q set, q' set, q" set) to be commanded for the motor positions (q), the motor speeds (q') and/or the motor accelerations (q"), in that the motor position deviations (q ref) occurring on account of the moment ripple (τ ripple) are determined from the estimated moment ripples (τ ripple) and a joint torsional stiffness (k) of the at least one joint and are used for the adaptation of the setpoint values (q set, q' set, q" set) to be commanded. - detecting the motor positions (q), the motor speeds (q') and/or the motor accelerations (q") of the electric motor (M1-M6) at specific points in time (t) over the course of time, - measuring the respective joint moment (τ) at the specific points in time (t) over the course of time, - calculating the respective model-based joint moments (τ ref) at the specific points in time (t) over the course of time by means of the inverse dynamics of a dynamic model of the robotic arm from the detected motor positions (q), motor speeds (q') and/or motor accelerations (q"), - determining estimated moment ripples (τ ripple) in the form of a periodic function with the amplitude and the phase (φ) in dependence on the motor positions (q), wherein - the amplitude and the phase (φ) of the periodic function are adapted by means of an optimizing procedure, in that - the deviation between the respectively measured joint moments (τ) and the respectively calculated model-based joint moments (τ ref) is used as a remainder (r) for the optimization, and - adapting the setpoint values (q set, q' set, q" set) to be commanded for the motor positions (q), the motor speeds (q') and/or the motor accelerations (q"), in that the motor position deviations (q ref) occurring on account of the moment ripple (τ ripple) are determined from the estimated moment ripples (τ ripple) and a joint torsional stiffness (k) of the at least one joint and are used for the adaptation of the setpoint values (q set, q' set, q" set) to be commanded.