Change your stepper by a servo DC motor on Prusa i3 x-axis

by misan, published

Change your stepper by a servo DC motor on Prusa i3 x-axis by misan Jan 1, 2015
0 Share
Download All Files

Thing Apps Enabled

Order This Printed View All Apps



Use This Project

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag

Thing Statistics

4146Views 341Downloads Found in 3D Printer Accessories


I am studying the choices of using DC motors instead of steppers. This is my first example and I needed to attach the motor to an existing printer, this part did it.

You can see the servo working before being installed in the printer in the next video: https://www.youtube.com/watch?v=jB6carTGRn8


This is the software I am running on an additional Arduino UNO: https://www.youmagine.com/designs/dc-motor-closed-loop-control-software

And here it is the first print:

More from 3D Printer Accessories

view more

All Apps

3D Print your file with 3D Hubs, the world’s largest online marketplace for 3D printing services.

App Info Launch App

Auto-magically prepare your 3D models for 3D printing. A cloud based 3D models Preparing and Healing solution for 3D Printing, MakePrintable provides features for model repairing, wall thickness...

App Info Launch App

Kiri:Moto is an integrated cloud-based slicer and tool-path generator for 3D Printing, CAM / CNC and Laser cutting. *** 3D printing mode provides model slicing and GCode output using built-in...

App Info Launch App
KiriMoto Thing App

With 3D Slash, you can edit 3d models like a stonecutter. A unique interface: as fun as a building game! The perfect tool for non-designers and children to create in 3D.

App Info Launch App

Print through a distributed network of 3D printing enthusiasts from across the US, at a fraction of the cost of the competitors. We want to change the world for the better through technology, an...

App Info Launch App

Quickly Scale, Mirror or Cut your 3D Models

App Info Launch App

3D Print a wide range of designs with Treatstock. Easy to use tools to get the perfect result. The global 3D printing network that connects you with high-quality and fast working print services nea...

App Info Launch App

Excellent idea. I was thinking about something like this.
Here are my questions/proposals:

  1. what pulley do you use for the motor? It sure does not look like GT2 or something similar...
  2. as the link to Aliexpress no longer works, can you, perhaps, share the specs of the motor? Like torque, voltage, ... I am wondering if a smaller DC motor like from salvaged inkjet printer can also do this work
  3. how do you solve the static position? Can the motor hold some position as servo does? Would some sort of gear/transmission be better for this? (e.g. worm gear)
  4. my first idea was to wastly increase the number of steps per mm to provide better "resolution input" to the decoding arduino. However you suggest to change it to 31.18 from my current value (100). Do you think increasing the number of steps would help the target arduino to provide more accurate signal?
  5. I thought about moving the encoder part to the other side of the axes - so I count only real-life movement, not movement ofthe motor shaft. With this approach I can more or less compensate for any skipped steps due to pulley vs. belt slips on the motor side. It would mean I will have to make some type of pulley-like wheel on the other side of the belt, but that should in general not be a big problem. What do you think?
  6. Final thought - instead of measuring the shaft or the wheel, my idea was to use optical sensor from PS/2 mouse and measure the direct movement of the belt and provide this as the closed loop info for the arduino. You already made I2C code for the AMS sensors, so this should not be huge difference. Is it, in your oppinion, feasible?
    Thanks again for sharing this!

Hi rklauco,

1- motor I used came with MXL pulleys but those can be replaced by the ones of your choice (but then the part may need a redesign)
2- Asking datasheets on Aliexpress is kind of a lost cause, they do not have a clue what they are selling most of the time http://es.aliexpress.com/store/product/DC-3V-6V-12V-encoder-speed-motor-Worm-gear-motor-AB-phase-888-Free-shipping-1604/909696_1925658956.html?spm=2114.04010208.3.307.higsZQ&ws_ab_test=searchweb201556_1,searchweb201644_5_505_506_503_504_301_10020_502_10001_10002_10017_10010_10005_10006_10011_10003_10021_10004_10013_10022_10009_10008_10018_10019,searchweb201560_5,searchweb1451318400_-1,searchweb1451318411_6451&btsid=30ba4b94-9577-4440-a78a-b82d3112aa7f
3- a closed-loop motor is a servo. If you tuned it well it will hold position. A gear set can increase output torque.
4- that entirely depends on the encoder avaiable on the shaft, the number of teeth and pitch of the pulley and whether or not you use a gear set.
5- that sounds like a good idea, though delay may make it more difficult to tune or get stable. Let me know of it goes if you try it, please. It will be a good idea if you use a geared motor too.
6- that was mentioned in reprap forums and G+ but some people claim it won't work. I have not tested myself but it seemed to me it could work. However mouses might lose steps without us noticing as we do not expect to provide a high accuracy, as we use the visual feedback on the computer screen. I won't be surprised it could work, but my guess is that processing power needed to work at high speed might not be available in common optical mouse chips. If you go for it and get good results, please let us know.

Great work. but...
whenever I want to compile the script, I get an error:

servostrapv02.ino:20:32: fatal error: PinChangeIntConfig.h: No such file or directory
compilation terminated.

maybe you can help me.

many greetings

Thanks zelos113, please note I am using a couple of libraries here. That means these libraries need to be installed http://arduino.cc/en/Guide/Libraries

If not, an error is triggered when compiling the code as Arduino does not know anything about that library.

Feb 24, 2015 - Modified Feb 24, 2015
zelos113 - in reply to misan

Hey Misan,
Thanks for you really fast Reply.

Can you tell me which libraries i need?

And can you give me please an actual link to the Motor?

Thanks a lot and have a nice day

Thank you a lot. Now it Works.
Can you maybe provide your Config.h from Marlin? Just for example.

I did only change the steps/mm on the axis I replaced the motor by a servo (X & Y in my case). The new steps/mm was 31.18steps/mm (though the word steps now means encoder lines) but that number was for the first version of the encoder, I guess now it should double that. You can change that in Configuration.h but I do use M92 command to do it from pronterface and M500 to store the changes in EEPROM (that only works if you have it enabled in your firmware to start with).

Hola Misan,

Thanks you soo much for your Help and Time.
How do you Calculate the Stepperstick current on the Ramps? Like with a Stepper Motor?
Like here: Imax(mA) x (0,4 Rs = Vref ( A) ?

And can you Maybe tell me more or send mi a link to understand more the Gains?
What about this concept of DC Motors in a Delta Tower? Do you already think about this?
Muchas Gracias,
Que tengas un Buen Dia.

Exactly, voltage the potentiometer is proportional to the current through the motor windings. 0.4V is usually more than ok.

Have a look at this: http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/

I do have several deltas and I think this can be used too, I just did not have the time to try it out, but it should work ok (though current version may be a bit rough yet leading to not having better looking parts than with steppers).

Feb 25, 2015 - Modified Feb 25, 2015
zelos113 - in reply to misan

Thank you for the Informations and the Link. It's very helpful for me.
now I wired up all as like you but I can't control the motor. When I connect in pronterface, all fine... but when I click on move manually x axis right 10 steps the motor starts and turn permanently till I cut of the usb cable from the arduino.move manually x axis to the Left does not work. Do you have any idea about this?
Do you put 12V on the L298N Module? On The Photo you do it but in the schematics not?!
Have a nice day

Please note you may have the motor power backwards (so motor will turn the wrong way and never will reach the intended destination as it is not getting closer but farther away from destination). Swap motor cables to see if that fixes it.

Yes I do use 12V for the L298 module.

I see! You are right! Big improvement!

Jan 2, 2015 - Modified Jan 2, 2015

Where is the benefit? Higher precision?

Closed-loop means it will gracefully recover from any bump (no missed steps).

where did you find the servo motor

Sorry guy but the link above is no longer pointing to the motors I used.

Nope. That looks like spees only. Not position encoder.