Hardware Reference
In-Depth Information
Figure 7-6. My bipolar stepper motor setup
Choosing Driving GPIOs
Recall from Chapter 6's Table 6-1 that some GPIO pins are more suitable than others for
motor controls. While the Raspberry Pi is booting up, we don't want driver circuits and
motors running amok. It is best that the motor remains disabled until the Pi boots up and
the motor-controlling software takes proper control.
When using the L298, we can take one of two design approaches:
Tie enable inputs high, but choose
motor-safe GPIO pins for the
driver inputs.
Drive the enable inputs from a
motor-safe GPIO and configure the
other GPIO pins after boot-up.
The first option does not use the enable inputs at all. For that, you must make sure
that all In GPIO pins are safe for motor control at boot time. The disadvantage is that all
four input controls need to be taken from the safe GPIO pool. If you need to drive more
than one motor, your options start to become limited.
The second approach uses motor-safe GPIO pin(s) on the two enable inputs of the
L298 driver. This way, the enable inputs are pulled down during the boot-up process,
disabling the motor controls, regardless of the state of the In pins. This gives you flexibility
to choose any other GPIO pins for use for the In signals. This is the approach adopted for
this chapter's project. (Note that you can tie the enable pins together so that only one safe
GPIO pin is required to drive the enable input.) Because a bipolar stepper motor needs a
bridge driver for each of its two windings, we'll use both bridge driver units provided by
the L298 IC.
The enable inputs for the two windings can be ganged together and driven by one
GPIO pin. This, of course, increases the load on the GPIO output, but at a worst case of
200 mA , the driving voltage requirements will be easily met.
 
Search WWH ::




Custom Search