A cassette-based fluid balancing system (143), comprises a first liquid flow path connecting a first inlet to a first outlet; a second liquid flow path connecting a second inlet to a second outlet; a control fluid path configured for controlling a diaphragm pump (35); said pump (35) comprising a rigid vessel containing a diaphragm dividing the rigid vessel into a control compartment and a liquid pumping compartment, the control compartment of said pump (35) being in fluidic communication with the control fluid path and the liquid pumping compartment being in fluidic communication with the second liquid flow path; a balancing chamber (341; 342) comprising a flexible diaphragm dividing the chamber into two liquid compartments, a first liquid compartment in fluidic communication with the first liquid flow path and a second liquid compartment in fluidic communication with the second liquid flow path; the balancing chamber (341; 342) configured to balance flow between the first liquid flow path and the second liquid flow path; and a first valve (211; 222) interposed between the liquid pumping compartment of the diaphragm pump (35) and the second liquid compartment of the balancing chamber (341; 342), said first valve (211; 222) under control of a controller; wherein the controller is configured to operate the first valve (211; 222) using pulse-width modulation.