Phoenix code running on an Arduino Mega with an SSC-32

Try the following:
First hit start. Note: there are times when the joystick does not get or keep connection and you will see blinking. Try resetting the processor and/or turn on/off PS2 sender…

If you hit Start all of the servos should do to their default position.

Now hit Triangle button, This should make it such that it lifts up for normal walking. Now try moving the left joystick and see if you have any luck.

im trying ur instructions kurt,
still nothing servo moving,

sorry I was wrong, it just triangle button does not respond to an ssc-32 LED when I press the button.

hmm if u have extra time, can u give me pict how to configure thats all

thanks kurt

hello kurt,
yesterday Im found seller real ssc32 in my country, then I buy with price $90 :smiley:
and I change my ssc-32 clone with real ssc32 from lynxmotion
but I still got the same problem :frowning:

imageshack.us/photo/my-images/71 … 11103.jpg/

Try this code. maybe will help for test
letsmakerobots.com/node/26395

Couple of things.

  1. Looks like you have the SSC-32 connected to the Uno on Digital pins 8,9 but I do not see a common ground wire. They need to have a common ground wire or electricity does not flow properly…

  2. You have your SSC-32 configured for a baud rate of 115200 (both baud jumpers are in place). Try to configure to 38400, also make sure the Arduino is configured for 38400 as well.

Kurt

@vintikas
ihave tried before :stuck_out_tongue:

hi kurt thanks for always helping me…

previously I’ve tried it that way, before I post the above, but still could not move as well,
I tried consulting some of my friends, and they told me the power I give less,
I will try to use the batteries below, whether the power that I gave would be enough?
surabayahobby.com/produk_163 … --gun.html

Sorry, I can not tell from your description if you are still getting no response from the servos or they are not working very well.

If you are still not getting anything, I think you need to step back and methodically start checking out each thing and make sure of each thing. Things like:

  1. Do you have the right connections between the processor and the SSC-32? Likewise is the baud rate and jumpers properly set?

  2. If you start up the program with the Serial Monitor (in Arduino IDE) open configured for 57600 baud, what does it show at the beginning? That is does it show something like: Check GP Enable:
    Does it show some string after this? The SSC-32 should have responded from a “Ver” command with it’s current version number string. This will both verify that the communications is properly set up between the two boards. Also depending on what is returned will tell us additional things.

  3. What version did it return? Is it one that is extended GP enabled? If not you should update the firmware or make sure the line:
    #define cSSC_BINARYMODE 1
    In the Hex_Cfg.h file is either commented out or deleted…

3a) If no string is returned, communications is probably not working? Is the LED on the SSC-32 flashing at all?

  1. Do you have proper power going to your servos. Is the power separate from the VL going to the SSC-32? Did you remove the VL=VS1 jumper? What voltages and capacities are the batteries and/or wall adapters that are going to each one? Can you measure with volt meter to verify? Does the power going to the servos match the power requirements for the servos?

  2. Are you sure all of the servos are properly connected, they looked OK from your earlier photo, but… Have you tried removing all of them and see if the SSC-32 works differently? (Like now returns version…) If so you might try plugging in only 1 servo and see if you can get it to respond. (Like if you hit the start button on the PS2, does it then move to a location and if you move the joysticks does it appear to do something. If so add more servos, if not try a different one… (ie you could have one or more bad servos…).

Now if you are getting some response from servos but not right, then some of the above still applies. Also could be issues with you power to the servos or logic. If VL is not enough, the SSC-32 will reset. If the power to the servos is not enough, servos won’t respond very well.

As for the battery you gave a link to. Not sure. Won’t work with mine as I use Hitec HS-645mg servos which only want 6V and the one you noted was 7.2V. But some servos out there work OK on 7.2v so check with the specs for your servos. I use: lynxmotion.com/p-426-60-volt … -pack.aspx

Good Luck
Kurt

oh kurt finally I can continue my project and finally its work perfect kurt…
thank you so much kurt :smiley:
thanksss u the best :slight_smile:

Has anybody tested the balance mode?
If I hit the square on my ps2 controller my bot makes a strange kind of yoga ^^.
Everything else works fine so far.

Greetings
Daniel

Yep Balance mode is screwed up!!! I have some fixes on my local machine that will go into the next version. I am planning to update the code when the new BotBoarduino board arrives! :smiley:

If I remember correctly the issue is that some of my tables are in PGM space and not data space and I missed some places to tell the compiler that… You might try this version of the BalCalcOneLEg which may help… Obviously you can get rid of the debug code…

Kurt

[code]//--------------------------------------------------------------------
//[BalCalcOneLeg]
void BalCalcOneLeg (short PosX, short PosZ, short PosY, byte BalLegNr)
{
short CPR_X; //Final X value for centerpoint of rotation
short CPR_Y; //Final Y value for centerpoint of rotation
short CPR_Z; //Final Z value for centerpoint of rotation
long lAtan;

//Calculating totals from center of the body to the feet
CPR_Z = (short)pgm_read_word(&cOffsetZ[BalLegNr]) + PosZ;
CPR_X = (short)pgm_read_word(&cOffsetX[BalLegNr]) + PosX;
CPR_Y = 150 + PosY;        // using the value 150 to lower the centerpoint of rotation 'BodyPosY +

TotalTransY += (long)PosY;
TotalTransZ += (long)CPR_Z;
TotalTransX += (long)CPR_X;

lAtan = GetATan2(CPR_X, CPR_Z);
TotalYBal1 += (lAtan*1800) / 31415;

lAtan = GetATan2 (CPR_X, CPR_Y);
TotalZBal1 += ((lAtan*1800) / 31415) -900; //Rotate balance circle 90 deg

lAtan = GetATan2 (CPR_Z, CPR_Y);
TotalXBal1 += ((lAtan*1800) / 31415) - 900; //Rotate balance circle 90 deg

#ifdef DEBUG_BALMODE
if (g_fDebugOutput && ((TravelLengthX != 0) || (TravelLengthZ !=0) ))
DBGSerial <<"BCOL: " << _DEC(PosX) << " " << _DEC(PosZ) << " "<< _DEC(PosY) << " "<< _DEC(BalLegNr)
<< " :: " << _DEC(TotalTransY) << " " << _DEC(TotalTransZ) << " "<< _DEC(TotalTransX)
<< " :: " << _DEC(TotalYBal1) << " " << _DEC(TotalZBal1) << " "<< _DEC(TotalXBal1) << endl;

#endif

}
[/code]

Seems that the mistake is somewhere else.
With the old version the legs on the right goes down and the legs on the left up. Now it’s vice versa.

Well it was worth a shot… What you may want to check is for everything that is defined like:

static const word GetSin] PROGMEM =

or like:

static const byte cCoxaPin] PROGMEM = {cRRCoxaPin,  cRMCoxaPin,  cRFCoxaPin,  cLRCoxaPin,  cLMCoxaPin,  cLFCoxaPin};

All of the places that use the variable are marked to get it from program space, like:

sin4 = pgm_read_word(&GetSin[AngleDeg1/5]); // 5 is the presision (0.5) of the table

or SSCSerial.write(pgm_read_byte(&cCoxaPin[LegIndex]) + 0x80);
Where the pgm_read_byte or pgm_read_word are used to tell the compiler to generate the code to read the value from the program space and not the data space. I think I got most of them, but I know I missed one or two with the balance mode code…

Kurt

The other question is which version of the sources are you using? I think the most up to date code that I have uploaded is up in the thread: viewtopic.php?f=44&t=7278&start=76

I believe that there is not much difference with my current stuff and this one, except in debug messages and in the PS2 controller code, there is one place that had a hard coded sound pin instead of the define from the config file… (At least that is all that WinMerge shows as different)

Kurt

Hm, I can’t access this thread:

You are not authorised to read this forum.

I use the last code, you posted earlier in this thread. Think it was from april.

Yep, sorry, I guess that thread was killed off… Will see about posting it again later.

Kurt

hi kurt button cross is GP player right?
im press that button mypot not respond nothing happen…
and button box mypot do acrobatics lol :laughing:

For GP Player with Arduino and BAP… - Works with my current code base - not sure with older…
X button enters and Leaves that mode.
Select button - chooses which sequence to run (each time increments and then wraps around.
R2 button actually starts the selected sequence.

Yes the balance mode is busted with the currently uploaded sources. I think it is working on my current version. Current plans is to update the sources up here when the new Botboarduino board arrives. I believe it is now in production, so probably only a few weeks off…

Kurt

sir, this robot using inverse kinematics? :slight_smile:

Yep, this is using the same IK code as the Basic Atom Pro versions that was written by Xan using the algorithms that were used in Zenta’s spreadsheets. I ported the phoenix code over to C and have it running on Arduino.

Kurt

Now that we are Botboarduino board shows up on the Product page (lynxmotion.com/c-153-botboarduino.aspx) as coming soon :smiley:

I thought I should update the code up here with my later stuff, that for example balance mode did not turn the robot into a pretzel :laughing:

Again this is a work in progress. The code is based off of the 2.1 BAP28/Arc32 beta code that has been converted to C++/Arduino. It is currently configured to work with my main Test Hex which is currently a 4DOF CHR type robot with T-HEx legs. Earlier tests were for 3DOF. I have not done the work to create multiple different configurations for different HEX robots as I am somewhat lazy (:lol:). Could if needed probably modify my T-Hex to have an Arduino board to test it if needed. This code also currently requires the use of an SSC-32 as I have not made a version yet that tries to run all 18-24 servos on the Arduino itself. On Megas I am using hardware serial port and on Non-Megas I am using Software serial port. In both cases I configure the SSC-32 for the baud rate 38400 as SoftwareSerial only knows standard baud rates and Hardware Serial does not work at 115200 on 16mhz processors…

Note: this code relies on several different external libraries, which include:

  1. PS2X_LIB: which you can get more information including pointers for download at: billporter.info/?p=240

  2. Streaming: Because I am lazy: arduiniana.org/libraries/streaming : I find it easier to do:
    Serial << "Blah: " << _DEC(myBlah) << endl;
    Than have to do this with separate commands:
    Serial.print("Blah: ");
    Serial.println(myBlah, DEC);

  3. SoftwareSerial: Note: I am using the NewSoftSerial 11 beta, which I believe will become the new official software serial (arduiniana.org/2011/01/newsoftserial-11-beta/). Why? This is needed on the non-mega boards like Botboarduino as it adds support for things like Streaming (Based on stream class). Also it uses the PinChange interrupt for input, such that it can buffer input…

May be some others I am forgetting.

Note: the current code is configured for PS2 input. There is also code in place for XBEE support with our DIY remotes, but I don’t have that enabled in this drop… Can be enabled by UN-commenting the line: //#define USEXBEE in the Hex_Cfg.h file. Note: This would only work on Megas as I have not converted it to run with Softwareserial yet.

Warning: The code is also configured to use SSC-32 with binary commands. It will only work if the SSC-32 has been updated to a version of firmware that supports it, like: lynxmotion.com/p-395-ssc-32- … oller.aspx

Sorry: I know that someday I should work on turning this all into a tutorial or the like, but I am having too much fun playing with several different things and it works for me :slight_smile:.

Kurt
Arduino_Hex-111202a.zip (39.9 KB)