go_away

Author Topic: Build my own "dynamixel"  (Read 1505 times)

0 Members and 1 Guest are viewing this topic.

Offline ErikYTopic starter

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 0
Build my own "dynamixel"
« on: February 28, 2013, 07:15:53 PM »
I have been playing with the ax12, and I love these things.

However, I have a need for a very powerful Dynamixel Type Servo, and I really cannot afford the $500 for the Mx106, ideally I would love to get a motor even more powerful than the mx-106 if realistic.

I started thinking about building my own version, and was wondering if anyone could give me some guidance.

I understand I need the following:

Gear motor
Encoder
Processor
Motor controller

Possibly EEPROM if I want to daisy chain with others down the road
Probably some type of  a case



My inclination would be to use an AVR micro controller for the processor, and I2c instead of serial communication.

I will probably build an h-bridge for the motor controller as the SN754410 only has 1 amp max current.


Also, I am thinking the code for this is to have a desired position, and use PWM to get the motor at the desired position, at the desired speed, using the encoder to know when to stop.

My uses would be for angle/position control, as well as speed control, and I have no need for continuous rotation.

Am I missing anything here in the plan?

Also, could someone recommend a geared motor for this task, as well as a pretty high res encoder, that would be reasonable for a somewhat newbie to work with? I have never worked with geared motors before, nor encoders.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,928
  • Helpful? 98
Re: Build my own "dynamixel"
« Reply #1 on: February 28, 2013, 10:12:52 PM »
One method of getting a high res position/speed is to put a low res encoder on the motor's shaft before the gear reduction. This way the encoder res is increased by the gear ratio.

Sounds like a plan.
Just change the name in your list from 'motor controller' to 'motor driver' (ie H-bridge) since the processor will be the controller.


Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: Build my own "dynamixel"
« Reply #2 on: March 01, 2013, 04:23:57 AM »
For positional control, I think, disk with stripes will be difficult to work with, as You will have to always count ticks to know current angle. Also, after reset, You'd always have to bring motor back to some sort of hard stop point in order to properly reset position tracker. Pot would be a better solution, as with it You can not exact angle at any point in time, however pots tend to wear out, so the best option, in my opinion, is to go for magnetic encoder on the final output shaft.

http://www.adafruit.com/blog/2009/02/14/diy-hall-effect-quadrature-encoder/

With better magnet positioning one would get nicer output (more sine-like).
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline ErikYTopic starter

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 0
Re: Build my own "dynamixel"
« Reply #3 on: March 01, 2013, 05:41:39 AM »
Guys, thanks for the replies.

Yes, definitely meant motor driver, not controller, brain fart.

That DIY hall effect sensor is very interesting.

I may play around with a cheap gear motor and that setup to see if I can get a prototype working before moving on to a bigger more expensive motor.

I am struggling to find anything with the power I want.

For example, the MX-106 has a stall torque of 1,189 oz·in

That is a monster, at Pololu the most powerful geared motor I found was less than 1/4 that powerful. If anyone has any suggestions, I would love to hear where I can get such a motor.

Also, another thought came up, to precisely stop at an angle, would it be better to use hardware interrupts when the encoder is measuring at the desired angle, or would I do that in code?

My thought is I may need an algorithm either way to know how fast it is moving, and how long at the speed it takes to break so that it will be fairly accurate.

Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: Build my own "dynamixel"
« Reply #4 on: March 01, 2013, 05:57:17 AM »
For precision stops one would probably use PID. With simple if (position >= threshold) { stop(); } You will get an overshoot which severity will be proportional to inertia.

If You are using ADC to get data from encoder there is no way to have an interrupt for a specific position, as You only find out about current position after ADC conversion is done inside microcontroller, so that would be more like polling. Actually it would look something like pseudo-code above. With PID You can regulate velocity to make shaft de-accelerate as it approaches it's destination.
« Last Edit: March 01, 2013, 06:05:27 AM by newInRobotics »
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline ErikYTopic starter

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 0
Re: Build my own "dynamixel"
« Reply #5 on: March 01, 2013, 06:51:44 AM »
For precision stops one would probably use PID. With simple if (position >= threshold) { stop(); } You will get an overshoot which severity will be proportional to inertia.

If You are using ADC to get data from encoder there is no way to have an interrupt for a specific position, as You only find out about current position after ADC conversion is done inside microcontroller, so that would be more like polling. Actually it would look something like pseudo-code above. With PID You can regulate velocity to make shaft de-accelerate as it approaches it's destination.

Makes sense, thanks!

Offline Azraels

  • Full Member
  • ***
  • Posts: 57
  • Helpful? 1
Re: Build my own "dynamixel"
« Reply #6 on: March 01, 2013, 10:27:54 AM »
I was thinking along the same lines as you but had it set aside for now, but here is a website I came across when i was doing some of the research, hope it helps!

http://fab.cba.mit.edu/classes/MIT/863.10/people/brian.mayton/servo.html
If your first post is, "I want to build a super complex robot with object recognition, etc..but I have never done programming or electronics...etc." 
Your doing it wrong. Start Simple and Work Up.

Offline ErikYTopic starter

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 0
Re: Build my own "dynamixel"
« Reply #7 on: March 01, 2013, 12:59:06 PM »
Thanks, that is actually very interesting.

This is very much along the lines of what I had been thinking. I had been thinking of using an Arduino lilypad, in a similar way to what they did.

Still really struggling to find a really powerful DC geared motor in the 12V range.



Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,343
  • Helpful? 81
Re: Build my own "dynamixel"
« Reply #8 on: March 01, 2013, 03:34:37 PM »
I looked into building my own high-torque servos with encoders and controllers, and I came to the conclusion that there's a reason these guys are expensive. It's hard!

High-torque servos are used all the time in industrial automation and motion control situations. However, if you think the MX-106/EX-106 is expensive, then you're going to get a heart attack when you see the prices those guys pay. The reason they pay those prices, is that they need gear that actually works for a long time, and building those kinds of things actually costs money.

A servo (any closed-loop controlled motor -- not just cheap "hobby servos" used in RC planes/cars) is very simple as an idea: A motor, possibly a gearbox, a rotaty encoder (typically an absolute sensor on the output after the gearbox,) a motor controller, and a microcontroller to tie it all together. Plus the mechanical engineering to fit it all into a particular form factor, and keep it there under load. Once you figure out how to build and integrate it all yourself, you're not really saving much money compared to buying it from the people who build them in bulk!

Offline ErikYTopic starter

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 0
Re: Build my own "dynamixel"
« Reply #9 on: March 01, 2013, 04:00:49 PM »
I looked into building my own high-torque servos with encoders and controllers, and I came to the conclusion that there's a reason these guys are expensive. It's hard!

High-torque servos are used all the time in industrial automation and motion control situations. However, if you think the MX-106/EX-106 is expensive, then you're going to get a heart attack when you see the prices those guys pay. The reason they pay those prices, is that they need gear that actually works for a long time, and building those kinds of things actually costs money.

A servo (any closed-loop controlled motor -- not just cheap "hobby servos" used in RC planes/cars) is very simple as an idea: A motor, possibly a gearbox, a rotaty encoder (typically an absolute sensor on the output after the gearbox,) a motor controller, and a microcontroller to tie it all together. Plus the mechanical engineering to fit it all into a particular form factor, and keep it there under load. Once you figure out how to build and integrate it all yourself, you're not really saving much money compared to buying it from the people who build them in bulk!


Yeah, I am starting to see that as well.

I will admit, I don't know a lot about motors, but I cannot find anything as "torquey" as the 106's, and anything I find that is decent torque, the motors seem to be big and expensive.

I never doubted the value of the 106's, I just kind of doubt my ability to really pay for them.

Offline Azraels

  • Full Member
  • ***
  • Posts: 57
  • Helpful? 1
Re: Build my own "dynamixel"
« Reply #10 on: March 01, 2013, 07:45:59 PM »
Same here! Do they come with insurance? With my luck I would destroy it the first day I got it, then your out $500. A big difference from frying a regular $15 servo.
« Last Edit: March 01, 2013, 07:47:34 PM by Azraels »
If your first post is, "I want to build a super complex robot with object recognition, etc..but I have never done programming or electronics...etc." 
Your doing it wrong. Start Simple and Work Up.

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,343
  • Helpful? 81
Re: Build my own "dynamixel"
« Reply #11 on: March 02, 2013, 12:23:07 AM »
The torque in those servos comes from the gearbox as much as from the motor. Plus they may be running the motors hotter than "rated" to get more torque.

The servos do have a built-in heat sensor, and if you stall them for too long, they will overheat and shut down. You then have to wait 20 minutes before you turn them on again. If you wait less, you will most likely seize up the motor and it will be lost forever.

Unfortunately, robotics for real is a pretty expensive hobby :-( You can learn a lot playing with Arduinos and RC servos and RC cars and webcams, but once you want to take the step up from toys, it's an order of magnitude in cost! This is different from, say, computers, where there's good options all the way up and down the cost/complexity spectrum. Or painting, where even a high end paintbrush is unlikely to break catastrophically :-)

Some credit cards have "accident protection" where, if something breaks within X time of purchase (usually 90 days,) it's covered by their protection. You might want to plan as much as possible out before you buy the servos, then use such a card for the actual purchase, and get as much testing as you can in within that period!

Offline ErikYTopic starter

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 0
Re: Build my own "dynamixel"
« Reply #12 on: March 02, 2013, 05:49:42 AM »
The torque in those servos comes from the gearbox as much as from the motor. Plus they may be running the motors hotter than "rated" to get more torque.

Yeah, I actually figured that out yesterday, I found a calculator that takes gear ratio, motor starting torque and speed, and converts it into a geared torque and speed, playing with some of the gear boxes ratios, I was able to approach some MX106 type numbers

The servos do have a built-in heat sensor, and if you stall them for too long, they will overheat and shut down. You then have to wait 20 minutes before you turn them on again. If you wait less, you will most likely seize up the motor and it will be lost forever.

Unfortunately, robotics for real is a pretty expensive hobby :-( You can learn a lot playing with Arduinos and RC servos and RC cars and webcams, but once you want to take the step up from toys, it's an order of magnitude in cost! This is different from, say, computers, where there's good options all the way up and down the cost/complexity spectrum. Or painting, where even a high end paintbrush is unlikely to break catastrophically :-)

No doubt about that, I am learning this more and more each day. I think robotics today is kind of where computers were in the 70's. I remember reading Steve Wozniak say that the intel 8080 cost more than his monthly rent, so he had to figure out some alternatives when designing what became the Apple I, and that was just for the microprocessor, then there was the RAM, the ROM, and many other chips that were very expensive back then.

Some credit cards have "accident protection" where, if something breaks within X time of purchase (usually 90 days,) it's covered by their protection. You might want to plan as much as possible out before you buy the servos, then use such a card for the actual purchase, and get as much testing as you can in within that period!

This is a very good idea, thanks for the thought, I never would have thought of this.


I think I still want to try to build my own higher torque smart servo, but maybe more as a learning experience and for fun, rather than my initial idea to save money.

You are  very knowledgeable about many different areas of Robotics, do you do this for a living?

Offline ErikYTopic starter

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 0
Re: Build my own "dynamixel"
« Reply #13 on: March 02, 2013, 07:39:47 AM »
Same here! Do they come with insurance? With my luck I would destroy it the first day I got it, then your out $500. A big difference from frying a regular $15 servo.

So I picked up two used Mx106s on eBay, cheap enough that I could not resist, but still not really cheap.

Got them last night.

Tried to reset one of them as they were only writing, not reading, and now it's not working.

:(
« Last Edit: March 02, 2013, 08:59:19 AM by ErikY »

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,928
  • Helpful? 98
Re: Build my own "dynamixel"
« Reply #14 on: March 02, 2013, 08:36:08 AM »
Building your own will be a good learning experience and it can be fun to do it yourself.
There is a bit of info on the control algorithms around but you'll need to dig.

Microchip does have a few decent App Notes on this that may be helpful to you.

Yes, the more gear reduction to greater the Torque output (minus frictional losses in the gears). However, increasing torque decreases speed so you need to figure the trade offs.
If you a fairly fast output with lots of torque you will need a strong motor.


Another thought: look into some to the places that sell surplus parts. Many times high quality gear motors are available for a small fraction of their original cost.

Another on the encoder:
Use a coarse absolute position encoder on the gear shaft output and an encoder of the motor shaft for very fine relative position and speed.
This could work well for the Accel/decal & position hold parts of the control loop.

Offline ErikYTopic starter

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 0
Re: Build my own "dynamixel"
« Reply #15 on: March 02, 2013, 12:15:57 PM »
Waltr, thanks for the tips, very helpful.

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,343
  • Helpful? 81
Re: Build my own "dynamixel"
« Reply #16 on: March 02, 2013, 01:57:31 PM »
Quote
You are  very knowledgeable about many different areas of Robotics, do you do this for a living?

Thanks, but no :-) A real robotics engineer would look at me and laugh. I'm good with the software part, having spent my entire career in various kind of distributed software and software/hardware/electronics, but the mechanical and robotics parts I've had to dive into head first and learn as I go. And the difference is huge: In software, an experiment is pretty low cost, and you can throw it away if it fails. In robotics, an experiment may easily be hundreds of dollars in physical materials and tooling, and if it doesn't work, it'll take a long time to recover the parts that can be recovered, and then you cry as you chuck your carefully crafted metal parts in the recycling bin...

Offline ErikYTopic starter

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 0
Re: Build my own "dynamixel"
« Reply #17 on: March 02, 2013, 02:06:50 PM »
Quote
You are  very knowledgeable about many different areas of Robotics, do you do this for a living?

Thanks, but no :-) A real robotics engineer would look at me and laugh. I'm good with the software part, having spent my entire career in various kind of distributed software and software/hardware/electronics, but the mechanical and robotics parts I've had to dive into head first and learn as I go. And the difference is huge: In software, an experiment is pretty low cost, and you can throw it away if it fails. In robotics, an experiment may easily be hundreds of dollars in physical materials and tooling, and if it doesn't work, it'll take a long time to recover the parts that can be recovered, and then you cry as you chuck your carefully crafted metal parts in the recycling bin...

Well, I guess perspective is everything.

I too have a software background, but the electronics/mechanical/hardware part is completely new to me.

It seems like you have a lot of kowledge to me, a HECK of a lot more than I do!

 


Get Your Ad Here