Programming my Hexapod

Hi all, So i have my hexapod built, its a custom design, rectangular in shape with three legs on each side. I have been following the Phoenix assembly tutrorials all along and I have completed whats in them except step 18 (see below). I didn’t download the program because this i presume is a program specifically for Phoenix.

Step 18. Download the Program
Download the .zip file, and unzip it. Open the .prj file in Studio (File->Open->*.prj), and verify that the files listed in the Workspace are in the order shown in Table 18. Program the Atom Pro. Install the PS2 controller receiver into the PS2 cable on the robot, and apply power. If all is well, you will hear a beep after power up. Press Start and the legs should snap to position. At this point, if you properly calibrated the servo offsets, the legs should be perfectly aligned. Remove power to the robot.

My question is how do I start to create my program? I purchased the Lynxmotion visual sequencer software when I was buying the SSC32, BBII and BAP28, I don’t know if I need it or not. I also have the Basic Micro Studio software. How do I start to create programs for my Hexapod?

Thanks for your help.

you can download powerpod. this program allows you to create hexapod code for the round chassis hex and also “Inline”
lynxmotion.com/p-566-free-do … erpod.aspx

you can also edit the .cfg file of the phoenix code so it knows your legs are inline, and not round.

Thanks innerbreed. I downloaded Powerpod and I worked my way through it using the manual. I got as far as step 7 and I can’t seem to find anything to open the window which is shown in step 7 (attached below)

I thought phoenix was an inline robot.

I did try to program the phoenix code onto my BAP28 using Basic micro studio but i kept on getting errors. (attached below)

Thanks again.

The page in step 7 is for controlling the robot from a PC. It’s a stand-alone exe program in the Powerpod download. Most people use the PS2 control method. Isn’t that what you want?

Phoenix is not an inline robot. The legs are separated by 60 degrees.

The Phoenix code must be opened as a project, not as a basic program.

Thanks Jim, ya I want to control my Hexapod with the PS2 controller, I have the lynxmotion controller. I can’t find the stand alone exe file (or maybe I don’t need powerpod) To be honest I am unsure what to do now. I have everything assembled, tested and servos offsets done. I am ready for programming only I don’t know where to start.

I have the PEP and manual downloaded also. I have the Lynxmotion visual sequencer software as well. I just don’t know what I should be using.

I think I was opening the Phoenix code as a project, it is a .prj file The reason I was trying to program this to my hexapod was just to see how it reacted.

Can you please advise me on where/how to get started on a program? I have added a picture of my hexapod also (wires etc will be tidied up later)


If your servos are at center in the photo then you should use powerpod to build a basic atom pro program as an inline robot. It’s not a true inline robot, but powerpod code cheats on the rotation anyway so it should work just fine.

If you use the Phoenix code then just realign the servos as if it were a phoenix.

Either way we have detailed tutorials on each method. You should follow the tutorials and stop when you have a question. For example no where in The Complete H3/H3-R Tutorial v2.0 lynxmotion.com/images/html/build99c.htm does it mention using the Serial Port Control Panel cause it’s not used for PS2 control. The Serial Port Control Panel has been in the powerpod download since the first V1.00 version was released. But you don’t need it so forget about it. You need to work from the tutorials, not from the users manuals.

The PEP is complicated, and not really necessary to tackle at this time. Maybe later… We already have code for PS2 walking control.

I’m not sure what the errors are in your above post. Hopefully someone can help you with that.

Wow… That’s a realy cool frame and legs desing… !!

Waiting a video soon ?

Thanks DiaLFonZo. :smiley: My design was inspired by many other hexapods on this site and others. I’ll get a video of it as soon as I get it working, can’t wait to have it working! What way did you program yours (the one in picture under your name). I just started using the PEP, entering values etc

As Jim pointed out above, go to this address and follow the instruction and you will have your bot walking in no time.

lynxmotion.com/images/html/build159.htm

Like everyone say follow the link… !

Mine is a 4legs design… so i have to tweak a bit.

the thread:
lynxmotion.net/viewtopic.php?f=8&t=6951

Everyone here in the Forum have give me precious information to do it. I am in learning process too…!

Good luck !

Thanks everyone, I followed the tutorial very closely and I got there. I got passed the error code problem which I was getting on Phoenix_V20 line 1071, I found out how to do this on this link lynxmotion.net/viewtopic.php?f=13&t=7021&p=69042&hilit=line+1071#p69042
Its great to have the program running on the BAP28 :slight_smile:
Since my Hexapod is a custom design I presume I will have to change some values within the code like lengths of tibia and femur, body dimensions, min and max positions of the servos. Would I be correct on saying this? and is it just simply changing the values in the Phoenix_cfg.bas

I will let other more experienced people answer you on that. But my answer would be Yes.

[code];[BODY DIMENSIONS]
cCoxaLength con 29 ;Length of the Coxa [mm]
cFemurLength con 76 ;Length of the Femur [mm]
cTibiaLength con 106 ;Lenght of the Tibia [mm]

cRRCoxaAngle1 con -600 ;Default Coxa setup angle, decimals = 1
cRMCoxaAngle1 con 0 ;Default Coxa setup angle, decimals = 1
cRFCoxaAngle1 con 600 ;Default Coxa setup angle, decimals = 1
cLRCoxaAngle1 con -600 ;Default Coxa setup angle, decimals = 1
cLMCoxaAngle1 con 0 ;Default Coxa setup angle, decimals = 1
cLFCoxaAngle1 con 600 ;Default Coxa setup angle, decimals = 1

cRROffsetX con -43 ;Distance X from center of the body to the Right Rear coxa
cRROffsetZ con 82 ;Distance Z from center of the body to the Right Rear coxa
cRMOffsetX con -63 ;Distance X from center of the body to the Right Middle coxa
cRMOffsetZ con 0 ;Distance Z from center of the body to the Right Middle coxa
cRFOffsetX con -43 ;Distance X from center of the body to the Right Front coxa
cRFOffsetZ con -82 ;Distance Z from center of the body to the Right Front coxa

cLROffsetX con 43 ;Distance X from center of the body to the Left Rear coxa
cLROffsetZ con 82 ;Distance Z from center of the body to the Left Rear coxa
cLMOffsetX con 63 ;Distance X from center of the body to the Left Middle coxa
cLMOffsetZ con 0 ;Distance Z from center of the body to the Left Middle coxa
cLFOffsetX con 43 ;Distance X from center of the body to the Left Front coxa
cLFOffsetZ con -82 ;Distance Z from center of the body to the Left Front coxa[/code]

that’s what you need to change

Hi all,
It has been a while since I was here, I was busy applying finishing touches to my Hexapod. So I have it fully assembled at present with the phoenix code on it. I have changed the values of the lengths of the legs within the .cfg file I still have to change the Min/Max angles and offset angles.

My question is what does the “c” stand for before each word e.g. cRRTibiaMax1 con 770 and what does the “con” stand for? Also in the example Ive given why is the angle -770. Does this mean 77?

When I am calculating my min/max angles should I do this in Lyxnterm?

Also my hexapod has its legs in line and it is walking pretty good with the pheonix code at present but to change the code to for an inline body is it just a matter of changing the set up angle which is currently -600 to 0 for the four Coxas which are positioned at the corners of the hexapod?

Sorry for all the questions and thanks for your help in advance.

cRRCoxaAngle1 con -600 ;Default Coxa setup angle, decimals = 1
cRMCoxaAngle1 con 0 ;Default Coxa setup angle, decimals = 1
cRFCoxaAngle1 con 600 ;Default Coxa setup angle, decimals = 1
cLRCoxaAngle1 con -600 ;Default Coxa setup angle, decimals = 1
cLMCoxaAngle1 con 0 ;Default Coxa setup angle, decimals = 1
cLFCoxaAngle1 con 600 ;Default Coxa setup angle, decimals = 1

The “c” stand for constant, the con declare the constant. Xan uses fixed point calcs for better angle resolution. -770 means -77,0 deg.

No. The min/max angles are simply mechanical limits, you set them by measuring the min/max mechanical travel range for each joint.

The +/- 600 (60 deg) should be equally to the calibrated centered position for each coxa. If all coxas are calibrated with the centered position like the picture you posted above, all angles should be 0. Take a look at the 4 DOF T-Hex tutorial step 6 and 10, thats an example of how the coxa are calibrated with the centered position (for the 4 outer coxa) at a 45 deg coxa angle (450).

I hope this helps.

poor Zenta, he has to explain this too every noob … :stuck_out_tongue:
(including me) :blush:

Thanks Zenta, things are becoming more clearer. I know PappaNiklas there are lots of us learning here on steep learning curves. I do have some more questions.
Xan Phoenix code was that created using the PowerPod? If so how easy or hard is it to create a programme? My next question is about using PEP. From what I know about it is that you can create sequences within this excel programme and then import it to Visual Sequencer. Is it possible to store a sequence as well as the phoenix code on the micro-controller? I came across some pre-made sequences which are built for phoenix lynxmotion.com/images/html/proj098.htm

How would one go about using one of these pre-made sequences?

Many Thanks

Hi I’ve 3 more questions:
I have my legs offset 15° from the body but it doesn’t seem to update in the body and coxa sheet on the graph, the legs stay in the same position on the graph as if they were at 60º. They figures change the RR, RF, LR and LF to 45° but they are highlighted in red. This can be seen in the picture below.

Also when I want to move the legs up I must use the down button and vice versa, what could be the problem here?

When I go to export the file and save as I don’t get the option to save it as a csv(semicolon seperated) ive added a screen grab of my options.

All help is greatly appreciated as its my FYP and the deadline is Monday.
Excel save as options.JPG

Another side note, If a variable name ends with a number. The last digit gives the number of decimals. so:

  • cRRTibiaMax1 tells you that -770 has 1 decimal and = -77.0.
  • sinA4 = 415 makes 0.0415
  • This one is tricky: IKA24 has 4 decimals, not 24 :wink:

Xan

Nope, The phoenix code is build from scratch.

Premade sequences can be uploaded to the SSC if you got the correct firmware (and a EEPROM) installed. The SSC firmware version number should end with GP. Once you’ve got the sequence done you can upload it using Visual Sequencer. Once the sequences are stored in the SSC it is possible to play them with the GP player. The phoenix code supports the GP player which makes it possible to play a sequence by pushing on a button.

Xan

Thanks Xan. Wow that is impressive building that code from scratch, . I would love to find out more on how it works. Is it all based on inverse kinematics?

I have the correct firmware and the EEPROM installed. I was able to make a sequence using the PEP software, I followed the manual all the way but when it came to saving the file as a csv file (semicolon separated) excel didn’t give me the option. I have added screen grabs which are in my post above. How would I get by this problem? I also came across some more issues which I have mentioned in the same post. Any ideas are welcome as I really want to get a sequence on my Hexapod.