Arduino

Post all your questions, problems and suggestions here.

Arduino

Postby NotrabDrahcir » Sun Mar 17, 2013 3:46 pm

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!
NotrabDrahcir
 
Posts: 2
Joined: Wed Mar 06, 2013 9:17 pm

Re: Arduino

Postby Hellboy » Sun Mar 17, 2013 4:22 pm

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: http://orangenarwhals.blogspot.co.uk/20 ... -mini.html
Hellboy
 
Posts: 23
Joined: Mon Jan 21, 2013 6:16 pm

Re: Arduino

Postby NotrabDrahcir » Mon Mar 18, 2013 2:18 am

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.
NotrabDrahcir
 
Posts: 2
Joined: Wed Mar 06, 2013 9:17 pm

Re: Arduino

Postby Hellboy » Mon Mar 18, 2013 6:31 am

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.
Hellboy
 
Posts: 23
Joined: Mon Jan 21, 2013 6:16 pm

Re: Arduino

Postby orangenarwhals » Mon Mar 18, 2013 8:54 am

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

Yay hexapods!
orangenarwhals
 
Posts: 2
Joined: Mon Mar 18, 2013 8:10 am

Re: Arduino

Postby Hellboy » Mon Mar 18, 2013 11:09 am

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.
Hellboy
 
Posts: 23
Joined: Mon Jan 21, 2013 6:16 pm

Re: Arduino

Postby orangenarwhals » Wed Mar 20, 2013 12:59 pm

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!
orangenarwhals
 
Posts: 2
Joined: Mon Mar 18, 2013 8:10 am

Re: Arduino

Postby Kerena100 » Fri Jan 09, 2015 1:58 pm

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.
Kerena
Kerena100
 
Posts: 1
Joined: Fri Jan 09, 2015 1:52 pm


Return to Questions, Problems and Suggestions

Who is online

Users browsing this forum: No registered users and 10 guests

cron