A method of controlling a hydraulic system arranged to operate a working equipment, wherein the hydraulic system comprises - a set of hydraulic cylinders (5, 6, 7), each cylinder (5, 6, 7) being equipped with a piston (8, 9, 10) which is slidingly arranged in the cylinder (5, 6, 7), wherein each piston (8, 9, 10) divides its associated cylinder chamber into a first chamber (11, 12, 13) and a second chamber (14, 15, 16), the first chamber (11, 12, 13) being provided with a first port (17, 18, 19) through which hydraulic fluid is able to enter and to exit the first chamber (11, 12, 13), and the second chamber (14, 15, 16) being provided with a second port (20, 21, 22) through which hydraulic fluid is able to enter and to exit the second chamber (14, 15, 16), - a tank for housing hydraulic fluid, - a pump configured to pump hydraulic fluid from the tank to each cylinder, - a set of hydraulic control valves (25, 26, 27), one for each cylinder, each control valve (25, 26, 27) being configured to control a flow of hydraulic fluid from said pump to either of the first port (17, 18, 19) and the second port (20, 21, 22) of its associated cylinder and to simultaneously allow a return flow from the other of the first port (17, 18, 19) and second port (20, 21, 22) of its associated cylinder to the tank, wherein said method is characterised in that it comprises the steps of: - determining the total return flow rate from said cylinders (5, 6, 7) to the tank, and - controlling the flow rate of hydraulic fluid to said first or second port) of the cylinders (5, 6, 7) on basis of the determined total return flow rate, such that a predetermined return flow rate limit is not exceeded. - a set of hydraulic cylinders (5, 6, 7), each cylinder (5, 6, 7) being equipped with a piston (8, 9, 10) which is slidingly arranged in the cylinder (5, 6, 7), wherein each piston (8, 9, 10) divides its associated cylinder chamber into a first chamber (11, 12, 13) and a second chamber (14, 15, 16), the first chamber (11, 12, 13) being provided with a first port (17, 18, 19) through which hydraulic fluid is able to enter and to exit the first chamber (11, 12, 13), and the second chamber (14, 15, 16) being provided with a second port (20, 21, 22) through which hydraulic fluid is able to enter and to exit the second chamber (14, 15, 16), - a tank for housing hydraulic fluid, - a pump configured to pump hydraulic fluid from the tank to each cylinder, - a set of hydraulic control valves (25, 26, 27), one for each cylinder, each control valve (25, 26, 27) being configured to control a flow of hydraulic fluid from said pump to either of the first port (17, 18, 19) and the second port (20, 21, 22) of its associated cylinder and to simultaneously allow a return flow from the other of the first port (17, 18, 19) and second port (20, 21, 22) of its associated cylinder to the tank, wherein said method is characterised in that it comprises the steps of: - determining the total return flow rate from said cylinders (5, 6, 7) to the tank, and - controlling the flow rate of hydraulic fluid to said first or second port) of the cylinders (5, 6, 7) on basis of the determined total return flow rate, such that a predetermined return flow rate limit is not exceeded. - determining the total return flow rate from said cylinders (5, 6, 7) to the tank, and - controlling the flow rate of hydraulic fluid to said first or second port) of the cylinders (5, 6, 7) on basis of the determined total return flow rate, such that a predetermined return flow rate limit is not exceeded.