Service Hotline: 13823761625

Support

Contact Us

You are here:Home >> Support >> Technology

Technology

Push the limit control of stepping motor in 3D printer

Time:2023-03-05 Views:1130
    "In the field of 3D printing, it is often difficult for novices to understand the real driving mode of the stepping motor. For example, many engineers will ask the question" My motor rated voltage is 4.6V, but my printer has 12/24V power supply. Can I use it? ". This is because most of the electronic products we use every day use constant voltage variable current power supply, which is our understanding in the past. A 12V LED light belt will be powered by a stable and controllable 12V, and the current consumption will increase with the increase of the number of diodes (load).”


Principle:
    In the field of 3D printing, it is often difficult for novices to understand the real driving mode of the stepping motor. For example, many engineers will ask the question, "My motor rated voltage is 4.6V, but my printer has 12/24V power supply. Can I use it?". This is because most of the electronic products we use every day use constant voltage variable current power supply, which is our understanding in the past. A 12V LED light belt will be powered by a stable and controllable 12V, and the current consumption will increase with the increase of the number of diodes (load).
     The stepper motor supplies power in the opposite way - the current is constant/controllable (detailed later), and the required voltage changes with the load. This is why 12V power supply is replaced by 24V or even higher voltage power supply in 3D printing - because (among other benefits) sampling can provide higher energy for the motor to achieve higher motion speed and better dynamic effect, although the current of the motor remains at the same value.
    But a typical power supply provides a constant voltage. How can it be converted into regulating and controlling current? This is the work of stepping motor driver, such as TMC2208.
    Current regulation is realized by a technology called PWM (pulse width modulation). The voltage can be switched on and off very quickly by using MOSFET, so that the current can float at a required level. However, this current control method is not applicable to simple resistive load -- current regulation can only be realized when the driving coil and magnet or other coils rotate the stepping motor together. The coil - inductance - has an interesting characteristic - it "slows down" the current and adds "inertia" to it. This means that if the voltage is applied, the current flowing through the inductor will not rise immediately, but slowly. When the voltage is cut off, the same thing will happen - the current will not drop to 0A immediately, but will decrease with time.
    By the way, LED is actually controlled by current - but for a simple LED light band, a resistance is enough to adjust the current, so the LED light band can be regarded as a constant voltage device.


actual measurement
    The described current control method can be clearly seen in the actual measurement:
    The yellow curve represents the current passing through the motor coil, and the blue line represents the voltage being switched on/off. This measurement is carried out during the standby period. At this time, the motor does not rotate, but its position is maintained. The current is almost constant, and the voltage is regularly turned on for a short time, and then turned off. Please note that this switching is occurring more than 30000 times per second!
    When the motor starts to move, something interesting happens. The shape of the current waveform is no longer flat, it is a sine wave. To make the motor rotate, the current needs to be changed to change the excitation magnetic field to generate motion. This principle applies to all brushless motors. TMC2208 is used to actively measure and adjust the current, generate a sine current shape with a set amplitude, and the effective voltage changes accordingly. The rotation speed depends on the frequency of the current sine wave.
    Don‘t worry about the fluctuation of voltage measurement. Magnitude - at the bottom of the screen, it is more or less equal to the power supply voltage of 32V we use. RMS value is an indicator of "how much" effective voltage is transmitted to the motor coil. In this case, the measured/calculated value is not very accurate, but it shows that at this speed, the voltage we provide is lower than 40% of the nominal supply voltage.
    When we zoom in, we can clearly see the special properties of the inductance mentioned above:
    When the voltage is turned on, the current rises, but it is relatively slow compared with the speed of voltage rise/fall. When we turn off the voltage, the current flowing through the coil decreases, but it is still quite slow. Before it reaches too low, the driver turns on the power again and the current rises again. This is basically how we keep the current at the required level. Please also note that the time of MOSFET switch conduction (the time of voltage maintaining conduction) depends on the "position" on the sine wave. When we look at the sine wave, we can see the areas with slow change (near the top/bottom) and fast change (near zero on the Y axis). If we want the current to follow this shape, we only need to apply a longer voltage in the "fast region" of the sine wave!
    The slight irregularity and deviation from the ideal and smooth sine shape are called ripple, and always exist when PWM is used to control the coil current.


Influence of motor load
    At this point, a very important question arises - what causes the required voltage (the actual power supplied to the motor) to change with the load? This is BEMF ---- the inherent characteristic of each motor. I don‘t want to go into the physical details of this phenomenon in this article - simply speaking, the motor coil during rotation will produce a "back" voltage, which is opposite to the voltage we apply from the power supply to the motor, which is why it is called the back electromotive force. The higher the speed (or load), the higher the BEMF we need to fight.


BEMF is affected by three main factors:
    • Motor coil inductance - the smaller the better
    • Set current - the higher the current, the stronger the motor, but the same is true for the generated BEMF
    • Speed/mechanical load - of course, BEMF will increase as the load increases. This is the working principle of the sensorless homing of the Trinamic StallGuard - it measures BEMF!


Actual impact of BEMF:
    In the following measurement, we can see acceleration and close-up of two areas - low speed/high speed
    When the speed is still very low, the motor controller still has enough margin to adjust the current well, so it can be considered that the sine wave is ideal. But if we zoom in later, we can see that the current looks more like a triangle, and the applied voltage is not very accurate. That is because the controller has no voltage margin to correctly adjust the current. In fact, although the motor is still running, the sine wave will be distorted.
    Now that we know how to control the stepping motor, we can go to the next point and answer the last question - what happens when the BEMF is so high that it is close to the power supply voltage? You may guess that the motor will start to lose step - indeed, but it will not appear immediately! To be honest, I was surprised at the ability of the drives and motors to handle extreme speeds. Let‘s see:
    This is the current flowing through the motor coil during a complete operation using a 24V power supply. The printer starts at a standstill, then accelerates to 900 mm/s at a speed of 9000 mm/s2, and finally stops. So, what actually happened? At first, the driver can maintain a sine wave, but later, when the BEMF approaches the power supply voltage, the waveform will deteriorate, as we can see above. But at this time, the printer still does not reach the required speed - soon the back EMF voltage generated by the motor is too high to reach the set current value, and it drops until it reaches the required speed, and then the amplitude becomes stable, but we no longer see the sine wave - in this point, it is closer to the square wave.
    These results look bad, but in fact - the results are good! The machine will not have any problems after running for more than one year under this setting. This is normal in high-speed applications. Of course, the torque is greatly reduced, and the accuracy may not be perfect, but after the deceleration, the motor returns to the nominal torque, and the position is accurate. 900mm/s is the maximum speed I thought was safe before I started to lose step.
    I also tried to use the raw data from the oscilloscope to calculate and display the average "voltage consumption" during the operation.
    It turns out that this is more difficult than I expected, so the results are only indicative - that is why no figures are provided. Anyway:
    The two figures show voltage and current with "Local RMS", which is more or less the average effective value.
    We can see that as the speed increases, we need to apply more and more voltage until the limit is reached, at which time the current will drop a little. Two important conclusions can be drawn from these charts:
    • We can never provide 100% power supply voltage because we need to change the current ->we need some time to let it drop.
    • At high speed, we cannot provide full power for the motor.


Benefits of higher supply voltage
     Maybe some people have realized that in most measurements, I use 32V instead of 24V power supply. Indeed - I upgraded my machine to 32V, which is why I decided to play with my oscilloscope and compare the two options.
    Is it worth it? really
    Using the previous setting parameters, the waveform shape looks much better, and the current amplitude is about 60% higher than before, which means that there is better stability and higher margin before the motor starts to lose step. On the other hand, I can print at a fairly high acceleration, even up to 1200 mm/s, rather than a higher safety margin! This is not to say how much it means for FDM printers But I am very satisfied with the result.


Summary and suggestions!
    Even a few volts difference will improve the operation of our stepper motor driver or let us reach a higher speed. Sometimes higher printing speed will lead to lower print quality, but this is usually not a big problem. At least we can improve the travel speed, which will not only reduce printing time, but also help shrink adjustment.
    With all the knowledge we have gained, we can now more confidently choose motors for our machines. So:
    Ensure that the rated inductance and resistance of the motor are as low as possible
    For drivers like TMC2208 or TMC2130, the motor with rated current of 1.5-1.7A should be the best
    For TMC2209, TMC2660 and TMC51X0, the rated current is 2.0 – 2.5A
    Select the motor power voltage as high as possible, but carefully check the rating of your drive and motherboard!
    Personally, I think that in the next few years, we will see more and more 36V and higher versions of 48V motherboards used for Reprap/commercial 3D printers, so our machines will become better and better, and the speed available will be improved. The only disadvantage is that the heater is usually designed for 24V - but maybe this will also change!


Instruments used:
    Silent SDS 1104X-E oscilloscope
    HANTEK CC65 current probe
    150W Mingwei power supply
    CoreXY 3D printer
 












   
      
      
   
   


    Disclaimer: This article is transferred from other platforms and does not represent the views and positions of this site. If there is any infringement or objection, please contact us to delete it. thank you!
    矽源特科技ChipSourceTek