 Hello, and welcome to today's webinar, Solutions for Stepper Motor Control from Theory to Practice. My name is Erie Keperda and I'm Product Marketing Engineer responsible for motor drivers at ST Microelectronics. Thank you for taking time out and being here today. Today, we will be looking at the following, Stepper Motor Theory, ST Solutions for Stepper Motors, PowerStep 01 Advanced Stepper Driver, ST Evaluation Tools for Stepper Motors, Tips and Tricks, Technical Support, and we will be running a live Q&A at the end of the webinar. Let's start with a short Stepper Motor Theory. A stepper motor is a brushless, synchronous electric motor. The electrical pulses are converted into mechanical shaft rotation. ST Motor Drivers supports the bipolar configuration of stepper motors. A bipolar stepper motor has two coils or phases. Each coil can be energized positive and negative depending on the current flow. There are four total combinations how the magnetic field inside the motor can be created. Case number one, both coils A and B are energized positive because both current flow positive with respect to the rotor reference position, lower right quadrant. Case number two, coil A is energized negative, the coil B positive, the rotor moves to the lower left quadrant. Case number three, both coils A and B are energized negative. The rotor moves to the upper left quadrant. Case number four, coil A is energized positive and coil B negative. The motor moves to the upper right quadrant. We need to perform four electrical steps in order to complete one mechanical rotation in this simplified picture. Most stepper motors have a step angle of 1.8 degree. It means there are 200 steps required to make one full mechanical rotation. It is possible to increase the number of mechanical positions of the rotor between two consecutive steps. This can be achieved by changing the levels of the current using two sinusoidal profiles delayed by a 90 degree. We will get a sine and cosine waveform. Each position of the rotor can be achieved applying the proper pair of currents to the phases. This pair is determined by the sine and cosine values of the target value. The microstepping technique theoretically allows us to achieve any position of the rotor. The numbers of levels in which a single step is divided represents the microstepping resolution. For example, in quantum microstepping, the single step is divided in four microsteps. Four step plot pulses are needed to perform a single step movement. Increasing the microstepping resolution results in a smoother profile in a higher number of step plot pulses per each mechanical step. The main advantage of the microstepping is the smoother operation compared to the full or the half step. The step movement is split in sub-movements, so the resulting rotation is more continuous. The main drawback is the reduction of the maximum output torque at the same maximum current. In fact, in microstepping, the motor phases are driven with the maximum current one at a time. The sine peak corresponds to the cosine zero crossing, whereas in full step mode, both phases can be driven at the maximum current at the same time. Each phase of two phases bipolar stepper motor is driven by an H-bridge power stage. ST current mode control devices like L6400 family, power step 01, apply a non-dissipative current sensing and PWM techniques in order to implement a feedback current control in each of two phases. They are shunned in this particular picture as only an illustrative purpose. The bridge topology ensures that the motor can spin in two directions. At the power-up, the motor is energized in one direction. The phase current high-phase rises in given direction according to the motor electrical characteristics. When the IP current level is reached, indicated by VRAP level on R-shun resistor, the starting phase is over and the decay is applied. The current flows diagonally through high side and low side MOSFETs. The RDS on MOSFETs are neglected here for simplicity. However, the proper calculation of the power losses in the H-bridge is important. Next step is slow decay. During the slow decay, the phase current at a circuit wave only in the high side or only in the low side switches of the power bridge. The current is reduced only using the RL discharge. Lower current ripple, lower noise and power dissipation are the advantages for slow decay mode. The current decrease ratio may occasionally be insufficient due to the fixed off-time scheme. During on-time phase, the current increases in the original direction diagonally through the high side and low side switch. The IP current level is sent again and triggers next step, fast decay described on the next slide. During the fast decay, the supply voltage is applied in a reverse polarity. This brings more effective control action at the cost of increased current ripple, higher noise and power dissipation. I would like to stress here to not forget the properly sized bus capacitor which can absorb the energy coming from the motor during the fast decay. An efficient strategy of appropriate decay mode has to be adopted by the control algorithm in order to achieve accurate control of the desired current profile. The current control algorithm consists in continuous selection of the right decay which has to be applied and finding the best trade-off between slow and fast decay and setting of its actual duration. The current control in SD products is realized by peak current control with fixed off-time for L6200 family drivers, peak current control with adaptive decay for L6474 driver and predictive current control for the drivers with digital motion engine. Next few slides will describe SD motor control solutions for stepper motors. We are offering a broad portfolio of stepper motor drivers starting with a device for mobile and portable applications up to the system in package solution which can handle up to 85 volt and 10 m rms. The driver from SD Spin 200 family is dedicated for mobile and portable applications with low quiescent current requirement. SD Spin 800 family extends the voltage range up to 45 volt. Typical applications are ATM machines, 3D printers, medical devices and industrial applications for example when controlled. The L6400 family represents the advanced stepper motor drivers with digital motion engine built in. These drivers have advanced algorithm options and high-level commands over the SPI. These features allows to customers build more complex system like stage lighting, factory automation and high complex industrial tools with several stepper motors. The PowerStep 01 is the very first driver based on system in package technology. All drivers are protected by a set of protections which include overcurrent and thermal protection. Let's have a look more in detail what is inside of SD Spin 220 stepper driver. The voltage range is from 1.8 volt to 10 volt which is one of the lowest in the industry. Two full edge bridges can energize the coils of the bipolar stepper motor up to 1.3 m rms due to the low rds zone which is 400 milliamps measured across the high side and low side together. The SD Spin 220 has a step clock and the direction pin for PWM control with programmable off time. The microstapping resolution is 1 over 256 microsteps. One of the key requirements for mobile or portable applications is a quiescent current. The SD Spin 220 has only 80 nano m leakage current in sleeve mode due to the fact that the entire logic is disconnected from the power supply using a built-in semiconductor switch. The driver is protected with full set of protections. Non-dissipative overcurrent protection, cross conduction protection, thermal shutdown and undervoltage lockout. The SD Spin H20 driver can be used up to 45 volt and can handle 1.5 m rms with 2.5 m peak. The SD Spin 820 has a similar feature like SD Spin 220. It has one over 256 microstapping resolution. Current control is programmable off time, low standby power consumption and same set of protections. Overcurrent protection, thermal shutdown, cross conduction protection and undervoltage lockout. The SD Spin 820 has a 4x4 QFN package. The L6400 series are the drivers with digital motion engine and advanced control algorithm. All drivers from this family are using the SPI bus. The SPI bus is used for a communication with the microcontroller for register configuration and on-flight diagnostic. The L6400 family provides predictive current control algorithm for an accurate positioning and the adaptive auto-regulated decay provides the system stability and low noise. The L6470 and the L6480 drivers with SD patented voltage walk algorithm can improve the noise performance further. The L6470 and L6472 are monolithical drivers with current capability up to 3 m rms based on the package selection. The L6480 and L6482 are controllers which allows to adjust and customize the power stage, selecting the proper MOSFETs according to design requirements. The monolithic drivers operating voltage range is between 8V and 45V. The controllers can operate up to 85V. The PowerStep01 is the most advanced driver from SP portfolio for stepper motors. Both control modes are available. The current control mode like L6472 and L6482 and also voltage mode like L6470 and L6480. The PowerStep01 besides all features available at L6400 family offers also enhanced current capability and thermal performance. The PowerStep01 thanks to the system in package topology can achieve up to 10 m rms current. The eight discrete MOSFETs are integrated together with a digital motion engine controller in one single high performance UFM 11 by 14 mm package. The system in package solution reduced the PCB area by 67% and the integration improves the performance and reduces the build of material. More details about the electrical performance of PowerStep01 is on the next chapter. The overview of the electrical characteristics of PowerStep01. The operating voltage range is between 7.5V and 85V. Low RDS on MOSFETs which are built inside the package allows you to energize the coils of the stepper motor up to 10 m rms. One of the key factors important to achieve such a high current is also proper PCB layout. The PowerStep01 has a built-in overcurrent protection based on MOSFET drain source drop. The microstepping resolution is one over 128 microsteps in the voltage mode and one over 16 microsteps in the current mode. The sensor left stall detection is available in voltage mode and allow the system to detect when the motor stalls. The digital motion engine makes the speed profiling easy using the high-level commands. This is accomplished by high-speed 5 MHz STI interface with daisy chain compatibility. It has integrated 16 MHz oscillator, integrated 5-speed A2D converter, and 15 and 3.3V regulators are part of the controller. The PowerStep01 is protected by overcurrent protection, thermal shutdown and undervoltage lockout. These fault conditions can be monitored by status register. Now there is a time to talk about integrated intelligence built inside the PowerStep01. The architecture shown here is an example of pre-axis control system before PowerStep01 integration. The system MCU controls three dedicated MCUs with lower-level routine, directly driving stepper controllers with gate drivers and MOSFETs. The GPIOs of the dedicated microcontroller are connected to step clock and direction inputs on the controller side. New architecture with PowerStep01 brings completely new approach, not only integrated several components of the system in one single package, but it brings also the control scheme to the new level. As you see, overall the pre-axis system was significantly simplified to four main blocks, one system MCU and three PowerStep01 directly driving three stepper motors. MCU and drivers are connected via high-speed SPI bus. There is no more dedicated MCU to perform speed profile and position calculations. The digital motion engine will take care of those calculations. The PowerStep01 has a fully digital interface to MCU. One single MCU can control multiple daisy chain drivers over the SPI bus. Program-able Allen flag open drain output can be used as a trigger for an interrupt routine. Busy open drain output allows the MCU to know when the last command has been performed. In daisy chain configuration, busy pins of different devices can be or required to save host controller GPIOs. Busy pin can be used as a sync signal, giving a feedback of the step clock signal to MCU. The PowerStep01 can accept different types of commands, constant speed command, absolute position command, a relative position command, and there is also step-clock mode. In step-clock mode, the motor motion is defined by step-clock signal applied to the step-clock pin. At each step-clock rising edge, the motor is moved one microstep in the program direction and absolute position is consequently updated. A constant speed command produces a motion in order to reach and maintain a user-defined target speed started from program minimum speed set in the minimum speed register and with the program acceleration and deceleration value set in the acceleration and deceleration register. A new constant speed command can be requested anytime. An absolute position command produces a motion in order to reach a user-defined position that is sent to the device together with the command. Motion commands produce a motion in order to perform a user-defined number of microsteps in user-defined directions that are sent to the device together with the command. Move command, perform a motion of number of steps in the selected direction. This command can be performed only when the motor is stopped. Go to target command. Reach the target position using shortest path. This command can be performed only when the motor is stopped or is running at constant speed. Go to direction command. Reach the target position moving the motor in the selected direction. This command can be performed only when the motor is stopped or is running at the constant speed. In most applications, the power-up position of the stepper motor is undefined, so an initialization algorithm driving the motor to a known position is necessary. The go until and release switch command can be used in combination with an external limit switch input. The go until command moves the mechanical load at the constant speed until the switch input is forced load. When this event occurs, one of the following actions can be performed. ABS underscore POS register is set to zero and the motor decelerates to zero. ABS underscore POS register value is stored in the mark register and the motor decelerates to zero speed. The release SW command moves the mechanical load with program minimum speed until SW input is forced high. When this event occurs, one of the following actions can be performed. ABS underscore POS register is set to zero, meaning home position, and the motor immediately stops. ABS underscore POS register value is stored in the mark register and the motor stops immediately. Similarly, as a hard stop command, the power stepper one has two fundamentally different modes, current peak control mode and voltage mode control. On the left side, you can find the sinusoidal curve typical for microstepping. On the right side, you can find zoom in of this waveform, specifically focusing on the change from one current level to the next one. We can make few observations, abrupt current change and change in the switching period. Those factors lead to more jerky and noisy motion compared to voltage modes driving. Also, the peak current control technique brings into the system a systematic error due to the difference between the peak current and the average current during steady state conditions. This error leads to an accurate position. Very similar picture for voltage mode. In voltage mode, the system applies a sinusoidal voltage to motor and phase. The phase current is not directly controlled. It is open loop approach. It takes more clock cycles to move from one current level to another one, which is a consequence of keeping the switching frequency constant. In this case, the system works like the low pass filter. The torque ripple is under control and the average current is under control. Overall, the voltage mode provides more softer and silent operation. Now, we can summarize the trade-offs between voltage mode and current mode. The voltage mode allows true 1 over 128 microstep resolution. It has outstanding smoothness at low speed. It allows a stall detection. There is no need for shunt resistor and we can achieve very precise positioning. On the other side, the current control mode provides better torque control at high speed. It is less sensitive to the vibration and is more robust to mechanical resonance. The gate driver setup depends on the application requirements and finding the right values is more complex because several parameters are in the game. The same gate charge value can be obtained by using different combinations of TCC and iGate. Both parameters TCC and iGate are programmable. The gate current can be set to one of the following values 4, 8, 16, 24, 32, 64 and 96 milliamps through the iGate parameter in the gate CFG register. Controlled current time can be programmed within range from 125 nanoseconds to 3.75 microseconds with a resolution of 125 nanoseconds. If we increase the iGate value, the power dissipation is lower, but the EMI will increase. If we increase the TCC time, the power dissipation is higher, but the EMI is lower. We can see here the same tradeoff between TCC and iGate from different perspectives. A higher gate current allows reducing the commutation time. It means the slew rate is higher, but there are more harmonics. It means more EMI. On the other side, longer commutation time requires less gate current with positive impact on the EMI performance. Due to the slower slew rate, the power dissipation will increase. Be careful here. During the bridge commutation, a dead time is added in order to avoid cross-conductions. The dead time can be programmed within range from 125 nanoseconds to 4 microseconds with a resolution of 125 nanoseconds. The duration of blanking time is programmable through the T blank parameter in gate CFG to register. We prepared for your convenience this lookup table where you can find different slew rate settings for the corresponding parameters. The evaluation system is based on the nuclear platform with STN32 and STN32 Open Development Environment. The STN32 Open Development Environment is an open, flexible, easy, and affordable way to develop innovative devices and applications based on the STN32 microcontroller family combined with other state-of-the-art ST components connected via expansion boards. It enables fast prototyping with leading edge components that can be quickly transformed into the final designs. The STN32 ODE includes the following five elements, STN32 Nuclear Development Boards, STN32 Nuclear Expansion Boards, STN32 Cube Software, STN32 Cube Expansion Software, and STN32 ODE Function Tax. The ex-nuclear IHM-03A1 is a compatible with the Arduino Uno R-free connector and supports the addition of other boards which can be stacked to drive up to three stepper motors with a single STN32 nuclear board. The connector allows to connect also other nuclear shield boards with connectivity ICs and wide range of ST MEMS and sensors. The thermal performance is limited due to the form factor of the PCB. The X-Cube SPN-3 is an expansion software package for STN32 Cube. The software runs on the STN32 and includes driver recognition for PowerStep 01 device. The expansion is built on STN32 Cube software technology to ease portability across different STN32 microcontrollers. It is compatible with the Nucleo F401, Nucleo F030, Nucleo F334, and Nucleo L053 boards connected to one, two, or three ex-nuclear IHM-03A1 STN32 expansion boards. The software comes with a simple implementation of the drivers to control a stepper motor. The SPIN Family Evaluation Tool is a Windows-based software whose purpose is to control assist in family devices. It requires the Microsoft.NET tool framework. Device configuration can be done through a registry editor, a user-friendly configuration panel, or a wizard. The wizard contains predefined configurations for existing demonstration boards and allows easily configuring the devices. Configurations can be stored and loaded. For the Nucleo board IHM-03, we will select Nucleo tab, correct COM port, and PowerStep 01 option. The main dashboard gives us an access to all features and configuration settings. The indicators provide us visual feedback from the status register. Now it's time to watch video with live demo prepared by my colleague Rosario. Hello everyone, this is Rosario Tanasio, Applications Manager for ST Micro Electronics. In this part of the webinar, I will show you how simple and quick it is to spin a stepper motor using ST Ardor and software tools. The demonstration will take just a couple of minutes, so let's dive in. The Ardor and software I'm going to use consists of a Nucleo board STM-32 F401RE, an expansion board with PowerStep 01, the IHM-03A1, a power supply capable of providing 12V 1.5A such as the EVL STCH-336W SR, a power stepper motor, a USB cable, the spin family software GUI SW Spin002, which is available on ST.com and a laptop. Here is a picture of the final hardware setup. Once the Nucleo board is connected to the laptop and 12V are applied to the SHIELD board, the next step is to upload the firmware to the MCU. The firmware is located in a dedicated folder of the Spin Family Evaluation Tool. By default it can be found under start menu all the programs, ST microelectronics, and here you will find the shortcut to firmware. In this folder you have all the binary files relative to the supported STM-32s. We will choose the STM-32F4, drag and drop this file to the Nucleo device, which will be seen as a mass storage device. You can close this window and double click on the Spin Family Evaluation Tool icon. We select the power step 01, close this window, and check that the board is connected. If the board for any reason is not connected, from this connected to board icon we can connect or disconnect the Nucleo board. At this point we will read and clear the status registers and open the wizard. Click on next and we can select between the voltage mode and the current mode configuration. I will choose the current mode configuration and click on next. Here we can select the advanced current control settings. First of all I will set the value of the sensor resistor for the IHM-03A1, it is 100 million. Then I will select the value of run, hold, acceleration, and deceleration current. For this demonstration I will choose one amp for each of them. Okay, click on next. From here we can select the gate driver settings. For this demonstration I will keep the recommended ones and click on next. In this window we can choose the speed profile settings. First of all we will define the step mode. We can choose between the full half and the microstep. I will select microstep 01 over 64 steps, then I will select the value of the maximum speed 1000 steps per second and the full step speed of 700 steps per second. The full step speed is the speed at which the controller will transition from microsteping operation to full step and I will click on next. In this window we can select the alarms relative to the protection supported by the power step 01. I will keep the default configuration and click on next. Here we can check the summary of all the settings that we have chosen. We can save this configuration to file, providing a name, test, click on save and finally write the configuration to the device. Click on okay and close this window. From the speed tab I can access the speed configuration register. I can set a running speed of 400 steps per second. Click on run the motor will start. On the oscilloscope you can see waveform is a sinusoidal. This is the current in one of the two phases of the bipolar stepper motor. It has a sinusoidal shape which is typical of the microsteping operation. Now I will change the speed to 900 steps per second. Click on run on the oscilloscope you can see now the current waveform has changed because we have set up the 700 steps per second the transition speed from microstep to full step. Finally we can stop the motor by choosing the hard hi-z option which will put in impedance the two MOSFET bridges inside the power step 01. We have now reached the end of this demonstration. Thank you very much for your attention and for more information please visit www.st.com. Thank you very much Rosario for your demo and now there is a time to share some tips and tricks. Now I would like to share with you some experience with my customers. One of the most common questions I'm receiving from the customers is I'm losing the torque at the higher speed. What is your recommendation? Let's have a look more in details step by step. First of all I would like to stress the need of using the current probe. Figure one show nice sinusoidal current waveform for phase current of 1m at the speed of 800 steps per second. Now if we increase the speed to 1000 steps per second as shown on the picture 2 we can observe some waveform distortion. Instead of having a nice sinusoidal curve as on the picture 1 the current waveform became more triangular type of waveform rather than sinusoidal. Clearly the current is not following the ideal reference curve. If we are increasing the speed further as on the figure 3 clearly the current waveform becomes now pure triangular waveform indicating the limits of the system. What is the root cause? Is the driver limit or step promoter limit? Let's have a look on the figure 4 where we increase the speed again to 1400 steps per seconds. Now we can observe that also the amplitude has decreased. There are two factors which are causing this phenomenon. The back EMF is directly proportional to the speed so we will get higher back EMF at the higher speed. This back EMF is stealing the available voltage from the power supply. The second reason is the general behavior of the impedance with resistance and inductance in series past the corner frequency. We can neglect j omega L term at lower frequencies. Once we pass the corner frequency the impedance will increase and it will be directly proportional to the frequency. As an outcome the amplitude will be smaller. There are two possible solutions replacing the current motor with a motor with lower inductance and the second solution can be more complex since it requires a gearbox. Another very common question is if the driver can compensate the loss of the torque at the higher speed. First let's compare those two waveforms. Both pictures are showing current waveforms at the same speed. The waveform on the left side has a half step resolution and the waveform on the right side shows the current waveform at the full step. The area under the curve is a smaller at the half step resolution than at the full step. In order to get more torque we need more energy meaning more area under the curve. If we are able to switch from microstepping in this case from half stepping to the full step resolution we can boost the torque. The power staple one has built-in feature which allow you to boost the torque at a higher speed. When the motor speed is greater than a programmable full step speed threshold the device switches automatically to full step mode. The driving mode returns to microstepping when the motor speed decreases below the full step speed threshold. Going back to the microstepping ensures again the smooth and high resolution. The boost threshold is set through the related parameter in the fs underscore spd register. The sd nuclear ecosystem has also solutions for those who would like to evaluate and test more complex systems for example with more than one stepper motor. The nuclear ecosystem this power staple one allows to build a system with up to three ihm zero three a1 evaluation boards in order to ensure proper communication over the sdi bus small hardware modifications are required. Quick overview is on this slide and more details about zero ohm resistor placement can be found in the user manual um 1910. Once we finish the hardware modifications we can put those boards together and now they are ready for the complex and advanced testing. If the hardware was properly modified and connected you should observe two or three highlighted rectangles on top of the main control window. It depends on the number of connected boards. If not please double check the hardware modifications again. Now you can control both motors at the same time from one window. The limit of free evaluation boards come from the nuclear hardware and the number of boards can be expanded up to eight evaluation boards with evl power step 01 board is necessary. The last feature which I would like to mention here is the built-in python-based script editor. The python and its extension for motor control is a very powerful tool for more intensive evaluation of the prototype especially if we are running systems with several motors performing complex speed profiles and also it can be used as a demonstrator or proof of concept in front of your management. We are approaching the end of today's webinar. We understand how important is the technical support for our customers. There are several ways how you can obtain more information. You can always go on www.sp.com for more information or you can contact us through the distribution channels or directly through the sales reps in your territory. This presentation includes the list of frequently asked application notes for your future reference and also on the next slide you can find the extensive list of evaluation boards for our stepper motor control. Thank you very much for your attendance.