About a program for BH3-R for direct simulation without PS2

Hello, i worked at this program for my hexapod BH3-R, and i have problems with rotating this platform, i want to ask you if you can help me with this. Here is my code:
counter var word

‘MOVING THE HEXAPOD PLATFORM BH3-R (FORWARD MOVE)’

FOR counter = 1 TO 150
PULSOUT P22, 2100
PULSOUT p21, 1500
PULSOUT P20, 800
PULSOUT p2, 2100
PULSOUT P1, 1500
PULSOUT p0, 800
PULSOUT P10, 2100
PULSOUT p9, 1500
PULSOUT P8, 800
PULSOUT P6, 2100
PULSOUT P5, 1500
PULSOUT P4, 800
PULSOUT P18, 2100
PULSOUT P17, 1500
PULSOUT P16, 800
PULSOUT P26, 2100
PULSOUT P25, 1500
PULSOUT P24, 800

PAUSE 5
NEXT

‘BACKWARD MOVE’

FOR counter = 1 TO 150
PULSOUT P22, 1200
PULSOUT p21, 1000
PULSOUT P20, 900
PULSOUT p2, 1200
PULSOUT P1, 1000
PULSOUT p0, 900
PULSOUT P10, 1200
PULSOUT p9, 1000
PULSOUT P8, 900
PULSOUT P6, 1200
PULSOUT P5, 1000
PULSOUT P4, 900
PULSOUT P18, 1200
PULSOUT P17, 1000
PULSOUT P16, 900
PULSOUT P26, 1200
PULSOUT P25, 1000
PULSOUT P24, 900

PAUSE 3
NEXT

Thanks and i waiting for your answers

Hi Andi,

Looks like you are having fun. It would help to have some additional information here, like what processor you are using (Basic Atom, Basic Atom Pro, Basic Stamp…). From this code my assumption is that you are not using a SSC-32, but are instead using your processor to control all 18 servos. Also from your post location and title I can not tell what your goal is here.

From the code you posted, it looks like you maybe have one part of a step in both the forward and backward directions. From your post I can not tell if you are stuck and asking for hints or are hoping that someone will write the code to complete the gait sequences and include turning or rotating. The nice thing of the round hexs are that they can walk more or less in any direction.

It is great to see that you are making a go of it and while I don’t have the time to write the complete code, I will try to answer any specific questions you have. Also I will try to offer suggestions on what I would do… I hope some of it helps.

My first suggestion would be use something like the SSC-32 to control all of the servos. Doing the pulseouts for 18 servos is going to eat up most of your processing time!

My next suggestion would be if possible start off with some existing code. This could be code that is generated by Powerpod (free download from Lynxmotion), or maybe the code that was written by a forum member Xan and modify it for your own use.

But if you prefer to do it from scratch, you have some different options on how to proceed.

Option 1: You could hard code the sequence. This will require you to figure out the servo positions for the gait you are using. You could hard code it such that you can only walk forward (as defined from some position of your hex) and rotate. You could also add in go backwards as well. Or you can have it such that the hex can walk in any direction.

Option 2: You could code up the IK algorithms to calculate the servo positions given X,Y,Z positions, such as Xan has done.

Both of these can be a lot of work, especially option 2. If it were me, I would probably look for ways to calculate the gait sequences easily. Things I would try would be to use Zentas Excel spreadsheet (PEP) and configure it for your bot and try to generate the sequence. Or start from Xan’s program and maybe hack it slightly to instead of doing serout’s to the SSC-32, maybe instead have them dumped to the terminal window (S_OUT) and then capture the sequences as you make it move foreward, backward and rotate. Then you can convert these sequences to the pulseouts or the like.

I hope this helps and good luck.

Kurt