Step 4Test the PCB and add on your controller
After looking at the PCB and doing some testing, I found out the following pin info:
pin 2 - ground
pin 6,7 - controls the left motor h-bridge
pin 10,11 - controls the right motor h-bridge
pin 13 - Vcc output from the battery.
I'm assuming the other pins are housekeeping and getting the input from the receiver components. While having a wireless input into the PCB might be handy for something in the future, right now I'm interested in the h-bridges and how you control them.
The h-bridge for each side is made of 4 power transistors and 2 regular transistors. On my PCB, the power transistors where a pair of H8050 and H8550, controlled by a couple of regular transistors, C945s. All are in the TO-92 physical package. I suspect that other transistors might be used on other PCBs, it was a matter of who had what in stock at a cheap price that day. I found some datasheets for the H8050 and H8550 and it looks like each h-bridge is rated to 1.5 Amps. Again, there might be different components on other PCBs on other Tumblers, but the basic 1.5A rating should stay the same.
For each h-bridge, there is a pair of pins that controls it. Pins #6 and #7 for the left side, and #10 and #11 for the right side.
Left Wheel:
Pin 6: OFF, Pin 7: OFF - nothing, no movement
PIN 6: ON, Pin 7: OFF - wheel rotates - forward direction
PIN 6: OFF, Pin 7: ON - wheel rotates - reverse direction
PIN 6: ON, Pin 7: ON - untested, suspect this might fry something in a puff of smoke.
Right Wheel:
Pin 10: OFF, Pin 11: OFF - nothing, no movement
PIN 10: ON, Pin 11: OFF - wheel rotates - reverse direction
PIN 10: OFF, Pin 11: ON - wheel rotates - forward direction
PIN 10: ON, Pin 11: ON - untested, suspect this might fry something in a puff of smoke.
For the pins on the "OFF" position, N/C or ground both seem to work. On general principle I suggest sticking to ground and not N/C.
What does this all mean?
To drive a particular side of the robot, you need two digital outputs, hopefully PWM capable. For both sides it takes four outputs. For instance, if I wanted to go forward at 40% max speed I would set my pins like this:
pin 6: PWM signal at 40%
pin 7: ground (PWM 0%)
pin 10: ground (PWM 0%)
pin 11: PWM signal at 40%
I've been using the standard Arduino PWM frequency of around 500Hz and that works for switching the h-bridges off and on just fine. I would not be surprised if the components handled up to the 20KHz range.
When hooking up your microcontroller and using a different battery for the data signals (like the 9V I used), don't forget to "share a ground" wire between the two. If you look at my pictures, that is why I have a wire from the #2 pin on the IC Socket into the ground plane of my breadboard.
So for my test setup, I used the Arduino PWM signals:
Arduino : Tumbler
pin 9 ---- pin 6
pin 10 --- pin 7
pin 3 ---- pin 11
pin 11 --- pin 10
Here is some hardwired, ugly test code. However, it does work and proves the general idea. It is a loop that goes like this:
start loop
drive forward at 50% power for 2 seconds
wait 2 seconds
drive in reverse at 50% power for 2 seconds
wait 2 seconds
loop to top
It's showing me that this is not the most precise motor/wheel alignment I've seen, but it does work. I'll work on better wheel control code over time - need to get the laser rangefinder working first!
// Tumbler1
// by Ray Alderman
//
// Connections to the Tumber PCB
//
// Arduino : Tumbler
// pin 9 ---- pin 6
// pin 10 --- pin 7
// pin 3 ---- pin 11
// pin 11 --- pin 10
// ground --- pin 2 (ground)
//
//
int RightFwd = 3; // PWM Output to go Foward on Right Wheel
int RightRev = 11; // PWM Output to go Reverse on Right Wheel
int LeftFwd = 9; // PWM Output to go Forward on Left Wheel
int LeftRev = 10; // PWM Output to go Reverse on Left Wheel
int delaytime = 2000; // delay between steps
int speedval = 127; // speed forward and reverse, at 50% (of 255 max)
void setup()
{
pinMode(RightFwd, OUTPUT);
digitalWrite(RightFwd, LOW); // Make sure Output is initally at LOW
pinMode(RightRev, OUTPUT);
digitalWrite(RightRev, LOW); // Make sure Output is initally at LOW
pinMode(LeftFwd, OUTPUT);
digitalWrite(LeftFwd, LOW); // Make sure Output is initally at LOW
pinMode(LeftRev, OUTPUT);
digitalWrite(LeftRev, LOW); // Make sure Output is initally at LOW
delay(delaytime);
}
void loop()
{
analogWrite(LeftRev, 0);
analogWrite(LeftFwd, speedval); // turns on the left wheel in forward direction at the speed value
analogWrite(RightRev, 0);
analogWrite(RightFwd, speedval); // turns on the right wheel in forward direction at the speed value
delay(delaytime);
analogWrite(LeftFwd, 0); // turns off the left wheel
analogWrite(RightFwd, 0); // turns off the right wheel
delay(delaytime);
analogWrite(LeftRev, speedval); // turns on the left wheel in reverse direction at the speed value
analogWrite(RightRev, speedval); // turns on the right wheel in reverse direction at the speed value
delay(delaytime);
}
| « Previous Step | Download PDFView All Steps | Next Step » |
1
comment
|
Add Comment
|
needlenoodles
says:
![]() |
Add Comment
|

















































