Shop OBEX P1 Docs P2 Docs Learn Events
activity bot servos not working — Parallax Forums

activity bot servos not working

bikemanbikeman Posts: 10
edited 2014-05-17 12:26 in General Discussion
the servos on the activity bot don't seem to run at all. I've checked voltage, the jumper is in VIN. When trying to run calibrate it downloads, the P26 and P27 light comes on but then nothing?

Comments

  • idbruceidbruce Posts: 6,197
    edited 2014-05-02 14:48
    bikeman

    You will have to supply your source code for others to help resolve your problem
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-05-02 14:57
    As Bruce suggests, you'll want to post your source code. (Use code tags or link to the code you're using if it's from a Parallax tutorial.)

    What are you using for a power supply? A lot of servo problems are cause by weak batteries (even if they're new). 9V batteries used in smoke detectors are not a good power source.
  • PublisonPublison Posts: 12,366
    edited 2014-05-02 15:10
    When running the servos, the power switch needs to be in the "2" position to supply power to the servos.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-05-02 15:10
    Another common error is plugging the servo connectors in backwards. The white lead should face the outside of the circuit board.

    -Phil
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2014-05-02 16:37
    Hi bikeman, and welcome to the forums!

    I'm assuming you are using the ActivityBot tutorial code, so let's look at the hardware for problems first.

    There's a Troubleshooting page that might help you figure out what's wrong.

    http://learn.parallax.com/activitybot/troubleshooting

    If nothing happens except the LEDs coming on, the most common problems are:

    1. You moved the 3-position PWR switch to 1 instead of 2. You must put it all the way to 2 to power the header where you plugged in the servos and encoders.

    2. Not enough power to run the servos:
    • Batteries are tired.
    • One or two batteries are in backward.
    • Using 1.2 V rechargeables instead of 1.5 V batteries.


    3. Connection problems:
    • Servo cables are plugged in backwards.
    • Servo cables are swapped with the encoder cables.


    Double-check that switch and those batteries and cables, then let us know how it goes!

    -Steph
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2014-05-02 16:39
    Ooops, I see you checked the battery pack output voltage, so as long as it is at 7.5 - 8 that's not the problem!
  • bikemanbikeman Posts: 10
    edited 2014-05-05 07:38
    Voltage is reading 7.31, I swapped them with batteries from a bot that is working well. I've checked all of the above and I am using the calibrate code from the learn folder. I had checked the troubleshooting page before posting here. I also tried switching servo and encoder ports and changing the port setting in the code to see if the board had a bad port
  • idbruceidbruce Posts: 6,197
    edited 2014-05-05 07:43
    bikeman

    Please read this http://forums.parallax.com/showthread.php/129690-How-to-post-program-code-in-the-forum. and post your code, just in case there is any type of program error, and so others may advise you more on what to look for.
  • bikemanbikeman Posts: 10
    edited 2014-05-05 07:46
    I just ran the test encoder code from the learn folder and the right servo flashes the P27 light and the left servo flashes the P26 light. That's correct isn't it?
  • PublisonPublison Posts: 12,366
    edited 2014-05-05 07:56
    bikeman wrote: »
    I just ran the test encoder code from the learn folder and the right servo flashes the P27 light and the left servo flashes the P26 light. That's correct isn't it?

    That's correct, and only works if the power switch is in position "2", full on.

    Can you provide a photo of your servo/encoder connections?
  • bikemanbikeman Posts: 10
    edited 2014-05-05 08:06
    Here is the calibrate code I'm using:
    #include "simpletools.h"
    #include "abcalibrate.h"    
    
    
    int main()
    {
      servo_pins(12, 13);
      encoder_pins(14, 15);
    
    
      high(26);
      high(27);
      cal_activityBot();
      low(26);
      low(27);
    }
    
    
  • PublisonPublison Posts: 12,366
    edited 2014-05-05 08:18
    Do you have the jumper to the left of P12-P13 set to VIN?
  • bikemanbikeman Posts: 10
    edited 2014-05-05 08:26
    and here is a pic:

    image.jpeg
    640 x 480 - 104K
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2014-05-05 08:32
    Hmmm. Can you check the voltage on the servo header VIN pins 12 & 13 where the servos get plugged in? There is a small chance that the little shunt jumper that sets those pins to VIN is somehow defective and so power is not reaching the servos.
  • PublisonPublison Posts: 12,366
    edited 2014-05-05 09:12
    Thanks for the pic. The cables look to be orientated correctly. Check Steph's question.
  • bikemanbikeman Posts: 10
    edited 2014-05-05 10:20
    I get 6.75 V across the white and red jumper pins on P12 and P13. Voltage on the Plug is 7.2 V
  • PublisonPublison Posts: 12,366
    edited 2014-05-05 10:42
    .................................
  • bikemanbikeman Posts: 10
    edited 2014-05-05 11:17
    I get a voltage reading between red and white pins 6.75V and also between the black and red pins 7V. I checked a bot that works fine and I get 2.6V across the red and white and 6.2 across the black and red pins.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-05-05 12:07
    Publison wrote: »
    Are you sure the 7.2 Volt is between Red and White? That means 7.2 Volt are going into the Propeller pin.

    Not really. Set as an output (as it would be when running a servo), the "white" pin will be 0V most of the time so the voltage difference between the two should be pretty close to Vin and ground (6.75V seems about right).
  • PublisonPublison Posts: 12,366
    edited 2014-05-05 12:18
    ............................................
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-05-05 13:05
    If the Prop pin is set to output a low (0V), there will be Vin volts between it and the red pin. And that's okay.

    Bikeman,

    The important voltage to measure is between the red and black pins. Also, do not connect the encoders to a set of pins supplied by Vin. They run on +5V, and a higher voltage could damage them.

    -Phil
  • ValeTValeT Posts: 308
    edited 2014-05-05 16:09
    I had this problem with my robot as well. Make sure you have the right resistors in place. Here is the link to the electrical connections page: http://learn.parallax.com/activitybot/electrical-connections. If that doesn't work, make sure you have the right software and the right libraries, as that fixed my problem. Do any of these suggestions help?
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2014-05-05 17:12
    In the other threads where people had problem with the servos, I suggested a tai chi program that demonstrates only servo operation, taking the encoders out of the equation. I'm not sure what the ActivityBot learning guides offer, but there ought to be some program code that makes the servos go forward and backward, without regard to anything else. You'd use the program without the encoders plugged in, or the resistors in place. It's about the simplest connection you can have for a rolling robot.

    Stephanie, is there such an example program out there that doesn't use the calibration procedure?

    If all else fails, you could always download a copy of the Spin IDE and get a simple servo exerciser program. Your ActivityBot won't mind being programmed in Spin just this once...

    I'm also curious: You get a different voltage reading between the power plug and the servo headers. I am not yet a proud owner of an Acrtivity Board, but what's in line there to cause the voltage drop? Is that from a diode in place to prevent reverse volting? Either way, 6.5V is adequate for those high speed servos.
  • Mr. LewisMr. Lewis Posts: 24
    edited 2014-05-17 12:26
    I was trying to help my students develop a project to see if we could control the servos on our own, and use a gripper attached to it to pick up items. Ultimately we were controlling this action with a remote control. As I did this, I wanted different control than using the encoders, so I tried this code:

    #include "simpletools.h" // Include simple tools
    #include "servo.h"
    int main() // Main function
    {
    freqout(4, 200, 3000); // Speaker tone: P4, 2 s, 3 kHz
    servo_speed (14,-650);
    servo_speed (15,650);

    pause (1800);
    for(int speed = 128; speed >= 0; speed -= 2)
    servo_speed (14,0);
    servo_speed (15,0);
    servo_stop ();

    }

    It worked for what I needed and may help you test if the servos are working at all.

    By the way, look in the text file for some better numbers for the servo speed - I think 100, 200 might be maximum. I still think in BS2 mode too often ;-).
Sign In or Register to comment.