-
Notifications
You must be signed in to change notification settings - Fork 1
Connecting it up
The Raspberry Pi is connected to the stepper motor via the TB6600 stepper driver as follows:
Unless you are brave, I wouldn't go ahead with simply connecting the Raspberry Pi to the stepper driver until you've done some basic tests of your wiring first. I would recommend connecting the GPIO cables to the stepper driver, but performing the following tests with the connector removed from the driver first to see if the signal levels coming out of the Raspberry Pi are correct and hence connected correctly.
From the top of the connector you have access to the following pins:
- ENA-
- ENA+
- DIR-
- DIR+
- PUL-
- PUL+
Also in the picture you will see a black cable connected to GPIO pin 9 which is a 0V point.
Run the all_low script as follows:
python3 all-low.py
The console should have shown this:
setting all pins low: ENA-, DIR- and PUL-
pi@raspberrypi:~/wheel-cutter $
At this point you should use a multimeter to test the voltages of each pin using the GPIO pin 9 as a 0V reference. You should get the following:
Pi | Voltage |
---|---|
ENA- | 0V |
ENA+ | 3V |
DIR- | 0V |
DIR+ | 3V |
PUL- | 0V |
PUL+ | 3V |
You can now run the script to make the ENA- pin high:
python3 ena-high.py
The console will show the following:
setting ENA- : HIGH
You should now be able to read 3.3V from the ENA- pin, but the DIR- and PUL- should still be reading 0V.
Now go ahead and set the DIR- pin high using this script
python3 dir-high.py
The console will show the following:
setting DIR- : HIGH
The DIR- pin should now be high (3.3V).
Finally test the PUL- pin setting high (3.3V) by running the following script:
python3 pul-high.py
The console will show the following. You can now check the voltage. All pins should be reading 3.3V this point.
setting PUL- : HIGH
Provided that all of the above tests worked, you should be safe to connect the Raspberry Pi to the stepper motor driver.