RTK RPi MCB Basics
The documentation that is provided with the RTK MCB is pretty sparse. Here are some things that I learned while putzing that I wish was in the documentation.
Second, as the documentation says, the left-hand input on the J1 VCC2 terminal block is for positive power. The right-hand input is for ground. The positive input is on the left when you face the terminal block to insert the wires.
Next, the J2 and J3 terminal blocks are to connect to the motors. J3 is for motor one. J2 is for motor two. The circuit that connects to the terminal blocks works as follows:
- GPIO 17 / Pin 11 on the RPi connects to the left-hand input on terminal block J3
- GPIO 18 / Pin 12 on the RPi connects to the right-hand input on terminal block J3
- GPIO 22 / Pin 15 on the RPI connects to the right-hand input on terminal block J2
- GPIO 23 / Pin 16 on the RPI connects to the left-hand input on terminal block J2
This is a bit confusing. Say your motor has a red and a black wire. If you plug the red wire into the left input on terminal J3 and send power out GPIO 17, it will spin the motor in one direction, for example clockwise. Then, you plug the red wire into the left input on terminal J2 and send power out GPIO 22, it will spin the motor counter-clockwise. It would make more sense if applying power to GPIOs 17 and 22 made the same motor spin the same way.
In order to power a motor, you have to set one of the pins HIGH and the other pin LOW on a terminal block. Setting one pin HIGH but not setting the other pin will not work.
Finally, I have no idea what pin headers J4, J5, and J6 are for. The are labeled 3V3, GND, and I2C respectively. The documentation does not explain their purpose and they are not needed to run the motors. It would be nice to have a circuit diagram for the PCB.
Power Supplies
I connected a 12v, 200mA power supply and it worked much better. More on that below.
Trying to run two motors at the same time seems to make each motor run slower than just powering one motor. Maybe a PSU that put out more amps would help in this case.
Python Code
- accept inputs for the motor to power (1, 2, or both), the time the motors will run, and the amount of power to send to the motors
- power one or both of the motors for whatever length of time the user specifies
- spin the motor first clockwise for one second. Then, counterclockwise for 1.5 seconds. Repeat for the allotted time.
- control how fast the motors spin using pulse width modulation.
Testing with the Auger
We tried using a smaller, 1" tube. The motor would not spin the auger at all with food in the tube. We changed the program so it spun the motor clockwise for 5 seconds instead of 1 second. That did nothing.
Next, we connected a 12v, 200mA power supply as the motor power source. The motor had no problem pushing food through the 2" tube with this much power. We played with the time and power settings. It looks like the best settings are to run the motor for 10 seconds at 75% power. This will push the right amount of food into the bowl.
It would also be nice to have something to hold the motor down while testing. I'll have to build something.
No comments:
Post a Comment