EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: pratiken on June 18, 2018, 09:56:41 pm

Title: Arduino: DC Motor rotating shaft with 1deg resolution and 360deg rotation
Post by: pratiken on June 18, 2018, 09:56:41 pm
Hi Everyone,

I need a little help figuring out how to approach this.

I have a Main Shaft that I need to rotate 360 degrees once at 1 RPM, then rotate back 360 degrees at 1 RPM. I also need 1 degree resolution accuracy so that I can have the Arduino rotate it Main Shaft in 1 degree increments. Basically, I want to be able to say "rotate 15 degrees CW." or "Rotate 3 degrees CW".

What do I need to attach to the main shaft to be able to read back 360 degree rotation at 1 degree increments? I don't believe Potentiometers have that kind of capability, but maybe I'm wrong. How would you do it?

(https://i.imgur.com/M6TEBWG.jpg)

Thanks so much in advance!!
Title: Re: Arduino: DC Motor rotating shaft with 1deg resolution and 360deg rotation
Post by: Ian.M on June 18, 2018, 10:50:34 pm
If you can move the shaft at startup to seek to the zero position, then a high resolution quadrature encoder with an index pulse output would be suitable.   
Title: Re: Arduino: DC Motor rotating shaft with 1deg resolution and 360deg rotation
Post by: DaJMasta on June 18, 2018, 10:56:48 pm
Yeah, i think your best bet for accuracy and repeatability is an encoder, not a potentiometer.  Get an encoder (optical or magnetic) and put it on the worm gear's shaft, then determine how many rotations of the worm gear give you a rotation of the main shaft.  The encoder on the worm gear shaft will probably only need a few pulses per rotation for you to get 1 degree of accuracy on your main shaft, and since you have a fixed number of pulses per rotation of your encoder and a fixed mechanical linkage, you get very little drift or accruing offset.
Title: Re: Arduino: DC Motor rotating shaft with 1deg resolution and 360deg rotation
Post by: Ian.M on June 18, 2018, 11:01:08 pm
That will only work well with an anti-backlash gear on the main shaft - or a brakeband for controllable friction + software to always approach the final position from the same direction.
Title: Re: Arduino: DC Motor rotating shaft with 1deg resolution and 360deg rotation
Post by: pratiken on June 18, 2018, 11:39:33 pm
This is really helpful, thank you!

Would an application like this be better suited for a servo than DC motor?
Title: Re: Arduino: DC Motor rotating shaft with 1deg resolution and 360deg rotation
Post by: MasterT on June 19, 2018, 12:52:35 am
Perhaps, stepper motor?
Title: Re: Arduino: DC Motor rotating shaft with 1deg resolution and 360deg rotation
Post by: Ian.M on June 19, 2018, 01:12:57 am
Steppers are great if you don't need rapid acceleration and can over-size them enough that the load on them is only a small fraction of their torque at the desired speed.  However they are 'open loop' so if anything impedes their motion, they will loose steps and the mechanical position will no longer match that commanded by the software.

A real servomotor with a rear mounted encoder disk would work nicely, though you'd need an additional index sensor on the main shaft to detect the zero position.   RC servos are less suitable - if modded for continuous rotation, you typically loose the servo feedback, so you'd need an external encoder to close the loop