Basebot modules
From Rsewiki
Back to Basebot
Module description
Main code
Support modules
Motor blocks
Motor voltage is translated to a PWM at 65kHz where the average value corresponds to the set motor voltage. Current battery voltage is taken into consideration.
PWM = motorVoltage * MAX_PWM/(battery_voltage - voltageLoss)
The motor controller has a minimum pulse width. If the motor voltage is not zero, a minimum PWM is added to compensate. The minimum corresponds to 0.4V motor voltage.
(implemented in umotor.cpp in function motorSetAnchorVoltage())