Too high voltage on the generator

Robin2:

ManFish:
The problem is that i measured a 7.3 V on the generator when setting the PWM to 255 (for the first motor). Since the motor (generator) operating voltage ,according to the datasheet, is 1.5 - 6.5 V this could damage the motor.

I assume the PWM signal is applied to motor A and the voltage is measured on Motor B acting as a generator? I presume there is no electrical connection between motor and generator?

Correct.

Thank you both, you've been very helpful.