wiki:MiniBotDrive

Mini Bot DC Motor Control

The PiBotZero includes a dedicated hardware PWM generator with 6 individual outputs at 5v levels that can be used to drive servo motors directly or DC motors via a PWM motor controller.

Two of the PWM outputs are available on the MotorController connector which is pin compatible with the very low cost L298N dual DC motor controller which is suitable for small DC motors. The same connector can be connected to larger motor controllers such as Spark, Victor SP, or Talon SR which can drive much larger motors such as CIM motors. The remaining 4 PWM outputs can control additional DC or Servo motors for mechanisms.

The PiBot Image libraries include an L298 motor control class and a Servo control class that are similar to the classes offered in WPILib.

Note that power to the motors is supplied by the battery through the motor controller; motors are *not* powered by the PiBotZero power supply (although in a pinch, the PiBotZero can power a single very small servo motor directly); the PiBotZero only provides the *interface* to connect the raspberry pi to the motor controllers.

The Raspberry Pi can also be used for motor control in limited fashion without a PiBotZero; the Pi Zero has 2 hardware-supported PWM outputs on GPIO18, GPIO19: Pi PWM Tutorial PWM via WiringPi through some clever programming, additional hardware-assisted PWM can be implemented via DMA: PWM via DMA. However, note that the PWM outputs of the raspberry Pi are at 3.3 volt levels which may not be suitable for most motor controllers.

Last modified 4 years ago Last modified on Jul 17, 2017, 9:57:17 PM