AN4144 STMICROELECTRONICS | Alldatasheet
Document overview
- Manufacturer or author: Provided By ALLDATASHEET.COM(FREE DATASHEET DOWNLOAD SITE)
- PDF pages: 28
Technical content
Datasheet sections
- 1 Voltage mode driving
- 1.1 Basic principles
- 1.2 Back EMF compensation algorithm
- 1.3 Motor supply voltage compensation
- 1.4 Compensation of thermal drift of the phase resistance
- 2 Tuning of the BEMF compensat ion parameters
- 2.1 Collecting the application characteristics
- 2.2 First dimensioning
- 2.2.1 Holding, acceleration, deceleration and running currents
- 2.2.2 Compensation register values out of range
- 2.3 Fine tuning
- 2.3.1 Step 1: verify the phase current during the speed sweep
- 2.3.2 Step 2: adjust t he starting amplitude (KVAL)
- 2.3.3 Step 3: adjust the intersect speed value
- 2.3.4 Step 4: adjust the starting and final slopes
- 2.3.5 Step 5: final check
- 3 Supply voltage compensation guidelines
- 4 Thermal drift compensation guidelines
- 5 Stepper motor resonances
- 5.1 The effects of the resonances on Voltage mode driving
- 5.2 Facing resonances
- 5.2.1 Damping resonances using the mechanical load
- 5.2.2 Reducing motor current
- 5.2.3 Skipping the resonance points increasi ng the acceleration
- 6 Revision history
Voltage mode control operation and parameter optimization Enrico Poli Introduction Voltage mode driving is the stepper motor driving method patented by STMicroelectronics® which improves the performance of classic control systems. This driving method performs smoother operation and higher microstepping resolutions and is the best solution for applications where high precision positioning and low mechanical noise are mandatory. This application note describes the operating principles of Voltage mode driving and the strategies for the regulation of the control parameters in order to fit the application requirements. The application note also investigates and provides solutions to one of the most common issues in Voltage mode driving systems: the resonances of the stepper motors.
AN4144 Voltage mode driving
1 Voltage mode driving
This section describes the basic principles of Voltage mode driving and its implementation in STMicroelectronics devices with a focus on the compensation of: The back electromotive force (Section 1.2 on page 7) The motor supply voltage variation (Section 1.3 on page 11) The thermal drift of the phase resistance (Section 1.4 on page 12).
1.1 Basic principles
The classic current mode driving method limits the phase current to a reference value using a comparator and a current sensor (usually an external resistor). This control is the most intuitive but brings with it some drawbacks: the current ripple can be significant and obtaining an acceptable control of the current can be challenging. In trying to solve these problems, current control algorithms were made more and more complex, including techniques such as fast decay and mixed decay. With the introduction of microstepping in stepper motor driving a new current control algorithm limit became evident: the analog circuitry and the control loop should be able to manage lower currents with higher resolution. Voltage mode totally changes the control approach implementing an open-loop control: a sinusoidal voltage is applied to the motor phases and the electro-mechanical system response with a sinusoidal current. Note: Due to its principle of operation, Voltage mo de driving is not suited to full step driving. The best performance is always obtained using microstepping operation. This result can be obtained through the analysis of the stepper motor electrical model. Equation 1, extracted from the model in Figure 1, shows how the current of a generic motor phase is related to: Phase voltage V PH Back electromotive force (BEMF) Phase resistance (Rm) and inductance (Lm). The back electromotive force is typically a sinusoidal voltage with frequency and amplitude proportional to motor rotation speed. The BEMF frequency (fel) is equal to one quarter of the rotation speed expressed in steps per second (fSTEP); this frequency is exactly the same as the hypothetical current sine wave that should be applied to the motor phase in order to make the motor turn at f STEP step rate. The BEMF amplitude is proportional to step frequency through a linear coefficient ke: this parameter depends on motor characteristics and structure (rotor material, coil turns, etc.).
AN4144 Voltage mode driving Equation 2 Equation 3 Equation 4 Starting from Equation 2, it is possible to obtain the voltage amplitude which, when applied to the motor phase, makes the amplitude of phase current constant. The basic principle of Voltage mode control is based on this relationship. The resulting formula (Equation 5) shows how the voltage amplitude is a complex function of phase current, motor parameters and other factors. Equation 5 Resolving this equation, to obtain the phase voltage to be applied for various speeds, is very complex and computationally onerous. In addition, the phase relationship between the current and the BEMF phasors () is difficult to measure or evaluate for a specific application. The STMicroelectronics control method, starting from this complex model, implements an effective driving strategy that overcomes these issues with the classic current mode control method in most microstepping applications.
1.2 Back EMF compensation algorithm
In order to devise a simple but effective compensation method, consider the formulas in Equation 6. In this manner, the dependence on the load angle () can be removed, obtaining a formula which allows the evaluation of the VPH voltage that is able to produce a constant IPH current independent of the motor speed (or its equivalent fel). Equation 6 Using this formula, a compensation algorithm that gives the phase voltage amplitude (VPH) for a target phase current (IPH) and motor speed (fel) is defined. IPH fel VPH fel BEMF f el+ 2--- –= Tq Kt IPH cos K t IPH 2--- – Kt Nm/A Ke V/Hz= VPH 2 Rm 2 2fel 2 Lm 2+ IPH 2 ke fel 2+= 2 2fel 2 Lm + cos– VPH R m i2fel Lm+ IPH VBEMF fel+ VPH Rm 2 2fel 2 Lm
fel << R/L) and when it is high (2fel >> R/L). simplified model described by Equation 7. (i.e. motor speed is greater than intersect speed). These parameters are listed inTable 1. Table 1. BEMF compensation parameters in order to obtain the target current value. compensation slope that should be used. speed is lower than intersect speed. speed is higher than intersect speed.
voltage values must be normalized to the supply voltage of the power stage (Figure 3). Figure 3. BEMF compensation curve
than the supply voltage, the phase current cannot reach the expected value (Figure 4). Figure 4. Maximum output current limitation example Table 2. BEMF compensation parameters normalized to the supply voltage (V
1.3 Motor supply voltage compensation
errors on the output voltage and then on the phase currents. significant voltage fluctuations, due to various factors, e.g.: variations of load conditions. a compensation system that increases the supply voltage rejection of PWM modulator. compensate for its variations. Figure 5. Supply voltage compensation system
Voltage mode driving AN4144 large enough to obtain the target current (maximum output current limit has been reached) and the compensation algorithm fails.
1.4 Compensation of thermal drift of the phase resistance
During operation, the motor dissipates energy and increases its temperature, therefore the phase resistance. The relationship between phase resistance and temperature is shown in Equation 11: the change in the phase resistance is proportional to the temperature variation, its nominal value (phase resistance at room temperature T0) and the temperature coefficient () of the material composing the coil. Equation 11 As described in previous paragraphs, the voltage to current relation depends on different motor parameters, including phase resistance (Rm in Equation 1 on page 6). In particular, a higher phase resistance reduces the load current at the same applied voltage. The duty cycle of the PWM output is multiplied by a scalar factor in order to compensate for the resistance variation.
AN4144 Tuning of the BEMF compensation parameters
2 Tuning of the BEMF compensation parameters
This paragraph describes how the BEMF compensation parameters can be tuned in order to obtain the best results. Setting the correct compensation parameters is fundamental to Voltage mode algorithm performance. The tuning sequence can be divided into the following steps: Collecting the characteristics of the application and motor (Section 2.1) Obtaining a preliminary set of parameters (Section 2.2) Tuning the parameters in order to obtain the needed results (Section 2.3 on page 17).
2.1 Collecting the application characteristics
The compensation system is based on the electrical model of the stepper motor, so its setup is strongly dependent on the motor characteristics. The required information is: Resistance of the motor phase (Rm) Inductance of the motor phase (Lm) Electrical constant of the motor (ke). The Rm and Lm values are usually reported on the motor datasheet. They can also be measured with common measuring instruments. If the user has an RLC meter, they can connect it to one of the motor phases and measure the series R and L at 100 Hz (make sure the motor does not move). The resulting values are considered to be R m and Lm. If they do not have an RLC meter, the Rm can be measured using a bench multimeter applied to one of the phases. To measure the Lm, use the following procedure: Connect a DC voltage at one motor phase and apply the voltage and current probes of the oscilloscope, as shown in Figure 6 A Increase the voltage up to the value where the current equals the nominal value For a better measurement, lock the rotor position Unplug one terminal of the voltage source cable without switching it off and disable (or set to the max.) the current limitation Connect the voltage source rapidly and monitor, on the scope, the voltage and current waveform The measurement is good if the voltage trace is similar to a step and the current increases exponentially (Figure 6 B) Measure the time for the current waveform to rise up to 63% of the nominal value (Figure 6 B) This time is equal to the Lm/Rm ratio.
2.2 First dimensioning
stepper motor described in Section 1.1 on page 5. optimization of the control system. integrated into the L6470 evaluation software.
2.2.1 Holding, acceleration, d eceleration and running currents
The BEMF compensation system allows different current values according to motion status. The different current values are set through a specific set of registers, as shown in Table 4. Table 3. BEMF compensation register values according to application parameters Table 4. Motor status and BEMF compensation registers relationship
ST_SLP and FN_SLP_ACC parameters. setup (INT_SPEED, ST_SLP and FN_SLP_ACC), so the two currents are closely related. minimum constant speed current (Figure 9). Figure 9. Running current limit
2.2.2 Compensation regist er values out of range
range of the respective registers. target current and motor characteristics) are not consistent and they should be changed. Target current is not achievable. attention should be paid to the intersect speed region. 4 (Rm/2Lm) ≈ 15920 steps/s -> maximum value should be used.
AN4144 Tuning of the BEMF compensation parameters If one or more of the compensation slope parameters (ST_SLP, FN_SLP_ACC and FN_SLP_DEC) exceeds the maximum value, the motor supply voltage is not enough to counteract the BEMF voltage increase. The maximum compensation rate is 0.004% of the bus voltage at step/s. Considering a starting KVAL value equal to zero, this compensation rate reaches 100% of the bus voltage at a rotation speed of only 250 step/s. So a high compensation value does not correspond to any real application. The application parameters (supply voltage, target current and motor characteristics) are not consistent and they should be changed.
2.3 Fine tuning
In some cases, the results obtained after the first dimensioning of the BEMF parameters (Section 2.2) do not fit with the performance required by the application. In these cases the optimal compensation can be obtained by fine tuning the system. Performing these adjustments requires a current probe that is able to measure the phase currents over the entire operating range of the application. The following procedure describes how to tune the acceleration parameters of the BEMF compensation system (KVAL_ACC, INT_SPEED, ST_SLP and FN_SLP_ACC). Replacing the KVAL_ACC and FN_SLP_ACC values with the respective deceleration parameters (KVAL_DEC and FN_SLP_DEC), the same procedure can be used to tune the BEMF compensation in the deceleration phase. Intersect speed and starting slope parameters are shared by both the acceleration and deceleration compensation setups (Section 2.2.1), so their tuning should be performed one time only.
2.3.1 Step 1: verify the ph ase current during the speed sweep
The most important step in the fine tuning of the BEMF compensation system is the analysis of the result obtained through the first dimensioning procedure. This check can be performed monitoring the phase current of the motor during a slow acceleration (e.g.: 200 - 400 step/s2) up to the maximum speed of the application. If the amplitude of the phase current is constant during the entire acceleration, the BEMF is well compensated. Otherwise, the BEMF compensation parameters should be tuned. Figure 10 shows an example of sub-optimal BEMF compensation obtained using the first dimensioning formulas (target peak current equal to 1 A).
Figure 10. Speed sweep with first dimensioning parameters
2.3.2 Step 2: adjust the starting amplitude (K VAL)
- Copy the first dimensioning value of the parameter into the KVAL_HOLD register.
- Set the electrical position register EL_P OS to one of the full step position values
- Turn on the device outputs sending a HardStop command to the IC (only one phase of
other outputs are forced to ground through the low-side MOSFETs).
- Measure the driving current and adjust the K VAL value in order to obtain the required
Table 5. Output current according to the electrical position 0x000 OUTB1 source, OUTB2 sink. OUTA1 and OUTA2 shorted to ground. OUTB1 and OUTB2 shorted to ground. OUTA1 and OUTA2 shorted to ground. OUTB1 and OUTB2 shorted to ground.
2.3.3 Step 3: adjust the intersect speed value
The most important parameter in the BEMF compensation algorithm is the intersect speed. which has been obtained during the first dimensioning. e.g.: in Figure 11 the optimal intersect speed value is about 138.9 step/s. Figure 11. Evaluation of the optimal intersect speed value
2.3.4 Step 4: adjust the starting and final slopes
the phase current during a series of speed sweeps. value must be reduced, otherwise it must be increased. part of the acceleration must be considered (Figure 13).
2.3.5 Step 5: final check
may be displayed when long time acquisitions are performed. Figure 14. Final check acquisition showing artifacts Split the acceleration into more parts. Figure 15. Magnified acquisition verifies the presence of artifacts
Supply voltage compensation guidelines AN4144
3 Supply voltage compensation guidelines
The effectiveness of the compensation is strongly dependent on the actual duty cycle value because the system is not able to overcome the maximum duty cycle of 100%. When the variations of the application supply voltage make the use of the compensation system essential, the maximum target current is limited by the lower voltage value which is expected from the power supply output. For this reason, the application setup, i.e. motor characteristics and phase currents, should be chosen considering the minimum expected supply voltage. For example, suppose 85% of the 24 V bus is needed in order to reach the target current at 1000 step/s. If the bus voltage is reduced by 20% (i.e. the actual voltage is: 24 V 0.8 = 19.2 V), the compensation system increases the duty cycle by a factor of 1/0.8 = 1.25. In this case the resulting duty cycle is 106.25%, which is greater than the maximum available value (100%). Example 3 VBUS = VBUS,nom = 24 V -> DutyCyclePWM at 1000 step/s = 85%
AN4144 Thermal drift compensation guidelines
4 Thermal drift compensation guidelines
The compensation of the thermal drift of the phase resistance is not automatically performed by STMicroelectronics devices, but a compensation factor (KTHERM) is made available through a dedicated register. The thermal compensation factor (KTHERM) is a scalar value between 1 (no compensation) and 1.5, which is applied to the PWM value obtained by the other compensation systems (BEMF compensation and supply voltage compensation). As shown in Equation 11 of Section 1.4 on page 12, the thermal drift of the resistance is directly proportional to the nominal resistance value (Rm,T0) and the temperature variation. For this reason the thermal drift compensation becomes more important when the driven motor has a high phase resistance value. A suggested implementation of the thermal drift compensation is based upon the phase current measurement during the non-operative period of the motor (if present). The proposed method requires an initial calibration of the system (performed when the motor is cold) and described by the following sequence: 1. The motor is stopped in a specific electrical position. 2. The overcurrent or stall detection threshold is set to a calibration value (I cal). 3. The output voltage is increased at a low rate through the KVAL_HOLD parameter. 4. When the calibration current is reached, the respective KVAL_HOLD value must be stored (KCAL) in the MCU memory. Since the KCAL value is related to the design parameters only, this calibration can also be performed during the design of the application. However, because of the variation of the application characteristics (bus voltage, motor phase resistance, etc.) and the device circuitry (current sensing), it would be useful to perform the calibration sequence on each system instead of defining a single KCAL value during the application design. When a significant change of the motor temperature is expected, the following compensation sequence can be performed: 1. The motor is stopped in the same electr ical position used during the calibration. 2. The overcurrent or stall detection threshold is set to a calibration value (I cal). 3. The KVAL_HOLD value is set to KCAL. 4. The compensation coefficient (K_THERM) is increased or decreased in order to reach the calibration current using the overcurrent/stall information provided by the device.
5 Stepper motor resonances
some cases the vibration can be strong enough to cause a step loss or motor stall. Figure 16. Position ripple caused by the step change mechanical load connected to the shaft.
5.1 The effects of the resonanc es on Voltage mode driving
Figure 17. Phase current distortion Figure 18. Motor stall caused by resonances
Stepper motor resonances AN4144
5.2 Facing resonances
Facing resonances is a critical issue in the development of a stepper motor application. This section lists the most common solutions to reduce or avoid resonance effects.
5.2.1 Damping resonances using the mechanical load
The worst condition for stepper motor driving is when the shaft is unloaded. When the shaft remains unloaded, all the energy provided to the motor is dissipated by the rotor itself exciting its resonance points. Even a small load can dampen the rotor oscillations enough to make the motion smoother. Moreover, the mechanical load adds inertia to the system shifting the resonance points. The stepper motor mounting can also influence the resonance frequencies.
5.2.2 Reducing motor current
As previously described, the resonances are caused by the rotor oscillations during a step change. The amplitude of these oscillations is proportional to the intensity of the stimulating magnetic field, i.e. the current value. Reducing the phase current to the minimum required reduces the strength of the resonances. Many times the resonance points of the stepper motor are represented as a lack of torque on the speed-torque curve. This representation may cause misunderstandings with this issue. The reduced torque is not the root cause of the problem (resonance), but it is the consequence of it. Therefore, increasing the phase current in order to compensate for the torque reduction is usually not a solution.
5.2.3 Skipping the resonance po ints increasing the acceleration
The most common method to avoid resonance points is to quickly accelerate past their positions. Working within the range of the system resonances is never recommended even for a short period of time. High acceleration values allow the motor to pass through the resonance points faster, reducing the negative effects.
6 Revision history
Table 6. Document revision history 26-Jul-2012 1 Initial release. 14-Feb-2014 2 Updated Figure 4 on page 10 (updated data). Minor modifications throughout document. Minor modifications throughout document.