A drivetrain system (10; 100; 200) for a human-powered vehicle comprising: a crank (1; 11; 110; 210) configured to be rotated by a human; a shaft (3; 30; 212) driven by the crank; a drive wheel (6; 52; 152; 252) configured to be driven by the shaft; a first motor (4; 32; 132; 232; 340) configured to power the shaft; a first freewheel mechanism (2; 26; 214) connected between the crank and the shaft such that the first motor powers the shaft to drive the drive wheel forwards without back-driving the crank; a second freewheel mechanism (5; 48; 240) connected between the shaft and the drive wheel such that the drive wheel moves forwards without back-driving the first motor or the crank; a second motor (7; 54; 154; 254; 342) configured to power the drive wheel or a further drive wheel; and a transmission (9; 42; 242; 360) connected between one of: the first motor and the second freewheel mechanism; the second freewheel mechanism and the drive wheel; and the first freewheel mechanism and the first motor; characterised by a controller (8; 305, 320) connected to: a sensor configured to sense pedal cadence; a sensor configured to sense pedal torque; a sensor configured to sense speed of the first motor; a sensor configured to sense speed of the second motor; a sensor configured to sense current drawn by the first motor; a sensor configured to sense current drawn by the second motor; a sensor configured to sense input shaft speed of the transmission; a sensor configured to sense output shaft speed of the transmission; the first and second motors; and the transmission; wherein the controller is configured to optimize a combined efficiency of the first and second motors,when both first and second motors are powering the vehicle. a crank (1; 11; 110; 210) configured to be rotated by a human; a shaft (3; 30; 212) driven by the crank; a drive wheel (6; 52; 152; 252) configured to be driven by the shaft; a first motor (4; 32; 132; 232; 340) configured to power the shaft; a first freewheel mechanism (2; 26; 214) connected between the crank and the shaft such that the first motor powers the shaft to drive the drive wheel forwards without back-driving the crank; the first motor and the second freewheel mechanism; the second freewheel mechanism and the drive wheel; and the first freewheel mechanism and the first motor; characterised by a controller (8; 305, 320) connected to: a sensor configured to sense pedal cadence; a sensor configured to sense pedal torque; a sensor configured to sense speed of the first motor; a sensor configured to sense speed of the second motor; a sensor configured to sense current drawn by the first motor; a sensor configured to sense current drawn by the second motor; a sensor configured to sense input shaft speed of the transmission; a sensor configured to sense output shaft speed of the transmission; the first and second motors; and the transmission; wherein the controller is configured to optimize a combined efficiency of the first and second motors,when both first and second motors are powering the vehicle. a sensor configured to sense pedal cadence; a sensor configured to sense pedal torque; a sensor configured to sense speed of the first motor; a sensor configured to sense speed of the second motor; a sensor configured to sense current drawn by the first motor; a sensor configured to sense current drawn by the second motor; a sensor configured to sense input shaft speed of the transmission; a sensor configured to sense output shaft speed of the transmission; the first and second motors; and the transmission; wherein the controller is configured to optimize a combined efficiency of the first and second motors,when both first and second motors are powering the vehicle.