Hexapod Futaba servos! Left right have switched! [FIXED!]

Heh, S3003 are like < $11USD at Tower. For the $11 he would have been better off with MG995 servos… it’d walk like it had parkinsons but it wouldn’t lack for power. :laughing:

I agree. But he did it DIY, which says a lot. Too bad he didn’t get bigger servos! It’s a really nice build, using hardware store parts.

That was a year or two ago (just before I built my 'hex), I don’t know if he’s done anything with it since then.

I’m in the process of replacing the knee and V hip servos in my 'hex with 645s, which gives me 475s to play with in my 'quad projects.

It looks like “Servo City” around here! Legs everywhere!

Alan KM6VV

@ Fish;

Thanx! I think it’s clear to me. At least it’ll give me the chance to understand the code a bit more.

I thought programming would be easyer since i used to make little programs on my Basic MSX computer. But even though… I’m really enjoying this!

For the rest; My hexapod can get up by itself, walk by itself and even carry some extra load. Sometimes with very big pases i need to put it a bit higher because the body will lower itself (low torque). But in generall it walks great!

Hi Mano,

Everybody on this forum, ( yes, including me :wink: ) is willing to help each other. But you really have to be more specific about the problem next time. That would be much easier. And double check the reactions because the bot-freeze question is already answered twice :wink:

Anyway, reading the previous post give me enough information to your questions.

The picture seems to be offline already…

Well anyway, the Futaba servos seems to be the cause of the problems. Like the others I do have serious doubts they are strong enough to get it up and running smooth so I would like to see a vid once you’ve got it done.

As for the servo’s running in the wrong direction. You need to change the inverse the angles in the servo driver part.

Original code

[code] ;[SERVO DRIVER] Updates the positions of the servos
ServoDriver:
;Front Right leg
serout SSC_OUT,SSC_BAUTE,"#",dec RFCoxaPin,“P”,dec TOINT(TOFLOAT(-RFCoxaAngle +90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec RFFemurPin,“P”,dec TOINT(TOFLOAT(-RFFemurAngle+90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec RFTibiaPin,“P”,dec TOINT(TOFLOAT(-RFTibiaAngle+90)/0.10588238)+650]

;Middle Right leg
serout SSC_OUT,SSC_BAUTE,"#",dec RMCoxaPin,“P”,dec TOINT(TOFLOAT(-RMCoxaAngle +90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec RMFemurPin,“P”,dec TOINT(TOFLOAT(-RMFemurAngle+90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec RMTibiaPin,“P”,dec TOINT(TOFLOAT(-RMTibiaAngle+90)/0.10588238)+650]

;Rear Right leg
serout SSC_OUT,SSC_BAUTE,"#",dec RRCoxaPin,“P”,dec TOINT(TOFLOAT(-RRCoxaAngle +90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec RRFemurPin,“P”,dec TOINT(TOFLOAT(-RRFemurAngle+90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec RRTibiaPin,“P”,dec TOINT(TOFLOAT(-RRTibiaAngle+90)/0.10588238)+650]

;Front Left leg
serout SSC_OUT,SSC_BAUTE,"#",dec LFCoxaPin,“P”,dec TOINT(TOFLOAT(LFCoxaAngle +90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec LFFemurPin,“P”,dec TOINT(TOFLOAT(LFFemurAngle+90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec LFTibiaPin ,“P”,dec TOINT(TOFLOAT(LFTibiaAngle+90)/0.10588238)+650]

;Middle Left leg
serout SSC_OUT,SSC_BAUTE,"#",dec LMCoxaPin,“P”,dec TOINT(TOFLOAT(LMCoxaAngle +90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec LMFemurPin,“P”,dec TOINT(TOFLOAT(LMFemurAngle+90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec LMTibiaPin,“P”,dec TOINT(TOFLOAT(LMTibiaAngle+90)/0.10588238)+650]

;Rear Left leg
serout SSC_OUT,SSC_BAUTE,"#",dec LRCoxaPin,“P”,dec TOINT(TOFLOAT(LRCoxaAngle +90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec LRFemurPin,“P”,dec TOINT(TOFLOAT(LRFemurAngle+90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec LRTibiaPin,“P”,dec TOINT(TOFLOAT(LRTibiaAngle+90)/0.10588238)+650]

;Send
serout SSC_OUT,SSC_BAUTE,“T”,dec SSCTime,13]

PrevSSCTime = SSCTime
return
[/code]

Futaba version:

[code] ;[SERVO DRIVER] Updates the positions of the servos
ServoDriver:
;Front Right leg
serout SSC_OUT,SSC_BAUTE,"#",dec RFCoxaPin,“P”,dec TOINT(TOFLOAT(RFCoxaAngle +90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec RFFemurPin,“P”,dec TOINT(TOFLOAT(RFFemurAngle+90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec RFTibiaPin,“P”,dec TOINT(TOFLOAT(RFTibiaAngle+90)/0.10588238)+650]

;Middle Right leg
serout SSC_OUT,SSC_BAUTE,"#",dec RMCoxaPin,“P”,dec TOINT(TOFLOAT(RMCoxaAngle +90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec RMFemurPin,“P”,dec TOINT(TOFLOAT(RMFemurAngle+90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec RMTibiaPin,“P”,dec TOINT(TOFLOAT(RMTibiaAngle+90)/0.10588238)+650]

;Rear Right leg
serout SSC_OUT,SSC_BAUTE,"#",dec RRCoxaPin,“P”,dec TOINT(TOFLOAT(RRCoxaAngle +90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec RRFemurPin,“P”,dec TOINT(TOFLOAT(RRFemurAngle+90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec RRTibiaPin,“P”,dec TOINT(TOFLOAT(RRTibiaAngle+90)/0.10588238)+650]

;Front Left leg
serout SSC_OUT,SSC_BAUTE,"#",dec LFCoxaPin,“P”,dec TOINT(TOFLOAT(-LFCoxaAngle +90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec LFFemurPin,“P”,dec TOINT(TOFLOAT(-LFFemurAngle+90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec LFTibiaPin ,“P”,dec TOINT(TOFLOAT(-LFTibiaAngle+90)/0.10588238)+650]

;Middle Left leg
serout SSC_OUT,SSC_BAUTE,"#",dec LMCoxaPin,“P”,dec TOINT(TOFLOAT(-LMCoxaAngle +90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec LMFemurPin,“P”,dec TOINT(TOFLOAT(-LMFemurAngle+90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec LMTibiaPin,“P”,dec TOINT(TOFLOAT-(LMTibiaAngle+90)/0.10588238)+650]

;Rear Left leg
serout SSC_OUT,SSC_BAUTE,"#",dec LRCoxaPin,“P”,dec TOINT(TOFLOAT(-LRCoxaAngle +90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec LRFemurPin,“P”,dec TOINT(TOFLOAT(-LRFemurAngle+90)/0.10588238)+650]
serout SSC_OUT,SSC_BAUTE,"#",dec LRTibiaPin,“P”,dec TOINT(TOFLOAT(-LRTibiaAngle+90)/0.10588238)+650]

;Send
serout SSC_OUT,SSC_BAUTE,“T”,dec SSCTime,13]

PrevSSCTime = SSCTime
return
[/code]

As for the attack mode. The solution is already given you 3 times. You need to change the baud rate to i38400 or SSC_BAUTE. The hex isn’t moving because the BAP is doing all his pauses from the sequence. But it doesn’t move because you’ve got the wrong baud rate configured. Check the BAP manual on page 110 for more information. When it’s done doing his sequence it will unfreeze.

You’ve also copied a piece of code to enable/disable the balance calculations from the square button to the cross button. So after playing the sequence the balance mode will be switched on/off. That part can be removed from the cross button to keep it work properly.

I hope it makes any sense.

Xan

YES! It’s working now! Thanx alot! I had to change the pin table too:

[code];[PIN NUMBERS]
#IF SSC_LM_SETUP ;Connector to the front
RRCoxaPin con P16 ;Rear Right leg Hip Horizontal
RRFemurPin con P17 ;Rear Right leg Hip Vertical
RRTibiaPin con P18 ;Rear Right leg Knee

RMCoxaPin con P20 ;Middle Right leg Hip Horizontal
RMFemurPin con P21 ;Middle Right leg Hip Vertical
RMTibiaPin con P22 ;Middle Right leg Knee

RFCoxaPin con P24 ;Front Right leg Hip Horizontal
RFFemurPin con P25 ;Front Right leg Hip Vertical
RFTibiaPin con P26 ;Front Right leg Knee

LRCoxaPin con P0 ;Rear Left leg Hip Horizontal
LRFemurPin con P1 ;Rear Left leg Hip Vertical
LRTibiaPin con P2 ;Rear Left leg Knee

LMCoxaPin con P4 ;Middle Left leg Hip Horizontal
LMFemurPin con P5 ;Middle Left leg Hip Vertical
LMTibiaPin con P6 ;Middle Left leg Knee

LFCoxaPin con P8 ;Front Left leg Hip Horizontal
LFFemurPin con P9 ;Front Left leg Hip Vertical
LFTibiaPin con P10 ;Front Left leg Knee[/code]

But even after the baute changing to i34800, the attack mode still doesn’t work. It is still freezing and after it finishes the script it starts beeping loud and doesn’t stop until i disconnect powerplug.

Any more suggestions?

Try i38400? :unamused: :stuck_out_tongue:

oh yes ofcourse, it was a mistype. i used i38400

Still doesn’t work though. it only moves one leg now. the rest is standing still. I was looking the BAP Manual to read P. 110

hope that’ll make me wiser.

This is wat i have converted untill now. but it seems it only uses one leg The Rear Left Tibia. Did i make a mistake?

IF (DualShock(2).bit6 = 0) and LastButton(1).bit6 THEN ;Cross Button Attack Modus serout ssc_out, SSC_BAUTE, "#",RMCoxaPin,"P1800#",RMFemurPin,"P1700#",RMTibiaPin,"P1700#",LMCoxaPin,"P1200#",LMFemurPin,"1300#",LMTibiaPin,"P1300T288",13] pause 288 serout ssc_out, SSC_BAUTE,"#",RMFemurPin,"P1500#",RMTibiaPin,"P1500#",LMFemurPin,"P1500#", | LMTibiaPin,"P1500T288",13] pause 288 serout ssc_out, SSC_BAUTE,"#",RRFemurPin,"P1800#",RRTibiaPin,"P1800#",RMFemurPin,"P1400#", | RMTibiaPin,"P1400#",RFCoxaPin,"P1800#",RFFemurPin,"P2100#",LRFemurPin,"P1200#", | LRTibiaPin,"P1200#",LMFemurPin,"P1600#",LMTibiaPin,"P1600#",LFCoxaPin,"P1200#", | LFFemurPin,"P900T288",13] pause 288 for Index = 1 to 10 serout ssc_out, SSC_BAUTE,"#",RFFemurPin,"P2000#",RFTibiaPin,"P1600#",LFFemurPin,"P900#", | LFTibiaPin,"P1600T144",13] pause 144 serout ssc_out, SSC_BAUTE,"#",RFFemurPin,"P2100#",RFTibiaPin,"P1400#",LFFemurPin,"P1000#", | LFTibiapin,"P1400T144",13] pause 144 next serout ssc_out, SSC_BAUTE,"#",RFCoxaPin,"P1500#",RFTibiaPin,"P1500#",LFCoxapin,"P1500#", | LFFemurPin,"P900#",LFTibiaPin,"P1500T288",13] pause 288 serout ssc_out, SSC_BAUTE,"#",RRFemurPin,"P1500#",RRTibiaPin,"P1500#",RMFEmurPin,"P1500#", | RMTibiaPin,"P1500#",RFFemurPin,"P1500#",LMFemurPin,"P1500#",LMTibiaPin,"P1500#", | LFFemurPin,"P1500#",LRFemurPin,"P1500#",LRTibiaPin,"P1500T576",13] pause 576 serout ssc_out, SSC_BAUTE,"#",RMCoxaPin,"P1500#",RMFemurPin,"P1700#",RMTibiaPin,"P1700#", | LMCoxaPin,"P1500#",LMFemurPin,"P1300#",LMTibiaPin,"P1300T288",13] pause 288 serout ssc_out, SSC_BAUTE,"#",RMFemurPin,"P1500#",RMTibiaPin,"P1500#",LMFemurPin,"P1500#", | LMTibiaPin,"P1500T288",13] pause 288 sound P9,[100\4000, 50\8000] sound P9,[250\2000] ENDIF

Hi,

Does your bot stand on a table or on a stand (free legs in the air) while doing the test of code? If you are using futaba servos I also believe you have to reverse the values you use in the code too (New value = 3000-Old value).

I agree on this. But it should move. not that the sequence should make any sense. but it should move…

a small note. You are trying to let a phoenix style hex stand on only four legs doing a attack mode. This will never work with the servos you’re using. It can hardly stand on his own. I’m using 645’s and the tibia servo gets really hot when it stands on 4 legs for to long. So make sure you’ve got all the legs in the air when testing since they will probably not do the job.

Another small note. Although this should work I don’t think this is the best way to go. The SSC can be upgraded with the GP Player. This way a sequence like “attackâ€

It can do the attack mode by itself. I,ve done allready with the powerpod generated code. Now i just want to implement it in Xan’s code.

So to answer your question Zenta; It was standing on the ground with testing.

So is this the way to put this adjustment in??:

	serout ssc_out,SSC_BAUTE,"#",RRFemurPin,"P3000#-P1500#"

Don’t think that will work. I was thinking that you could precalculate it. There is no meaning in reversing a 1500 value though :wink:
Or something like this : ... ,"P", dec (3000-2000),"#"

Like Xan mentioned, I asked if you had your bot on a stand because then you would see if the servos moved in wrong direction (with no load) easier, since the servos you use have limited torque.

Here is my first movie. The hexapod is not yet calibrated nor has the right rubber feet yet so the floor is a bit slippery.

Let me know what you think!!

youtube.com/watch?v=RhFP0mrBNlE

I’m really sorry , but i still don’t get it.

Can you please show me a before and after piece of code so i know what means what, and how to translate it?

Do you know the weight of the bot? I assume your tethering the power. I have to admit it works much better than I imagined. Good job!

I think Zenta was saying is that this code:

   serout ssc_out,SSC_BAUTE,"#",RRFemurPin,"P3000#-P1500#"

Would probably not work, what you would need is something like:

   serout ssc_out,SSC_BAUTE,"#",RRFemurPin,"P", dec 3000-1500,"#"

Which will make the BAP have to do the work when the program is running. He also meant that changing 1500 is not needed as it is the center point in either direction.

Here’s the idea. For the attack mode I believe the positions are hard coded. In other words when you changed the code for the walking gate you changed some polarity in an algorithm so the values were reverse. That way your Futaba servos would get the opposite value as the Hitec servos used. But the attack mode doesn’t use this algorithm, the positions are directly put into the program. Because your servos respond in the opposite way you need to reverse the positions.

A servo can move to an approximate range of 500 to 2500 with 1500 being in the center. So to fix the positions you need to reverse the values. To do this you can take the position away from 3000. For example…

Hitec servo 500 = full counter clockwise.
Futaba servo 500 = full clockwise.
3000 - 500 = 2500
Hitec servo 2500 full clockwise.
Futaba servo 2500 = full counter clockwise.

So can you see how taking the position value away from 3000 reverses it? So the easiest way to fix it is to look at the positions that are sent for the attack mode and just DO THE MATH to change them right there in the code. Ok? :confused:

You know, for what it is… this is growing on me. The Phoenix with 422 servos! Must power via tether, but hey it’d be cheap fun! lol

Hrmmm…

Cheap? Hell no! Here in holland everything is almost twice the price.

And yes i use a 5V 2,5A powersupply at the moment. But want to buy a battery pack soon. 5100mA should be enough right?

And now it’s clear what to do with the code. I will try tonight!

Oh yeah, The weight of the bot is 1.2 kilograms

Can you cut carbon fiber sheets with your laser? Would cut the weight down a tad perhaps.
:smiling_imp:

You can make a stock Phoenix walk with an 1800mAh pack. It just depends on how long you want the bot to work on a charge. In your case I would get the smallest capacity that gives you the wanted run time. Weight is your enemy.

My comments on the price is not directed at you. It’s merely a comparison of the cost compared to 475/645 or all 645 versions. :wink: