APod Hexapod Cannot Walk!

Great, thank you! I will do that.

Also, in the guide, from step 7, it says to adjust the “offset” slider until the parts are in place and then write to the registers. If the “offset” slider is not enough to have the servos go to their starting/neutral positions, the guide says that you have to take the robot apart and manually turn the servo. However, are you able to also use the “width” slider and store these values into the SSC-32 registers to have the robot start at that position? (Essentially, does “offset” = “width”?)

I would have to re-look at the A-Pod assembly instructions, but I know for many of these robots, you first need to go through and assemble the robot where the servo horns are at their normal spot on the servo, and then adjust the sliders until you get the angles of the servos to be completely horizontal or vertical, then yes you need to save away the positions. Then on many of these robots, you do not want the servos to be directly at these positions, so the instructions say to remove the screw holding the servo horn to the servo, gently pull up on the horn until it is off of the servo spline and turn it one direction or the other by 1 or 2 clicks (15 degrees per click). Then press the servo horn back on to the servo and put the screw back in…

Note: for some of these robots (not this one as don’t have one to experiment with), Also Bap28 code space was filled up, I added a Terminal monitor that one of the commands was to enter into Servo offset mode, where you could fine tune the servos and update the SSC-32. But again that is not in the A-Pod code base (sorry).

Kurt

I just feel it is weird I have to use the “width” slider because the instructions did not tell us to turn the servos before assembling the robot. It told us to make sure that the servos were at their center position, which I did; however, the “offset” slider simply isn’t enough to have the robot be in the correct position… But I guess I will try saving the register values for both the “offset” and “width” sliders.

Just to make sure, these offset values will automatically be taken into account during the movement of the robot?

The Initial Pulse Width setting is only the initial position of the servo when the SSC-32 is given power, before it is given any other commands by the microcontroller, so setting the IPW registers won’t help correct the alignment, only the Initial Pulse Offset registers which are used a as reference point for all following movements.

If the offset registers/sliders aren’t enough to correct a misalignment, then it means that the bracket wasn’t attached to the servo at the right angle and you have to do like Kurt said and change the servo horn by 1 or 2 clicks. If the servo was properly centered and the bracket was attached as instructed, there could be an error in the assembly guides. Can you tell us which servos require changing clicks like this?

Also side note: I did just do a quick look through the assembly guide for Apod and I don’t think you have to do some of the extra steps I mentioned about moving the servos from their alignment position. You do have to do this for Phoenix(Step 13) and T-Hex (Step 9). Yes the SSC-32 does take the Offset into account on each move (position given in each command) (lynxmotion.com/images/html/b … m#ssc32reg)

So good news: the hexapod works with a PS2 controller and the BAP28 using the code that was provided on the website! Now, I want to try moving back to using an Arduino to have the hexapod move. I tried using the Arduino code on Kurt’s github, but after I install the directory and try to compile to code using the Arduino IDE (Arduino 1.0.5), it gives me the following error:

core.a(main.cpp.o): In function main': C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/main.cpp:11: undefined reference to setup’
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/main.cpp:14: undefined reference to `loop’

After doing some research, I am still not sure how to fix this error… Any ideas?

Essentially, the goal of the project is to have the hexapod behave autonomously, but the problem I am running into is not having the proper gait. When I was working on it in the fall, I tried to code my own gait sequence based off of known sequences, but I believe this is why the hexapod did not walk properly. This is why I wanted to take a step back to see if the hexapod would work with the PS2 controller - because there was a working gait sequence in the code with the PS2 controller (I wanted to see if there was a problem with the gait or the robot itself). Now seeing that the robot can walk, I guess I could extract the gait from the Arduino code that Kurt has on his github for the Phoenix and PS2 controller, but I was wondering if a working standalone gait has already been written for a hexapod?

Thanks!

I’ve gotten those messages as well. I’m trying to get my 'quad running.

Read the MD file from the gethub, it tells how to set up the files.

The problem is probably in the setup of the files. Put a libraries directory and move the QuaC_PS2_SSC32 directories under your Arduino directory. Put the library files in the library directory.

Under files/preferences/ set up the sketchbook location. Make sure the the “show sketchbook” under Sketches shows the sketchbook directory.

Hope that gets you going.

Alan KM6VV

Thank you for the prompt response. Sorry, but I am still confused… What is the directory and what is the library directory?

I read the MD file from github, but it just tells you to copy each of the included directories into your Arduino Library directory. Since I am using a Windows PC, this folder should be in the Documents folder. I thought I did that correctly, but I am not sure what exactly is going on now.

Also, what do you mean by the “show sketchbook” under Sketches? I am in preferences, but I do not see this.

Sorry and thank you very much for your help.

File folders?

Show sketchbook is under the Sketches header of the Arduino IDE. Another menu.

I put an Arduino directory under the Documents directory. You need to move the QuadC_PS2_SSC32 (my case) or whatever your directory is (phoenix_ps2_scc32 or something…) also under Arduino, and then make a library directory into which you copy the library files (input, driver, phoenix, etc).

Note, I only see “quad” in the Kurt’s gethub, but I think you can set it for 4 or 6 legs.
Let’s ask Kurt! I’m still working to get my pesky 'Quad to walk!

Alan KM6VV

Yes, the one that says Quad support is my more up to date version. If I understood how to do things better with Github, I would make it the Master branch… May still. May fork current Master as some branch name like: Before Quad support, then choose the Master branch, copy all of the Quad support files into it and then sync it up…
So yes you can configure it for either 4 or 6 legs.

With my current stuff, You have a couple of choices on how to behave: My official way, where all of the pieces are individual libraries…

First off by default the Arduino Sketch folder is in your standard documents folder under the directory Arduino. In my case it is:
C:\Users\Kurt\Documents\Arduino

If you wish to download and user libraries. there are a few ways to do it (arduino.cc/en/Guide/Libraries), Actually never tried the Automatic way. I do the manual way, and you copy the files into:\Users\Kurt\Documents\Arduino\libraries.

So in the case of the main Phoenix files, they would live in: C:\Users\Kurt\Documents\Arduino\libraries\Phoenix likewise for the PS2 input:
C:\Users\Kurt\Documents\Arduino\libraries\Phoenix_Input_PS2 and the SSC-32 driver: C:\Users\Kurt\Documents\Arduino\libraries\Phoenix_Driver_SSC32

Each library on an Arduino system, can have examples. I have placed some example configurations. For example there is an one for a Phoenix using PS2 input and an SSC-32 for output. Now if your libraries are installed properly, you should be able to start the Arduino IDE and then go to file menu and see the menu item Examples. If you go to this menu item, it should show you a list of libraries, select the Phoenix directory, which will show you the configurations I put in. Select the Phoenix and it should load up a window the the couple of files in that setup (an .ino file and a Hex_Cfg.h file). Choose the right processor and Com port and it should be able to compile and download… If you wish to make changes and save it, you will not be able to directly as examples are read only, but it will allow you to save it away. Best location is again into your Sketch folder…

The other way if you only wish to deal with one configuration, there is a way to copy all of the appropriate files into the one sketch folder. But this will only compile properly if you do not also have some/all of them in the libraries or if you change the names. I do this at times, example Phantom_Phoenix: I make a copy in the sketch, rename all of the .h file to start with an _ and touch a couple of the files to change the header file included. Easier to do this for single configurations as you can edit all of the files in the IDE and try out things without screwing up the official one…

Alan, will try to help out again next week. Quad parts are scheduled to arrive Wed… Although I am also tempted to work on this using a Teensy, as it removes memory constraints, plus gives me other Serial ports to make it easier to output debug information…

Hi Kurt,

I have a mega board, but that won’t fit the 'quad 'bot very well.

Maybe you could put some of the new leg parm editor stuff (?) in conditional compiles, that would keep stuff a little smaller.

Have fun building your new 'Quad!

Alan KM6VV

Yep - I will work on some of this stuff soon. As I mentioned, the hardware arrives later this week. Hopefully soon after will start playing with it. But still tempted to use higher end processor. Yes once things are working, I know I should have a configuration of it that builds on the Arduino 328.

As for Mega’s being too big. Most of my Megas I have sitting around here are the ones by Seeedstudio, which are pretty compact. Mine are the earlier versions of: seeedstudio.com/depot/Seeedu … ?cPath=6_7 (I do have an older standard Arduino Mega 128 and an Arduino Due sitting around as well)
Normal Arduino Sheilds can work, but obviously not the Arduino Mega shields as the header pattern for extra pins is different… I do have a shield with similar capabilities as the botboarduino, that I did long time ago. Have not used them for awhile.

I’ve used the Mega boards in a table top 'bot, nice to have the extra interface pins. I also have ChipKit (PIC) boards, but the drivers were quite bad when they came out. Just ordered two Sparkfun boards for $9 each, same as UNO. The Seed boards sound interesting, but I want to use the BotBoardueno boards on this 'bot.

Alan KM6VV

I also have chipkit (Max32 and Uno32). Could was working on those as well. Been a while since I tried them

I haven’t touched them for probably two years. Not even sure where the IDE is for it.

How are you mounting it on a 'bot? Special bracket?

Alan KM6VV

Sometimes I do modified brackets, sometimes I use double faced tape, other times it is semi loose.

As for chipkit. You can download from: chipkit.net/started/
My issue is that they are still back at the Arduino 0023 build level. It was well over a year ago that they talked about getting up to Arduino 1.0.x release level or potentially skipping and going to the 1.5.x builds. But so far I have not seen any thing saying that they have released a new IDE. If or when they do this, I may take a look again, but for now I have then in box in my cabinet.

Yeah, same here. I think that’s the old build I had. I guess they would work for some simple com projects (no servos!). I was on their list, I gave up trying to keep up.

Hey guys. So I tried going back to the Arduino (Arduino UNO) and having the hexapod walk. The problem I have is the inverse kinematics for the legs - the hexapod either falls on its face or on its tail. I have been trying to tweak how much each servo turns and how quickly each servo turns, but I can not get the correct amount. I am sure that the hexapod walks fine if the gait is correct (because I used the PS2 controller with the BAP28). Does anyone have the inverse kinematics written for a hexapod gait (that does not require the PS2 controller)? Or is there a way to extract the gait that was written from the Arduino or BAP28 code? I appreciate your help!!

In the current gethub builds, the PS2 is a separate library, and other input libraries are available for use. They work independent of the Phoenix library.

If you are using a tripod gait, then you always have three legs on the ground, and there should be no tipping as you describe.

Alan KM6VV

So I tried doing this. I copied the “Phoenix” folder from your Github into C:\Users\kjwang915\Documents\Arduino\libraries, as well as the Phoenix_Input_PS2 folder and the Phoenix_Driver_SSC32 folder (I also tried moving the individual files in the folders into the libraries folder).

When I tried to compile the code, it gave me this error:

In file included from Phoenix_PS2_SSC32.ino:33:
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:93: error: ‘PS2X’ does not name a type
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h: In member function ‘virtual void InputController::Init()’:
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:125: error: ‘ps2x’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h: In member function ‘virtual void InputController::ControlInput()’:
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:162: error: ‘ps2x’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:185: error: ‘PSB_START’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:200: error: ‘PSB_L1’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:213: error: ‘PSB_L2’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:226: error: ‘PSB_CIRCLE’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:243: error: ‘PSB_CROSS’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:256: error: ‘PSB_SQUARE’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:267: error: ‘PSB_TRIANGLE’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:275: error: ‘PSB_PAD_UP’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:284: error: ‘PSB_PAD_DOWN’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:294: error: ‘PSB_PAD_RIGHT’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:301: error: ‘PSB_PAD_LEFT’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:311: error: ‘PSB_SELECT’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:327: error: ‘PSB_R1’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:337: error: ‘PSB_R2’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:343: error: ‘PSB_R3’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:350: error: ‘PSS_RY’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:353: error: ‘PSS_LX’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:354: error: ‘PSS_LY’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:362: error: ‘PSS_RX’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:368: error: ‘PSS_LX’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:369: error: ‘PSS_LY’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:370: error: ‘PSS_RX’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:371: error: ‘PSS_RY’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:376: error: ‘PSS_LY’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:377: error: ‘PSS_RX’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:378: error: ‘PSS_LX’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:379: error: ‘PSS_RY’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:385: error: ‘PSB_SELECT’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:393: error: ‘PSS_LX’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:394: error: ‘PSS_RY’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:395: error: ‘PSS_LY’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:398: error: ‘PSB_R2’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:413: error: ‘PSS_RY’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:426: error: ‘PSB_SELECT’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:439: error: ‘PSB_R2’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:454: error: ‘PSS_LX’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:454: error: ‘PSS_LY’ was not declared in this scope
C:\Users\kjwang915\Documents\Arduino\libraries\Phoenix_Input_PS2/Phoenix_Input_PS2.h:454: error: ‘PSS_RX’ was not declared in this scope

Am I missing a library?

Thanks!