Shop OBEX P1 Docs P2 Docs Learn Events
Activity Bot Calibration issue — Parallax Forums

Activity Bot Calibration issue

stcnzstcnz Posts: 3
edited 2014-04-08 10:10 in General Discussion
Hello there!
i'm having problems going through the calibration process for my activity bot.
Here is the specific information:
- my robot will begin the calibration by turning anti-clockwise, by turning the left wheel in reverse.It slows down to a stop and repeats...
- if i change the following code 'servo_pins(12, 13); and encoder_pins(14, 15);' by swapping numbers i.e. swap 12 with 13 and 14 with 15, the robot turns anti-clockwise by turning the right wheel forward, it also repeats after stopping
- my display calibration gives widely varying numbers as results, from successive 0's on left servo encoder ticks, to crazy high values on right servo.
- both servo drive values are all over the place also

I tried one posts suggestion by fixing the servo positioning, giving the adequate gap between the encoder and the servo. Not saying that its even related to this issue, I just dont know what is so I tried it. No luck there

So initially I thought perhaps there was something wrong with one of the pins of 12 and 13. But since I swapped the numbers in the calibration code I got the right wheel to move, so I potentially ruled that out.

So what is the real issue then? Can faulty encoders prevent the robot from doing the calibration properly, turning the appropriate ways?
If the encoders shouldn't effect the typical movement of the calibration, what could be potential factors?

Last note, all of the connections are correct, the correct resistors in the right place are used. The servo and encoders are correctly plugged in. I have switched the P12 and P13 to VIN. The rest are 5V.
The pre encoder light test worked correctly, when turning either wheel the corresponding P26/27 light flashed.

Thankyou in advance.

Comments

  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2014-04-04 08:27
    Have you tried first setting the zero point of both servos as noted in the documentation for the High Speed Continuous Servo? You do this without the encoder. Set your BS2 to send 1.5 millisecond pulses, and manually adjust the trim pot in the servo until the motor stops. Do this after running the servo for about a minute to warm it up. There are numerous BS2 programs that show this process.

    You should also run a simple "servo exerciser" that turns the servo full CW, full CCW, and stops. Test each servo separately to make sure they are working properly.

    Once function is verified you can add the encoders back into the mix. I'm not familiar with the calibration program you're using, but if it's doing automatic zero-point calculation to measure the motion of the servo, then yes: if an encoder is not working properly (or isn't connected right), the calibration will fail.
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2014-04-04 09:17
    Hi stcnz, and welcome to the forums.

    For clarification, you do NOT need to mechanically center the ActivityBot's High Speed Continuous Rotation Servos if you are following the ActivityBot tutorial. The tutorial's calibration routine and abdrive library are designed to use the servos just as they come from the manufacturer.

    If you purchased your ActivityBot directly from Parallax recently, the servo encoder brackets will not be a problem, those were redesigned last October. (The encoder issue is still included on the ActivityBot Troubleshooting Page for those who might have the earlier brackets http://learn.parallax.com/activitybot/troubleshooting)

    You mentioned that the calibration routine makes your robot start by turning its left wheel backward, this is what it is supposed to do. The sequence is:

    Left wheel backward at full speed, gradually slowing to a stop
    Left wheel forward slowly, gradually increasing to full speed, then stopping.
    Right wheel backward at full speed, gradually slowing to a stop
    Right wheel forward slowly, gradually increasing to full speed, then stopping.
    Resting a long moment, then the P26 and P27 LEDs turn off


    So, what is the sequence of movement you get with the calibration program, when you are using the pin assignments from the tutorial? (P12: Left Servo, P13: Right Servo, P14: Left Encoder, P15: Right Encoder)
  • PublisonPublison Posts: 12,366
    edited 2014-04-04 09:59
    stcnz wrote: »
    Hello there!
    i'm having problems going through the calibration process for my activity bot.
    Here is the specific information:
    - my robot will begin the calibration by turning anti-clockwise, by turning the left wheel in reverse.It slows down to a stop and repeats...
    - if i change the following code 'servo_pins(12, 13); and encoder_pins(14, 15);' by swapping numbers i.e. swap 12 with 13 and 14 with 15, the robot turns anti-clockwise by turning the right wheel forward, it also repeats after stopping
    - my display calibration gives widely varying numbers as results, from successive 0's on left servo encoder ticks, to crazy high values on right servo.
    - both servo drive values are all over the place also

    I tried one posts suggestion by fixing the servo positioning, giving the adequate gap between the encoder and the servo. Not saying that its even related to this issue, I just dont know what is so I tried it. No luck there

    So initially I thought perhaps there was something wrong with one of the pins of 12 and 13. But since I swapped the numbers in the calibration code I got the right wheel to move, so I potentially ruled that out.

    So what is the real issue then? Can faulty encoders prevent the robot from doing the calibration properly, turning the appropriate ways?
    If the encoders shouldn't effect the typical movement of the calibration, what could be potential factors?

    Last note, all of the connections are correct, the correct resistors in the right place are used. The servo and encoders are correctly plugged in. I have switched the P12 and P13 to VIN. The rest are 5V.
    The pre encoder light test worked correctly, when turning either wheel the corresponding P26/27 light flashed.

    Thankyou in advance.

    Welcome to the forums!

    Your post in the Robotics forum has been removed because cross posting is not allowed.:

    http://forums.parallax.com/showthread.php/134682-Forum-Guidelines

    I have left it here since it had responses.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2014-04-04 15:55
    Stephanie, Just as a note I suggested the manual centering in case at the factory a servo wasn't adjusted properly during assembly, or was adjusted by the user or someone else and is now in an unknown position.
  • stcnzstcnz Posts: 3
    edited 2014-04-06 04:07
    Thanks for the replys, Gordon and Steph.
    To Steph, the issue with my calibration is that it only does for the first movement of the calibration. I noticed from the video that the first movement was left wheel in reverse. But it continues with the first movement over and over again and does not do the rest.
    This is why I tried changing the code to see if the other wheel would move, I thought perhaps the right servo was not working, so it was unable to follow to the next movement in the sequence. But from switching the pin numbers, the right wheel moved forward.
    I did buy my activity bot recently so the servo lining up should not be an issue. I tried it anyway just in case, since I had nothing else to try anyway.
    I'm not really sure what steps to take now, my issue is not on the troubleshooting page from what I can see. I was hoping you might be able to isolate the problem, or perhaps a suggestion on code that could isolate it. I'm keen to test whatever you suggest.
    Thankyou in advance.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2014-04-06 10:28
    You mentioned the encoder test worked (the lights flashed when you manually turned the wheels) so I think it safe to say it's probably not the encoders. I'd concentrate on the servos.

    The behavior you mention can occur if the servos are manually adjusted way out of band; that is, the potentiometer on the side has been adjusted by someone so that the servo no longer has a center point within the normal pulse range provided by the Activity Board. If you (or a previous owner of your kit, if used) tweaked the servo pots, you need to put it right before you can continue. The encoders might not be able to compensate for the new setting.

    If you didn't change the servos, and the kit is new, that leaves defective servos. But I find it highly unlikely both would be bad. So I'd look for a power problem instead. What you describe can also occur if the batteries are weak, or if separate power isn't reaching the servos (the servos are deriving what little power they're getting from the signal lines).

    Be sure to run the servos with *fresh* batteries (don't assume; change them with new), and be sure the operating switch on the board is set to position "2". Switch the jumpers around for the servo headers, being sure the jumper for P12/P13 is set to VIN. Actually do physically switch the jumpers; the process can help to identify a bad power connection.

    I don't know if there is example ActivityBot C code for setting the servo zero point and then demonstrating forward and back motion, but I would encourage you to locate one, so you can definitively test the servos, separate from the encoders.

    I'm sure Steph will have other and probably better suggestions for you to try.
  • stcnzstcnz Posts: 3
    edited 2014-04-08 01:16
    Turns out.......it was the batteries. You were right, it was a power issue. I wasn't convinced myself it was the batteries initially because it ran the first movement of the sequence so quickly.
    Seems strange to me that the batteries have enough power to move the robot so quickly in succession, but cannot change to the next movement in the sequence.
    But it was a brand new activity bot and since the encoders worked correctly and the servo's seemed fine mechanically, it didn't leave much else.
    So now i'm definitely going to invest in a rechargeable battery charger.

    Now I can keep the ball rolling with my new interest. Also I look forward to reading builder's bonanza which I have beside me, once I finish the programmer's version.
    Thanks again!
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2016-02-24 09:29
    Batteries strike again!

    We carry a Li-Ion battery pack-charger designed to fit inside our small robot chassis. A less expensive option is to add a 6th battery with the BOE-Boost module - it slips right between the ends of the batteries and the terminals of the 5-cell battery holder that you already have.

    If you use only 5. 1.2 V AA rechargeables, you will have only 6 V, which is at the very low end of the High Speed CR Servo input voltage specs --- they want 6 to –8 VDC.
  • Hi. I'm new to the Forum and I'm having the same problem. I'm going to try the batteries, and if that doesn't work I'll let you know.
  • ercoerco Posts: 20,256
    Welcome to the forum, Jack. Weak batteries get us all every now and then. Hope that's the issue, the simplest fix I know.
  • jack_nunninkjack_nunnink Posts: 3
    edited 2016-02-25 16:42
    Did not work! :crazy: The right wheel is just rotating slowly and continuously. Do you have any idea what I should do? I've tried every thing else.
  • Did not work! :crazy: The right wheel is just rotating slowly and continuously. WHAT DO I DO? :o I've tried every thing else.


    Swap sevo conections, as to rule out servo malfunction.
  • Forgot, you need to calibrate the servo for its dead zone.
  • Try manual calibration, and then re-run the calibration program.

    This code:
    #include "simpletools.h"                      // Include simple tools
    #include "servo.h"
    
    int main()                                    // Main function
    {
      servo_set(12, 1500);
      servo_set(13, 1500);
    }
    
    Should set your servos to their approximate center, but if either one continues to spin you should gently use a small screwdriver to adjust the pot (the small hole in the back of the servo) until it stops spinning.

    Don't forget to re-run the calibration program from the ActivityBot instructions once you have done any manual centering.
  • ercoerco Posts: 20,256
    Does Matt G still make house calls to sort out problems for new members? Everyone gets one free visit. But he does stay on for a week after he sorts out the problem. :)
  • jack_nunninkjack_nunnink Posts: 3
    edited 2016-02-26 19:42
    Thank you all. I got it to work! :D Now I can get on with my Activity Bot. Also. If you can tell me how to get to Matt G's forum page, that would be great.
  • Thank you all. I got it to work! :D Now I can get on with my Activity Bot. Also. If you can tell me how to get to Matt G's forum page, that would be great.

    @Jack,

    Matt G is a Parallax employee and does not have a forum page, but he does pop in the forum ever once and a while.


  • Does Matt G still make house calls to sort out problems for new members? Everyone gets one free visit. But he does stay on for a week after he sorts out the problem.

    Everyone including erco gets unlimited visits because erco reimburses me for all travel and entertainment expenses incurred when helping all other Forumistas ;) FYI erco, Latest travels include 13 mid-western states, and Norway. I'll expect a PayPal from you by morning... ;)
    Glad you got it up and running there Jack!
    -MattG

Sign In or Register to comment.