ActivityBot Robot- Issues
ASHEN
Posts: 14
I am student and working on the activitybot. I managed to assemble the robot and also finished writing the code. The robot was working fine. The next day when I started to work on the robot it was not performing the actions as per the code. I re calibrated and downloaded the test code and I am having issues. The robot goes forward but does and then just goes in circle and stops.
I checked the batteries, the servo connections and they are okay. This is the first time I am working on the activity bot. Please let me know what I may be doing wrong.
Thanks for your help.
I checked the batteries, the servo connections and they are okay. This is the first time I am working on the activity bot. Please let me know what I may be doing wrong.
Thanks for your help.
Comments
Batteries can be tested using a battery tester (places the battery under load) or by swapping out with a brand new set. Its not enough to test batteries with a volt meter and no load.
I checked the servo connections.
Thanks
Welcome to the forums
-Phil
Andy
Not sure what this is for, the Activity Board already has series resistors built in between servo port signal and I/O pin, so we don't add any resistors to the servos. The encoders do require 20 k pull-up resistors (red-black-orange), which is in the assembly instructions.
I don't think the resistor value is critical. I and all my students are using 10K, and they work just fine. I guess it's the series resistors that make the 20K preferable, though.
-Phil
based on the suggestion from Chris i checked the calibration. Here are the values for the the test. They seem to be correct. When I run the "test for trim"code the robot goes backward and travels 10feet .
As per the code it should go 80 cm and forward. Below is the code used.
/*
Test for Trim.c
Test and adjust trim for servos and encoders
http://learn.parallax.com/activitybot
*/
#include "simpletools.h"
#include "abdrive.h"
int main()
{
drive_trimSet(0, 0, 0);
drive_speed(32, 32);
pause(8000);
drive_speed(0, 0);
}
Calibration out put:
=== LEFT SERVO ===
Table Entries = 88
Zero Speed Index = 41
Index Servo Drive Encoder Ticks/Second
0 -194 1000
1 -189 172
2 -184 176
3 -179 174
4 -174 170
5 -169 176
6 -164 174
7 -159 172
8 -154 170
9 -149 178
10 -144 174
11 -139 163
12 -134 172
13 -129 172
14 -124 165
15 -119 158
16 -114 160
17 -109 160
18 -104 163
19 -99 154
20 -94 152
21 -89 147
22 -84 146
23 -79 143
24 -74 136
25 -69 131
26 -64 122
27 -59 113
28 -54 107
29 -49 101
30 -44 92
31 -39 84
32 -34 75
33 -29 66
34 -24 59
35 -19 49
36 -14 39
37 -9 29
38 -4 20
39 1 10
40 3 6
41 11 0
42 19 8
43 21 11
44 23 14
45 25 18
46 27 21
47 32 31
48 37 41
49 42 51
50 47 58
51 52 67
52 57 76
53 62 86
54 67 94
55 72 100
56 77 110
57 82 112
58 87 123
59 92 123
60 97 134
61 102 138
62 107 144
63 112 148
64 117 149
65 122 155
66 127 158
67 132 155
68 137 167
69 142 160
70 147 164
71 152 164
72 157 165
73 162 167
74 167 167
75 172 170
76 177 170
77 182 174
78 187 171
79 192 172
80 197 172
81 202 169
82 177 170
83 182 174
84 187 171
85 192 172
86 197 172
87 202 1000
=== RIGHT SERVO ===
Table Entries = 89
Zero Speed Index = 40
Index Servo Drive Encoder Ticks/Second
0 -195 1000
1 -190 163
2 -185 178
3 -180 174
4 -175 170
5 -170 167
6 -165 167
7 -160 174
8 -155 162
9 -150 170
10 -145 172
11 -140 158
12 -135 158
13 -130 158
14 -125 158
15 -120 152
16 -115 146
17 -110 141
18 -105 145
19 -100 136
20 -95 139
21 -90 127
22 -85 117
23 -80 115
24 -75 102
25 -70 98
26 -65 91
27 -60 79
28 -55 75
29 -50 65
30 -45 55
31 -40 44
32 -35 36
33 -30 28
34 -25 19
35 -23 18
36 -21 15
37 -19 10
38 -17 6
39 -15 5
40 -9 0
41 -3 5
42 -1 10
43 1 15
44 3 18
45 5 21
46 10 31
47 15 40
48 20 50
49 25 58
50 30 69
51 35 74
52 40 85
53 45 93
54 50 100
55 55 112
56 60 113
57 65 117
58 70 123
59 75 131
60 80 134
61 85 144
62 90 142
63 95 150
64 100 152
65 105 158
66 110 158
67 115 155
68 120 163
69 125 160
70 130 165
71 135 165
72 140 170
73 145 165
74 150 170
75 155 166
76 160 166
77 165 168
78 170 168
79 175 170
80 180 168
81 185 166
82 190 166
83 195 167
84 200 167
85 185 166
86 190 166
87 195 167
88 200 1000
#include "simpletools.h" // Include simple tools #include "abdrive.h"
int main() // Main function
{
drive_trimSet(0, 0, 0);
drive_speed( 32 , -32 );
pause(3000);
drive_speed(0, 0);
drive_speed(32, 32);
pause(3000);
drive_speed(0, 0);
}
Do you think we will have a resolution today.
I have still got no solutions to why the robot is doing what it is doing. I am running out of time to get my class project done.
Thanks
sunil
Run the test code with the robot on block so the wheels do NOT touch the ground. Do both wheels turn?
I still think there is some issue with board.
* @brief Stores trim values to EEPROM.
*
* @details Trim values can compensate for mechanical wheel alignment errors.
* When you set the ActivityBot's trim, you are telling it to make a certain
* wheel turn an extra tick per certain number of ticks. For example, you
* can use this to make the right wheel turn 1 extra tick per every 64 ticks.
* It will actually just expect to see an encoder transition 1/64th of a tick
* sooner with every tick.
*
* @param direction Selects to set the trim for a given direction. Use
* AB_FORWARD OR AB_BACKWARD.
*
* @param side Selects the side to make one more or less ticks per number of
* ticks. Use AB_LEFT or AB_RIGHT to select the left or right wheel.
*
* @param value Number of ticks that should elapse before the extra tick will
* have accumulated. Use a negative number if you want a given wheel to go
* one less tick per number of ticks instead of one more tick.
*/
void drive_trimSet(int direction, int side, int value);
The problem is the zero parameters. They don't correspond to either the direction or side arguments, which are spec'd to be either -1 or 1. So what does the call with zero parameters accomplish, if anything? I'd leave it out entirely. I know I've never used it.
Also, I still suspect that you've reversed the servo connections and the encoder connections. Just to be sure, is this the way you've hooked things up?
In any event, I do not believe the Activity Board is defective. It's got to be something else.
-Phil
Thanks, Andy
I found a loose one, and was able to duplicated all your symptoms. Then, I pressed it lightly toward the P13 servo with a fingernail to complete the circuit, and the program started working correctly.
FIX
- DISCONNECT POWER AND USB CABLEs
- Remove the shunt jumper that connects the 5V and center pins. (From the 3-pin power header between the P13 and P14 ports).
- Bend the lower pin toward its 5 V label and the center pin toward the VIN label. (Just bend them away from each other very slightly, we only need to bend them far enough to make the shunt jumper fit more tightly.)
- Replace the shunt jumper that connects the 5V and center pins.
- Reconnect power and USB cables
- Retry your test code.