# Gear Train Encoder

Posted by Joshua Merchant
 Gear Train Encoder July 28, 2008 11:04PM Registered: 13 years ago Posts: 152

Why can't you just attach a gear train to the shaft to be measured, using a mechanical advantage to achieve more accurate measurements?

That is, you put a big gear on the shaft, and have it contact and spin a small gear. Say the small gear completes a revolution every, say, 2 times the big gear completes a revolution (MA=2), and you have an encoder that can measure 12 different rotational positions on a shaft (12 pulses per revolution/rotation or ppr).
If you rotate the main shaft with the big gear one full revolution, and you have the encoder mounted on the main shaft, the encoder will pulse 12 times. If you instead mount the encoder on the secondary shaft with the small gear, it will pulse 24 times.
If you rotate the main shaft 360/12=30

Edited 1 time(s). Last edit at 07/29/2008 12:37AM by Joshua Merchant.
 Re: Gear Train Encoder July 29, 2008 01:14AM Registered: 14 years ago Posts: 370
Sure, that's possible. But your gear train adds another place for backlash to happen and inaccuracies to build up. I'm sure it's been done before, but the normal solution is just to buy a higher-resolution encoder. It's not *that* much more expensive, and much less of a hassle.
 Re: Gear Train Encoder July 29, 2008 01:22AM Registered: 13 years ago Posts: 152
> It's not *that* much more expensive, and much less of a hassle.
The 10-bit (1024ppr) encoders are \$12 each (or more). A 12ppr encoder costs \$0.54.
If you buy 4 (one for each axis, and one for the extruder), that's \$12*4=\$48, compared to \$0.54*4=\$2.16. That's \$45.84 more.

It is good to know that it's possible though.

As to the inaccuracies from backlash... you get what you pay for, I guess.
I think after some progression, these can inaccuracies can reduced while still maintaining a similar cost. I think in this case it's better for me to start low cost and gradually increase efficiency than start high efficiency and try to slowly reduce cost.

Edited 1 time(s). Last edit at 07/29/2008 01:24AM by Joshua Merchant.
 Re: Gear Train Encoder July 29, 2008 01:49AM Registered: 14 years ago Posts: 370
To me, the goal is to start with something that *works* and try to reduce cost and complexity from there. It will be no fun trying to determine whether your persistent encoder error is coming from a flaw in the extruder design or a loose bolt in the encoder geartrain assembly.

It also seems a bit nonsensical to gear motor output down by a huge factor in the GM3 gearbox, then back up for encoder accuracy. Perhaps a different gearbox/motor combo is the correct solution? To me personally though, the theoretical cost savings don't really justify the added fiddlyness in an alpha product.

However, in spite of my gloom, this is really what RepRap is all about! If you can get something such as this servo idea working reliably for a fraction of the cost of the current system, I can pretty much guarantee you'll have many thankful adopters. Nothing would please me better than to eat my words in this thread.
 Re: Gear Train Encoder July 29, 2008 03:31AM Registered: 13 years ago Posts: 152
Kyle Corbitt Wrote:
-------------------------------------------------------
> *works* and try to reduce cost and complexity from
> there.
People keep saying that! I wonder why...
> It will be no fun trying to determine
> whether your persistent encoder error is coming
> from a flaw in the extruder design or a loose bolt
> in the encoder geartrain assembly.
Bleh, I started in software... complex debugging is just traditional.

> It also seems a bit nonsensical to gear motor
> output down by a huge factor in the GM3 gearbox,
> then back up for encoder accuracy. Perhaps a
> different gearbox/motor combo is the correct
> solution?
I figured I would attach the encoder gear train directly to the output of the motor, probably through some cheap modification of the GM3 setup. Alternately, I could just buy the RM2 motor and build my own two geartrains for it (since I'll have to build the encoder gear train myself anyway).

> To me personally though, the
> theoretical cost savings don't really justify the
> added fiddlyness in an alpha product.
I have finite funds and no income (and will remain in this state beyond the time it takes to get the RepStrap up and running). This explains why I've been so savings-oriented.
The specific cost to be cut is about 12% of the current total. Spending a couple days on it, out of a couple months total, adds somewhere around 3% more time. It's hard to compare time and cost in this way, but it seems to make sense to me at the moment. (When I subconciously realize it's not worth it, then it will cease to make sense conciously and I'll go "baroo?" and scrap this portion of the project.)
It should work out fine.

Also, it should be noted that replacing stepper motors with a closed loop system increases the percentage of parts that can be RepRapped (by replacing the complexity of the components of the stepper motors with RepRappable gear trains and cheap DC motors [the encoder is part of the stepper motor driver replacement in this sense, along with the DC motor driver]).

Anyway, it's not really a big deal to fiddle with it a bit to get the encoder working. It's probably about as much fiddling as getting the steppers working, plus the cost difference [that, of course, is the point; now I feel like I'm part of the Department of Redundancy Department].
 Re: Gear Train Encoder July 29, 2008 04:09AM Registered: 13 years ago Posts: 361
It may well be that the higher resolution encoder is overkill. You might well get away with a much coarser resolution encoder on the shaft output anyway, without gearing. And for a few bucks, its the sort of thing you could just try out

Also consider that encoders are the sort of thing that you can add much later, or upgrade at will. Yes, they have a big impact on build quality, but the extruder was used to make stuff before the encoder was added.

Quote

Also, it should be noted that replacing stepper motors with a closed loop system increases the percentage of parts that can be RepRapped

Forrest has a lot to say on the matter of using your own servo setup. Its dishearteningly negative. Basically, for applications where you want to run the motor at good speed in short movements, you need a high quality low inertia motor and a low backlash gear box. The two of those cost big bucks; more than a stepper. They're the sort of things you might pik up second hand though, if you searched around a bit.

Using cheaper motors and gears really impacts you when moving the head short arcs... you need to run the whole thing so slowly that it becomes extremely tedious to use as a tool.
 Re: Gear Train Encoder July 29, 2008 11:47AM Registered: 14 years ago Posts: 370
Joshua Merchant Wrote:
-------------------------------------------------------

> I have finite funds and no income (and will remain
> in this state beyond the time it takes to get the
> RepStrap up and running). This explains why I've
> been so savings-oriented.
> The specific cost to be cut is about 12% of the
> current total. Spending a couple days on it, out
> of a couple months total, adds somewhere around 3%
> more time. It's hard to compare time and cost in
> this way, but it seems to make sense to me at the
> moment. (When I subconciously realize it's not
> worth it, then it will cease to make sense
> conciously and I'll go "baroo?" and scrap this
> portion of the project.)
> It should work out fine.
>
> Anyway, it's not really a big deal to fiddle with
> it a bit to get the encoder working. It's probably
> about as much fiddling as getting the steppers
> working, plus the cost difference .

Haha... I've spent weeks trying to implement an effective PID system for another application without every getting it to work in a way I'm happy with, and my understanding is that Forrest spent months pursuing this exact path you're proposing without much success.

I'm not trying to say that it can't be done - I'm sure that it can. But "a few days" is not really a realistic time frame estimate for a development of this magnitude, imho. You're oversimplifying the problem.

Of course, as I said before if you can get it working effectively with inexpensive components you'll have many of us extremely grateful to you and it will be a truly useful contribution. But know what you're getting yourself into; if your goal here is to make life easier on yourself, my sense is that you're going about it in the wrong way.
 Re: Gear Train Encoder July 29, 2008 04:31PM Registered: 13 years ago Posts: 152
Ru Wrote:
-------------------------------------------------------
> Using cheaper motors and gears really impacts you
> when moving the head short arcs... you need to run
> the whole thing so slowly that it becomes
> extremely tedious to use as a tool.
Well, you get what you pay for. Having to move exponentially more slowly for a lower price is just expected.

> Forrest has a lot to say on the matter of using
> your own servo setup. Its dishearteningly
> negative. Basically, for applications where you
> want to run the motor at good speed in short
> movements, you need a high quality low inertia
> motor and a low backlash gear box. The two of
> those cost big bucks; more than a stepper. They're
> the sort of things you might pik up second hand
> though, if you searched around a bit.
I checked out his blog [www.3dreplicators.com] and he does have a lot of information on this subject. I still believe that with proper fine tuning and real-time adjustments, I can achieve greater speed and accuracy with a cheaper encoded DC motor setup. If all else fails, I'll cut out the "speed" part.

> It may well be that the higher resolution encoder
> is overkill. You might well get away with a much
> coarser resolution encoder on the shaft output
> anyway, without gearing. And for a few bucks, its
> the sort of thing you could just try out
Aye. I figured I would order the encoders with the rest of the equipment, but then try just using the DC motors without encoders. Then try it with the encoders, and then try it with the geared encoders. I'm hoping that I can get sufficient print quality without geared encoders to be able to print gears for the geared encoders (otherwise I'm going to have to buy a geartrain, which takes the pricing closer to the steppers, or make my own gear-making device, which would be a hassle... then again, maybe I'll just use some LEGO Technic gears ).

> Also consider that encoders are the sort of thing
> Yes, they have a big impact on build quality, but
> the extruder was used to make stuff before the
Yar. The "upgrade at will" part is precisely what I intend to do, as above.

In any case, it is a bit scary how similar the Tommelise ideology is to my plywood Seedling (which, by now, has diverged so much that it probably can't be called a "Seedling" anymore...).

Kyle Corbitt Wrote:
-------------------------------------------------------
> Haha... I've spent weeks trying to implement an
> effective PID system for another application
> without every getting it to work in a way I'm
> happy with, and my understanding is that Forrest
> spent months pursuing this exact path you're
> proposing without much success.
>
> I'm not trying to say that it can't be done - I'm
> sure that it can. But "a few days" is not really
> a realistic time frame estimate for a development
> of this magnitude, imho. You're oversimplifying
> the problem.
You have to remember that people normally do other stuff while doing stuff. That is, Forrest's "months" spent pursuing this was actually probably within the range of a few hundred hours of actual work (or less). When I say "a few days", I mean that it would be the equivalent of a few days of hard focused work, around 50-100 hours. Because it won't be the only part of the RepRap I'll be working on, it will most likely be spread out over a few weeks.
As far as oversimplifying the problem, what I find is that by oversimplifying problems we tend to realize how overcomplicated the "normal" view of the problem is. Also, oversimplification is just an aspect of my personality that I can't change .

> Of course, as I said before if you can get it
> working effectively with inexpensive components
> you'll have many of us extremely grateful to you
> and it will be a truly useful contribution. But
> know what you're getting yourself into; if your
> goal here is to make life easier on yourself, my
> sense is that you're going about it in the wrong
> way.
Sir, if I wanted to make life easier on myself, I would not be involved in the RepRap project. I'm more interested in making my life more productive and cool-gadget-filled.

Edited 1 time(s). Last edit at 07/29/2008 04:40PM by Joshua Merchant.
 Re: Gear Train Encoder July 29, 2008 05:29PM Registered: 14 years ago Posts: 370
Joshua Merchant Wrote:
-------------------------------------------------------
> Aye. I figured I would order the encoders with the
> rest of the equipment, but then try just using the
> DC motors without encoders.

I hope you're talking about the extruder here, and that you realize that you will absolutely without question NEED to put encoders or some kind of feedback on all three axes if you hope to use them with DC motors...

Please understand that my goal isn't to rain on your parade, it's just to inform you of my personal experience with this topic. You are of course free to do what you want with that, and I sincerely wish you the best of luck.

> Sir, if I wanted to make life easier on myself, I
> would not be involved in the RepRap project. I'm
> more interested in making my life more productive

Fair enough. ><
 Re: Gear Train Encoder July 29, 2008 05:43PM Registered: 13 years ago Posts: 152
Kyle Corbitt Wrote:
-------------------------------------------------------
> I hope you're talking about the extruder here, and
> that you realize that you will absolutely without
> question NEED to put encoders or some kind of
> feedback on all three axes if you hope to use them
> with DC motors...
Yeah, I figured I would need the encoders on the axes, but I also want to experiment without them (just to make sure; scientific procedure cat [farm2.static.flickr.com] says we should use control variables). While I do agree with you, it is interesting to point out that the axes will still have the opto endstops, which are a simple form of feedback (though almost surely insufficient).

> Please understand that my goal isn't to rain on