ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Splitting work between ROS and a custom motor controller board

asked 2011-12-26 08:18:16 -0600

mrjogo gravatar image

I'm designing a hobby bartending robot arm around ROS, and I'm wondering what's the best way to implement motor control.

Some background: I'm using brushed DC motors with homemade encoders controlled by various Atmega microcontrollers + H-bridges. Right now, I'm planning on having them communicate via RS-485, with an Atmega32u4 usb bridge to the computer running ROS.

I looked at how the PR2 motor controller boards work, and the only onboard control they do is a 100kHz control loop around the motor current. All other control is done in a realtime Linux loop and communicated using EtherCAT (more details). I'm tempted to copy what they've done, but I'm worried that my lower-cost approach means more onboard control (ie, position/velocity) will work better.

I'm relatively new to this, so any advice on how to implement it, or even recommendations on a better way to do the multi-drop communications would be greatly appreciated. Thanks!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2011-12-30 14:08:10 -0600

ahendrix gravatar image

The main motivation behind running all of the PID control loops for the PR2 on the main computer is to reduce the number of languages and environments that a user has to know in order to write software for the PR2.

If you're building your own motor control boards and writing the software for them yourself, putting the postion control on the motor board is probably a better idea. You'll have less data on your bus, because you won't need real-time feedback from all of your encoders, and you won't need to run a realtime kernel on your main computer (the real-time kernel on the PR2 is one of its weak points).

If you're looking for a low-cost system as a model, take a look at the Arbotix board and drivers. It uses an atmel microcontroller as a bridge between the main computer and an AX servo bus, and the AX servos have a built-in microcontroller that does all of the motor and position control.

edit flag offensive delete link more


Ah, that makes a lot of sense. Thanks!
mrjogo gravatar image mrjogo  ( 2012-01-16 10:23:35 -0600 )edit

answered 2011-12-30 11:27:07 -0600

Kevin gravatar image

updated 2011-12-30 14:11:15 -0600

Umm ... well, I am not sure, your description is sort of vague.

I assume you have some arms for your bartender, so I would suggest using simple servos, either the cheap ones that take PWM or the more more expensive, smart ones like AX-12. No use re-inventing the servo if you don't have to. One Arduino can drive many simple servos pretty effectively. I have not tried it, but there is a serial bridge for Arduino's in the ROS stacks.

You mention DC motors, I assume are for movement ... how many? Is it differential drive or omni? Being in a confined space like behind a bar, I would suggest omni (3 or 4 wheels depending). The navigation stack can handle either. Remember more motors means more power required.

I doubt you really need a real-time linux to do this ... a standard linux distro should do the job depending on your programming skills and linux knowledge.

What is your bartender robot going to do exactly? Does it mix drinks, grab a user requested bottle of beer, or does it only dispense one thing? Will cameras or a kinect be involved?

I would strongly suggest starting very simple. ROS will take a while to learn and it is constantly changing. If you tackle too much you will never get done. Good luck!

edit flag offensive delete link more


It's one 4-DOF arm built into the center of a round serving. It will spin around and grab/pour the bottles, using a Kinect for sensing. I didn't use servos because ones I found cost a lot for the torque to lift a full wine bottle. I know the project is quite ambitious, but that's half the fun :)
mrjogo gravatar image mrjogo  ( 2012-01-16 10:21:43 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2011-12-26 08:18:16 -0600

Seen: 1,721 times

Last updated: Dec 30 '11