Exercise: DRV8833 Dual DC Motor Driver¶
Control a pair of DC motors using a driver module.
Driving a DC motor in either direction requires a circuit which can control the direction of the current. A common solution is to use a H bridge circuit topology which uses four switches operated in pairs to drive the supply current either forward or backward through the motor winding. The circuit is commonly drawn like the letter H with a motor on the crossbar and a switch on each leg. The bridge could be implemented using mechanical switches or relays, but for fast control with PWM it is common to use solid-state switches such as MOSFET transistors.
This exercise uses a module incorporating a DRV8833 driver chip which includes two H bridges and can drive two small DC motors bidirectionally. Speed control is supported by generating PWM signals in an Arduino to vary the average motor current. The bridges can also be wired in parallel to drive a single motor with twice the current.
Steps and observations¶
Find a DRV8833 module in the lab. The part comes without connectors installed, so if you find a new part you will need to solder two eight-pin header rows on the board so it can be used on a breadboard. Be sure to solder every pin. The recommended orientation is as pictured, with the driver chip on top, since the pin layout then matches the schematic symbol. You may find parts in the drawer with the pins soldered on the opposite side (silkscreen up, chip down); that orientation works fine, but please pay attention to the signal labels on the silkscreen so you make correct connections since the pin positions will be mirrored from the schematic symbol.
Load and run the WheelDrive sketch.
Observe the DC motor motion and compare against the code.
Try writing a ramp function to produce smoother speed changes. Can you choreograph a smooth motion sequence?