New custom hexapod - Kodama!

That would be awesome, thanks! I’ll look forward to getting it from you, I’m not quite sure how to approach it myself.
Appreciate all the help :slight_smile:

In the mean time It might be worth looking at the head control for the APod. That’s how I think we will need to do it.

Where can I check out that code? I’ll start getting my head around it if I can.

It’s only available on the ABB2 but Kurt my have a port.
lynxmotion.com/images/html/build184.htm

You just need to look to see what it’s doing…

Repaired my arduino, and Kodama is mobile again!
Spot my repair :slight_smile:

http://i531.photobucket.com/albums/dd355/innerbreed/1356761136363_zps6fb22986.jpg
???
:wink:

I think the problem we had before about the servo only moving in one direction is due to my earlier thoughts of scaling the values of the sticks…
This would have solved it… :arrow_right:

[code]void loop ()

{
panVal = analogRead(panPin); // read pan joystick position
panVal = map(panVal, 0, 1023, 0, 179); // scale reading to servo
panServo.write(panVal); //move servo to required position
tiltVal = analogRead(tiltPin); // read pan joystick position
tiltVal = map(tiltVal, 0, 1023, 0, 179); // scale reading to servo
tiltServo.write(tiltVal); //move servo to required postion
}[/code]
Zoomkat posted something similar to another post that prompted me to post this… :wink:

Sorry I have not ported Zenta’s A-Pod code into my code base yet. For his most recent code I would look under the thread he created while reviewing the Lynxmotion A-Pod. May try to add some of this support at some point, but may not be able to test…

As you may notice the PS2 is not the greatest control for doing smooth accurate movements. In Zenta’s A-Pod code he does some indirect PS2 control code to try to smooth things out. In other places he uses a smoothing function (SmoothControl) to try to get better movements.

In other code bases I have seen some other smoothing functions like simple signal filters to smooth it out, like:

//simple signal filter macro #define filter_update(filter,input,rate) (filter = filter - (filter >> rate) + input) >> rate;

I think you already fixed it, but sometimes when you run into cases where it only runs one way, it can be causes by signed versus unsigned math. That is the Analog() function returns a byte which is unsigned, so sometimes if you do something like:
Analog(x)-128 it may stay being an unsigned positive value no mater what the value was… Sometimes you need to cast it to make it work…

Kurt

Well spotted, Jonny :slight_smile: What does the map() method do?

Kurt: I did get the positive movement working. Thanks for posting the filter. I’m not quite sure how to implement it though. Perhaps it’s a syntax thing that I’m not getting. Would I call this as a method?

map, is a standard arduino function that is in the Arduino reference… It maps values from one range to another range… From the reference the actual definition of it is:

long map(long x, long in_min, long in_max, long out_min, long out_max) { return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; }

Some of the code using the filters looks like:

    long rxfilter;   // defined in global so init to 0...
...
    int RX = filter_update(rxfilter,-ps2x.Analog(PSS_RX),1);
    int RY = filter_update(ryfilter,-ps2x.Analog(PSS_RY),1);

Kurt

:wink:

So I’m expecting a full length video now…

I will totally make one once I get the head having smooth motion.

This project is making me want to build another hex!!!

It is a blast :slight_smile:

If the servos are are a little twitchy, you can do some filtering using a value change dead band requirement like below to suppress small changes sent to the servo.

// Controlling a servo position using a potentiometer (variable resistor) 
// by Michal Rinott <http://people.interaction-ivrea.it/m.rinott> 

//#include <Servo.h> 
 
//Servo myservo;  // create servo object to control a servo 
 
int potpin = 0;  // analog pin used to connect the potentiometer
int newval;    // variable to read the value from the analog pin 
int oldval; 
void setup() 
{ 
  Serial.begin(9600);   
  //myservo.attach(9);  // attaches the servo on pin 9 to the servo object 
} 
 
void loop() 
{ 
  newval = analogRead(potpin);            // reads the value of the potentiometer (value between 0 and 1023) 
  newval = map(newval, 0, 1023, 500, 2500);     // scale it to use it with the servo (value between 0 and 180) 

if (newval < (oldval-2) || newval > (oldval+2)){
//if (newval != oldval){ 
  //myservo.write(newval);
  Serial.print("#1P");
  Serial.println(newval);
  oldval=newval;
}           
  // sets the servo position according to the scaled value 
  delay(150);                           // waits for the servo to get there 
} 

I am trying to set up the filter above, do I need to set the rate or the filter variables manually?

//simple signal filter macro #define filter_update(filter,input,rate) (filter = filter - (filter >> rate) + input) >> rate;

EDIT: Also, doesn’t << indicate a bitwise shift, how does this work in this case?

They SO need a Google Translate that works with programming languages.

wow sandstorm, i read through the entire thread - and this is so sick!

i just started getting into robotics, and i was planning on building a hexapod/spider robot, but then found out how hard it is :frowning: So my question to you is that what helped you become good at robotics? or what books, tutorials can i read and follow to get me to a more higher stage at which i can build something like what you have built? im 16 (17 soon) and my dads an engineer if that helps. my dad can help me, but hes never done programming - so im on my own on that part. thanks! and awesome project!

Hey jdmkid,

Actually, I didn’t know anything about robotics until I found this forum. I saw the Morphex and the A-Pod and got inspired to create my own.
Overall, it wasn’t that bad, it just required a lot of patience. I “chunked down” from a big task like building a robot to a bunch of small tasks like, “draw body” and “buy servos.”

After looking at a bunch of robots on this forum and others, I used Illustrator to design my own. You could use Inkscape as well, it’s free. Then I found a hackerspace online which was near me and they taught me how to use the laser cutter, which cut my pieces from acrylic plastic. I started the simple tutorials on arduino.cc to program the arduino and get used to the environment. Finally, I started putting everything together and slowly worked toward a final product.

It’s taken a few months, but it’s been a fun project and I learned heaps about robotics and industrial design as well as electronics and programming.
Much of the heavy lifting has already been done by Kurt and others, and the source code is available for setting up your own. Then you can customize as much as you want.

If you have any questions I’m happy to help.

Duane

EDIT: Also, this community is amazingly supportive. I wouldn’t have made nearly as much progress without their help, so feel free to ask questions. Everyone here is really cool.

Wow thanks! So i guess ill be sticking around here and the arduino forum quite a bit then. I just ordered the arduino starter kit and a couple books on C and arduino programming, so ill do the small projects in the books first.

Also for making the bodyparts of the walker - Im fairly good at autoCAD and other 3d cad design so designing something isnt hard for me - its more the programming and electronics. If i have any questions ill send you a message. thanks!

No problem dude, welcome to the club.

Here’s one for you guys. I’d like to simplify my bot’s power system. Currently I am using a 5-cell 6V 2200mah battery for the servos and a 6-cell 9V 2000mah for the servo logic and the arduino. Any good ways to reduce this to one battery? It would free up space and weight in my bot for more brains :slight_smile: