Hello everybody,
I have a hexapod that I bought that came with an elechouse 32 channel servo controller. My goal is to get this thing going with a wireless PS2 controller and a arduino mega 2560 micro controller. But so far I can't even get the legs to move properly.
I have searched on the internet about this controller and there is not much out there. These are the links that I have found and the resources I have.
LetsMakeRobots Forums:
https://www.robotshop.com/letsmakerobots/node/30349
Elechouse Website:
http://www.elechouse.com/elechouse/index.php?main_page=product_info&cPath=100_146&products_id=1883
The forum post that I have put here has the pdf file controller manual for more information as well.
What I have attempted:
Wiring
I hooked up with a single wire, the TX/RX pins from the mega to the servo controller TX/RX pins.
I hooked up the RX/TX with both the grounds on the servo controller to the same ground as the mega.
I hooked the ground of the servo power input to the mega ground.
I hooked up the RX/TX 5V pins to the 5V pin on the mega.
Programming
As for programming, I have a very strong programming background. Especially in C#. But have dabbled many times with arduino language and C++. So I am pretty sure I have this correct and I understand whats going on with my code. And for the most part have used the code example from the LMR forum post I linked above. I have tried many different versions with the example code trying to get the leg to move but nothing has worked. I can get the legs to move, but its random legs with random rotations at random times. Especially if I touch and untouch the grounds from the mega to the ground pins of either RX/TX pins of the servo controller.
Code
void setup()
{
Serial1.begin(9600);
}
void loop()
{
move(6, 950, 500);
move(6, 750, 500);
}
void move(int servo, int pos, int time)
{
Serial1.print("#");
Serial1.print(servo);
Serial1.print("P");
Serial1.print(pos);
Serial1.print("S");
Serial1.println(time);
delay(500);
}
This is pretty much the example code from the LMR forum post. I have tried setting the pin modes of the megas serial 1 TX/RX pins to input and output and that did not work either. I am pretty new to robotics and not too experienced but know that I can get this if I just get a little help. :D
Any help is appreciated. I am to the point that I am thinking about just not using this servo controller board that came with this hexapod and replacing it with something else. If it comes to that, any suggestions?