Shop OBEX P1 Docs P2 Docs Learn Events
Need help: Re-calibration of ActivityBot failed — Parallax Forums

Need help: Re-calibration of ActivityBot failed

chillitillichillitilli Posts: 5
edited 2013-11-20 05:40 in Robotics
Hey everyone!

I did a re-calibration of my ActivityBot for some measurements. After that calibration the robot only moved very randomely. I tried to figure out which problem occurs by reading the troubleshooting, but couldn´t find any solution. When I did the Interpolation I had the following results for both servos.
Could someone please tell me what to do, and how to solve this probelm!?
Thank you very much in advance!
757 x 992 - 131K
764 x 842 - 115K

Comments

  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2013-11-15 08:44
    Not commenting on your test code but just the lack of data, I'd suspect a wiring problem on the left encoder. Redo the wiring and resistor for that encoder just to make sure nothing happened with you've been handling your robot.

    If that doesn't work, though it's a hassle, you might swap the left and right encoders (wiring only, not physically) to make sure you don't now have a bad sensor.
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2013-11-15 09:31
    Hi Chillitilli, and welcome to the forums!

    (For others reading the thread, this is the ActivityBot Troubleshooting page: http://learn.parallax.com/activitybot/troubleshooting)

    Gordon is right, this could be a bad left encoder. Andy Lindsay, the ActivityBot guy, will join the thread in a little bit with some specifics on how to verify that.
  • edited 2013-11-15 10:15
    Hi chillitilli,

    Here is a program you can use to test encoder functionality.
    #include "simpletools.h"
    
    int main()                    
    {
      low(26);
      low(27);
      while(1)
      {
        set_output(26, input(14));
        set_output(27, input(15));
      }
    }
    

    Use the Load EEPROM & Run button, and after it's loaded, set your ActivityBot's PWR switch to 2. Then, gently turn the right wheel (closest to PWR switch). Monitor the P27 light as you turn the wheel. It should turn on/off as the wheel's spokes/windows pass by the encoder.

    Repeat for the left wheel (closer tot he servo ports), and observe the response of the P26 LED. Here are some conditions that it can indicate indicate:

    P26 Light stays off while turning wheel:
    - 3-wire cable to P14 in backwards
    - 20 k resistor not making contact at either P14 or 3.3 V

    P27 Light blinks while wheel turning
    - Probably not your problem based on calibration display, but it would indicate the encoder cables are swapped. In other words, if this were the symptom, the cable that should be plugged into P14 is plugged into P15 and vice versa.

    P26 Light stays on while turning wheel:
    - Resistor across P14 -> 3.3 V is too small. It should be 20 k (red-black-orange-gold)

    P26 Light on most of time, but occasionally flickering off, but not in sync with spokes passing by as you turn the wheel:
    - For certain encoder vintages, if assembled while pressing the encoder bracket and servo toward each other, the encoder can end up seeing too much of the rim instead of the spokes. Easily corrected by loosening the servo screws slightly, then re-tighten while at the same time lightly pulling the encoder bracket and servo away from each other.

    As Gordon pointed out, check your wiring. Make sure all connections are complete, color codes correct. Also make sure the mounting screws have not come loose. I recommend using the nylon locknuts in the kit to make sure they stay tight.

    Please keep us posted.

    Thanks, Andy
  • edited 2013-11-15 10:27
    P.S. I'd also recommend trying the LED+manually turning wheel tests first before swapping any parts.
  • chillitillichillitilli Posts: 5
    edited 2013-11-18 04:05
    Thank you very much for your help.

    I rechecked the wires, did the test of the encoders but everything was fine. When turning the wheels the lights turned on and off as you desribed it (P27 for right, P26 for left)

    I recognized just another thing, that when I put the switch on position 1 the two lights (P26/27) turn on and just turn off when I load something via Load EEPROM+Run button.
    Any new idea which component could be bad?

    Thanks!
  • chillitillichillitilli Posts: 5
    edited 2013-11-18 05:48
    And I tried to use only the servos with the following code:

    #include "simpletools.h" #include "servo.h"


    int main()
    {
    servo_speed(12,50);
    pause(500);
    servo_speed(12,100);
    pause(500);
    servo_speed(12,200);
    pause(500);
    servo_stop();


    }

    For the servo on the right side (P13) I could see that the speed ramped up, at the left servo (P12) the speed was the same for all the time - does this mean that the left servo is bad? Or is there some issue with the software?
  • edited 2013-11-18 09:52
    .
    IMPORTANT: This post will not fix the problem. Skip to the next post, that has the solution.

    Not sure yet. I'd like to check first and make sure the servo's potentiometer is correctly adjusted.

    Do not disconnect or reconnect any wires while you are doing this.

    (0) Set PWR switch to 0
    (1) Remove batteries
    (2) Remove battery pack
    (3) Unscrew and remove left servo wheel.
    (4) Remove screws hold encoder and servo to chassis.
    (5) Take servo out
    (6) Load battery pack then set PWR switch to 2
    (7) Run code below
    (8) Find hole in servo case near cable
    (9) Use your parallax screwdriver to gently turn the screw in the case. As you turn the screw back and forth, the servo should slow, change direction, and speed up in the opposite direction. Adjust the screw so that it's right in between directions, either moving very slowly or completely stopped.
    (10) PWR switch to 0 and remove batteries again.
    (11) Put everything back together.
    (12) Re run ActivityBot Calibrate.side using the Load EEPROM & Run button and PWR switch to 2. Make sure to wait for the lights to go off before disconnecting power and returning to your computer.
    (13) Re run ActivityBot Display Calibration.side using the Run with Terminal button.
    (14) Shade and copy the SimpleIDE terminal output and paste it here (or do the pictures like you did before).
  • edited 2013-11-18 10:01
    Wait, I figured out what the problem is.

    The left servo cable should be plugged into P12 and the left encoder should be plugged into P14.

    Based on your display in the first post, those two are swapped, with the servo plugged into P14 and the encoder plugged into P12.

    So, first step would be to correct that, and then re-run calibration and calibration display.

    That should also correct the servo speed problems you are seeing, but if not, try the post above.
  • chillitillichillitilli Posts: 5
    edited 2013-11-19 01:29
    Actually the wires have all been plugged correctly.

    But when I adjusted the little screw I received the following results, which look quite familiar to the one posted in the tutorial:

    Thanks so much for your help!!!

    === LEFT SERVO ===

    Table Entries = 89
    Zero Speed Index = 45


    Index Servo Drive Encoder Ticks/Second


    0 -194 1000
    1 -189 160
    2 -184 154
    3 -179 158
    4 -174 158
    5 -169 158
    6 -164 158
    7 -159 155
    8 -154 158
    9 -149 158
    10 -144 154
    11 -139 158
    12 -134 155
    13 -129 149
    14 -124 152
    15 -119 150
    16 -114 153
    17 -109 150
    18 -104 149
    19 -99 145
    20 -94 146
    21 -89 143
    22 -84 143
    23 -79 139
    24 -74 136
    25 -69 131
    26 -64 130
    27 -59 120
    28 -54 119
    29 -49 112
    30 -44 105
    31 -39 98
    32 -34 92
    33 -29 83
    34 -24 76
    35 -19 68
    36 -14 58
    37 -9 50
    38 -4 42
    39 1 34
    40 6 26
    41 11 16
    42 13 14
    43 15 10
    44 17 7
    45 25 0
    46 33 9
    47 35 13
    48 37 17
    49 39 21
    50 44 30
    51 49 39
    52 54 47
    53 59 55
    54 64 65
    55 69 73
    56 74 82
    57 79 87
    58 84 95
    59 89 101
    60 94 106
    61 99 114
    62 104 115
    63 109 125
    64 114 126
    65 119 132
    66 124 133
    67 129 133
    68 134 138
    69 139 140
    70 144 141
    71 149 145
    72 154 143
    73 159 145
    74 164 151
    75 169 152
    76 174 154
    77 179 151
    78 184 152
    79 189 148
    80 194 145
    81 199 149
    82 204 149
    83 179 151
    84 184 152
    85 189 148
    86 194 145
    87 199 149
    88 204 1000




    === RIGHT SERVO ===


    Table Entries = 89
    Zero Speed Index = 45


    Index Servo Drive Encoder Ticks/Second


    0 -195 1000
    1 -190 157
    2 -185 157
    3 -180 162
    4 -175 162
    5 -170 157
    6 -165 160
    7 -160 155
    8 -155 157
    9 -150 155
    10 -145 157
    11 -140 160
    12 -135 153
    13 -130 155
    14 -125 157
    15 -120 157
    16 -115 152
    17 -110 153
    18 -105 149
    19 -100 146
    20 -95 147
    21 -90 145
    22 -85 141
    23 -80 141
    24 -75 138
    25 -70 131
    26 -65 124
    27 -60 124
    28 -55 118
    29 -50 108
    30 -45 105
    31 -40 99
    32 -35 90
    33 -30 81
    34 -25 75
    35 -20 66
    36 -15 59
    37 -10 51
    38 -5 42
    39 0 35
    40 5 29
    41 10 19
    42 12 15
    43 14 11
    44 16 6
    45 25 0
    46 34 9
    47 36 13
    48 38 17
    49 40 21
    50 45 31
    51 50 40
    52 55 49
    53 60 59
    54 65 65
    55 70 75
    56 75 81
    57 80 89
    58 85 96
    59 90 102
    60 95 108
    61 100 115
    62 105 119
    63 110 119
    64 115 122
    65 120 127
    66 125 130
    67 130 138
    68 135 142
    69 140 141
    70 145 143
    71 150 144
    72 155 149
    73 160 150
    74 165 146
    75 170 147
    76 175 152
    77 180 155
    78 185 155
    79 190 150
    80 195 152
    81 200 152
    82 170 147
    83 175 152
    84 180 155
    85 185 155
    86 190 150
    87 195 152
    88 200 1000
  • edited 2013-11-19 09:25
    Great, thanks for the update. Those values look good; your ActivityBot is ready for navigation.

    Andy
  • chillitillichillitilli Posts: 5
    edited 2013-11-20 00:21
    Thank you very much for your help!! :smile:
Sign In or Register to comment.