Friday, January 10, 2020

Some Useful way to Smooth Stepping Motor Movements

One of the criteria that determines the quality of a 3D printed part is how accurately the printhead traces out the true shape of the part’s geometry. Since the motion of the printhead (called the toolpath) is determined by the printer’s stepper motors, a more accurate toolpath can be obtained by ensuring the stepper motors accurately reflect the true geometry of the part being printed.
Some Useful way to Smooth Stepping Motor Movements

Recently an engineer discovered that the electrical signals sent by the stepper motor controllers on the printer motherboard to the stepper motors for sale contained “bumps” which cause the motors to produce tiny motion errors with the printhead. So he (or someone) designed a small circuit board that filters out these steps and that goes between the stepper motor controller and the stepper motor itself. He made this 9 1/2 minute video that shows the results of using the circuits: https://youtu.be/qYI9XlADed8. If you skip to 2:30 in the video you can see a direct comparison of the filtered and unfiltered stepper motor motion.
This blog page describes how all this works and shows the results of some initial testing.
The Problem
This photo shows a scope trace of the input and output wave forms of a typical stepper motor controller.
Notice the ugly corners in the output trace that differ significantly from the smooth shape of the input trace. These corners result in inaccurate movement of the printhead.
But after inserting the filter circuits between the stepper controller and the  motor the results look like this:
Notice how much closer the output trace matches the input trace. This will result in a more accurate toolpath.
The Solution
I found the parts for this fix from a posting in the Facebook forum for my printer. They come from the Chinese website Aliexpress.com; here is a link to the item: Click Here. As you can see there is one circuit board for each of the X, Y, and Z stepper motors, and at a cost of less than $9.00 it is an inexpensive set of parts indeed.
Update: there is now an option to get 4 circuits for $10.00 at this link: 4 filters, but I don’t think there is much reason to filter an extruder stepper.
If you scroll down the Aliexpress page you’ll see a number of photos (nema 14 gearbox or nema 23 gearbox) that show results from using the parts.  It took 16 days for me to get the parts, but that included 2 holidays.
This is the parts package as it arrived:
Here are the parts laid out ready for assembly. Note the clever plastic sleeves that cover the circuit boards after assembly.
And here is everything assembled ready to connect to the motherboard.
Installation
Installing the filters is quite simple. I just unplugged my stepper motor cables from their connectors on the motherboard, plugged one of the filter connectors back into that socket, and then plugged the other connector into the stepper motor connector. Here is a photo if my motherboard before I started:
Note that my motherboard has 5 stepper motors because I did some Beta testing for a dual-extruder upgrade, and as a result my printer has 2 extruders.
Here is how the motherboard looks after connecting the filters:
It is a bit more messy but still presents no problem reattaching the glass build plate.
Testing
While I waited to receive the filters I created and printed a test part to check out the results.  I also printed out the “torture test” part references in the YouTube video. As I expected, both of these printed with very good results:
Of course, the proof is in the pudding. Here are the “After” results:
As you can see, there is not any significant difference.  Here are the 2 torture test parts side by side:
And here are my 2 test parts:
Conclusion
This fix, as elegant as it may seem, appears to have no noticeable impact on parts printed by my printer. There may be a different result with a different printer, but someone else will have to determine that. What I plan to do is leave the filters installed for a few more prints and see if they have some positive effect on some other type of geometry. If that happens I will make an update to this page (or perhaps make a new one) that shows the result.
Update 
Here is a copy of a message I received on the Facebook 3d printing group. It explains why I found no difference in the before/after tests shown above:
Chin Ming Keat hey, I am the guy that made the youtube video. ATOM uses high inductance motors (which is usually not the case for most hobbyist 3d printers) which don’t suffer from the issue mentioned in the video. Hence, you don’t see any differences with the before-after.

Wednesday, January 8, 2020

Number of steps per revolution

The china stepper motors don’t have a continuous motion, therefore they cannot position themselves in every angle.
They work like the seconds in an analog watch, which they only have 60 unique positions.
As expected, the more steps the motor has, the better resolution we could achieve but with a reduced speed.
The common motors used inside machines and robotics use to have 200 steps per revolution. That is 360º/200 = 1.8º per step.

Angle per step

That is a different view over the number of turns per revolution. It is the equivalent way to give you number of steps or angle per step. 200 steps per turn is equivalent to 1.8º per step.

Micro stepping

This is a topic which generates lots of questions. Specially since the RAMPS boards contain jumpers to select the number of microsteps.
The idea behind this technique is based on not sending 100% of the power to the magnets, thereby the motor will not complete 100% of the step.
The microstepping designed drivers send energy using a sinusoidal wave.
Using this technique, in theory, we lose torque and power, but we gain resolution and fluidity.
Con esta técnica, en teoría perdemos torque y fuerza, pero ganamos resolución y fluidez.
And you can really see it. If you deactivate the microstepping (just remove the jumpers on the RAMPS), the movement becomes abrupt. Personally, every machine i put together i always set them to the maximum setting.

Gearbox

If the motor is connected to a gear and the gear to another gear we obtain a gearbox.
If the second gear is bigger, we will apply more torque while trading speed.
If the gear is smaller, we will go faster while trading torque.
It is very common to use gearboxes, and there are motors which have then integrated, saving us the installation problems.
Gearboxes are specified in ratios. And it is very common to see number of teeth per gear.
An example, 32:8 means that we will go from a 32 teeth gear to one of 8. For each 32 revolutions, the second gear will turn 8, therefore the relationship is 32/8 = 4 times.
The use of gearboxes stepper motor depends on the machine and the torque and speed required.

Holding torque

I have to admit that i had to search Google for the term. I’ve been always seen it referred as simply torque.
In lame terms, it is the measurement of the torque that a motor can apply to hold a fixed weight.
To measure it, imagine you have a 1 meter long staff, and on its tip we set a 1 kg weight.
Now we have to lift that staff with one hand only. Many people will not be able to do it.
Now imagine that instead of 1 Kg, we have 2 Kg. It makes things worst!
What about having a 5 meters staff and 500 grams?. Although there is less weight , to lift half a kilo at 5 meters distance with only one had is quite difficult.
That is why, we measure the torque in Newtons per meter, since it depends on the weight and distance to the motor shaft.
3D printers usually require a lot of torque at the extruder in order to push filament, especially the ones trying to print with a 3mm diameter.
To give you an idea, the traditional extruder Wade (the most known extruder for Prusas) is able to produce a torque of 40 Newtons per cm.
However a laser engraver it almost doesn’t require torque, since it doesn’t have to push anything.
The stepper motors usually have less torque than DC motors. But instead, it is easier to hold them in place.
To keep a DC motor standstill, it is required to re-calculate the position in a constant feedback loop.

How to reuse 4 and 6 wires stepper motors for your projects

Stepper motors are used in various types of equipment for accurate rotation angle and speed control using pulse signals. Stepper motors generate high torque with a compact body, and are ideal for quick acceleration and response. Stepper motors also hold their position at stop, due to their mechanical design. Stepper motor solutions consist of a driver (takes pulse signals in and converts them to motor motion) and a stepper motor.

When you start to create a CNC or something similar you need a stepper motor, probably you can find they inside your trash.

If you have and old printer or better a laser printer, probably you can get 2 Nema17 motor. I specify old because newest one use a brushless motor with feedback.

But the real problem when you decide to reuse stepepr, is the identification of the coil.

To use It the best solution is to use a driver, the most common one is A4988, but existing various models.



4 wires stepper motors
The most common motors is 4 wires (bipolar) and 6 wires motors.




To use this motor you must identify the coil, take your tester and start check de restitance of all coils.




As you can clearly see from the images and the video for the bipolar motors it is simply necessary to find the connected ones, in practice the pairs will be formed by the wires that have a resistance differente from 0.

6 wires stepper motors
This type of motor is more complex to use, but with tester and some patience you can find the 4 wires you need to connect.






As you can see in this case the pairs of wires that must be taken are those that have a greater resistance, ie those more external to the coils.

When you don’t have the specifications
Normally the motors that you find inside the printers are not easily traceable, consequently you are without specifications.

Given that the circular stepper motors (not nema17) usually have 75 steps and not 200 like the classic nema17 (there is also the 400 variant), the real problem is how much voltage and current give to the motors.

Amperage drivers
There is a simple “trick/way” to set correct amperage, you must put tester + on potentiometer and tester – to GND of the driver (look the image) then:

DRV8825: Imax = 2 * Vref (if Imax = 1.5A, then Vref is to be set to 1.5/2 V = 0.75V)
A4988: Imax = 2,5 * Vref



In my situation I put 0,8v*2,5 = 2A even if the step amp phase is 1,7amp but I need more power.

Step to follow to set the right input

I recommend following the following steps:
  • Trivially test the outputs of the power supply to determine the rating.
If you can’t do this, follow the steps below:
  • Start with 12v and set the maximum amperage per phase on the driver (for the A4988 2A): the low voltage affects the speed of rotation and naturally forces you to a greater amperage with a consequent increase in temperature. The motors you extract usually have 24-36v but they also work at 12v.
  • If the temperature as we expect it becomes too high, decrease the amperage to obtain a high but acceptable temperature.
  • If you get a very high temperature, increase the voltage and repeat the steps above.

Test the motors

create a silly program to check the motor, normally I connect they on CNC Shield, but if you don’t have It you can directly connect to a driver.
I also use that program to calculate the exact number of steps / mm when setting the parameters of my CNCs.
Some Arduino have problem when you doing a long running transmission with grbl firmware, pay attention.
You can buy here

CNC shield Nema 17 connections
You can buy here
Stepper motor X Axis connection