Xan's Phoenix Code

I played around with the 1.3 code for awhile, made no progress (aside from verifying that the PS2 controller was in fact communicating just fine), then loaded the original, unmodified version of the 1.3 code. At this point I went into the Reg settings for the SSC-32 and disabled Initial Pulse Width, saved it, and hooked everything back up, and everything worked!

Code is fully functioning now, it beeps when I turn on the robot initially and waits for me to hit the start button.

FANTASTIC code btw. Reading through all of it last night, I finally started putting everything together as to how it works, and have that much more appreciation for all the work you put into it.

I’m glad to hear that you’ve solved the problem with the SSC. V1.1 uses a serout command to set up the offsets at the beginning of the code. The offsets are moved to the SSC’s registers in a later version. It looks like the serout command for the offsets disables the Initial Pulse Width and the SSC register offsets. I think I remember Jim saying something like that about the offsets. But I’m not sure about the Pulse Width… Anyway, now we know :wink: thanks for the test! 8)

Is it fully working right now? I can’t see how the Initial Pulse Width caused the program not to “beepâ€

Xan,

Thank you for the tip. Yes, I am set up with the serial connector to the front. I tried both configurations - “0” was way off the mark. I am a “1” :smiley:
I believe all of my pins are in the right places, as I used the LM bot for a guide when I was wiring it up. I have the registers set with proper offsets. After careful observation with very slow movements I believe it’s the servos. I have not gone into the “Mad Robo-geek Shop” and tested my theory yet. It looks like MG995 servos respond with opposite directional rotation to a signal than what Hitec HS645 servos do. All of the movements I see on the bot are in the opposite directions of what the commands should be telling them to do. How’s that for a goofy problem? :unamused:

I have only a few HS645’s and a half-dozen MG995’s so I will go hook some up to a signal and see if that is the case. If so I could rewire all the pots to give proper directional movements for this project. Sounds like the code would require some major “surgery” in its computations to invert all the output values. :confused:

For the most part I have learned the money I saved trying out the MG995’s has been a pain in the neck. All of the hexapod parts I designed are on the Futaba standard dimensions since they were drawn to fit the MG995’s. I don’t want to start over from scratch as yet so if I decide to upgrade to better servos, I need to find the best deal on lots of Futaba S3305 metal gears.

I’ll be back with the results of the servo test :wink:

The results are in: :open_mouth: :open_mouth: :open_mouth:

I tested a Towerpro MG995, a Hitec HS645, and a Futaba S3305
I used Visual Sequencer and an SSC-32 on 7.2VDC battery for the test.

The Towerpro & the Futaba rotate in the same direction for the same signal.
The Hitec rotates in the opposite direction for the same signal. :blush:

Well, that explains a lot. . . . :confused: :confused: :confused: It’s not Xan’s code, but my mechanics.
Has anyone tested a hex using Xan’s code with servos other than Hitec?

Hi,

I can just confirm your findings about the direction of rotation for Hitec vs. TowerPro. You’ll have to reverse the direction in the code. Locate the ServoDriver sub and switch the +/- before each angle.

Original code:

ServoDriver: ;Front Right leg serout SSC_OUT,SSC_BAUTE,"#",dec RFCoxaPin,"P",dec TOINT(TOFLOAT(-RFCoxaAngle +90)/0.10588238)+650]

Change this to:

ServoDriver: ;Front Right leg serout SSC_OUT,SSC_BAUTE,"#",dec RFCoxaPin,"P",dec TOINT(TOFLOAT(RFCoxaAngle +90)/0.10588238)+650]

and so on for each angle…

Thanks Zenta!
It does not sound as bad as I thought. I’ll try that before I start performing excessive surgery on the bot.
Three of my servo gear-trains are really sloppy and one of the motors is trashed. When I address that bit of repair I plan to pack all the gear-trains with LOTS of lithium grease, that should improve gear life a bit. Cheap way to get a some more good use out of these servos before I spring for upgrades. I’ll post You-Tube clips to my project page when it all starts running properly. I’m getting closer! :smiley:

Hi brlippincott!

Do you use Towerpro servos? I ordered 4 towerpro servo a few days ago.

What is your experimentation with these servos? These are as bad as others wrote? Or it is usable to hexapod?

I read a lot of bad exp about towerpros. But I readed it on airplane forums. I think airplanes need a very precise servo.

Hexapods need a very precise servo? Or Towerpro is enough?

As you have already ordered them you are about to learn what is perhaps the #1 guiding rule about hobby servos, you get what you pay for, and perhaps its collary of there are no free rides. Quite probably the biggest issue with towerpro servo is their jitter… basically they tend to oscillate around the stop point and it can occasionally become quite severe. On the other hand we have seen someone build a scout (biped) with these servos so it may be interesting to see what the net impact on a hex will be. :wink:

Hi Tyberius,

Good to hear that you’ve got it up and running and that you like the program. :wink: Please enjoy! 8)

Hi brlippincott,

I’m glad that you’ve found the cause for the problem. Different brands having different direction is also new for me!

Zenta’s solutions should do the job. :wink:

Xan

If you don’t mind, could you go in and re-enable the initial position register to see if it breaks it. Sorry, this makes no sense. If you can break it by enabling initial positions then I can go to Mike. If not I will do it here, but I’m currently buried with some things. :frowning:

Zenta wrote:

Thanks Zenta. It worked!! :smiley: :smiley: :smiley: Everything works as designed. I spent time looking at some details of the program and understand more of how it works. I’ll get to work on the mechanical parts next. I will try to post some video of initial tests soon.

There is a robot event on the 22nd of this month in Dallas, Texas, USA. I went to the Dallas Personal Robotics Group event last year, not a lot of crawlers there. David P. Anderson (He built J-Bot & n-Bot) is a club member.

This bug really sucks batteries dry in a hurry!! :open_mouth:

I’m glad your hexapod is up and “running” :wink: . Looking forward to your vid.

Didn’t get the previous one right . . . sorry. I think I have a handle on it now, this seems to look more like it is supposed to.

youtube.com/watch?v=g9bHprxsDlE

youtube.com/watch?v=cNvTGBXnNss

Be safe. 8)

Hi,

It looks good! You didn’t try the balance mode yet? :wink:

Hi Zenta,

Thanks. I’m still playing with all the controls. BTW, what is “balance” mode? :blush:

Check out Xan’s latest v 1.3 code. Check my phoenix thread about the balance mode or page 8 in this thread. :wink:

I have implemented all the gait of the v1.3 code with balance mode to !

A video of my tripod 8 with balance on/off/on…

fr.youtube.com/watch?v=siGQnPUPaYY

other videos on : lynxmotion.net/viewtopic.php?t=4361

Now i will try to change gait without stop the hexapode !

Hi guys,

It’s great to see so much hexapods, in all kind of shapes and materials walking over the whole world using the same code! 8)

I’ve got the first results on calculation speeds concerning fixed point calculations. I’ve rewrote the GetSinCos function to fixed point and compared it with the original floating point function. The current resolution of the fixed point functions is 0.5 deg with a precision of 4 decimals.

For the test I calculated a full circle with steps of 1 degree. The floating point version needs 386ms to get it done where the fixed point can do the same in only 147ms! :smiley:

This is just the difference between one function, I think that the difference will only get bigger when not only all the floats will be removed but also the conversions between the floats and integers.

I’ll keep you updated.

Xan

That sounds great! If desired at some point I could probably help convert some of this to assembly to see if that gains you more.

Kurt

Thanks Kurt! I’ll keep that in mind and let you know if i could use some help! :smiley:

Xan

i have build my own hexapod… a phoenix.

same like zenta and xan… with u code…

but i want make it a little bit autonom.
with a sharp sensor. when somebody come sin range 20cm the body from phoenix goes back… when it comes near than 20 cm it make a step back.

its only when he stand. hend he must move some lega a little bit. same like IC bot.

an with the ps2 controll.
how i can include attacking mode on r1?

that phoenix goes to the 4 legs backside… and the other 2 legs he moves. like the movie from zenta…

and here a big thank to you all!
its a cool new hobby for me.