A grinding machine for grinding an external or internal surface of a cylindrical workpiece (W), comprising: a grinding wheel ; a workpiece support device for rotatably supporting and driving the cylindrical workpiece (W); a feed device for relatively moving the cylindrical workpiece (W) and the grinding wheel to move the cylindrical workpiece (W) and the grinding wheel toward and away from each other; advance grinding control means for performing an advance grinding in which the grinding wheel is relatively moved in a first direction to be pressed on the cylindrical workpiece (W) to increase a total bending amount value δ(t) which is a total value of a bending amount of the cylindrical workpiece (W) and a bending amount of the grinding wheel ; a sizing device for detecting the diameter of the cylindrical workpiece (W); and a linear scale for detecting the position of the grinding wheel on a corresponding axis; characterized by target bending amount generation means for generating target total bending amount values δ(t) of the cylindrical workpiece (W) and the grinding wheel at respective times t within a rotational range for the cylindrical workpiece (W) to rotate from a present rotational phase θt to a target rotational phase θe in a retraction grinding which is to be performed following the advance grinding in such a way as to relatively move the grinding wheel in a second direction to go away from the cylindrical workpiece (W) as the total bending amount value δ(t) of the cylindrical workpiece (W) and the grinding wheel is decreased; position command value generation means for generating relative position command values X ref (t) at the respective times t of the grinding wheel relative to the cylindrical workpiece (W) based on the target total bending amount values 5(t); and retraction grinding control means (70, S4-S6, 203, 204) for controlling the feed device based on the position command values X ref (t) to execute the retraction grinding. a grinding wheel ; a workpiece support device for rotatably supporting and driving the cylindrical workpiece (W); a feed device for relatively moving the cylindrical workpiece (W) and the grinding wheel to move the cylindrical workpiece (W) and the grinding wheel toward and away from each other; advance grinding control means for performing an advance grinding in which the grinding wheel is relatively moved in a first direction to be pressed on the cylindrical workpiece (W) to increase a total bending amount value δ(t) which is a total value of a bending amount of the cylindrical workpiece (W) and a bending amount of the grinding wheel ; a sizing device for detecting the diameter of the cylindrical workpiece (W); and a linear scale for detecting the position of the grinding wheel on a corresponding axis; characterized by target bending amount generation means for generating target total bending amount values δ(t) of the cylindrical workpiece (W) and the grinding wheel at respective times t within a rotational range for the cylindrical workpiece (W) to rotate from a present rotational phase θt to a target rotational phase θe in a retraction grinding which is to be performed following the advance grinding in such a way as to relatively move the grinding wheel in a second direction to go away from the cylindrical workpiece (W) as the total bending amount value δ(t) of the cylindrical workpiece (W) and the grinding wheel is decreased; position command value generation means for generating relative position command values X ref (t) at the respective times t of the grinding wheel relative to the cylindrical workpiece (W) based on the target total bending amount values 5(t); and retraction grinding control means (70, S4-S6, 203, 204) for controlling the feed device based on the position command values X ref (t) to execute the retraction grinding. <EOS>