Motors

The Zumo32U4 includes a DRV8837 [2] as a dual motor driver. The DRV8837 handles the current requirements for motors. It also provides rotational direction control of the motors.

The Zumo Library [8] provides the following API to control the motors’ speed.

class Zumo32U4Motors
Controls motor speed and direction on the Zumo 32U4.
void setSpeeds(int16_t leftSpeed, int16_t rightSpeed)

Sets the speeds for both motors.

int16_t leftSpeed

A number from -400 to 400 representing the speed and direction of the left motor. Values of -400 or less result in full speed reverse, and values of 400 or more result in full speed forward.

int16_t rightSpeed

A number from -400 to 400 representing the speed and direction of the right motor. Values of -400 or less result in full speed reverse, and values of 400 or more result in full speed forward.

Zumo32U4Motors::setSpeeds() enables us to control both motors. For instance a \(400\) value in leftSpeed will set the a 100% duty cycle with level \(6V\) PWM between the left motor’s DRV8837’s outputs (OUT1 and OUT2). Which results in applying full forward speed to the left motor. A value of \(-200\) will set a 50% duty cycle with level of \(-6V\) PWM between the left motor’s DRV8837’s outputs (OUT1 and OUT2).

The PWM duty cycle can be translated into a percentage of maximum current applied to the motor \(I_{max}\). Table 1’s shows the value of \(I_{max}\) which corresponds to the Stall Current at 6V. Additionally, the torque of the motor is linearly related to the current is applied to it. Therefore, the torque of the motors can be calculated by;

\[\tau_0 = \frac{\tau_s}{400} \times speed_{PWM}\]

Where \(\tau_s\) is the stall torque of the motor at 6V. In our case we used \(\tau_t = 0.211846 Nm\).

Table 1 Motors’ Torque related information per Zumo32u4 model [11]
Model Stall Torque @ 6V (\(Nm\)) Free-run Speed @ 6V (\(RPM\)) Stall Current @ 6V (\(A\))
75:1 \(0.105923\) \(625\) \(1.6\)
50:1 \(0.155354\) \(400\) \(1.6\)
100:1 \(0.211846\) \(320\) \(1.6\)

[2]Texas Instruments. Texas Instruments DRV8837/DRV8838 motor driver datasheet. June 2012. URL: https://www.pololu.com/file/0J806/drv8838.pdf.
[8]Pololu. Zumo library. URL: https://github.com/pololu/zumo-32u4-arduino-library.
[11]Pololu. Zumo 32u4 robot (assembled with 100:1 hp motors). 2017. URL: https://www.pololu.com/product/3127.