A power generating apparatus of renewable energy type, comprising: a rotor configured to rotate by renewable energy, a hydraulic pump configured to be driven by the rotor to pressurize working fluid, a hydraulic motor configured to be driven by the working fluid from the hydraulic pump, a high-pressure fluid line connecting an outlet of the hydraulic pump and an inlet of the hydraulic motor and configured to supply the hydraulic motor with the working fluid pressurized by the hydraulic pump, a low pressure fluid line connecting an outlet of the hydraulic motor and an inlet of the hydraulic pump and configured to return the working fluid having flown through the hydraulic motor to the hydraulic pump, a generator connected to a grid and configured to be driven by the hydraulic motor, and a motor controller for controlling the hydraulic motor, wherein the hydraulic motor includes: a rotatable shaft, a plurality of pistons configured to reciprocate in conjunction with the rotatable shaft, a plurality of cylinders forming a plurality of working chambers together with the plurality of pistons, a high-pressure valve for switching a communication state between each of the working chambers and the high-pressure fluid line, and a low-pressure valve for switching a communication state between each of the working chambers and the low pressure fluid line, wherein the motor controller is configured to close the high-pressure valve, for at least one of the working chambers corresponding to at least one piston moving downward from a top dead center toward a bottom dead center among the plurality of pistons, before the at least one piston moving downward reaches the bottom dead center, at the time of occurrence of a failure event of the grid, characterised in that the high-pressure valve is a normally-closed solenoid valve, and in that the motor controller is configured to stop supplying the high-pressure valve with exciting current, after the exciting current supplied to the high-pressure valve or the sum of the exciting current supplied to the high-pressure valve and exciting current supplied to the low-pressure valve becomes not greater than a threshold value, at the time of occurrence of a failure event of the grid. a rotor configured to rotate by renewable energy, a hydraulic pump configured to be driven by the rotor to pressurize working fluid, a hydraulic motor configured to be driven by the working fluid from the hydraulic pump, a high-pressure fluid line connecting an outlet of the hydraulic pump and an inlet of the hydraulic motor and configured to supply the hydraulic motor with the working fluid pressurized by the hydraulic pump, a low pressure fluid line connecting an outlet of the hydraulic motor and an inlet of the hydraulic pump and configured to return the working fluid having flown through the hydraulic motor to the hydraulic pump, a generator connected to a grid and configured to be driven by the hydraulic motor, and a motor controller for controlling the hydraulic motor, wherein the hydraulic motor includes: a rotatable shaft, a plurality of pistons configured to reciprocate in conjunction with the rotatable shaft, a plurality of cylinders forming a plurality of working chambers together with the plurality of pistons, a high-pressure valve for switching a communication state between each of the working chambers and the high-pressure fluid line, and a low-pressure valve for switching a communication state between each of the working chambers and the low pressure fluid line, a rotatable shaft, a plurality of pistons configured to reciprocate in conjunction with the rotatable shaft, a plurality of cylinders forming a plurality of working chambers together with the plurality of pistons, a high-pressure valve for switching a communication state between each of the working chambers and the high-pressure fluid line, and a low-pressure valve for switching a communication state between each of the working chambers and the low pressure fluid line, wherein the motor controller is configured to close the high-pressure valve, for at least one of the working chambers corresponding to at least one piston moving downward from a top dead center toward a bottom dead center among the plurality of pistons, before the at least one piston moving downward reaches the bottom dead center, at the time of occurrence of a failure event of the grid, characterised in that the high-pressure valve is a normally-closed solenoid valve, and in that the motor controller is configured to stop supplying the high-pressure valve with exciting current, after the exciting current supplied to the high-pressure valve or the sum of the exciting current supplied to the high-pressure valve and exciting current supplied to the low-pressure valve becomes not greater than a threshold value, at the time of occurrence of a failure event of the grid.