A motor driving device configured to control motor current flowing to a motor in accordance with a torque command, the motor driving device comprising: a friction compensator configured to generate a friction compensating torque command for compensation of static friction torque of the motor, wherein the friction compensator generates the friction compensating torque command in accordance with code of variation for a torque command immediately before the torque command, and the motor driving device controls the motor current in accordance with a compensated torque command; and a speed detector configured to receive a motor position from an encoder of the motor and to calculate a motor speed, wherein the friction compensator includes: a variation calculator configured to calculate the variation of torque command in accordance with the received torque command; a code calculator configured to calculate a variation code in accordance with the variation received from the variation calculator, wherein the variation code is 1 when the variation has a positive value, and the variation code 112)is-1 when the variation has a negative value, characterized in that the friction compensator further includes a storage configured to store a value of static friction torque; and a torque calculator configured to calculate the friction compensating torque command in accordance with the motor speed and a static friction torque compensation value obtained by multiplying the variation code and the static friction torque; wherein the torque calculator receives the motor speed from the speed detector, wherein the torque calculator sets the friction compensating torque command to the static friction torque compensation value when the motor speed is zero and sets the friction compensating torque command to zero when the motor speed is not zero; and wherein the compensated torque command is generated by adding or subtracting the friction compensating torque command to or from the torque command. a friction compensator configured to generate a friction compensating torque command for compensation of static friction torque of the motor, wherein the friction compensator generates the friction compensating torque command in accordance with code of variation for a torque command immediately before the torque command, and the motor driving device controls the motor current in accordance with a compensated torque command; and a speed detector configured to receive a motor position from an encoder of the motor and to calculate a motor speed, wherein the friction compensator includes: a variation calculator configured to calculate the variation of torque command in accordance with the received torque command; a code calculator configured to calculate a variation code in accordance with the variation received from the variation calculator, wherein the variation code is 1 when the variation has a positive value, and the variation code 112)is-1 when the variation has a negative value, characterized in that the friction compensator further includes a storage configured to store a value of static friction torque; and a torque calculator configured to calculate the friction compensating torque command in accordance with the motor speed and a static friction torque compensation value obtained by multiplying the variation code and the static friction torque; wherein the torque calculator receives the motor speed from the speed detector, wherein the torque calculator sets the friction compensating torque command to the static friction torque compensation value when the motor speed is zero and sets the friction compensating torque command to zero when the motor speed is not zero; and wherein the compensated torque command is generated by adding or subtracting the friction compensating torque command to or from the torque command. a variation calculator configured to calculate the variation of torque command in accordance with the received torque command; a code calculator configured to calculate a variation code in accordance with the variation received from the variation calculator, wherein the variation code is 1 when the variation has a positive value, and the variation code 112)is-1 when the variation has a negative value, characterized in that the friction compensator further includes a storage configured to store a value of static friction torque; and a torque calculator configured to calculate the friction compensating torque command in accordance with the motor speed and a static friction torque compensation value obtained by multiplying the variation code and the static friction torque; wherein the torque calculator receives the motor speed from the speed detector, wherein the torque calculator sets the friction compensating torque command to the static friction torque compensation value when the motor speed is zero and sets the friction compensating torque command to zero when the motor speed is not zero; and wherein the compensated torque command is generated by adding or subtracting the friction compensating torque command to or from the torque command.