New custom hexapod - Kodama!

For the pan servo you can attach it into the code in the same way as the coxas have been. Giving its position relative to the center of the body etc. That way when you perform body moves the head will look to that direction.
With tilt you May also do the same as femur.
Just make sure you don’t include the servos into the servo index otherwise the code will think its another leg and will act as if its trying to help walk. Lol

Cable management complete! Kodama is now a tidy robot :slight_smile:



Still looking awesome to me… :wink:

Seconded! :mrgreen:

Hey guys here’s a question for you,

I picked up a 9v 2200ma battery to replace the piles of standard 9vs I’ve been going through. When I plugged it in, my arduino started to smoke, but I was able to unplug it in time to prevent permanent damage. Voltage testing revealed that the battery was actually outputting ~10.5v (probably because its brand new), so I made a voltage divider to reduce it to 9v, but the arduino still smoked.

I would still like to use this battery, but I am afraid to plug it in. Could it be the current that is the problem? If so, can I build a current divider that would work?

The clean way to use batt to power a robot is to use a BEC.
It’s a voltage regulator use in RC stuff and commondly availible.

What’s the batt your using… NIMH… LiPo… ?

Normaly those BEC can take many range of batt cell and are also programmable on the output.

I certainly don’t wish to sound condescending, but are you absolutely certain you had polarity correct? Reason I ask: I purchased an experimenter’s breadboard with power distribution circut that got extremely hot (almost burning) whenever I plugged in my (proper voltage) wall wart. I called the vendor who correctly diagnosed polarity as the problem. I had inadvertantly used a wall wart with a center negative rather than center positive connector. Changed to a different source and problem solved. Fortunately, the few circut components were not damaged.

Sounds like something else going on here, like a short. If you have multimeter, would do quick check of what is the resistance between the power terminals, if a lowish value, probable short. I don’t remember which Arduino you have, but some of the pictures makes it look like it might be an UNO. By the Uno specs the recommended input voltages is between 7-12v and limits at 6-20v.

If it were me, I would first do a visual inspection of the board to verify that there is nothing causing an obvious short. If that did not uncover anything, I would unplug everything else going to board and then try again. If it does not smoke, I would then carefully plug stuff back in. Potentially 1 at a time to see if one of them shows an issue. Also might use meter to check resistance between ground and power, likewise between signal wires and ground…

Good Luck
Kurt

Actually, I solved it. Turns out since I had two 9v connectors hooked together, the polarity was getting reversed.

Danger! Danger!

Works perfectly now though, whew.

Thanks everyone.

RoboTed: No condescension taken, you diagnosed the problem correctly.
The confusion arose because of the following weird state: the new 9v has a Tamiya connector, but the robot already had a standard 9v battery connector, so I soldered a second standard connector onto the tamiya, not realizing that two standard 9v connectors hooked together reverse polarity. They’re not really meant to be connected like that :slight_smile:

Crisis averted!

Question for Kurt (or anyone else who knows):
I’m trying to call my eye color method in Phoenix_Code.h from the PS2 controller class, but it’s not declared in scope. How do I make it public or accessible by that other class?

Merry Xmas from me and Kodama.

There are several ways to do it… I believe most of the code in Phoenix_Code.h is simple subroutines and functions and not part of a specific class. So probably the easiest and most direct way would be to use a forward reference. That is if the subroutine you wish to call looks like:

void EyeColor(void) { ... }
In the PS2 controller class, you could add:

extern void EyeColor(void);

before where you actually wish to call it.

If you look at the file Phoenix.h in the same directory as Phoenix_Code.h you will see that this header file has some of these forward references already defined in it.

Good luck and Merry Christmas
Kurt

That is perfect, Kurt, works like a charm.
Much appreciated buddy, merry Christmas!

Is there a way to move a single servo to a specific position over time? My robot has an eyebrow I’d like to raise/lower, but I’m not sure how to set it up with the Phoenix codebase.

It is doable, but I have not added the support in for it yet. What I would do, is to add another method to the ServoDriver class, something like:
void MoveServo(byte iServo, short sAngle1, word wMoveTime);
Then I would need to implement this in the actual Servo driver classes (AX12, Orion, ServoEx, SSC32). For the SSC-32 would be simple conversion of angle to the appropriate MS and then a simple output to the SSC-32…

Kurt

Edit: Of course if you are only doing it for yourself, you could simply output the appropriate SSC-32 command directly to the SSC-32 without the abstractions. For myself I try to keep everything abstracted out as then I can easily make changes to the hardware and most of the stuff just works.

Thanks Kurt! I’ve tried putting the following code into the Phoenix_Driver_SSC32.h file, but nothing happens (although it does print to the serial monitor).
Do I have to initialize those servos first or something?

void moveSingleServo(int servo, int position, int time) { Serial.print("#"); Serial.print(servo); Serial.print(" P"); Serial.print(position); Serial.print(" T"); Serial.println(time); }

EDIT: I will of course try to find a better, more sustainable way that I can pass on to the community, I’m just trying to get proof of concept first. This is new territory for me, I’m a C# programmer :slight_smile:

Edit2: obviously that’s not working. Looks like this should be executed from loop… I seem to be having a mental block about moving the servo a bit each cycle of the loop.

Try changing: Serial.print(…)
to
SSCSerial.print(…)

That is SSCSerial is defined as which ever serial port (hardware or software) that the SSC is connected to… Something like:

void moveSingleServo(int servo, int position, int time) { SSCSerial.print("#"); SSCSerial.print(servo, DEC); SSCSerial.print(" P"); SSCSerial.print(position, DEC); SSCSerial.print(" T"); SSCSerial.println(time, DEC); }
Kurt

P.S. - I should learn c# one of these days, but sometimes hard to teach a… new tricks :laughing:

Thanks Kurt I will try that tomorrow morning.
Re: C#, all of my programming has been within the realm of a game engine, so while complex, it was also very specific. I’m still in awe of your skillset :slight_smile:

Thanks Kurt, that worked perfectly. One issue I’m having though is that I’m trying to call the moveSingleServo() method in the Phoenix_Code.h setup() method, but it doesn’t seem to do anything. Is this because it hasn’t been loaded yet? When I call the method later with a button press, it works fine. Any ideas?

In the meantime, my arduino’s voltage regulator finally gave up the ghost, so I’ve got a replacement on express order. Meanwhile, the bot is tethered and can’t run off its battery.