Activity bot to tank tread conversion - won't drive!
dsomashe
Posts: 21
Hi Everyone, sorry if this has already been answered. I recently converted my activity bot to the tank with the tank tread kit. The only problem is now, when I use commands such as drive_speed and drive_goto, only one tread will spin (the right one).
I'm assuming this has to do with the fact that the optical encoders were removed (the tank tread directions say to remove the encoders).
How do I get it to drive again?
-Deepak
I'm assuming this has to do with the fact that the optical encoders were removed (the tank tread directions say to remove the encoders).
How do I get it to drive again?
-Deepak
Comments
Your treads should have come with or pointed you to the Tank Tread Product Guide. The following section, last page of this document, is what you need to get going:
ActivityBot abdrive.h library
To “turn off” the abdrive library’s expectation of encoder feedback with a calibrated ActivityBot,
use drive_feedback(0); at the beginning of the main routine. Then, your program may still use the functions
drive_speed, drive_ramp, and drive_rampStep. Do not use drive_goto. Ramping into and out of high-
speed maneuvers is recommended.
[code][/#include "simpletools.h"
#include "fdserial.h"
#include "abdrive.h"
#include "wavplayer.h"
#include "servo.h"
#include "ping.h"
int main()
{
drive_feedback(0);
drive_speed(50,50);
pause(3000);
drive_speed(0, 0);
pause(3000);
}code]
Have you checked batteries and electrical connections? Be sure to try with fresh batteries, and double-check all connections you have made for errors. Including clear images of your robot and its wiring can also help with diagnosing an issue.
Also, did your program run as expected with the unmodified robot?
If the motor will run in one direction and not the other the wiring must be ok. Perhaps the problem is in the H bridge. Try switching the motor to H bridge connections to see if the problem switches sides.
-Phil
The program definitely worked literally right before changing to the tread system.
I switched the servo pins to see if it was a problem with the motor or what. When switched, the opposite side now works in forward and reverse and the other side (which was previously working) only works in reverse. WTF? So weird, I cannot understand why....could the pin be bad? but then why would reverse commands work?
-Deepak
Servos, DC motors, or whatever, switching the motor wires around will tell you whether it is a motor problem or not. Divide and conquer.
Time to look at the servo pulse width with a scope or other means. If the pulse width is not right then check the code.
I recalibrated to make pin 14 and 15 the servo pins. It isn't the pins, and it isn't the servos. As far as I can tell, there is absolutely nothing wrong with the hardware or the connections, I've tried every possible combination. The code I am typing in SHOULD make the wheels move forward at a rate of 50 for 3 seconds, and then stop. INSTEAD what is happening is the right wheel will spin much much faster than the left for about 3 seconds, and then the wheels will spin at equal speeds, the right one moving in forward and the left moving in reverse. They will spin in this opposite fashion indefinitely.
I cannot fathom what transpired during the conversion between the regular set up and the tank tread other than removing the encoders. I reiterate that the batteries are fresh and the robot was working fine before. It HAS to be something about removing the encoders or something.
http://www.ebay.com/itm/112071339989
-Phil
Run this program:
If your servos are centered, they should not rotate at all when this program runs. If they are not centered, they will start rotating, and then you will need a small screwdriver to very gently adjust them (via the small hole in one end of the servo) until they stop.
If you have changed the pins your servos are connected to, make sure you adjust this program to match or reconnect your servos to P12 and P13.