Shop OBEX P1 Docs P2 Docs Learn Events
ActivityBot Robot- Issues — Parallax Forums

ActivityBot Robot- Issues

ASHENASHEN Posts: 14
edited 2014-04-21 14:08 in Learn with BlocklyProp
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.
«1

Comments

  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2014-04-16 18:34
    How exactly did you check the batteries? It sounds like maybe the switch on the board was still on and the batteries got drained. If left connected servos will slowly drain out batteries, even if everything else is off.

    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.
  • ASHENASHEN Posts: 14
    edited 2014-04-16 19:00
    I have removed the batteries and replaced them with new ones. I just finished recalibrating and ran the program called open test for trim. It was supposed to go forward 80 cm instead it went in reverse about 10ft and stopped.

    I checked the servo connections.

    Thanks
  • Mike GMike G Posts: 2,702
    edited 2014-04-17 04:08
    Check all your connections - encoders too.

    Welcome to the forums
  • ASHENASHEN Posts: 14
    edited 2014-04-17 07:37
    I did check all connections. Ran test to check if encoder is working but still have the same issue. If I change the values to negative then it moves forward. Do you think there is something wrong in the board as it does not interpret the code as it should .
  • Mike GMike G Posts: 2,702
    edited 2014-04-17 07:58
    Do you think there is something wrong in the board as it does not interpret the code as it should .
    Yes, I think you have one of those mirror image boards... you should swap the Left/Right encoders and/or servo connections.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-04-17 13:39
    Try this section in http://learn.parallax.com/activitybot/calibrate-your-activitybot and post the output. An example of a healthy calibration is below. Of course, if on inspection, it's obviously not following the pattern here, you should re-run the calibration, making sure to wait until the yellow lights turn off. Also, power jumper for P12 and P13 should be at VIN, and batteries should be fresh, hopefully in the 7 to 8 V range.


    [/FONT]=== LEFT SERVO ===
    
    Table Entries = 89
    Zero Speed Index = 41
    
    
    Index   Servo Drive     Encoder Ticks/Second
    -----   -----------     --------------------
    0       -194            1000
    1       -189            170
    2       -184            170
    3       -179            170
    4       -174            188
    5       -169            181
    6       -164            172
    7       -159            170
    8       -154            172
    9       -149            168
    10      -144            172
    11      -139            172
    12      -134            170
    13      -129            168
    14      -124            159
    15      -119            164
    16      -114            162
    17      -109            159
    18      -104            154
    19      -99             150
    20      -94             146
    21      -89             145
    22      -84             139
    23      -79             132
    24      -74             130
    25      -69             124
    26      -64             115
    27      -59             106
    28      -54             97
    29      -49             89
    30      -44             82
    31      -39             71
    32      -34             65
    33      -29             56
    34      -24             45
    35      -19             36
    36      -14             27
    37      -9              19
    38      -7              14
    39      -5              10
    40      -3              6
    41      4               0
    42      11              2
    43      13              8
    44      15              11
    45      17              14
    46      19              16
    47      21              22
    48      26              33
    49      31              43
    50      36              50
    51      41              59
    52      46              67
    53      51              80
    54      56              86
    55      61              93
    56      66              98
    57      71              109
    58      76              113
    59      81              122
    60      86              125
    61      91              135
    62      96              140
    63      101             143
    64      106             149
    65      111             150
    66      116             149
    67      121             162
    68      126             153
    69      131             157
    70      136             159
    71      141             164
    72      146             160
    73      151             162
    74      156             168
    75      161             170
    76      166             164
    77      171             176
    78      176             164
    79      181             168
    80      186             168
    81      191             172
    82      196             170
    83      201             170
    84      181             168
    85      186             168
    86      191             172
    87      196             170
    88      201             1000
    
    
    
    
    === RIGHT SERVO ===
    
    
    Table Entries = 89
    Zero Speed Index = 40
    
    
    Index   Servo Drive     Encoder Ticks/Second
    -----   -----------     --------------------
    0       -195            1000
    1       -190            174
    2       -185            170
    3       -180            176
    4       -175            172
    5       -170            172
    6       -165            170
    7       -160            172
    8       -155            174
    9       -150            170
    10      -145            166
    11      -140            166
    12      -135            166
    13      -130            163
    14      -125            159
    15      -120            157
    16      -115            148
    17      -110            154
    18      -105            156
    19      -100            145
    20      -95             142
    21      -90             140
    22      -85             133
    23      -80             121
    24      -75             121
    25      -70             110
    26      -65             104
    27      -60             97
    28      -55             88
    29      -50             80
    30      -45             72
    31      -40             68
    32      -35             56
    33      -30             45
    34      -25             37
    35      -20             28
    36      -15             19
    37      -13             19
    38      -11             11
    39      -9              8
    40      -1              0
    41      7               6
    42      9               7
    43      11              14
    44      13              14
    45      15              21
    46      20              31
    47      25              41
    48      30              45
    49      35              58
    50      40              66
    51      45              76
    52      50              82
    53      55              91
    54      60              99
    55      65              105
    56      70              114
    57      75              120
    58      80              121
    59      85              134
    60      90              137
    61      95              140
    62      100             148
    63      105             157
    64      110             156
    65      115             159
    66      120             172
    67      125             164
    68      130             168
    69      135             174
    70      140             164
    71      145             168
    72      150             166
    73      155             170
    74      160             170
    75      165             172
    76      170             170
    77      175             172
    78      180             172
    79      185             176
    80      190             176
    81      195             166
    82      200             168
    83      175             172
    84      180             172
    85      185             176
    86      190             176
    87      195             166
    
    88      200             1000[FONT=arial]
    
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-04-17 13:55
    Make sure you have the 10K pullups on the servo outputs. Trim the resistor leads short, so the resistors don't flop around and touch each other's leads or pull out of their receptacle holes. This was an issue with my students, who had problems like yours, until we got everythig trimmed and snug.

    -Phil
  • edited 2014-04-17 14:09
    Hi folks, this thread is being relocated to the Learn forum.

    Andy
  • edited 2014-04-17 14:11
    "Make sure you have the 10K pullups on the servo outputs...."

    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.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-04-17 14:19
    Andy,

    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
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-04-18 08:42
    By the way, the link I posted includes a troubleshooting guide. Have you tried the items listed there? http://learn.parallax.com/activitybot/troubleshooting
  • ASHENASHEN Posts: 14
    edited 2014-04-18 11:59
    Hi Andy,

    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
  • ASHENASHEN Posts: 14
    edited 2014-04-18 12:11
    In the "test for trim" code i changed the drive speed values from positive 32 to negative 32 and the robot went forward. However it still does not travel 80cm but i does run for 8 sec.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-04-18 12:32
    Please stand by...we're trying to come up with a reason why this may be happening.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-04-18 13:09
    Just to confirm, you're downloading the calibration code to EEPROM and not to RAM, correct? Also, are you sure the left/right servos and encoders are plugged into the correct headers on the board?
  • ASHENASHEN Posts: 14
    edited 2014-04-18 13:25
    When I download the calibration code I do it to EEPROM and also I checked that my left and right servos and left and right encoders are in the right pins. Left servo: P12, Right servo P13, Left encoder: P14, Right encoder P15.
  • ASHENASHEN Posts: 14
    edited 2014-04-18 13:45
    I am trying different ways to get the robot working. I wrote the following code. It complied correctly but when the robot runs it does not read the second bunch of code. So the robot goes in a circle for 3 seconds but instead of going straight it continues going in a circle.


    #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);



    }
  • ASHENASHEN Posts: 14
    edited 2014-04-18 14:37
    Chris,

    Do you think we will have a resolution today.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-04-18 14:41
    I am working to get you answers as quick as possible. Just out of curiosity, you have adjusted the potentiometers on the servos, have you?
  • ASHENASHEN Posts: 14
    edited 2014-04-18 14:45
    No i have not. Can you explain how I could do that.
  • ASHENASHEN Posts: 14
    edited 2014-04-18 15:23
    Chris could you give me the code needed to make my robot travel straight for 5 sec and then execute a 90-degree right turn and then go straight for another 5 sec.
  • ASHENASHEN Posts: 14
    edited 2014-04-19 10:31
    Chris,

    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
  • Mike GMike G Posts: 2,702
    edited 2014-04-19 14:35
    The code example posted in #18, has #include "abdrive.h", commented. Place #include "abdrive.h" on the next line under #include "simpletools.h".
    #include "simpletools.h"
    #include "abdrive.h"
    
    int main()                   
    {
      drive_trimSet(0, 0, 0);
      drive_speed(32, 32);
      pause(8000);
      drive_speed(0, 0);
    }
    

    Run the test code with the robot on block so the wheels do NOT touch the ground. Do both wheels turn?
  • ASHENASHEN Posts: 14
    edited 2014-04-21 07:52
    Thanks for the suggestion mike. The wheels turn but the problem still exists as mentioned in #18
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-04-21 09:49
    The code you asked for is code you already have. What I could send you is an exact copy of what you have. Unfortunately I can't see the robot to verify the connections. I'm still wondering if the encoders are connected backward, but cannot verify this.
  • ASHENASHEN Posts: 14
    edited 2014-04-21 09:57
    Checked the encoders . They are connected properly.

    I still think there is some issue with board.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-04-21 10:35
    I'm not sure I get the call to drive_trimSet. Here's its description:
    /**
    * @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?

    attachment.php?attachmentid=108248&d=1398101939

    In any event, I do not believe the Activity Board is defective. It's got to be something else.

    -Phil
    506 x 365 - 166K
  • edited 2014-04-21 10:40
    ASHEN, I sent you a PM to set up a telephone meeting. Please check your private message inbox.

    Thanks, Andy
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-04-21 11:06
    I also requested this information via e-mail.
  • edited 2014-04-21 13:59
    Check if the shunt jumper that sets P14 and P15 to 5 V is fitting tightly over the pins. It's the little removable piece on the lower two of three pins between the P13 and P14 servo ports.

    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.
Sign In or Register to comment.