Speed Controller Software

Places to spend cash or learn things!

Moderators: BeligerAnt, petec, administrator

Post Reply
User avatar
BeligerAnt
Posts: 1872
Joined: Wed May 15, 2002 12:00 am
Location: Brighton
Contact:

Speed Controller Software

Post by BeligerAnt »

I have written some software for the Pololu Baby Orangutan board for use as a speed controller.
It includes mixing and under-voltage protection and will happily run two 12mm gear motors on a 2-cell LiPo. The motor drive chip is the same as the one Peter Waller uses on his boards.

This board will be going into a new drive-all-day robot for the Maker Faire so it will get a thorough testing then!

More details and code download:
http://garya.org.uk/software/embedded-c ... controller
Gary, Team BeligerAnt
User avatar
Rhys
Posts: 738
Joined: Tue Oct 29, 2002 12:00 am
Location: Caerphilly, South Wales

Re: Speed Controller Software

Post by Rhys »

Nice one Gary! These are great little boards, I use them in all but 1 of my ants. I've used the example C code from pololu's website previously, but found Marto's arduino code a bit more responsive (but that could all be in my head...). I'll stick this one my spare board and see how it compares to the others. :)
Image
User avatar
BeligerAnt
Posts: 1872
Joined: Wed May 15, 2002 12:00 am
Location: Brighton
Contact:

Re: Speed Controller Software

Post by BeligerAnt »

I thought there was supposed to be some sample code on the Pololu website, but I couldn't find it so decided the write my own...

It's fairly simple, no complicated throttle curves or anything. The battery voltage protection has been tested with a power supply, but really needs proper testing with batteries. It might also need some more filtering to cope with other servos, spinner motors etc.

Let me know if you find any problems with it.
Gary, Team BeligerAnt
User avatar
Rhys
Posts: 738
Joined: Tue Oct 29, 2002 12:00 am
Location: Caerphilly, South Wales

Re: Speed Controller Software

Post by Rhys »

The example code is here:

http://www.pololu.com/docs/0J37/4
Image
User avatar
BeligerAnt
Posts: 1872
Joined: Wed May 15, 2002 12:00 am
Location: Brighton
Contact:

Re: Speed Controller Software

Post by BeligerAnt »

Thanks Rhys, I expected it to be linked on the "resources" pages rather than be buried in the manual...

The code is not vastly different to mine, although I use the Pololu PulseIn library which takes away most of the complexity in this particular example. I guess the library came after the example code.

I have found a problem with my battery monitor, and possibly with the Baby O in general, in that it isn't very happy with a weapon servo (HS-82MG). It seeems that supply noise from the servo trips the battery monitor and possibly also reset the the Baby O. I will post a fix when I have one, but for now it's best to disable the battery monitor function (tie pin AD6 to +5V)

Edit:
I found a bug in the battery monitor filter code - bit of a schoolboy error TBH :oops: - that's what you get from publishing untested code :roll:
Version 1.1 has now been uploaded and seems much better behaved. More testing tomorrow...
Gary, Team BeligerAnt
shakesc
Posts: 75
Joined: Mon Nov 08, 2010 1:13 pm
Location: Hampshire

Re: Speed Controller Software

Post by shakesc »

I know the thread is a bit old but programmed up and tested an Orangutan. All working, now need to build a new chassis
I started out with nothing and still have most of it left
Post Reply