3 | | The Pi Zero has 2 hardware-supported PWM outputs on GPIO18, GPIO19: [http://circuitdigest.com/microcontroller-projects/raspberry-pi-pwm-tutorial Pi PWM Tutorial] [https://www.npmjs.com/package/raspi-pwm PWM via WiringPi] through some clever programming, additional hardware-assisted PWM can be implemented via DMA: [https://pythonhosted.org/RPIO/pwm_py.html PWM via DMA] |
| 3 | 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. |
| 4 | |
| 5 | Two of the PWM outputs are available on the !MotorController connector which is pin compatible with the very low cost [https://www.newegg.com/Product/Product.aspx?Item=9SIA67049F0817 L298N dual DC motor controller] which is suitable for small DC motors. The same connector can be connected to larger motor controllers such as [http://www.revrobotics.com/spark/ Spark], [http://www.andymark.com/Victor-SP-p/am-2855.htm Victor SP], or [https://www.andymark.com/Talon-p/am-talon-discontinued.htm 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. |
| 6 | |
| 7 | Note that in all cases, power to the motors is supplied by the battery through the motor controller and *not* by the !PiBotZero power supply. |
| 8 | |
| 9 | The !PiBot Image libraries include an [http://wiki.team2537.com/browser/pibot/trunk/src/java/com/tenetics/pibot/L298.java L298 motor control class] that is similar to the motor control classes offered by WPILib. |
| 10 | |
| 11 | 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: [http://circuitdigest.com/microcontroller-projects/raspberry-pi-pwm-tutorial Pi PWM Tutorial] [https://www.npmjs.com/package/raspi-pwm PWM via WiringPi] through some clever programming, additional hardware-assisted PWM can be implemented via DMA: [https://pythonhosted.org/RPIO/pwm_py.html 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. |