Project Guidance? Servo control robotic arm

Hi there,

I’m embarking on a project to create a robotic arm for one of our disabled friends. He and his work crew already have the arm mechanics complete, and they are looking to me for some programming. I thought an Arduino board would be a great way of adding some smarts to the control of this thing.

  • arm uses 6 large RC servos and is currently controlled with an RC radio.

  • servos will need their own power supply (not from the board.)

  • we’ll use a 2 or 3 axis joystick, and 4-8 buttons for control

  • first version will be table mount, with an eye to mounting on wheelchair.

Q1) How do I choose the appropriate board? I think the Arduino UNO will work fine. It has (just) enough PWM outputs, analog and digital inputs/outputs.

Q2) If I want some user input to choose between a few different modes, what is best? A few momentary buttons, or buttons / switches that keep their state? Is it best to check the current state of the on/off buttons, or refer to a variable set by the momentary button?

Q3) Last (stupid?) question: How do I size the pull down resistor used with buttons? Is this correct? (Lets see: V=ir. 5v=i5000ohms. So current = .001A. Wattage = Vi, or 0.005 watts? So virtually any resistor would be fine?

Thanks for your thoughts,

Colin

ColinHB:
Hi there,

I’m embarking on a project to create a robotic arm for one of our disabled friends. He and his work crew already have the arm mechanics complete, and they are looking to me for some programming. I thought an Arduino board would be a great way of adding some smarts to the control of this thing.

  • arm uses 6 large RC servos and is currently controlled with an RC radio.

  • servos will need their own power supply (not from the board.)

  • we’ll use a 2 or 3 axis joystick, and 4-8 buttons for control

  • first version will be table mount, with an eye to mounting on wheelchair.

Q1) How do I choose the appropriate board? I think the Arduino UNO will work fine. It has (just) enough PWM outputs, analog and digital inputs/outputs.

Uno can control up to 12 servos.

Q2) If I want some user input to choose between a few different modes, what is best? A few momentary buttons, or buttons / switches that keep their state? Is it best to check the current state of the on/off buttons, or refer to a variable set by the momentary button?

Yep, a momentary button would work. You can save the last state in software.

Q3) Last (stupid?) question: How do I size the pull down resistor used with buttons? Is this correct? (Lets see: V=ir. 5v=i5000ohms. So current = .001A. Wattage = Vi, or 0.005 watts? So virtually any resistor would be fine?

Correct. The standard value is 1K and up. Shouldn’t have to go above 10K… The smaller the size the better if your limited on space.

You cang Google “Arduino servo control with joystick” and turn up lots of tutorials and example sketches.

codlink:

ColinHB:
Hi there,

I’m embarking on a project to create a robotic arm for one of our disabled friends. He and his work crew already have the arm mechanics complete, and they are looking to me for some programming. I thought an Arduino board would be a great way of adding some smarts to the control of this thing.

  • arm uses 6 large RC servos and is currently controlled with an RC radio.

  • servos will need their own power supply (not from the board.)

  • we’ll use a 2 or 3 axis joystick, and 4-8 buttons for control

  • first version will be table mount, with an eye to mounting on wheelchair.

Q1) How do I choose the appropriate board? I think the Arduino UNO will work fine. It has (just) enough PWM outputs, analog and digital inputs/outputs.

Uno can control up to 12 servos.

The UNO product page and the datasheet for the ATmega328 only claim 6 servos. And there's only 3 timers to do that. Heck, there are only 14 DIO pins. IIRC from perusing the Arduino forums it's gets dicey when using all 6 channels, I'm not sure it retains full resolution when doing so. A Teensy++ 2.0 or Mega2560 have more DIO pins and more timers and more PWM channels and frankly I'd start with one of those as a baseline.

Now they’re all about the same when it comes to doing computations and I’d advise the OP to try to get a handle on all the matrix rotations that will be needed, perhaps see if there are some benchmarks to determine if any of the above dev boards can support what will be needed computationally. If that looks questionable then perhaps it would pay to step up to one of the ARM based boards. Then again if the OP runs out of computing power, he can switch boards later on. How much $$ would have been “wasted” … $30 -$50. Small potatoes for this project.

http://arduino.cc/en/Main/ArduinoBoardUno

http://www.atmel.com/Images/doc8161.pdf

http://dlnmh9ip6v2uc.cloudfront.net/dat … SB1286.pdf

http://www.atmel.com/Images/doc2549.pdf

Thanks,

I agree - the UNO only lists 6 PWM outputs. Timers are new to me - thanks for pointing out a new area to look into.

Someone was able to get an arm going with coordinated servos using the Leonardo board. I’ll look more closely at the specs. Thanks for answers.

Colin

My fault for not explaining how you can control 12 servos… You can control 12+ servos with an Arduino that is running the Servo library. http://arduino.cc/en/reference/servo

Direct quote from the above link.

The Servo library supports up to 12 motors on most Arduino boards and 48 on the Arduino Mega. On boards other than the Mega, use of the library disables analogWrite() (PWM) functionality on pins 9 and 10, whether or not there is a Servo on those pins. On the Mega, up to 12 servos can be used without interfering with PWM functionality; use of 12 to 23 motors will disable PWM on pins 11 and 12.

If you wanted to write the code yourself, sure maybe 6 is your limit. It really doesn’t matter that the UNO only has 6 PWM pins.

http://www.youtube.com/watch?v=VmtrKH57Ons

http://www.youtube.com/watch?v=0PU6-8am_fE

codlink:
It really doesn’t matter that the UNO only has 6 PWM pins.

Yes and no. What's not done using hardware means doing it via software. That means less clock cycles to do other computations. So long as you always have enough, I guess it doesn't matter (HW vs SW). I wonder, in any 20 ms period, what % of clock cycles would be used doing servo timing via HW vs SW ?

There are so many variables to consider when calculating. But I did read somewhere about the breakdown of the timing and clock cycles regarding PWM. Honestly don’t remember the exact figures and won’t guess either. I do know that running multiple servos and doing communication like Serial or I2C, that they conflict with each other for cycles.

By the OP’s statement, he wasn’t planning on doing any heavy communications. So if he’s just reading an analog input, mapping, and writing those values, I don’t see nay reason why an UNO would control as many servos as he needs.

DuaneB from Arduino.cc has some good write-ups regarding servos. http://rcarduino.blogspot.com/