APod Hexapod Cannot Walk!

I recently assembled a APod Hexapod (using the Lynxmotion kit); however, it does not walk properly. With the battery fully charged, the hexapod is able to stand for a while but quickly loses power and falls on its belly. In addition, if I did make the robot walk, it would simply drag its body on the ground.

Is this a problem with the servos, the battery, the assembly…? Any ideas?

You’ll need to provide more information. What battery are you using? Did you purchase the complete A-Pod or just the no electronics version and add your own controller? What code are you using and how are you controlling it? How are you powering the microcontroller? The more information (including images) you can provide the better.

I purchased the complete APod kit (with all electronics). The battery that I am using is the 6.0 Volt Ni-MH 2800mAh Battery Pack that the kit suggests using.

However, I am not using the microcontroller that came with the kit (Basic Atom Pro), but rather, I tried using an Arduino because I felt it would be easier to code (I want the hexapod to move autonomously and not with a PS2 controller). I wrote a simple gait for the hexapod to walk. I am powering the microcontroller and servo controller with a 9VDC battery.

What kind of images do you want?

Thank you!

Not a problem if you use an Arduino-based microcontroller. It sounds like everything is correct. Can you check to see that the NiMh pack is fully charged, as is the 9V? Whenever we had this issue, it was always related to the battery. Note that most 9V batteries drain rather quickly, and we have found that rechargeable 9V batteries don’t work well. You have ground on the Arduino connected to GND on the SSC-32? You might try adapting the Phoenix code and controlling it via USB cable first.

Again hard to say without seeing the code and seeing more of what it is actually doing. As Coleman mentioned, you can try adapting the Phoenix code base. I do not have a version I have tested on the Lynxmotion A-Pod as I don’t have one. Have played some with getting it to work with the Orion Robotics Fire-Ant, which I do have. Current version of the Phoenix Code base is up on:
github: github.com/KurtE/Arduino_Phoenix_Parts (Note the Quad support branch has the most current code base).

The Fire Ant WIP which is based on the changes that Kåre(Zenta) did for the Apod is up at: github.com/KurtE/Orion/tree/mas … rion_Stock Again this is WIP. Also using Basic Micro PS2 instead of other PS2 and is configured using servo driver for their DaVinci shield… But can be adapted.

Kurt

@Coleman
Yeah, I will double check to see if the NiMh pack is fully charged. Even when it is, does it last a long time? I noticed that the battery pack only lasted for a good 10 minutes before starting to die out. I do not use a rechargeable 9V battery - I bought a 12 pack of 9V batteries and have been switching every so often.

When you said to make sure the GND on the Arduino is connected to the GND of the SSC-32, do you mean in addition to the Tx and Rx pins? Or is there another shared ground that I have to connect?

@Kurt
Thanks for the links!! I guess I will start with the Arduino Phoenix code because I currently have the Arduino attached to the SSC-32.

But actually, do you suggest using the Basic Atom Pro microcontroller? The main reason I am not working with that microcontroller is because I am more familiar with coding in C or Arduino.

If it were me, I might have started off with the BAP28 as I had it and that is currently the only code base for it. That way can maybe see if all of the hardware and the like are working. But then again I don’t always go the practical way. As for which processor to use? Again hard to say, I am more of a C/C++ type of guy, but the BAPS are pretty good for what they are. However my gut tells me you will max out the BAP28 pretty quick and in fact I believe Kåre had to turn off some features of the BAP phoenix code to get everything to fit. But when I go beyond BAPS, hard to say what to recommend. I am all over the place (Arduino, Arduino Mega, Due, Teensy, Chipkit Pic32, Linux boxes…). So the bright side is I have the code running on many different platforms

I see. I guess I was thinking of switching back to the BAP28 to see if that fixed the problem. I just felt that the provided code for the Phoenix is slightly hard to follow. Also, is there code to test the BAP28 without using a PS2 controller? As in, is there a way to power up the robot/ microcontroller system and have the hexapod start moving right away?

In order to stay standing, the servos are constantly using power. 10-15 minutes is about right with a 2800mAh pack.

Be sure to disconnect the battery when you don’t need to be using the electronics.

You need to connect the Arduino’s GND pin to the SSC-32’s GND pin.

The SSC-32 has 2 GND rails and a GND pin next to the TX and RX pins. It should not matter which one I connect to, correct?

You may already have a common power ground path, but a separate ground lead for the comm is desired. It will help keep noise out of the comm signals.

Alan KM6VV

I agree with Alan…

But before you spend too much time potentially barking up wrong tree, I often setup little test programs to see if things are working or not. Example when we were first developing the Botboarduino and I had some of the first prototypes, I did the test sketch, which I included in this post.

Note: it is specific to the Botboarduino, but does have a simple test for SSC-32, which simply sends out the Ver command and waits for a bit and prints out what it receives.

I extracted a real simple one that assumes SoftwareSerial. I have my test case on pins 13, 12, and it trys both 38400 and 115200 as these are the only two I use…

#include <SoftwareSerial.h>
#define cSSC_IN     13
#define cSSC_OUT     12
SoftwareSerial SSCSerial(cSSC_IN, cSSC_OUT);


//===========================================================================================
// Botboarduino JR Test program
//===========================================================================================
void setup() {
  int i;
  int j;
  delay(250);
  Serial.begin(38400);    

  delay(500);
  Serial.println("SSC-32 Test program");
}

void loop() {
  SSCTest(38400);
  delay(200);   
  SSCTest(115200);
  delay(1000);  
}
//==============================================================================
// SSCTest - Quick and dirty test to see if We have bidirectional communications
// setup...
//==============================================================================
void  SSCTest(unsigned long ulBaud) {
  // Try output of Ver command to SSCSerialand see if we get a response. 
  char abT[80];
  byte cbRead;
  Serial.print("SSC-32 Serial baud(");
  Serial.print(ulBaud, DEC);
  Serial.print(") Ver: ");

  SSCSerial.begin(ulBaud);
  delay (100);
  SSCSerial.println("ver");

  // Try using the Serial stream read until which times out.    
  cbRead = SSCSerial.readBytesUntil(13, abT, sizeof(abT));
  if (cbRead) {
    abT[cbRead] = 0;  // Make sure null terminated.
    Serial.println(abT);
  } 
  else {
    Serial.println("*** No Response ***");
  }    
  while (SSCSerial.read()!= -1)
    ;
  SSCSerial.end();
}


Botboarduino_Test-140304a.zip (3.38 KB)

So I switched back to the BotBoard 2 and used the sample code that was provided in the tutorial (link below) for the Phoenix. The setup i have is exactly what is stated on the tutorial in the link below.

lynxmotion.com/images/html/build159.htm

One question I have is: what is the baud rate for the SSC-32 supposed to be set at? Table 14-1 says to set it at 38.4, but the schematic below it shows that it is set at 115.2.

I tried connecting the PS2 controller to the robot, but nothing happens. The microcontroller beeps continuously. Based on the note provided in the tutorial, this means that the PS2 controller is not connected to the Atom properly or is not functioning. I tried resetting the Bot Board II several times, but this did not seem to solve the problem.

When the microcontroller is powered, the power LED on the receiver for the PS2 controller that is attached to the microcontroller on the robot is on and the RX LED flashes at a constant rate.

So as of this point, I am not sure what is going wrong… Any ideas?

Thanks.

If you could send us some pictures showing your electrical connections, like the top of the SSC-32 board, the top of the BotBoarduino and/or Bot Board 2 board, and the PS2 receiver and adapter, that would be helpful.

Did you remove the VL=VS1 jumper on the SSC-32? By default, the jumper is installed for a one-battery configuration.

For build159.htm, the baud rate in the table 14-1 and schematic are both 38.4k: the first baud jumper is installed and the second one is removed, gives 38.4k.

If the RX LED on the receiver is blinking, then it is not paring up properly with the remote. Do you have fresh batteries in the remote?

Also, do you have version 3 or version 2 of the Lynxmotion PS2 remote? If you purchased the remote recently, it is likely version 3. Unfortunately Version 3 does not work with the sample code for the Bot Board 2 and Basic Atom Pro 28.

If you’re also able to film a short video of your robot walking, it would be very helpful for us to see how exactly the robot is walking. For instance, before walking, do you use the D-Pad Up to raise the body off the ground?

Before I reply the rest, I noticed this. I bought the remote last week, so it is not going to work? Am I able to return it?
Also, where can I get a version 2 PS2 remote?

Thanks

Can you provide an image of your remote? We can confirm which version it is. We have a few spare V2 remote controls if needed.

A picture of the remote controller is shown below. Please let me know what I can do!

Thanks!

Since you are using the Bot Board 2 with the A-Pod, we don’t have a solution yet with the V3 remote. Please contact us via the RobotShop Support Center and refer to this thread, and provide your order number. We’ll exchange the V3 remote for a V2 (which should work without issue). We apologize for any inconvenience.

I got the new remote and tested it. It makes the hexapod move, but I think the servos are not properly calibrated. I am currently using the PS2 controller code for the BotBoard2 and was wondering if there is any way to set default starting values for each servo into the code so that the hexapod’s starting position is correct, and so that all movement is relative to this starting position.

The tutorial says to calibrate the servos using LynxTerm, but I am not sure how to store these values into the servo controller or microcontroller. Is this possible?

You will need to adjust the Initial Pulse Offset registers in the SSC-32 board itself. To do that, connect the SSC-32 directly to your computer, open LynxTerm, and open the Registers window to do the changes. Steps 5 to 13 of the Assembly Guide give more details. Remember to do Write to save the register positions.