A square baler comprising a biomass feed connected to a bale-forming chamber, a piston that is reciprocable in the bale-forming chamber in order to compress biomass fed into the bale-forming chamber via the biomass feed and form bales and a bale discharge, the dimensions of part of the interior of the bale-forming chamber being adjustable under the influence of at least one actuator the energization of which is controlable; the baler comprising: a) a first sensor for sensing the mass of a bale formed in the baler and generating a first signal that is indicative thereof; b) a second sensor for sensing the force applied by the piston and generating a second signal that is indicative thereof; c) a third sensor for sensing the energization of the acuator and generating a third signal that is indicative thereof; d) means for setting a target weight value by the operator for determining a target value for the mass of a bale formed in the baler; and e) a controller for controlling the operation of the baler in dependence on the first, second and third signals (MW, MF, MP), characterised in that: • the first signal is fed back in a first control loop and compared with the target weight value in order to generate a target force value; • the second signal is fed back in a second control loop and compared with the target force value in order to generate a target energization value; • the third signal is fed back in a third control loop and compared with the target energization value in order to control the energization of the actuator; and • the sampling frequency of the second control loop is higher than that of the first control loop and lower than that of the third control loop. a) a first sensor for sensing the mass of a bale formed in the baler and generating a first signal that is indicative thereof; b) a second sensor for sensing the force applied by the piston and generating a second signal that is indicative thereof; c) a third sensor for sensing the energization of the acuator and generating a third signal that is indicative thereof; d) means for setting a target weight value by the operator for determining a target value for the mass of a bale formed in the baler; and e) a controller for controlling the operation of the baler in dependence on the first, second and third signals (MW, MF, MP), characterised in that: • the first signal is fed back in a first control loop and compared with the target weight value in order to generate a target force value; • the second signal is fed back in a second control loop and compared with the target force value in order to generate a target energization value; • the third signal is fed back in a third control loop and compared with the target energization value in order to control the energization of the actuator; and • the sampling frequency of the second control loop is higher than that of the first control loop and lower than that of the third control loop. • the first signal is fed back in a first control loop and compared with the target weight value in order to generate a target force value; • the second signal is fed back in a second control loop and compared with the target force value in order to generate a target energization value; • the third signal is fed back in a third control loop and compared with the target energization value in order to control the energization of the actuator; and • the sampling frequency of the second control loop is higher than that of the first control loop and lower than that of the third control loop.