Shop OBEX P1 Docs P2 Docs Learn Events
ActivityBot mobility issue — Parallax Forums

ActivityBot mobility issue

metalRabbitmetalRabbit Posts: 5
edited 2014-03-02 13:11 in Robotics
My friend and I are working together on an Activity Bot. He handled the circuitry and I'm handling the C language for what we eventually want to do. I'm having a problem with this little thing where the left wheel does not want to move forward. This is the simple code used to test the wheels:
#include "simpletools.h"#include "abdrive.h"             


int main()
{
  drive_goto(16,16);
  return 0;
}



This makes the right wheel move forward as expected, but not the left. When the parameters are changed to (-16,16) the left wheel moves backwards while the right moves forward. Every other combination where the left wheel is supposed to be moving forward doesn't seem to work. I've tried running the tutorials for the Activity Bot, and the problem seems to persist. I really just want to know if there's anything I can do programming-wise, before blaming the hardware or circuitry. >_<

Comments

  • metalRabbitmetalRabbit Posts: 5
    edited 2014-02-24 09:42
    Addendum: We checked the motor in question and it works just fine. So after that I tried reversing the ports for the servo pins, and then set the robot to run backwards. It'll now run forward this way, but it won't go backwards with both wheels. So it can move forward but the problem is still there.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-02-24 10:03
    Try recalibrating the robot. Make sure your batteries are fresh before doing so.

    -Phil
  • Courtney JacobsCourtney Jacobs Posts: 903
    edited 2014-02-25 10:51
    metal,

    If you try recalibrating and are still having issues, could you post the output from your calibration table here for us to see? That might help us find the problem.
  • metalRabbitmetalRabbit Posts: 5
    edited 2014-02-28 10:40
    I ran the calibration, and it functioned properly. I still have the problem running my own code though. All 4 batteries tested at about 1.44 volts, so I don't think that's the issue.

    This is the output on the console after running ActivityBot Display Calibration:
    === LEFT SERVO ===
    
    Table Entries = 67
    Zero Speed Index = 1
    
    
    Index   Servo Drive     Encoder Ticks/Second
    -----   -----------     --------------------
    0       0               1000
    1       0               0
    2       0               0
    3       0               0
    4       0               0
    5       0               0
    6       0               0
    7       0               0
    8       0               0
    9       0               0
    10      0               0
    11      0               0
    12      -160496444              0
    13      1580372         0
    14      524290          0
    15      111415495               0
    16      661627068               0
    17      637819988               0
    18      661612796               0
    19      571497596               0
    20      1081596         0
    21      -1341095684             0
    22      1671420         0
    23      439484416               0
    24      126091264               0
    25      65535           0
    26      0               0
    27      0               0
    28      705757184               0
    29      739606780               0
    30      739191036               0
    31      1409276         0
    32      10443900                0
    33      12278908                0
    34      8543356         0
    35      15228028                0
    36      16211068                0
    37      9723004         0
    38      11689084                0
    39      16604284                0
    40      1474812         0
    41      1662076         0
    42      6904956         0
    43      7167100         0
    44      6511740         0
    45      6773884         0
    46      7953532         0
    47      1662076         0
    48      5790844         0
    49      570491068               0
    50      570491068               0
    51      705768700               0
    52      705724668               0
    53      570491068               0
    54      806628604               0
    55      806709436               0
    56      806444156               0
    57      772899068               0
    58      772309244               0
    59      26812           0
    60      1596668         0
    61      570491068               0
    62      805830844               0
    63      570517692               0
    64      571432060               0
    65      -580494212              0
    66      -1387963268             1000
    
    
    
    
    === RIGHT SERVO ===
    
    
    Table Entries = 199
    Zero Speed Index = 49
    
    
    Index   Servo Drive     Encoder Ticks/Second
    -----   -----------     --------------------
    0       -195            1000
    1       -193            59
    2       -191            61
    3       -189            63
    4       -187            65
    5       -185            67
    6       -183            -1275068347
    7       -181            491520016
    8       -179            531800
    9       -177            -1992327168
    10      -175            569389612
    11      -173            461500
    12      -171            654315004
    13      -169            1640508
    14      -167            537135292
    15      -165            537135292
    16      -163            537135295
    17      -161            23676
    18      -159            0
    19      -157            -65536
    20      -155            0
    21      -153            0
    22      -151            0
    23      -149            570491068
    24      -147            704946364
    25      -145            706765052
    26      -143            3169340
    27      -141            11885692
    28      -139            14507132
    29      -137            8805500
    30      -135            15817852
    31      -133            9395324
    32      -131            9985148
    33      -129            11820156
    34      -127            741497980
    35      -125            1662012
    36      -123            6380668
    37      -121            7429244
    38      -119            7691388
    39      -117            6642812
    40      -115            8019068
    41      -113            8150140
    42      -111            5921916
    43      -109            806444156
    44      -107            772899068
    45      -105            772309244
    46      -103            570491068
    47      -101            672214268
    48      -99             672694524
    49      5               806840508
    50      109             26812
    51      111             570491068
    52      113             570491068
    53      115             806825212
    54      117             -1606263684
    55      119             638671996
    56      121             806453500
    57      123             639118588
    58      125             24936700
    59      127             1679548
    60      129             1662206
    61      131             1662206
    62      133             1662206
    63      135             570491068
    64      137             1662206
    65      139             570491068
    66      141             1662206
    67      143             570491068
    68      145             1662206
    69      147             504454396
    70      149             1679548
    71      151             1655266557
    72      153             806444156
    73      155             0
    74      157             0
    75      159             0
    76      161             0
    77      163             0
    78      165             0
    79      167             0
    80      169             0
    81      171             0
    82      173             0
    83      175             0
    84      177             0
    85      179             0
    86      181             0
    87      183             0
    88      185             0
    89      187             0
    90      189             0
    91      191             0
    92      193             0
    93      195             0
    94      197             0
    95      199             0
    96      99              0
    97      -1              0
    98      1               0
    99      3               0
    100     5               0
    101     7               0
    102     9               0
    103     11              0
    104     13              0
    105     15              0
    106     17              0
    107     19              0
    108     21              0
    109     23              0
    110     25              0
    111     27              0
    112     29              0
    113     31              0
    114     33              0
    115     35              0
    116     37              0
    117     39              0
    118     41              0
    119     43              0
    120     0               0
    121     0               0
    122     0               0
    123     199             0
    124     0               0
    125     67              0
    126     1000            0
    127     59              0
    128     61              0
    129     63              0
    130     65              0
    131     67              0
    132     -1275068347             -160496444
    133     491520016               1580372
    134     531800          524290
    135     -1992327168             111415495
    136     569389612               661627068
    137     461500          637819988
    138     654315004               661612796
    139     1640508         571497596
    140     537135292               1081596
    141     537135292               -1341095684
    142     537135295               1671420
    143     23676           439484416
    144     0               126091264
    145     -65536          65535
    146     0               0
    147     0               0
    148     0               705757184
    149     570491068               739606780
    150     704946364               739191036
    151     706765052               1409276
    152     3169340         10443900
    153     11885692                12278908
    154     14507132                8543356
    155     8805500         15228028
    156     15817852                16211068
    157     9395324         9723004
    158     9985148         11689084
    159     11820156                16604284
    160     741497980               1474812
    161     1662012         1662076
    162     6380668         6904956
    163     7429244         7167100
    164     7691388         6511740
    165     6642812         6773884
    166     8019068         7953532
    167     8150140         1662076
    168     5921916         5790844
    169     806444156               570491068
    170     772899068               570491068
    171     772309244               705768700
    172     570491068               705724668
    173     672214268               570491068
    174     672694524               806628604
    175     806840508               806709436
    176     26812           806444156
    177     570491068               772899068
    178     570491068               772309244
    179     806825212               26812
    180     -1606263684             1596668
    181     638671996               570491068
    182     806453500               805830844
    183     639118588               570517692
    184     24936700                571432060
    185     1679548         -580494212
    186     1662206         -1387963268
    187     1662206         -984064900
    188     1662206         638671996
    189     570491068               1092124924
    190     1662206         638671996
    191     570491068               1226998012
    192     1662206         638671996
    193     570491068               1529184508
    194     1662206         -1370399620
    195     504454396               572039356
    196     1679548         1655266428
    197     1655266557              1662205
    198     806444156               1000
    
    
    
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-02-28 12:11
    Those are not good calibration values. Are you sure you have the motors and encoders connected properly? Did you remember to add the 10K pullups to the encoder lines?

    -Phil
  • edited 2014-02-28 14:38
    From the looks of your interpolation table, there's a wiring mistake. I would recommend going very carefully through these two pages a second time:

    http://learn.parallax.com/activitybot/electrical-connections

    http://learn.parallax.com/activitybot/test-encoder-connections

    Notes: Make sure to stick with the 20 k pullups called for in the Electrical Connections page. Here is an example of what your interpolation table should resemble when the electrical connections are correct. Although this table is showing top speeds in the 170 ticks/second range, yours will vary with battery voltage. Top speeds in the 170 to 200 range are typical.
    === 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
    
  • RickInTexasRickInTexas Posts: 124
    edited 2014-03-02 13:11
    I had similar symptoms, calibration seemed to go OK -- spun around CW, CCW, pause, rinse, repeat etc. Then I came across
    Issue: The ActivityBot calibration routine went fine, but instead of driving straight, it drives in a jerky, wavy line.
    which is on page: http://learn.parallax.com/activitybot/troubleshooting about 3/4 the way down. Fixxed my ActivityBot.
Sign In or Register to comment.