Putting robotics at your service™

Free shipping on orders over $200

Chiron R1 Quadruped Two Armed

Print view Share :
Previous topicNext topic

Page 1 of 2 [ 29 posts ]

1, 2
Rookie ( offline )
Posts: 26
Posted: 2009-06-28 00:30 
I am creating this robot as a project for college and thought this might
also be a good place to post my work.


Executive Summary (for the school):
Quadrupedal locomotion and navigation is one of the most common methods utilized by land-based animals.
While it is very common in the natural world, roboticists seem to underutilize this method and most often
substitute it with hexapodal and bipedal ones. This project aims to
discover the specific challenges and obstacles facing robotic quadrupeds
and to construct a functioning robot quadruped.

Chiron was the most intelligent and civillized of all the centaurs, which
is where this robot gets its name.

I am also in the process of writing an Instructable to be published on
project completion.

Some preliminary photos post assembly (95% assembled)
All photos are shown with the robot statically stable (non powered, locked knees, hips at 45 degrees to the body)

In the Garden


Outside


In the Workshop


Hardware (All parts listed as individual quantities):
    x9 [ASB-201] Large Servo Bracket, Multi-purpose
    x9 [ASB-202] Large Servo Bracket, "C"
    x2 [AHC-01] Hub Connector, Square
    x9 [MD-01] Mechanical Dampener, Large Servo Bracket
    x20 [HUB-08] Tubing Connector Hub
    x14 [HMSH-02] Servo Horn, Metal Spline
    x7 [ASB-03] Servo Bracket, "C"
    x14 [ASB-04] Servo Bracket, Multi-purpose
    x13 [ASB-06] Connector Bracket, "L"
    x2 [ASB-11] Servo Bracket, Offset
    x2 [MPSH-01] Sensor Housing, Multi-purpose
Electronics:
    x1 [HS-805BB] Servo, Quarter Scale, 343 oz/in (I had this on hand)
    x9 [HS-755HB] Servo, Quarter Scale, 183 oz/in
    x10 [HS-645MG] Servo, Standard Size, 133 oz/in
    x6 [HS-311] Servo, Standard Size, 49 oz/in

    x2 [SIR-01] IR Sensor, Sharp GP2D12
    x4 [HFS-01] Foot Sensor

    x1 Axon Microcontroller (Society of Robots)
    x4 A123 Systems 26650 cells (From Developer's Kit)
    x1 A123 Systems Mini 1~2S Lithium ion Charger (Hobby King | Specs available at Enerland)
    x1 AC-DC 12V 5A Power Supply (Hobby King)

Each A123 Systems Cell provides 2300 mAh and 70 A of continuous current.
The Axon microcontroller's bus lines are rated for about 13 A so I added three 20 W 8 Ohm resistors in parallel to limit the current. Ideally I would need three 20 W resistors at about 2 Ohms or one 60 W resistor at 0.6 Ohms to give me a desired 10 A of current. The operating current requirements for all of my servos with no load is about 8.5 A. I will make the requiste upgrades as parts become available to me. The resistors were wired to the ground of the circuit to make the full 6.6 V available to the servos.

I like tall robots. I don't see why most people's robots are so short. Mine
currently stands at about 33 inches.

Torque Estimates:

Using a formula translation of

Torque = Force x Length of Torque Arm
Force = Torque / Length of Torque Arm

one can calculate the amount of weight a servo can support.



Reviewing the above diagram, if the hip joints are each using HS-755HB (rated for 183 oz/in of torque at 6.0v), and the knee joints are using HS-645MG (rated for 133 oz/in of torque at 6.0v), we can use these numbers and plug them into our force (weight) equation.

Force = 183 oz/in / 7 inches ==> 26 oz ==> 1.6 lbs

Force = 133 oz/in / 12 inches ==> 11 oz ==> 0.7 lbs

Meaning each joint in the vertical axis (or Z axis) can support 2.3 lbs.
The last measured weight of the robot was about 7 lbs.
This means according to my calculations that the robot can stand but not walk. We'll see.

(Note: if anyone sees a flaw in my calculations please point it out to me.)


Golden Ratio:

The Golden Ratio as defined by wikipedia:

Quote:
In mathematics and the arts, two quantities are in golden ratio if the ratio of the sum of the quantities to the larger one equals the ratio of the larger one to the smaller.



This ratio appears very often in the natural world (including humans) and thus seemed like a good model for my robot to follow as well.
With that in mind and starting with a simple base measurement for the tibia (from joint to end effector) of 12 inches this made the femur equate out to about 7 inches (from joint to joint).
The rounding of the numbers occured to facilitate easier Inverse Kinematic calulations.

Salamander Walk


Videos

Chiron R1 standing - stage 1 - arm assisted - video 1
Chiron R1 standing - stage 1 - arm assisted - video 2

Code:
//-------------------------sensor variables
int FRFoot=0;
int FLFoot=0;
int RRFoot=0;
int RLFoot=0;

int FRFoot_i=0;
int FLFoot_i=0;
int RRFoot_i=0;
int RLFoot_i=0;

long X_Acc=0;
long Y_Acc=0;
long Z_Acc=0;
   
long Y_Rate=0;
long X_Rate=0;

//------------------------- elbow config

long re_degree=90;
long re_cycle_range=835;
long re_degree_range=180;
long re_convert_offset=265;
long re_servo_cycle;
int re_degree_low_limit=0;
int re_degree_high_limit=180;

long le_degree=105;
long le_cycle_range=835;
long le_degree_range=180;
long le_convert_offset=265;
long le_servo_cycle;
int le_degree_low_limit=0;
int le_degree_high_limit=180;


//------------------------- shoulder 2 config

long rs2_degree=105;
long rs2_cycle_range=800;
long rs2_degree_range=180;
long rs2_convert_offset=225;
long rs2_servo_cycle;
int rs2_degree_low_limit=65;
int rs2_degree_high_limit=180;

long ls2_degree=105;
long ls2_cycle_range=800;
long ls2_degree_range=180;
long ls2_convert_offset=225;
long ls2_servo_cycle;
int ls2_degree_low_limit=0;
int ls2_degree_high_limit=135;

//------------------------- shoulder 1 config

long rs1_degree=40;
long rs1_cycle_range=800;
long rs1_degree_range=180;
long rs1_convert_offset=225;
long rs1_servo_cycle;
int rs1_degree_low_limit=0;
int rs1_degree_high_limit=180;

long ls1_degree=145;
long ls1_cycle_range=800;
long ls1_degree_range=180;
long ls1_convert_offset=225;
long ls1_servo_cycle;
int ls1_degree_low_limit=0;
int ls1_degree_high_limit=180;

//------------------------- knee config

long frk_degree=90;
long frk_cycle_range=835;
long frk_degree_range=180;
long frk_convert_offset=265;
long frk_servo_cycle;
int frk_degree_low_limit=50;
int frk_degree_high_limit=180;

long flk_degree=90;
long flk_cycle_range=835;
long flk_degree_range=180;
long flk_convert_offset=265;
long flk_servo_cycle;
int flk_degree_low_limit=0;
int flk_degree_high_limit=135;

long rrk_degree=90;
long rrk_cycle_range=835;
long rrk_degree_range=180;
long rrk_convert_offset=265;
long rrk_servo_cycle;
int rrk_degree_low_limit=0;
int rrk_degree_high_limit=135;

long rlk_degree=90;
long rlk_cycle_range=835;
long rlk_degree_range=180;
long rlk_convert_offset=265;
long rlk_servo_cycle;
int rlk_degree_low_limit=50;
int rlk_degree_high_limit=180;

//-------------------------- hip 2 config

long frh2_degree=90;
long frh2_cycle_range=835;
long frh2_degree_range=180;
long frh2_convert_offset=265;
long frh2_servo_cycle;
int frh2_degree_low_limit=60;
int frh2_degree_high_limit=170;

long flh2_degree=90;
long flh2_cycle_range=835;
long flh2_degree_range=180;
long flh2_convert_offset=265;
long flh2_servo_cycle;
int flh2_degree_low_limit=10;
int flh2_degree_high_limit=135;

long rrh2_degree=90;
long rrh2_cycle_range=835;
long rrh2_degree_range=180;
long rrh2_convert_offset=265;
long rrh2_servo_cycle;
int rrh2_degree_low_limit=10;
int rrh2_degree_high_limit=135;

long rlh2_degree=90;
long rlh2_cycle_range=835;
long rlh2_degree_range=180;
long rlh2_convert_offset=265;
long rlh2_servo_cycle;
int rlh2_degree_low_limit=50;
int rlh2_degree_high_limit=170;

//------------------------ hip 1 config


long frh1_degree=110;
long frh1_cycle_range=800;
long frh1_degree_range=180;
long frh1_convert_offset=385;
long frh1_servo_cycle;
int frh1_degree_low_limit=0;
int frh1_degree_high_limit=180;

long flh1_degree=110;
long flh1_cycle_range=800;
long flh1_degree_range=180;
long flh1_convert_offset=225;
long flh1_servo_cycle;
int flh1_degree_low_limit=10;
int flh1_degree_high_limit=180;

long rrh1_degree=60;
long rrh1_cycle_range=800;
long rrh1_degree_range=180;
long rrh1_convert_offset=225;
long rrh1_servo_cycle;
int rrh1_degree_low_limit=0;
int rrh1_degree_high_limit=170;

long rlh1_degree=100;
long rlh1_cycle_range=800;
long rlh1_degree_range=180;
long rlh1_convert_offset=385;
long rlh1_servo_cycle;
int rlh1_degree_low_limit=0;
int rlh1_degree_high_limit=180;

//------------------------ back config

long back_degree;
long back_cycle_range;
long back_degree_range;
long back_convert_offset;
long back_servo_cycle;

//------------------------

char keyboard_input=-1;
//114 = r
//102 = f
//120 = x
//116 = t
//103 = g

long servo_degree_convert(long degree, long cycle_range, long degree_range, long convert_offset);

void update_sensors(void);
void update_legs(void);
void update_arms(void);

void get_up(void);

void enforce_leg_limits(void);
void enforce_arm_limits(void);

void initial_foot_reading(void);

void manual_arm_adjustment(void);
void manual_leg_adjustment(void);
void manual_arm_leg_adj(void);
void manual_height(void);

void control(void)
   {
   
   do
   {
   keyboard_input=uart1GetByte();
   get_up();
   }while (keyboard_input != 'x');
   rprintf("Program Terminated\n\r");
   LED_off();


}

//-----------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------

void get_up(void)
{

   LED_on();

   rprintf("Program Initiated\n\r");

      //while the knees aren't straight and the hips aren't all the way up
      while (   flk_degree != flk_degree_low_limit &&
            rrk_degree != rrk_degree_low_limit &&
            rlk_degree != rlk_degree_high_limit &&
            frk_degree != frk_degree_high_limit &&
            flh2_degree != flh2_degree_high_limit &&
            rrh2_degree != rrh2_degree_high_limit &&
            rlh2_degree != rlh2_degree_low_limit &&
            frh2_degree != frh2_degree_low_limit)
      {
                        
      
      //---knees straighten
            flk_degree--;
            rrk_degree--;
            rlk_degree++;
            frk_degree++;
      //---hips go up
            flh2_degree = flh2_degree_high_limit;
            rrh2_degree = rrh2_degree_high_limit;
            rlh2_degree = rlh2_degree_low_limit;
            frh2_degree = frh2_degree_low_limit;

         
            enforce_leg_limits();
            enforce_arm_limits();
            update_legs();
            update_arms();
            update_sensors();
            
            Back(682);

            delay_ms(10);
      }

      initial_foot_reading();
            
      //while the knees aren't bent all the way down
      //bend them down
      while (   flk_degree != flk_degree_high_limit &&
            rrk_degree != rrk_degree_high_limit &&
            rlk_degree != rlk_degree_low_limit &&
            frk_degree != frk_degree_low_limit)
      {
         
            //---knees bend
            rprintf("knees bend ");
            flk_degree++;
            rrk_degree++;
            rlk_degree--;
            frk_degree--;

            //---get the arms ready to push down
            re_degree = 0;
            le_degree = 180;
            rs2_degree = 130;
            ls2_degree = 70;

            enforce_leg_limits();
            enforce_arm_limits();
            update_legs();
            update_arms();
            update_sensors();
            
            Back(682);

            delay_ms(10);

            rprintf("rs2_degree=%d ",rs2_degree);
            rprintf("ls2_degree=%d ",ls2_degree);
            rprintf("re_degree=%d ",re_degree);
            rprintf("le_degree=%d ",le_degree);
            rprintf("flk_degree=%d ",flk_degree);
            rprintf("rrk_degree=%d ",rrk_degree);
            rprintf("rlk_degree=%d ",rlk_degree);
            rprintf("frk_degree=%d\n\r",frk_degree);

      }
      
            rprintf("flk_degree=%d ",flk_degree);
            rprintf("rrk_degree=%d ",rrk_degree);
            rprintf("rlk_degree=%d ",rlk_degree);
            rprintf("frk_degree=%d ",frk_degree);

            rprintf("flh2_degree=%d ",flh2_degree);
            rprintf("rrh2_degree=%d ",rrh2_degree);
            rprintf("rlh2_degree=%d ",rlh2_degree);
            rprintf("frh2_degree=%d\n\r",frh2_degree);

      
      //while all of the feet aren't touching bend the hips down
      while (   FLFoot <= FLFoot_i &&
            FRFoot <= FRFoot_i &&
            RLFoot <= RLFoot_i &&
            RRFoot <= RRFoot_i )
      {
            
            
            
            
            //---hips down

            FRFoot=a2dConvert8bit(4);
            rprintf("FRFoot=%d | ",FRFoot);
            FLFoot=a2dConvert8bit(5);
            rprintf("FLFoot=%d | ",FLFoot);
            RRFoot=a2dConvert8bit(2);
            rprintf("RRFoot=%d | ",RRFoot);
            RLFoot=a2dConvert8bit(3);
            rprintf("RLFoot=%d\n\r",RLFoot);

            rprintf("Stage 1\n\r");
            
            if (FRFoot <= FRFoot_i){
      
            frh2_degree++;
            }

            if (FLFoot <= FLFoot_i){
            flh2_degree--;
            }

            if (RRFoot <= RRFoot_i){
            rrh2_degree--;
            }

            if (RLFoot <= RLFoot_i){
            rlh2_degree++;
            }
            
                     


            enforce_leg_limits();
            enforce_arm_limits();
            update_legs();
            update_arms();
            update_sensors();
            
            Back(682);

            delay_ms(10);
         }


         //now that the legs are pushing up
         //push arms down to get the robot up
         while(   re_degree != 70 &&
               le_degree != 120 &&
               rs2_degree != rs2_degree_low_limit &&
               ls2_degree != ls2_degree_high_limit)
         {
         //---arms down
            rprintf("arms down \n\r");
            rs2_degree = rs2_degree - 5;
            ls2_degree = ls2_degree + 5;
            
            if (re_degree != 70){
            re_degree++;
            }
            else {
            re_degree = 70;
            }

            if (le_degree != 120){
            le_degree--;
            }
            else {
            le_degree = 120;
            }
         }

         int degree_counter=0;
         
         frk_degree_high_limit = 145;
         flk_degree_low_limit = 30;
         rrk_degree_low_limit = 30;
         rlk_degree_high_limit = 145;

         frh2_degree=frh2_degree+30;
         flh2_degree=flh2_degree-30;         
         rrh2_degree=rrh2_degree-30;         
         rlh2_degree=rlh2_degree+30;

         re_degree = 70;
         le_degree = 120;
         rs2_degree = rs2_degree_low_limit;
         ls2_degree = ls2_degree_high_limit;
            
         

      
      //---hold stance
      long i;      
      for (i=0; i<10000; i++)
      {
            enforce_leg_limits();
            enforce_arm_limits();
            update_legs();
            update_arms();
            update_sensors();
            
            Back(682);

            delay_ms(10);
            rprintf(" Hold Stance.");
      }

   
   rprintf("Program Terminated\n\r");
   delay_ms(100000);


}

//------------------------------------------------------------------------------


/* servo_degree_covert is a general purpose function that takes the desired degree and converts it into the appropriate
   servo cycle output for your servo. The additional inputs are calculated/measured as follows:

   servo cycle                           degree
   -----------                           ------
      ___   cycle upper limit (ex. 1100)        ___ degree upper limit (ex. 180 degrees)
       |\                                    |
       | |                                 | \
       | |                                 |  |
       | |                                 |  |
       | |---- cycle range (ex. 800)            |  |---- degree_range (ex. 180)
       | |                                 |  |
       | |                                 |  |
       |/                                    | /
      _|_   cycle lower limit (ex. 300)           _|_ degree lower limit (ex. 0 degrees)
       |\
       | |---- convert_offset (ex. 300)
       | |
       |/
      _|_ 0

*/

 long servo_degree_convert(long degree, long cycle_range, long degree_range, long convert_offset)
{
      long servo_cycle;   
      servo_cycle = ((degree * cycle_range)/degree_range) + convert_offset;
      
      /*rprintf("degree=%d\n\r",degree);
      rprintf("cycle_range=%d\n\r",cycle_range);
      rprintf("degree_range=%d\n\r",degree_range);
      rprintf("convert_offset=%d\n\r",convert_offset);
      rprintf("servo_cycle=%d\n\r",servo_cycle);
*/
   return servo_cycle;
}


void initial_foot_reading(void)
{
   FRFoot_i=a2dConvert8bit(4);
   FLFoot_i=a2dConvert8bit(5);
   RRFoot_i=a2dConvert8bit(2);
   RLFoot_i=a2dConvert8bit(3);
}

void update_sensors(void)
   {

   X_Acc=accelerometer_ACCM3D(a2dConvert10bit(6));
   Y_Acc=accelerometer_ACCM3D(a2dConvert10bit(7));
   Z_Acc=accelerometer_ACCM3D(a2dConvert10bit(8));
   
   Y_Rate=gyro_SEN00741(a2dConvert10bit(9));
   X_Rate=gyro_SEN00741(a2dConvert10bit(10));
   
   FRFoot=a2dConvert8bit(4);
   FLFoot=a2dConvert8bit(5);
   RRFoot=a2dConvert8bit(2);
   RLFoot=a2dConvert8bit(3);

   }

void sensor_readout(void)
{
   X_Acc=accelerometer_ACCM3D(a2dConvert10bit(6));
   Y_Acc=accelerometer_ACCM3D(a2dConvert10bit(7));
   Z_Acc=accelerometer_ACCM3D(a2dConvert10bit(8));
   
   Y_Rate=gyro_SEN00741(a2dConvert10bit(9));
   X_Rate=gyro_SEN00741(a2dConvert10bit(10));
   
   FRFoot=a2dConvert8bit(4);
   rprintf("FRFoot=%d | ",FRFoot);
   FLFoot=a2dConvert8bit(5);
   rprintf("FLFoot=%d | ",FLFoot);
   RRFoot=a2dConvert8bit(2);
   rprintf("RRFoot=%d | ",RRFoot);
   RLFoot=a2dConvert8bit(3);
   rprintf("RLFoot=%d\n\r",RLFoot);
}

void update_legs(void)
{
      frk_servo_cycle = servo_degree_convert(frk_degree,frk_cycle_range,frk_degree_range,frk_convert_offset);
      flk_servo_cycle = servo_degree_convert(flk_degree,flk_cycle_range,flk_degree_range,flk_convert_offset);
      rrk_servo_cycle = servo_degree_convert(rrk_degree,rrk_cycle_range,rrk_degree_range,rrk_convert_offset);
      rlk_servo_cycle = servo_degree_convert(rlk_degree,rlk_cycle_range,rlk_degree_range,rlk_convert_offset);
      
      frh2_servo_cycle = servo_degree_convert(frh2_degree,frh2_cycle_range,frh2_degree_range,frh2_convert_offset);
      flh2_servo_cycle = servo_degree_convert(flh2_degree,flh2_cycle_range,flh2_degree_range,flh2_convert_offset);
      rrh2_servo_cycle = servo_degree_convert(rrh2_degree,rrh2_cycle_range,rrh2_degree_range,rrh2_convert_offset);
      rlh2_servo_cycle = servo_degree_convert(rlh2_degree,rlh2_cycle_range,rlh2_degree_range,rlh2_convert_offset);

      frh1_servo_cycle = servo_degree_convert(frh1_degree,frh1_cycle_range,frh1_degree_range,frh1_convert_offset);
      flh1_servo_cycle = servo_degree_convert(flh1_degree,flh1_cycle_range,flh1_degree_range,flh1_convert_offset);
      rrh1_servo_cycle = servo_degree_convert(rrh1_degree,rrh1_cycle_range,rrh1_degree_range,rrh1_convert_offset);
      rlh1_servo_cycle = servo_degree_convert(rlh1_degree,rlh1_cycle_range,rlh1_degree_range,rlh1_convert_offset);

      FRK(frk_servo_cycle);
      FLK(flk_servo_cycle);
      RRK(rrk_servo_cycle);
      RLK(rlk_servo_cycle);

      FLH2(flh2_servo_cycle);
      FRH2(frh2_servo_cycle);
      RLH2(rlh2_servo_cycle);
      RRH2(rrh2_servo_cycle);
      
      FLH1(flh1_servo_cycle);
      FRH1(frh1_servo_cycle);
      RLH1(rlh1_servo_cycle);
      RRH1(rrh1_servo_cycle);
}

void update_arms(void)
{
      re_servo_cycle = servo_degree_convert(re_degree,re_cycle_range,re_degree_range,re_convert_offset);
      le_servo_cycle = servo_degree_convert(le_degree,le_cycle_range,le_degree_range,le_convert_offset);
            
      ls2_servo_cycle = servo_degree_convert(ls2_degree,ls2_cycle_range,ls2_degree_range,ls2_convert_offset);
      rs2_servo_cycle = servo_degree_convert(rs2_degree,rs2_cycle_range,rs2_degree_range,rs2_convert_offset);
      
      ls1_servo_cycle = servo_degree_convert(ls1_degree,ls1_cycle_range,ls1_degree_range,ls1_convert_offset);
      rs1_servo_cycle = servo_degree_convert(rs1_degree,rs1_cycle_range,rs1_degree_range,rs1_convert_offset);
      
      RE(re_servo_cycle);
      LE(le_servo_cycle);
      
      RS2(rs2_servo_cycle);
      LS2(ls2_servo_cycle);
      
      RS1(rs1_servo_cycle);
      LS1(ls1_servo_cycle);
}

void enforce_arm_limits(void)
{

         if (re_degree < re_degree_low_limit)
         {
            re_degree = re_degree_low_limit;
         }

         if (re_degree > re_degree_high_limit)
         {
            re_degree = re_degree_high_limit;
         }


         if (le_degree < le_degree_low_limit)
         {
            le_degree = le_degree_low_limit;
         }

         if (le_degree > le_degree_high_limit)
         {
            le_degree = le_degree_high_limit;
         }


         if (rs2_degree < rs2_degree_low_limit)
         {
            rs2_degree = rs2_degree_low_limit;
         }

         if (rs2_degree > rs2_degree_high_limit)
         {
            rs2_degree = rs2_degree_high_limit;
         }


         if (ls2_degree < ls2_degree_low_limit)
         {
            ls2_degree = ls2_degree_low_limit;
         }

         if (ls2_degree > ls2_degree_high_limit)
         {
            ls2_degree = ls2_degree_high_limit;
         }


         if (rs1_degree < rs1_degree_low_limit)
         {
            rs1_degree = rs1_degree_low_limit;
         }

         if (rs1_degree > rs1_degree_high_limit)
         {
            rs1_degree = rs1_degree_high_limit;
         }


         if (ls1_degree < ls1_degree_low_limit)
         {
            ls1_degree = ls1_degree_low_limit;
         }

         if (ls1_degree > ls1_degree_high_limit)
         {
            ls1_degree = ls1_degree_high_limit;
         }


}

void enforce_leg_limits(void)
{

         if (frk_degree < frk_degree_low_limit)
         {
            frk_degree = frk_degree_low_limit;
         }

         if (frk_degree > frk_degree_high_limit)
         {
            frk_degree = frk_degree_high_limit;
         }


         if (flk_degree < flk_degree_low_limit)
         {
            flk_degree = flk_degree_low_limit;
         }

         if (flk_degree > flk_degree_high_limit)
         {
            flk_degree = flk_degree_high_limit;
         }


         if (rrk_degree < rrk_degree_low_limit)
         {
            rrk_degree = rrk_degree_low_limit;
         }

         if (rrk_degree > rrk_degree_high_limit)
         {
            rrk_degree = rrk_degree_high_limit;
         }


         if (rlk_degree < rlk_degree_low_limit)
         {
            rlk_degree = rlk_degree_low_limit;
         }

         if (rlk_degree > rlk_degree_high_limit)
         {
            rlk_degree = rlk_degree_high_limit;
         }


         if (frh2_degree < frh2_degree_low_limit)
         {
            frh2_degree = frh2_degree_low_limit;
         }

         if (frh2_degree > frh2_degree_high_limit)
         {
            frh2_degree = frh2_degree_high_limit;
         }


         if (flh2_degree < flh2_degree_low_limit)
         {
            flh2_degree = flh2_degree_low_limit;
         }

         if (flh2_degree > flh2_degree_high_limit)
         {
            flh2_degree = flh2_degree_high_limit;
         }


         if (rrh2_degree < rrh2_degree_low_limit)
         {
            rrh2_degree = rrh2_degree_low_limit;
         }

         if (rrh2_degree > rrh2_degree_high_limit)
         {
            rrh2_degree = rrh2_degree_high_limit;
         }


         if (rlh2_degree < rlh2_degree_low_limit)
         {
            rlh2_degree = rlh2_degree_low_limit;
         }

         if (rlh2_degree > rlh2_degree_high_limit)
         {
            rlh2_degree = rlh2_degree_high_limit;
         }


         if (frh1_degree < frh1_degree_low_limit)
         {
            frh1_degree = frh1_degree_low_limit;
         }

         if (frh1_degree > frh1_degree_high_limit)
         {
            frh1_degree = frh1_degree_high_limit;
         }


         if (flh1_degree < flh1_degree_low_limit)
         {
            flh1_degree = flh1_degree_low_limit;
         }

         if (flh1_degree > flh1_degree_high_limit)
         {
            flh1_degree = flh1_degree_high_limit;
         }


         if (rrh1_degree < rrh1_degree_low_limit)
         {
            rrh1_degree = rrh1_degree_low_limit;
         }

         if (rrh1_degree > rrh1_degree_high_limit)
         {
            rrh1_degree = rrh1_degree_high_limit;
         }


         if (rlh1_degree < rlh1_degree_low_limit)
         {
            rlh1_degree = rlh1_degree_low_limit;
         }

         if (rlh1_degree > rlh1_degree_high_limit)
         {
            rlh1_degree = rlh1_degree_high_limit;
         }

}


Videos
Chiron getting up and taking one full step (inspired by the sine walk).

Video 1

Video 2

Note: The conversion formula for the h1 hip joints was written incorrectly. The imposed range for these joints is actually from 0 to 90 degrees but is written as 0 to 180 degrees so anyone trying to dissect that part of my code should always divide by two. The h1 hips joints are the hip joints that travel in the X Y plane, or the horizontal plane. All other joints have been calibrated correctly.

Code:

[code]/****************************************************************************
*
* Copyright (c) 2008 www.societyofrobots.com
* (please link back if you use this code!)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Alternatively, this software may be distributed under the terms of BSD
* license.
*
****************************************************************************/




//-------------------------sensor variables
int FRFoot=0;
int FLFoot=0;
int RRFoot=0;
int RLFoot=0;

int FRFoot_i=0;
int FLFoot_i=0;
int RRFoot_i=0;
int RLFoot_i=0;

long X_Acc=0;
long Y_Acc=0;
long Z_Acc=0;

long Y_Rate=0;
long X_Rate=0;

//------------------------- elbow config

long re_degree=90;
long re_cycle_range=900;
long re_degree_range=200;
long re_convert_offset=250;
long re_servo_cycle;
int re_degree_low_limit=0;
int re_degree_high_limit=200;

long le_degree=90;
long le_cycle_range=900;
long le_degree_range=200;
long le_convert_offset=250;
long le_servo_cycle;
int le_degree_low_limit=0;
int le_degree_high_limit=200;


//------------------------- shoulder 2 config

long rs2_degree=90;
long rs2_cycle_range=800;
long rs2_degree_range=180;
long rs2_convert_offset=225;
long rs2_servo_cycle;
int rs2_degree_low_limit=65;
int rs2_degree_high_limit=180;

long ls2_degree=90;
long ls2_cycle_range=800;
long ls2_degree_range=180;
long ls2_convert_offset=225;
long ls2_servo_cycle;
int ls2_degree_low_limit=0;
int ls2_degree_high_limit=140;

//------------------------- shoulder 1 config

long rs1_degree=40;
long rs1_cycle_range=800;
long rs1_degree_range=180;
long rs1_convert_offset=225;
long rs1_servo_cycle;
int rs1_degree_low_limit=0;
int rs1_degree_high_limit=180;

long ls1_degree=145;
long ls1_cycle_range=800;
long ls1_degree_range=180;
long ls1_convert_offset=225;
long ls1_servo_cycle;
int ls1_degree_low_limit=0;
int ls1_degree_high_limit=180;

//------------------------- knee config

long frk_degree=90;
long frk_cycle_range=860;
long frk_degree_range=210;
long frk_convert_offset=240;
long frk_servo_cycle;
int frk_degree_low_limit=45;
int frk_degree_high_limit=235;

long flk_degree=90;
long flk_cycle_range=860;
long flk_degree_range=210;
long flk_convert_offset=240;
long flk_servo_cycle;
int flk_degree_low_limit=45;
int flk_degree_high_limit=235;

long rrk_degree=90;
long rrk_cycle_range=860;
long rrk_degree_range=210;
long rrk_convert_offset=240;
long rrk_servo_cycle;
int rrk_degree_low_limit=45;
int rrk_degree_high_limit=235;

long rlk_degree=90;
long rlk_cycle_range=860;
long rlk_degree_range=210;
long rlk_convert_offset=240;
long rlk_servo_cycle;
int rlk_degree_low_limit=45;
int rlk_degree_high_limit=230;

//-------------------------- hip 2 config

long frh2_degree=90;
long frh2_cycle_range=835;
long frh2_degree_range=180;
long frh2_convert_offset=265;
long frh2_servo_cycle;
int frh2_degree_low_limit=0;
int frh2_degree_high_limit=180;

long flh2_degree=90;
long flh2_cycle_range=835;
long flh2_degree_range=180;
long flh2_convert_offset=265;
long flh2_servo_cycle;
int flh2_degree_low_limit=0;
int flh2_degree_high_limit=180;

long rrh2_degree=90;
long rrh2_cycle_range=835;
long rrh2_degree_range=180;
long rrh2_convert_offset=265;
long rrh2_servo_cycle;
int rrh2_degree_low_limit=0;
int rrh2_degree_high_limit=180;

long rlh2_degree=90;
long rlh2_cycle_range=835;
long rlh2_degree_range=180;
long rlh2_convert_offset=265;
long rlh2_servo_cycle;
int rlh2_degree_low_limit=0;
int rlh2_degree_high_limit=180;

//------------------------ hip 1 config


long frh1_degree=90;
long frh1_cycle_range=800;
long frh1_degree_range=180;
long frh1_convert_offset=385;
long frh1_servo_cycle;
int frh1_degree_low_limit=0;
int frh1_degree_high_limit=180;

long flh1_degree=90;
long flh1_cycle_range=800;
long flh1_degree_range=180;
long flh1_convert_offset=225;
long flh1_servo_cycle;
int flh1_degree_low_limit=10;
int flh1_degree_high_limit=180;

long rrh1_degree=90;
long rrh1_cycle_range=800;
long rrh1_degree_range=180;
long rrh1_convert_offset=225;
long rrh1_servo_cycle;
int rrh1_degree_low_limit=0;
int rrh1_degree_high_limit=170;

long rlh1_degree=90;
long rlh1_cycle_range=800;
long rlh1_degree_range=180;
long rlh1_convert_offset=385;
long rlh1_servo_cycle;
int rlh1_degree_low_limit=0;
int rlh1_degree_high_limit=180;

//------------------------ back config

long back_degree=90;
long back_cycle_range=815;
long back_degree_range=180;
long back_convert_offset=310;
long back_servo_cycle;
int back_degree_low_limit=0;
int back_degree_high_limit=180;

//------------------------

char keyboard_input=-1;
//114 = r
//102 = f
//120 = x
//116 = t
//103 = g

long time=0;

long X_Vel=0;
int X_Acc_unit;
long X_Acc_t1;
long X_Acc_t2;
long X_Acc_instan;

long Z_Vel=0;
long Z_Dist=0;
int Z_Acc_unit;
long Z_Acc_t1;
long Z_Acc_t2;
long Z_Acc_instan;

int X_Rate_base;

int Y_Rate_base;

long servo_degree_convert(long degree, long cycle_range, long degree_range, long convert_offset);

void update_sensors(void);
void update_legs(void);
void update_arms(void);
void update_back(void);

void get_up(void);
void crawl(void);

void enforce_leg_limits(void);
void enforce_arm_limits(void);
void enforce_back_limits(void);

void initial_foot_reading(void);
void leg_tilt(void);

void manual_arm_adjustment(void);
void manual_leg_adjustment(void);
void manual_arm_leg_adj(void);
void manual_height(void);
void manual_knee_cal(void);

//void sensor_readout(void);
//void sensor_cal(void);

//void x_acc_instan(void);
//void z_acc_instan(void);

void control(void)
{
sensor_cal();
do
{
keyboard_input=uart1GetByte();

//sensor_readout();
//manual_arm_adjustment();
//manual_height();
//manual_knee_cal();
get_up();
crawl();
//manual_leg_adjustment();

}while (keyboard_input != 'x');
rprintf("Program Terminated\n\r");
LED_off();


}

//-----------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------

void get_up(void)
{

LED_on();

rprintf("Program Initiated\n\r");

long i;
long j;

back_degree=90;

//all legs to /^\_ position
flk_degree=45;
rrk_degree=45;
rlk_degree=45;
frk_degree=45;

flh2_degree=0;
rrh2_degree=0;
rlh2_degree=0;
frh2_degree=0;

flh1_degree=90;
rrh1_degree=90;
rlh1_degree=90;
frh1_degree=90;

//get the arms ready to push down
re_degree = 20;
le_degree = 180;
rs2_degree = 130;
ls2_degree = 70;

for (i=0; i < 100; i++)
{
enforce_leg_limits();
enforce_arm_limits();

update_back();
update_legs();
update_arms();
update_sensors();

Waist(1100);

}

//hips down /~+ to 90 degrees



for (i=0; i < 90; i++)
{

flh2_degree++;
rrh2_degree++;
rlh2_degree++;
frh2_degree++;

enforce_leg_limits();
enforce_arm_limits();

//leg_tilt();
update_back();
update_legs();
update_arms();
update_sensors();

Waist(1100);

}

//knees to 90 degrees


for (i=0; i < 45; i++)
{

flk_degree++;
rrk_degree++;
rlk_degree++;
frk_degree++;

enforce_leg_limits();
enforce_arm_limits();

//leg_tilt();
update_back();
update_legs();
update_arms();
update_sensors();

Waist(1100);

}

//legs up more
for (i=0; i < 70; i++)
{

flh2_degree++;
rrh2_degree++;
rlh2_degree++;
frh2_degree++;

flk_degree++;
rrk_degree++;
rlk_degree++;
frk_degree++;

enforce_leg_limits();
enforce_arm_limits();

//leg_tilt();
update_legs();
update_arms();
update_sensors();

Waist(1100);

}



//now that the legs are pushing up
//push arms down to get the robot up
for (i=0; i<60; i++)
{
//---arms down
rprintf("arms down \n\r");
rs2_degree = rs2_degree - 5;
ls2_degree = ls2_degree + 5;


re_degree++;

//re_degree = 80;



le_degree--;
//le_degree = 125;


enforce_leg_limits();
enforce_arm_limits();
update_legs();
update_arms();
update_sensors();


Waist(1100);



}

for (i=0; i < 50; i++)
{
enforce_leg_limits();
enforce_arm_limits();

update_legs();
update_arms();
update_sensors();

Waist(1100);

}


//hold

for (i=0; i < 100; i++)
{
enforce_leg_limits();
enforce_arm_limits();

update_back();
update_legs();
update_arms();
update_sensors();

Waist(1100);

}

}


void crawl(void)
{



int i;
int m = 17;
long j;
for (j=0; j < 1000; j++)
{

rprintf("Start crawl.");

flh1_degree=90;
rrh1_degree=90;
rlh1_degree=90;
frh1_degree=90;

flh2_degree=150;
rrh2_degree=150;
rlh2_degree=150;
frh2_degree=150;

flk_degree=170;
rrk_degree=170;
rlk_degree=170;
frk_degree=170;



//shift body to front right


while (frk_degree!=150 ||
rlk_degree!=190 ||
flh1_degree!=60 ||
rrh1_degree!=60)
{

if (frk_degree > 150){
frk_degree=frk_degree-1;}
if (frk_degree < 150){
frk_degree=150;}

if (rlk_degree < 190){
rlk_degree=rlk_degree+1;}
if (rlk_degree > 190){
rlk_degree=190;}

if (flh1_degree > 60){
flh1_degree=flh1_degree-1;}
if (flh1_degree < 60){
flh1_degree=60;}

if (rrh1_degree > 60){
rrh1_degree=rrh1_degree-1;}
if (rrh1_degree < 60){
rrh1_degree=60;}

enforce_leg_limits();
enforce_arm_limits();

update_back();
update_legs();
update_arms();
update_sensors();


Waist(1100);


}

//rl foot take step 1
for (i=0; i < 10; i++)
{

rlk_degree=0;
rlh2_degree=0;
rlh1_degree=160;



enforce_leg_limits();
enforce_arm_limits();

update_back();
update_legs();
update_arms();
update_sensors();


Waist(1100);


}

for (i=0; i < 10; i++)
{

rlk_degree=170;
rlh2_degree=150;



enforce_leg_limits();
enforce_arm_limits();

update_back();
update_legs();
update_arms();
update_sensors();


Waist(1100);


}

//pause

for (j=0; j < 50; j++)
{
enforce_leg_limits();
enforce_arm_limits();

update_back();
update_legs();
update_arms();
update_sensors();

Waist(1100);

}

//shift to tripod balance positions
while (
flh1_degree!=90 ||
rrh1_degree!=120||
rlh1_degree!=120||
frh1_degree!=120||
frk_degree!=160 ||
back_degree!=60)

{

if (flh1_degree < 90){
flh1_degree++;}
if (flh1_degree > 90){
flh1_degree=90;}

if (rrh1_degree < 120){
rrh1_degree++;}
if (rrh1_degree > 120){
rrh1_degree=120;}

if (rlh1_degree < 120){
rlh1_degree++;}
if (rlh1_degree > 120){
rlh1_degree=120;}

if (frh1_degree < 120){
frh1_degree++;}
if (frh1_degree > 120){
frh1_degree=120;}

if (frk_degree < 160){
frk_degree++;}
if (frk_degree > 160){
frk_degree=160;}

if (back_degree < 60){
back_degree++;}
if (back_degree > 60){
back_degree=60;}

enforce_leg_limits();
enforce_arm_limits();
enforce_back_limits();

update_back();
update_legs();
update_arms();
update_sensors();

Waist(1100);

for (i=0; i < 2; i++)
{

enforce_leg_limits();
enforce_arm_limits();
enforce_back_limits();

update_back();
update_legs();
update_arms();
update_sensors();

Waist(1100);

}

}





//fl foot take step
while (
flk_degree!=45 ||
flh2_degree!=0 )

{

if (flk_degree > 45){
flk_degree=flk_degree-3;}
if (flk_degree < 45){
flk_degree=45;}

if (flh2_degree > 0){
flh2_degree=flh2_degree-3;}
if (flh2_degree < 0){
flh2_degree=0;}





enforce_leg_limits();
enforce_arm_limits();
enforce_back_limits();

update_back();
update_legs();
update_arms();
update_sensors();

Waist(1100);

rprintf("flk = %d | ", flk_degree);
rprintf("flh2 = %d | ", flh2_degree);
rprintf("flh1 = %d |\n\r", flh1_degree);

}


while (
flk_degree!=170 ||
flh2_degree!=150 ||
flh1_degree!=120
)

{
rprintf("fl foot step 2\n\r");
if (flk_degree < 170){
flk_degree=flk_degree+4;}
if (flk_degree > 170){
flk_degree=170;}

if (flh2_degree < 150){
flh2_degree=flh2_degree+6;}
if (flh2_degree > 150){
flh2_degree=150;}

if (flh1_degree < 120){
flh1_degree=flh1_degree+4;}
if (flh1_degree > 120){
flh1_degree=120;}




enforce_leg_limits();
enforce_arm_limits();
enforce_back_limits();

update_back();
update_legs();
update_arms();
update_sensors();

Waist(1100);



}


//shift back

while(back_degree!=120){

if (back_degree < 120){
back_degree++;}
if (back_degree > 120){
back_degree=120;}
}
//reset positions
flh1_degree=90;
rrh1_degree=90;
rlh1_degree=90;
frh1_degree=90;

flh2_degree=150;
rrh2_degree=150;
rlh2_degree=150;
frh2_degree=150;

flk_degree=170;
rrk_degree=170;
rlk_degree=170;
frk_degree=170;

for (i=0; i < 20; i++)
{




enforce_leg_limits();
enforce_arm_limits();

update_back();
update_legs();
update_arms();
update_sensors();


Waist(1100);


}



//shift body to front left


while (flk_degree!=150 ||
rrk_degree!=190 ||
frh1_degree!=60 ||
rlh1_degree!=60 ||

flh1_degree!=90 ||
rrh1_degree!=90)
{

if (flk_degree > 150){
flk_degree=flk_degree-1;}
if (flk_degree < 150){
flk_degree=150;}

if (rrk_degree < 190){
rrk_degree=rrk_degree+1;}
if (rrk_degree > 190){
rrk_degree=190;}

if (frh1_degree > 60){
frh1_degree=frh1_degree-1;}
if (frh1_degree < 60){
frh1_degree=60;}

if (rlh1_degree > 60){
rlh1_degree=rlh1_degree-1;}
if (rlh1_degree < 60){
rlh1_degree=60;}

if (flh1_degree > 90){
flh1_degree=flh1_degree-1;}
if (flh1_degree < 90){
flh1_degree=90;}

if (rrh1_degree < 90){
rrh1_degree=rrh1_degree+1;}
if (rrh1_degree > 90){
rrh1_degree=90;}

enforce_leg_limits();
enforce_arm_limits();

update_back();
update_legs();
update_arms();
update_sensors();


Waist(1100);


}
//rr foot take step
for (i=0; i < 10; i++)
{

rrk_degree=0;
rrh2_degree=0;
rrh1_degree=160;



enforce_leg_limits();
enforce_arm_limits();

update_back();
update_legs();
update_arms();
update_sensors();


Waist(1100);


}

for (i=0; i < 10; i++)
{

rrk_degree=170;
rrh2_degree=150;



enforce_leg_limits();
enforce_arm_limits();

update_back();
update_legs();
update_arms();
update_sensors();


Waist(1100);


}

//pause

for (j=0; j < 100; j++)
{
enforce_leg_limits();
enforce_arm_limits();

update_back();
update_legs();
update_arms();
update_sensors();

Waist(1100);

}

//shift to tripod balance positions
while (
flh1_degree!=120 ||
rrh1_degree!=120||
rlh1_degree!=120||
frh1_degree!=90||
frk_degree!=160 ||
back_degree!=90)

{

if (flh1_degree < 120){
flh1_degree++;}
if (flh1_degree > 120){
flh1_degree=120;}

if (rrh1_degree < 120){
rrh1_degree++;}
if (rrh1_degree > 120){
rrh1_degree=120;}

if (rlh1_degree < 120){
rlh1_degree++;}
if (rlh1_degree > 120){
rlh1_degree=120;}

if (frh1_degree < 90){
frh1_degree++;}
if (frh1_degree > 90){
frh1_degree=90;}

if (frk_degree < 160){
frk_degree++;}
if (frk_degree > 160){
frk_degree=160;}

if (back_degree < 90){
back_degree++;}
if (back_degree > 90){
back_degree=90;}

enforce_leg_limits();
enforce_arm_limits();
enforce_back_limits();

update_back();
update_legs();
update_arms();
update_sensors();

Waist(1100);

for (i=0; i < 2; i++)
{

enforce_leg_limits();
enforce_arm_limits();
enforce_back_limits();

update_back();
update_legs();
update_arms();
update_sensors();

Waist(1100);

}

}

//fr foot take step
for (i=0; i < 10; i++)
{

frk_degree=0;
frh2_degree=0;
frh1_degree=160;



enforce_leg_limits();
enforce_arm_limits();

update_back();
update_legs();
update_arms();
update_sensors();


Waist(1100);


}

for (i=0; i < 10; i++)
{

frk_degree=170;
frh2_degree=150;



enforce_leg_limits();
enforce_arm_limits();

update_back();
update_legs();
update_arms();
update_sensors();


Waist(1100);


}

//hold

for (i=0; i < 1000; i++)
{

enforce_leg_limits();
enforce_arm_limits();
enforce_back_limits();

update_back();
update_legs();
update_arms();
update_sensors();

Waist(1100);

}




}



//------------------------------------------------------------------------------
void leg_tilt(void)
{

update_sensors();

if (X_Rate > (X_Rate_base+1) && Y_Rate > (Y_Rate_base+1))
{
//straighten
flh2_degree=flh2_degree+4;
//flk_degree=flk_degree+2;
//bend
rrh2_degree=flh2_degree-2;
//rrk_degree=rrk_degree+1;
}

if (X_Rate < (X_Rate_base-1) && Y_Rate > (Y_Rate_base+1))
{
//straighten
frh2_degree=frh2_degree+4;
//frk_degree=frk_degree-2;
//bend
rlh2_degree=frh2_degree-2;
//rlk_degree=rlk_degree-1;
}

if (X_Rate > (X_Rate_base+1) && Y_Rate < (Y_Rate_base-1))
{
//straighten
rlh2_degree=rlh2_degree+4;
//rlk_degree=rlk_degree+2;
//bend
frh2_degree=rlh2_degree-2;
//frk_degree=frk_degree+1;
}

if (X_Rate < (X_Rate_base-1) && Y_Rate < (Y_Rate_base-1))
{
//straighten
rrh2_degree=rrh2_degree+4;
//rrk_degree=rrk_degree-2;
//bend
flh2_degree=rrh2_degree-2;
//flk_degree=flk_degree-1;
}

enforce_leg_limits();
update_legs();
}

void manual_leg_adjustment(void)
{

LED_on();

rprintf("Program Initiated\n\r");

do
{
keyboard_input=uart1GetByte();

//-----------------------knee adj

if (keyboard_input == 'r')
{
frk_degree--;
rprintf("frk=%d\n\r",frk_degree);
}

if (keyboard_input == 'R')
{
frk_degree++;
rprintf("frk=%d\n\r",frk_degree);
}
//-----------
if (keyboard_input == 't')
{
flk_degree--;
rprintf("flk=%d\n\r",flk_degree);
}

if (keyboard_input == 'T')
{
flk_degree++;
rprintf("flk=%d\n\r",flk_degree);
}
//-----------
if (keyboard_input == 'y')
{
rrk_degree--;
rprintf("rrk=%d\n\r",rrk_degree);
}

if (keyboard_input == 'Y')
{
rrk_degree++;
rprintf("rrk=%d\n\r",rrk_degree);
}
//-----------
if (keyboard_input == 'u')
{
rlk_degree--;
rprintf("rlk=%d\n\r",rlk_degree);
}

if (keyboard_input == 'U')
{
rlk_degree++;
rprintf("rlk=%d\n\r",rlk_degree);
}

//-----------------------h2 adj

if (keyboard_input == 'f')
{
frh2_degree--;
rprintf("frh2=%d\n\r",frh2_degree);
}

if (keyboard_input == 'F')
{
frh2_degree++;
rprintf("frh2=%d\n\r",frh2_degree);
}
//-----------
if (keyboard_input == 'g')
{
flh2_degree--;
rprintf("flh2=%d\n\r",flh2_degree);
}

if (keyboard_input == 'G')
{
flh2_degree++;
rprintf("flh2=%d\n\r",flh2_degree);
}
//-----------
if (keyboard_input == 'h')
{
rrh2_degree--;
rprintf("rrh2=%d\n\r",rrh2_degree);
}

if (keyboard_input == 'H')
{
rrh2_degree++;
rprintf("rrh2=%d\n\r",rrh2_degree);
}
//-----------
if (keyboard_input == 'j')
{
rlh2_degree--;
rprintf("rlh2=%d\n\r",rlh2_degree);
}

if (keyboard_input == 'J')
{
rlh2_degree++;
rprintf("rlh2=%d\n\r",rlh2_degree);
}
//-----------------------h1 adj

if (keyboard_input == 'v')
{
frh1_degree--;
rprintf("frh1=%d\n\r",frh1_degree);
}

if (keyboard_input == 'V')
{
frh1_degree++;
rprintf("frh1=%d\n\r",frh1_degree);
}
//-----------
if (keyboard_input == 'b')
{
flh1_degree--;
rprintf("flh1=%d\n\r",flh1_degree);
}

if (keyboard_input == 'B')
{
flh1_degree++;
rprintf("flh1=%d\n\r",flh1_degree);
}
//-----------
if (keyboard_input == 'n')
{
rrh1_degree--;
rprintf("rrh1=%d\n\r",rrh1_degree);
}

if (keyboard_input == 'N')
{
rrh1_degree++;
rprintf("rrh1=%d\n\r",rrh1_degree);
}
//-----------
if (keyboard_input == 'm')
{
rlh1_degree--;
rprintf("rlh1=%d\n\r",rlh1_degree);
}

if (keyboard_input == 'M')
{
rlh1_degree++;
rprintf("rlh1=%d\n\r",rlh1_degree);
}
//-----------------------------------------------------------------

enforce_leg_limits();

update_legs();

update_back();

//delay_ms(10);

update_sensors();

} while (keyboard_input != 'x');
rprintf("Program Terminated\n\r");
delay_ms(100000);


}

//---------------------------------------------------------------------

void manual_arm_adjustment(void)
{

LED_on();

rprintf("Program Initiated\n\r");

do
{
keyboard_input=uart1GetByte();

//-------------------------------- elbow adj

if (keyboard_input == 'w')
{
re_degree--;
rprintf("re=%d\n\r",re_degree);
}

if (keyboard_input == 'W')
{
re_degree++;
rprintf("re=%d\n\r",re_degree);
}
//-----------
if (keyboard_input == 'q')
{
le_degree++;
rprintf("le=%d\n\r",le_degree);
}

if (keyboard_input == 'Q')
{
le_degree--;
rprintf("le=%d\n\r",le_degree);
}
//--------------------------------- s2 adj
if (keyboard_input == 's')
{
rs2_degree++;
rprintf("rs2=%d\n\r",rs2_degree);
}

if (keyboard_input == 'S')
{
rs2_degree--;
rprintf("rs2=%d\n\r",rs2_degree);
}
//-----------
if (keyboard_input == 'a')
{
ls2_degree--;
rprintf("ls2=%d\n\r",ls2_degree);
}

if (keyboard_input == 'A')
{
ls2_degree++;
rprintf("ls2=%d\n\r",ls2_degree);
}

//--------------------------------- s1 adj

if (keyboard_input == 'c')
{
rs1_degree--;
rprintf("rs1=%d\n\r",rs1_degree);
}

if (keyboard_input == 'C')
{
rs1_degree++;
rprintf("rs1=%d\n\r",rs1_degree);
}
//-----------
if (keyboard_input == 'z')
{
ls1_degree++;
rprintf("ls1=%d\n\r",ls1_degree);
}

if (keyboard_input == 'Z')
{
ls1_degree--;
rprintf("ls1=%d\n\r",ls1_degree);
}
//-----------------------------------------------------------------

enforce_arm_limits();

update_arms();

Waist(1100);

//delay_ms(10);

update_sensors();

} while (keyboard_input != 'x');
rprintf("Program Terminated\n\r");
delay_ms(100000);


}
//----------------------------------------------------------------------------------------------------

void manual_arm_leg_adj(void)
{

LED_on();

rprintf("Program Initiated\n\r");

do
{
keyboard_input=uart1GetByte();
//---------------------------------- manual_leg_adjustment
//-----------------------knee adj

if (keyboard_input == 'r')
{
frk_degree--;
rprintf("frk=%d\n\r",frk_degree);
}

if (keyboard_input == 'R')
{
frk_degree++;
rprintf("frk=%d\n\r",frk_degree);
}
//-----------
if (keyboard_input == 't')
{
flk_degree++;
rprintf("flk=%d\n\r",flk_degree);
}

if (keyboard_input == 'T')
{
flk_degree--;
rprintf("flk=%d\n\r",flk_degree);
}
//-----------
if (keyboard_input == 'y')
{
rrk_degree++;
rprintf("rrk=%d\n\r",rrk_degree);
}

if (keyboard_input == 'Y')
{
rrk_degree--;
rprintf("rrk=%d\n\r",rrk_degree);
}
//-----------
if (keyboard_input == 'u')
{
rlk_degree--;
rprintf("rlk=%d\n\r",rlk_degree);
}

if (keyboard_input == 'U')
{
rlk_degree++;
rprintf("rlk=%d\n\r",rlk_degree);
}

//-----------------------h2 adj

if (keyboard_input == 'f')
{
frh2_degree--;
rprintf("frh2=%d\n\r",frh2_degree);
}

if (keyboard_input == 'F')
{
frh2_degree++;
rprintf("frh2=%d\n\r",frh2_degree);
}
//-----------
if (keyboard_input == 'g')
{
flh2_degree++;
rprintf("flh2=%d\n\r",flh2_degree);
}

if (keyboard_input == 'G')
{
flh2_degree--;
rprintf("flh2=%d\n\r",flh2_degree);
}
//-----------
if (keyboard_input == 'h')
{
rrh2_degree++;
rprintf("rrh2=%d\n\r",rrh2_degree);
}

if (keyboard_input == 'H')
{
rrh2_degree--;
rprintf("rrh2=%d\n\r",rrh2_degree);
}
//-----------
if (keyboard_input == 'j')
{
rlh2_degree--;
rprintf("rlh2=%d\n\r",rlh2_degree);
}

if (keyboard_input == 'J')
{
rlh2_degree++;
rprintf("rlh2=%d\n\r",rlh2_degree);
}
//-----------------------h1 adj

if (keyboard_input == 'v')
{
frh1_degree--;
rprintf("frh1=%d\n\r",frh1_degree);
}

if (keyboard_input == 'V')
{
frh1_degree++;
rprintf("frh1=%d\n\r",frh1_degree);
}
//-----------
if (keyboard_input == 'b')
{
flh1_degree++;
rprintf("flh1=%d\n\r",flh1_degree);
}

if (keyboard_input == 'B')
{
flh1_degree--;
rprintf("flh1=%d\n\r",flh1_degree);
}
//-----------
if (keyboard_input == 'n')
{
rrh1_degree++;
rprintf("rrh1=%d\n\r",rrh1_degree);
}

if (keyboard_input == 'N')
{
rrh1_degree--;
rprintf("rrh1=%d\n\r",rrh1_degree);
}
//-----------
if (keyboard_input == 'm')
{
rlh1_degree--;
rprintf("rlh1=%d\n\r",rlh1_degree);
}

if (keyboard_input == 'M')
{
rlh1_degree++;
rprintf("rlh1=%d\n\r",rlh1_degree);
}


//----------------------------------------- manual_arm_adjustment


//-------------------------------- elbow adj

if (keyboard_input == 'w')
{
re_degree--;
rprintf("re=%d\n\r",re_degree);
}

if (keyboard_input == 'W')
{
re_degree++;
rprintf("re=%d\n\r",re_degree);
}
//-----------
if (keyboard_input == 'q')
{
le_degree++;
rprintf("le=%d\n\r",le_degree);
}

if (keyboard_input == 'Q')
{
le_degree--;
rprintf("le=%d\n\r",le_degree);
}
//--------------------------------- s2 adj
if (keyboard_input == 's')
{
rs2_degree++;
rprintf("rs2=%d\n\r",rs2_degree);
}

if (keyboard_input == 'S')
{
rs2_degree--;
rprintf("rs2=%d\n\r",rs2_degree);
}
//-----------
if (keyboard_input == 'a')
{
ls2_degree--;
rprintf("ls2=%d\n\r",ls2_degree);
}

if (keyboard_input == 'A')
{
ls2_degree++;
rprintf("ls2=%d\n\r",ls2_degree);
}

//--------------------------------- s1 adj

if (keyboard_input == 'c')
{
r


Last edited by thesa1nt01 on 2009-08-04 01:34, edited 16 times in total.

User avatar
Guru ( offline )
Posts: 9256
Posted: 2009-06-30 11:09 
Were you going to add images or videos? Looking forward to seeing them.

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Rookie ( offline )
Posts: 26
Posted: 2009-06-30 11:17 
I was planning on it. Just waiting out my time limit. The other night I thought it would have been up but I tried to add links to my parts suppliers and it rejected my post.


User avatar
Expert ( offline )
Posts: 746
Posted: 2009-06-30 11:22 
thesa1nt01 wrote:
I was planning on it. Just waiting out my time limit. The other night I thought it would have been up but I tried to add links to my parts suppliers and it rejected my post.

You ought to be able to post links and images now that you've got two posts. (When you edit your first post, you'll still have one without images or links as per the requirements.) Let me know if you still have trouble with it.

_________________
Beth
Lynxmotion, Inc
http://www.lynxmotion.com

THANKS I COULD HELP BRO


Rookie ( offline )
Posts: 26
Posted: 2009-06-30 11:29 
Roger.


Guru ( offline )
Posts: 2251
Posted: 2009-06-30 11:49 
thesa1nt01 wrote:
I like tall robots. I don't see why most people's robots are so short. Mine
currently stands at about 19 inches.

Is it walking yet? Size is often limited by what hobby type servos can handle.

_________________
Why I like my 2005 rio yellow Honda S2000 with the top down, and more!
http://youtube.com/watch?v=pWjMvrkUqX0
http://youtube.com/watch?v=qfyRA-g1nhI
http://web.comporium.net/~shb/S2000video.htm


Rookie ( offline )
Posts: 26
Posted: 2009-07-03 22:07 
 Post subject: Battery Issue
So, here's a thing, this happened to me today:



I have 4 Lithium-Ion Iron Phosphate 26650's from A123systems wired in series-parallel and the bottom "half" of the cells went dead and the top "half" didn't.

Anyone have any ideas?

(the wire in between is for the charging circuit)(the batteries were not charging when this happened but they were wired up to my microcontroller and servos)

These voltages were measured while still in the circuit and the "0 volts" was actually more like 0.8 volts.

Ideas would be helpful.


User avatar
Guru ( offline )
Posts: 4127
Posted: 2009-07-03 23:57 
 Post subject: Re: Battery Issue
Perhaps the cells didn't start off with an equal charge?

I think the better chargers have taps to allow an equalizing charge. A123Systems may have other recommendations.

I don't have much info on these new technologies.

Alan KM6VV

thesa1nt01 wrote:
So, here's a thing, this happened to me today:

I have 4 Lithium-Ion Iron Phosphate 26650's from A123systems wired in series-parallel and the bottom "half" of the cells went dead and the top "half" didn't.

Anyone have any ideas?

(the wire in between is for the charging circuit)(the batteries were not charging when this happened but they were wired up to my microcontroller and servos)

These voltages were measured while still in the circuit and the "0 volts" was actually more like 0.8 volts.

Ideas would be helpful.

_________________
Visit:
http://groups.yahoo.com/group/SherlineCNC/
http://tech.groups.yahoo.com/group/HexapodRobotIK/


Rookie ( offline )
Posts: 26
Posted: 2009-07-04 00:02 
My charger does have a balacing circuit that I had to wire into my custom pack myself. I'd charged it several (testing) times before without problems. Unfortunately the charger's website doesn't provide detailed scats, nor does A123.


Guru ( offline )
Posts: 2158
Posted: 2009-07-04 11:57 
the A123 cells were purchased direct from somebody or salvaged from some other equipment?

some Li based cell designs have what amount to fuses built into them.. different types depending on the cell and the manufacturer. we use, for example, a li-ion cell that has both a PTC and a thermal fuse (as in a permanent blow fuse rather than a restaable device like the PTC) to handle different fault modes.

I'm not saying this IS your situation, just pointing out that it's a possibility depending on what the cells are and where they came from.


Rookie ( offline )
Posts: 26
Posted: 2009-07-04 13:13 
I purchased the cells directly from A123systems. I don't see any mention of fuses of any sort in the documentation. I'm going to rip the pack apart today and inspect and charge each cell individually. I just wish I knew how it could have gotten like this so I can prevent it next time.


Guru ( offline )
Posts: 2251
Posted: 2009-07-04 13:18 
Any particular reason you have a jumper in the middle between the two series strings?

_________________
Why I like my 2005 rio yellow Honda S2000 with the top down, and more!
http://youtube.com/watch?v=pWjMvrkUqX0
http://youtube.com/watch?v=qfyRA-g1nhI
http://web.comporium.net/~shb/S2000video.htm


Rookie ( offline )
Posts: 26
Posted: 2009-07-04 13:23 
Quote:
(the wire in between is for the charging circuit)


Rookie ( offline )
Posts: 26
Posted: 2009-07-04 13:26 
UPDATE:

Just before I was about to rip everything apart this afternoon I checked the batteries out with my multimeter again and:
    The overall voltage has risen from 3 v to 4.2 v

    The middle reading is at 2.5 v now like one would expect it to be.

    The charger recognizes all of the cells and is now charging.

I guess the batteries just needed a rest?

Any thoughts?


Guru ( offline )
Posts: 2251
Posted: 2009-07-04 13:28 
One of the 0v cells may be a dud. I'd charge them individually, then put them in series without the jumper and see how they perform.

_________________
Why I like my 2005 rio yellow Honda S2000 with the top down, and more!
http://youtube.com/watch?v=pWjMvrkUqX0
http://youtube.com/watch?v=qfyRA-g1nhI
http://web.comporium.net/~shb/S2000video.htm


1, 2

All times are UTC - 5 hours [ DST ]. It is currently 2014-12-22 21:31
Feedback Form
Feedback Form