Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

AX-12 Servos Not Responding

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
2 postsPage 1 of 1
2 postsPage 1 of 1

AX-12 Servos Not Responding

Post by netphaze » Thu Nov 12, 2009 4:43 pm

Post by netphaze
Thu Nov 12, 2009 4:43 pm

I currently have 4 AX-12 servos connected to a Sanguino MCU through the full-duplex to half-duplex circuit that is described in the AX-12 manual. Sanguino uses the Arduino environment. I have 4 FSRs connected to the controller, each one controlling its own servo.

I had all four servos working perfectly in response to input from the FSRs, and then I turned the power supply off, did some other work, and came back. When I turned it back on, one of the servos was not responding. I hadn't changed anything with the circuit or code. I disconnected all the others and tried to set its position. Nothing. I tried a reset. Nothing. Can't communicate with it. This happened again later with another servo. Not sure what's going on here.

I'm using the Bioloid library from Arbotix:
http://code.google.com/p/arbotix/wiki/BioloidController

Here is my code:
Code: Select all
#include <ax12>
#include <BioloidController>

//Two variables to check if the servo serial line is receiving or transmiting
boolean Transmit = true; //True Tx is active, False Rx is active

int Direction = 0; // Digital pin for direction port

int FSR_Pin[5] = {0, 1, 2, 3};  // analog pins FSRs connect to
int FSR_Output[5];      // the analog reading from the FSR resistor divider
int FSROutputSum = 0;

int ForceMin = 600;  // minimum FSR reading to actuate motor
int MaxPos[5] = {700, 400, 700, 700};  // max position for each servo
int MinPos[5] = {650, 350, 650, 650};  // min position for each servo

int ServoID[5] = {1, 2, 3, 4};  // IDs of servos
int ServoPos[5] = {650, 350, 650, 650};  // current position of servos

void setup()
{
  digitalWrite(Direction, HIGH);
  pinMode(Direction,OUTPUT); //Set direction port as an output
 
  for(int i=0;i<=3;i++){
    SetSpeed(ServoID[i], 100);  // set all servos to speed of 100
  }

}

void loop(){
 
  while(Transmit){
   
    FSROutputSum = 0;
   
  for(int i=0;i<3> ForceMin){  // if an FSR is being pressed
   
     FSROutputSum = 0;
   
   for(int i=0;i<3> ForceMin){     // actuate appropriate motor
        if(ServoPos[i] == MaxPos[i]){
          ServoPos[i] = MinPos[i];
        }
        else{
          ServoPos[i] = MaxPos[i];
        }
        SetPosition(ServoID[i], ServoPos[i]);
        delay(250);
      }
      FSR_Output[i] = analogRead(FSR_Pin[i]);  // read FSRs again
      FSROutputSum += FSR_Output[i];
    }
   }
   
  }
 
}
[/url]
I currently have 4 AX-12 servos connected to a Sanguino MCU through the full-duplex to half-duplex circuit that is described in the AX-12 manual. Sanguino uses the Arduino environment. I have 4 FSRs connected to the controller, each one controlling its own servo.

I had all four servos working perfectly in response to input from the FSRs, and then I turned the power supply off, did some other work, and came back. When I turned it back on, one of the servos was not responding. I hadn't changed anything with the circuit or code. I disconnected all the others and tried to set its position. Nothing. I tried a reset. Nothing. Can't communicate with it. This happened again later with another servo. Not sure what's going on here.

I'm using the Bioloid library from Arbotix:
http://code.google.com/p/arbotix/wiki/BioloidController

Here is my code:
Code: Select all
#include <ax12>
#include <BioloidController>

//Two variables to check if the servo serial line is receiving or transmiting
boolean Transmit = true; //True Tx is active, False Rx is active

int Direction = 0; // Digital pin for direction port

int FSR_Pin[5] = {0, 1, 2, 3};  // analog pins FSRs connect to
int FSR_Output[5];      // the analog reading from the FSR resistor divider
int FSROutputSum = 0;

int ForceMin = 600;  // minimum FSR reading to actuate motor
int MaxPos[5] = {700, 400, 700, 700};  // max position for each servo
int MinPos[5] = {650, 350, 650, 650};  // min position for each servo

int ServoID[5] = {1, 2, 3, 4};  // IDs of servos
int ServoPos[5] = {650, 350, 650, 650};  // current position of servos

void setup()
{
  digitalWrite(Direction, HIGH);
  pinMode(Direction,OUTPUT); //Set direction port as an output
 
  for(int i=0;i<=3;i++){
    SetSpeed(ServoID[i], 100);  // set all servos to speed of 100
  }

}

void loop(){
 
  while(Transmit){
   
    FSROutputSum = 0;
   
  for(int i=0;i<3> ForceMin){  // if an FSR is being pressed
   
     FSROutputSum = 0;
   
   for(int i=0;i<3> ForceMin){     // actuate appropriate motor
        if(ServoPos[i] == MaxPos[i]){
          ServoPos[i] = MinPos[i];
        }
        else{
          ServoPos[i] = MaxPos[i];
        }
        SetPosition(ServoID[i], ServoPos[i]);
        delay(250);
      }
      FSR_Output[i] = analogRead(FSR_Pin[i]);  // read FSRs again
      FSROutputSum += FSR_Output[i];
    }
   }
   
  }
 
}
[/url]
netphaze
Newbie
Newbie
Posts: 1
Joined: Thu Nov 12, 2009 4:30 pm

Post by arekku » Wed Nov 25, 2009 4:54 pm

Post by arekku
Wed Nov 25, 2009 4:54 pm

I'd say electronics error.

I would thus recommend:
Post complete schematics

When turning on power for a servo, does the LED correctly lit up and then unlit? If it does not well I reckon you can figure out that for yourself. If it does you might have some success in replacing the driver chip (74HC126D) but I'd advise you to wait and try other solutions first.
I'd say electronics error.

I would thus recommend:
Post complete schematics

When turning on power for a servo, does the LED correctly lit up and then unlit? If it does not well I reckon you can figure out that for yourself. If it does you might have some success in replacing the driver chip (74HC126D) but I'd advise you to wait and try other solutions first.
arekku
Robot Builder
Robot Builder
Posts: 17
Joined: Tue Sep 22, 2009 1:20 pm


2 postsPage 1 of 1
2 postsPage 1 of 1