0% found this document useful (0 votes)
42 views11 pages

An5385 Open Load Detection With Stspin220 Stepper Driver Stmicroelectronics

Uploaded by

Joel Cueva
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views11 pages

An5385 Open Load Detection With Stspin220 Stepper Driver Stmicroelectronics

Uploaded by

Joel Cueva
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

AN5385

Application note

Open load detection with STSPIN220 stepper driver

Introduction
The STSPIN220 is a stepper motor driver designed for battery powered applications. The device has an integrated power stage
with a complete set of protection features including overcurrent, overtemperature and short-circuit protection.
Some applications can be required to detect whether one or both phases of the motor are disconnected from the driver.
This document describes how to implement an external circuitry, in order to detect the open load condition.

AN5385 - Rev 1 - September 2019 www.st.com


For further information contact your local STMicroelectronics sales office.
AN5385
STSPIN220 basic operation

1 STSPIN220 basic operation

The STSPIN220 power stage is composed of two full-bridges, one for each phase of the stepper motor. Each full-
bridge is driven by the internal logic in order to implement an independent PWM current control. When the current
in the motor phase reaches the target level, a decay sequence is performed (slow decay and then fast decay).
During normal operation, with a load connected, the output pins switch according to the PWM sequence: TON,
slow decay and fast decay (see Figure 1). In an open load condition instead, one high-side MOSFET and the
opposite low-side MOSFET are steady turned on: the absence of the load avoids the current flow, so the PWM
controller does not switch (Figure 2).

Figure 1. Output voltages in a normal operating condition (load connected)


Vs

OUTx1

Vs
current
direction

OUTx1 OUTx2 OUTx2

Vs

Figure 2. Output voltages in an open load condition (load unconnected)


Vs

OUTx1

expected Vs
current
direction

OUTx1 OUTx2 OUTx2

Vs

Figure 1 and Figure 2 show just one full-bridge: for this reason the out pins are generically indicated as OUTx1
and OUTx2, where x can refer to phase A or phase B. The figures depict the voltage for a given direction of the
current. Changing the direction of the current results in a swap between voltage on OUTx1 and OUTx2.

AN5385 - Rev 1 page 2/11


AN5385
Open load detector circuit

1.1 Open load detector circuit


The open load detector checks when the condition represented in Figure 2 occurs. Since the circuit must work for
both the current directions, it is best to not consider OUTx1 and OUTx2 separately, but acquire the sum of the two
signals; if this resulting signal is steady at the Vs supply for a certain amount of time, an open load condition has
occurred. A simple way to implement the circuit is represented in Figure 3.

Figure 3. Basic open load detector filter

STSPIN220
OUTx1 STEPPER
MOTOR
Rp

Phase A

Phase B
Vf
To MCU
(ADC)
Rf Cf
Rp
OUTx2

The partition introduced by the resistors net, makes the signal suitable for a microcontroller, which in many cases
works at lower voltages than the STSPIN220 voltage supply. The capacitor Cf implements a low-pass filter, so the
signal Vf is proportional to the duty cycle of the sum of the PWM on the outputs. When the signal Vf reaches the
voltage corresponding to the 100% duty cycle, it means that the open load condition has occurred. Sampling the
Vf signal (for example with an ADC line of the microcontroller) it is possible to detect when the open load condition
occurs.
The capacitor Cf is mandatory, otherwise the open load detection is continuously triggered at each PWM cycle.
The circuit in Figure 3 represents the filter for one phase of the stepper motor. The same circuit must be replicated
on the other phase; as a matter of fact, the open load condition can occur on phase A, phase B or both, and must
be detected in all these cases.

1.2 Filter limitations and remarks


When using the circuit proposed in Figure 3, some points should be considered. The first regards the resistors
used, which should be tens of kΩ, in order to reduce the bias currents flowing through them. The resistors are
used to decouple the signal coming from the outputs and reduce it to a value suitable for the microcontroller or the
digital logic.
The proper operation of the filter is based on the integrated PWM current control, which must be active.
Therefore, the filter does not detect the open load condition when:
1. the power stage is disabled (i.e. EN/FAULT is set low by the external microcontroller)
2. the device is in STBY mode
3. one phase is in high impedance, during the zero-current microstep (open load is not detected on the phase
in high impedance)
Although in the above cases the “open load” is not detected, this is not actually an issue. Indeed, the behavior of
the system is the same, whether the load is connected or not. When the outputs of the STSPIN220 are in high
impedance, the capacitor is discharged and kept low by the resistor Rf.
In some other conditions, there may be a false detection: even if the load is connected, the filter is triggered and
signals an “open load”. A false detection occurs when:
1. A wrong detection voltage threshold is selected for the Vf signal
2. The PWM current control works with very high duty cycles, close to 100%. This can happen if the target
current is too high with respect to the voltage supply Vs, in relation to the electrical and mechanical
parameters of the motor.
These situations should be avoided by properly sizing the components and the voltages in the system.

AN5385 - Rev 1 page 3/11


AN5385
Filter sizing and configuration

1.3 Filter sizing and configuration


According to the schematic reported in Figure 3, the voltage Vf corresponding to an open load condition is:
Equation 1
(1)
Rf
Vf, open = Vs ⋅ R + 2R
p f
where vs is the voltage supply of the STSPIN220.
The Rp and Rf resistors can be chosen in order to have the voltage Vf,open compatible with the maximum input
voltage of the ADC.
If the open load condition occurs, the Vf reaches the Vf,open value after a transient, which is determined by the
time constant τf given by the Cf and the equivalent resistance of the filter. So the maximum time required to
detect the open load condition can be defined as:
Equation 2
(2)
Rp 3RpRfCf
tDET ≈ τf = 3 ⋅ 2 ∥ Rf ⋅ Cf = R + 2R
p f
The Cf capacitor can be sized according to the detection time required by the target application. The detection
time must be greater than the maximum PWM period, otherwise the ripple on the Vf introduced by the PWM can
lead to a false detection. As a rule of thumb, we can compare the time constant of the filter τf and the electrical
time constant of the stepper motor τm, checking that:

Equation 3
(3)
RPRfCf Lm
τf < τm Rp + 2Rf
>R
m
where Lm is the phase inductance and Rm is the phase resistance of the stepper motor.
Anyway, the best way to optimize the trade-off between intervention time of the detector tDET and Vf signal filtering
is doing some specific bench test on the application.
Last parameter to be set is the threshold which triggers the detector. During normal operation the voltage Vf will
follow the envelope of the PWM duty cycle: it reaches the maximum value Vf,PWM_max in correspondence with the
maximum duty cycle. During open load condition instead, the voltage Vf increases up to its maximum value
Vf,open stated in Eq. (1).
The detection threshold Vf,th must be chosen in between Vf,PWM_max and Vf,open; refer to Figure 4 in Section 2.1
for further explanations related to signals and waveforms involved.

AN5385 - Rev 1 page 4/11


AN5385
Implementation and examples

2 Implementation and examples

As described in the previous section, the implementation of the open load detector is composed of two identical
circuits, one for each phase, with a total components’ count of 6 resistors and 2 capacitors; moreover, 2 ADC
channels are required to detect the voltage threshold Vf,th, which triggers the open load condition.

2.1 Application example and waveform acquisition


To provide a typical example, let’s consider an application with the following parameters:
• Voltage Supply VS = 5V
• Microcontroller voltage VMCU = 3.3V
• Motor phase parameters Lm = 4mH and Rm = 7Ω

According to this data, it is possible to select Rp = Rf = 12kΩ: the Vf,open is 1.67V as stated in Eq. (1).
Assuming a maximum intervention time of about 1.8ms, Eq. (2) provides the value of Cf, that is 150nF, besides
respecting what Eq. (3) states.
Testing this solution at bench results in the waveform reported in Figure 4. The driver works in the 32
microstepping mode: during normal operation, the current is a sinewave and the filtered voltage Vf has a rectified
sinewave envelope, with a maximum value Vf,PWM_max. In this example only phase A is represented and it is
disconnected “on the fly” in order to analyze the dynamic behavior of the filter. At load disconnection, the phase
current falls to zero, meanwhile the Vf voltage increases at the expected value of 1.67V. Since the measured
value Vf,PWM_max during normal operation is around 1.4V, the threshold Vf,th can be set at 1.55V.

Figure 4. Waveform acquisition for a dynamic open load condition

Voltage level in
Load is
open-load
disconnected
here
condition

Voltage Vf Vf,open
Vf,PWM_max

Voltage level in
normal mode

Phase A Current
(microstepping)

2.2 Implementation without additional MCU resources


If no ADC lines are available in the microcontroller, or in general no more microcontroller GPIOs are available in
the system, a modified circuit represented in Figure 5 can be used. The open load threshold Vf,th (set by R1 and
R2 partition) is now detected by two comparators, one for each phase.
A single component can be used, such as the dual comparator LM193 or similar. The chosen comparators should
have open-drain output, so they can be connected all together with the EN/FAULT pin of the STSPIN220. In this
way it is possible to use the EN/FAULT line to detect the open load condition, without using another digital GPIO
line of the microcontroller.
Note: We are assuming that the EN/FAULT is already connected to the microcontroller, in order to manage the other
failure conditions such as overtemperature and overcurrent

AN5385 - Rev 1 page 5/11


AN5385
Implementation without additional MCU resources

When an open load is detected, the EN/FAULT pin goes low and the power stage is disabled for a time given by
RENCEN time constant. Then, the open load filter discharges and consequently the EN/FAULT pin is released. At
the end of the disable time, the power stage turns on and the open load condition is triggered again. Therefore,
the EN/FAULT pin toggles continuously as long as the load is disconnected. The microcontroller firmware should
manage the failure condition with a dedicated interrupt routine when the FAULT signal goes low.
The component sizing of this circuit should follow the rules already described previously: referring to the example
explained in Section 2.1 , we have the same values for Rp and Rf (both 12kΩ) and Cf (150nF). Since the
selected threshold is Vf,th around 1.55V, we can select R1 = 68 kΩ and R2 = 30 kΩ.

Figure 5. Open load circuit using comparators


VS

STSPIN220 VS VS VS

Dual open-drain
OUTA1 R1 comparator
(e.g. LM193)
Rp

Rp Rf Cf
Phase A
OUTA2
STEPPER
MOTOR
OUTB1 Phase B

Rp

Rp Rf Cf R2
OUTB2
VMCU

REN

EN/FAULT
CEN
To microcontroller
GND EN/FAULT management

AN5385 - Rev 1 page 6/11


AN5385

Revision history

Table 1. Document revision history

Date Version Changes

17-Sep-2019 1 Initial release.

AN5385 - Rev 1 page 7/11


AN5385
Contents

Contents
1 STSPIN220 basic operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1 Open load detector circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Filter limitations and remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Filter sizing and configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Implementation and examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5


2.1 Application example and waveform acquisition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Implementation without additional MCU resources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8
List of tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9
List of figures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10

AN5385 - Rev 1 page 8/11


AN5385
List of tables

List of tables
Table 1. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

AN5385 - Rev 1 page 9/11


AN5385
List of figures

List of figures
Figure 1. Output voltages in a normal operating condition (load connected) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Figure 2. Output voltages in an open load condition (load unconnected) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Figure 3. Basic open load detector filter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Figure 4. Waveform acquisition for a dynamic open load condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Figure 5. Open load circuit using comparators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

AN5385 - Rev 1 page 10/11


AN5385

IMPORTANT NOTICE – PLEASE READ CAREFULLY


STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and improvements to ST
products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST
products are sold pursuant to ST’s terms and conditions of sale in place at the time of order acknowledgement.
Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of
Purchasers’ products.
No license, express or implied, to any intellectual property right is granted by ST herein.
Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.
ST and the ST logo are trademarks of ST. For additional information about ST trademarks, please refer to www.st.com/trademarks. All other product or service
names are the property of their respective owners.
Information in this document supersedes and replaces information previously supplied in any prior versions of this document.
© 2019 STMicroelectronics – All rights reserved

AN5385 - Rev 1 page 11/11

You might also like