robot control language

Building my first bot and want to be able to send it remote commands. I was thinking of something like

PC......manual control AUTO....autonomous control FWD.....forward RVS.....reverse SPD.....speed MxS.....motor x speed MxD.....motor x direction etc.

A '?' could be used to query a setting and '=' to change a setting. eg SPD=100 would set the overall motor speed to 100 (could be a percentage of max speed).

I'm only learning c so it would probably be a good exercise to write my own but is there a standard easy to implement and in common use?

I was also wondering what sort of flash space this would take? I'm using an Atmel Mega32 (because I want to) with 32MB flash and will be experimenting with different buses (I2C, one-wire, SPI) so want to make sure there is enough room.

Any pointers greatfully received.

Cheers.

PS. This may be double posted as I first used google groups but I don't think much of it now.

Reply to
has2bok
Loading thread data ...

There's some work by people have defined a "generic" open source motor control. Try here for starters:

formatting link
Larry Barello has one or more projects he's developed, also around the Atmel AVR line of microcontrollerd, that use OSMC concepts:

formatting link
Keep in mind that you can create whatever macro language you like for the commands. Your software can convert tokens to a byte set that is more practical for sending across some serial line.

In most implementations of these kinds of things, you want an "attention" byte, followed by a unit ID, in case you want to control more than one thing. Then you can send a packet that represents things like mode, speed, direction, etc. The Scott Edwards serial servo controller uses this approach, and it spawned a lot of similar products.

For more ideas be sure to check out the Robobricks stuff at robobricks.net. (The site is sometimes down, because I think the server is Wayne's own PC.)

-- Gordon

has2bok wrote:

Reply to
Gordon McComb

Thanks for the links Gordon. I was thinking of just sending the commands and not tokens. This way any comms program on any platform can control the bot.

Reply to
has2bok

percentage of

experimenting

Without mentioning any names, another poster here would, I think, want much higher level commands than the above, namely,

get(beer); get(pie); get(woman);

:)

Reply to
JGCASEY

You will find some sample code on my web site for buiding a simple command lines and very basic command parsing:

formatting link
Try the 'speakjet2' sample program since it implements several different commands. Don't be intimidated by the length of this program - most of it is simple speakjet phoneme encodings and descriptions. I wrote this for my ATmega128 boards and since they have 128K of flash it's no problem to store all those tables and more as read-only data areas within the flash region. When playing with the speakjet chip I liked to have all the mnuemonics and their descriptions handy where they can be listed out to the screen for quick reference which this sample program does, as well as send specified sequencies of phoneme codes to the attached SpeakJet chip, of course.

But if you strip all the SpeakJet stuff out, you are basically left with a simple command-line processor that might help you get started. Note that there are some register name differences between the ATmega128 and your ATmega32. Mainly - on the ATmega128 there are 2 UARTs so all the UART registers either have a "0" or a "1" in the name on the ATmega128 to delineate which one you are referring to, while the ATmega32 does not.

Minimal - probably less than 2K. Your ATmega32 will have room to spare.

-Brian

Reply to
Brian Dean

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.