A method of controlling a robot arm, where said robot arm comprises a plurality of robot joints connecting a robot base and a robot tool flange, where at least one of said robot joints is a rotational robot joint comprising a joint motor having a motor axle, where said motor axle is configured to rotate an output axle of said rotational robot joint via a robot joint transmission, said method comprises the steps of: • obtaining the angular position (Θ) of said motor axle by measuring said angular position of said motor axle using a motor axle encoder; • obtaining the angular position (q) of said output axle by measuring said angular position (q) of said output axle using an output axle encoder; • obtaining the motor torque (τ motor) provided to said motor axle by said joint motor; • determining the friction torque ( F̂) of at least one of: o the input side of said robot joint transmission, or ∘ the output side of said robot joint transmission based on at least two of: o said angular position (Θ) of said motor axle, or o said angular position (q) of said output axle, or o said motor torque (τ motor /i motor) provided to said motor axle by said joint motor; • determining a robot joint transmission torque (τ̂ J) between the input side and the output side of said robot joint transmission based on at least one of: o said angular position (q) of said output axle, or o said angular position (q) of said output axle and said angular position (Θ) of said motor axle, or ∘ said angular position (Θ) of said motor axle and said motor torque (τ motor) provided to said motor axle by said joint motor; • generating, based on a dynamic model of the robot arm, a motor control signal for said at least one joint motor of said rotational joint based on: ∘ said friction torque ( F̂) of at least one of said input side of said robot joint transmission and said output side of said robot joint transmission, and ∘ said robot joint transmission torque (τ̂ J) between the input side and the output side of said robot joint transmission. • obtaining the angular position (Θ) of said motor axle by measuring said angular position of said motor axle using a motor axle encoder; • obtaining the angular position (q) of said output axle by measuring said angular position (q) of said output axle using an output axle encoder; • obtaining the motor torque (τ motor) provided to said motor axle by said joint motor; • determining the friction torque ( F̂) of at least one of: o the input side of said robot joint transmission, or ∘ the output side of said robot joint transmission based on at least two of: o said angular position (Θ) of said motor axle, or o said angular position (q) of said output axle, or o said motor torque (τ motor /i motor) provided to said motor axle by said joint motor; o the input side of said robot joint transmission, or ∘ the output side of said robot joint transmission based on at least two of: o said angular position (Θ) of said motor axle, or o said angular position (q) of said output axle, or o said motor torque (τ motor /i motor) provided to said motor axle by said joint motor; o said angular position (Θ) of said motor axle, or o said angular position (q) of said output axle, or o said motor torque (τ motor /i motor) provided to said motor axle by said joint motor; • determining a robot joint transmission torque (τ̂ J) between the input side and the output side of said robot joint transmission based on at least one of: o said angular position (q) of said output axle, or o said angular position (q) of said output axle and said angular position (Θ) of said motor axle, or ∘ said angular position (Θ) of said motor axle and said motor torque (τ motor) provided to said motor axle by said joint motor; o said angular position (q) of said output axle, or o said angular position (q) of said output axle and said angular position (Θ) of said motor axle, or ∘ said angular position (Θ) of said motor axle and said motor torque (τ motor) provided to said motor axle by said joint motor; • generating, based on a dynamic model of the robot arm, a motor control signal for said at least one joint motor of said rotational joint based on: ∘ said friction torque ( F̂) of at least one of said input side of said robot joint transmission and said output side of said robot joint transmission, and ∘ said robot joint transmission torque (τ̂ J) between the input side and the output side of said robot joint transmission. ∘ said friction torque ( F̂) of at least one of said input side of said robot joint transmission and said output side of said robot joint transmission, and ∘ said robot joint transmission torque (τ̂ J) between the input side and the output side of said robot joint transmission.