A controller for a robot provided with a vertical 6-axis articulated arm having an offset arm, the offset arm being provided with a fifth axis, linking a fourth axis and a sixth axis with each other, and having a link length d5, the fourth axis having a central axis and the sixth axis having a central axis, both of the central axes being parallel with each other, the vertical 6-axis articulated arm having a head portion designated as a control point, a position and an orientation targeted to the control point being processed by an inverse transform in order to calculate an angle of each of the axes, the controller characterised by: an angular provisional deciding unit configured to provisionally decide, as an initial angle thereof, an angle of the sixth axis; a direction calculating unit configured to calculate a direction of the offset arm based on the provisionally decided angle of the sixth axis; a provisional target position calculating unit configured to calculate a provisional target position which is subtracted from a target position of the sixth axis by the link length d5; an inverse transform processing unit configured to apply an inverse transform process to the provisional target position in a state where the link length d5 is set to 0; and an estimation unit configured (S7 to S12) to i) estimate an evaluation amount obtained by the inverse transform process based on an evaluation function, ii) determine whether or not an absolute value of the evaluation amount is over a predetermined value, iii) update the angle of the sixth axis when the absolute value of the evaluation amount is over the predetermined value, and iv) repeat the processes starting from the provisional decision performed by the angular provisional deciding unit to the inverse transform performed by the inverse transform processing unit, until a difference between the updated angle of the sixth axis and the provisionally decided angle of the sixth axis becomes equal to or less than a predetermined value. an angular provisional deciding unit configured to provisionally decide, as an initial angle thereof, an angle of the sixth axis; a direction calculating unit configured to calculate a direction of the offset arm based on the provisionally decided angle of the sixth axis; a provisional target position calculating unit configured to calculate a provisional target position which is subtracted from a target position of the sixth axis by the link length d5; an inverse transform processing unit configured to apply an inverse transform process to the provisional target position in a state where the link length d5 is set to 0; and an estimation unit configured (S7 to S12) to i) estimate an evaluation amount obtained by the inverse transform process based on an evaluation function, ii) determine whether or not an absolute value of the evaluation amount is over a predetermined value, iii) update the angle of the sixth axis when the absolute value of the evaluation amount is over the predetermined value, and iv) repeat the processes starting from the provisional decision performed by the angular provisional deciding unit to the inverse transform performed by the inverse transform processing unit, until a difference between the updated angle of the sixth axis and the provisionally decided angle of the sixth axis becomes equal to or less than a predetermined value.