Arduino


#1

Noob here.
Can some one please post the Arduino code to control one of the servos on the Hexy? I figure from this I should be able to figure out how to control the rest and maybe even get the thing to walk. I like the PoMoCo software, but I am interested in learning how to control the Hexy through the Arduino application.

Thanks!


#2

The difficulty with a stock arduino is that the stock servo library (and the hardware, I believe) doesn’t support the amount of servos required to run Hexy. Correct me if I’m wrong, but I believe that’s why Joseph’s Servotor32 has a different architecture and different servo library.

I’m using an Arduino Nano (great board, clones off ebay for less than a tenner) and the Pololu Maestro board. I like this combination very much. It has similar software to PoMoCo, but can control acceleration and speed as well as position. Also, with repsect to Joseph, no servo shake. The Arduino is programmable using C, and communicates with the Pololu Maestro using a simple protocol. You can find a straightforward example of this sort of setup (without the speed and acceleration, which I’m working on) at this link: orangenarwhals.blogspot.co.uk/20 … -mini.html


#3

Thanks. So, if I understand your post then I should install PoLoLu Maestro and try my hand at controlling and programming the Hexy through this as opposed to the Arduino interface.


#4

Not saying you should, just proposing a way of working if you want to use a stock arduino.

The Pololu Maestro board uses a picaxe processor, and is programmable using a simple forth-like language through a development environment that comes with it. Like an arduino, but different… It is also like the Servotor32 in that it has a PoMoCo-like piece of software that runs on your computer and controls the servo movement over a serial interface.

it has firmware (like the Servotor32) however instead of programming it directly, you can send it simple commands using an arduino (or a computer, or anything really) to control position, acceleration and speed of the servos. it also can communicate back, indicating current servo positions, and when movement is finished. These are very handy functions. So I program the arduino (with the arduino development environment) to send commands to the Pololu board, rather than program the Pololu board directly. I’m more familiar with programming the arduino, and the Pololu language is more of a scripting language.

Have a look at the link.


#5

Hello,
Feel free to ask any questions. I was bored so I made a diagram to help make more sense of the code:
github.com/nouyang/18-servo-hex … 7-2012.pde
Diagram:

Yay hexapods!


#6

Ha ha… Welcome, orangenarwhals. If anyone is interested, her site has some very clear code on how to use the arduino / Pololu combination to control a hexapod. The only usable example I could find.

I’m attempting to move this work forward (or backward) by incorporating speed, acceleration and position feedback to make the movement smoother to watch and easier on the servos.

Also, I want to incorporate multi-tasking to get rid of wasteful delay loops, and allow polling of sensors and communications whilst walking and doing other things.

If I ever get the time, that is. It’s nice to dream.


#7

Yea, clear code because it’s super simple XD;
That sounds excellent! yea, time. I’ve been meaning to do real things like inverse kinematics and such for what is it, two years now? Oh well.
I’m guessing you’re using the hexy kit, because my robot definitely doesn’t poll any sensors, hah.
Good luck!


#8

See the libraries page for interfacing with particular types of hardware. Try the list of community-contributed code. The Arduino language is based on C/C++. It links against AVR Libc and allows the use of any of its functions; see its user manual for details.