AN2009
APPLICATION NOTE
PWM MANAGEMENT FOR 3-PHASE BLDC MOTOR DRIVES USING THE ST7MC
The ST7MC microcontroller family is the second generation of the 8-bit microcontroller family dedicated to the driving of 3-phase brushless motors. Permanent Magnet Brushless DC motors are replacing DC brush motors more and more in many applications due to advantages such as higher efficiency, quieter operation and better reliability. These motors require the control of an inverter stage. In most cases the switching devices are MOSFET transistors or IGBTs and are organized in a three-phase bridge with free-wheeling diodes as shown in Figure 1. There are two methods of controlling the motor and reading information back from the rotor. These are called the sensor and the sensorless methods. The sensor method uses Hall sensors whereas the sensorless method reads the Back Electromotive Force (BEMF) signal back to determine the position of the rotor and so is less expensive.
The ST7MC microcontroller features a dedicated peripheral to drive this type of motor with the best efficiency in order to maintain the advantages of these types of motor. Besides the high flexibility of this dedicated peripheral, its high hardware integration allows cost savings for the application by reducing external components. It is suitable for both sensor and sensorless methods of PM BLDC motor control.
Although using the sensorless mode has big advantages in terms of cost and size, it makes the motor drive a little more complicated. The purpose of this application note is to explain in which cases the ST7MC motor control unit can directly read the BEMF voltage and how to quickly set up its control registers in order to use all the advanced features of this product. We will detail and explain the PWM management inside the ST7MC in order to help the developer use all the advantages of this flexibility to optimize the design and the efficiency of the application.
AN2009 |
Rev 2 |
1/39 |
1
Table of Contents
INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 MOTOR CONTROL MACROCELL INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 SIX-STEP, 120° DRIVE AND PWM POWER CONTROL . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3 SENSORLESS CONTROL METHODS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.1 CLASSIC METHOD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2 ST METHOD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4 PWM MANAGER IN VOLTAGE MODE AND CURRENT MODE . . . . . . . . . . . . . . . . . . 10
4.1 PWM MANAGER IN VOLTAGE MODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.1.1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12 4.1.2 PWM signal register setting in Voltage mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13
4.2 PWM MANAGER IN CURRENT MODE CONTROL . . . . . . . . . . . . . . . . . . . . . . . . 14
4.2.1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14 4.2.2 PWM signal register setting in Current mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16
4.3 SUMMARY VOLTAGE/CURRENT MODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 5 MANAGEMENT OF PWM AND READING OF BEMF . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.1 PWM ON THE HIGH SIDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.2 PWM ON THE LOW SIDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.3 EXAMPLE OF CONFIGURATION OF THE ST7MC REGISTERS . . . . . . . . . . . . . 22 6 SYNCHRONOUS RECTIFICATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
6.1 SYNCHRONOUS RECTIFICATION PRINCIPLE . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
6.2 SYNCHRONOUS RECTIFICATION CONFIGURATION . . . . . . . . . . . . . . . . . . . . . 27 7 WINDING DEMAGNETIZATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
7.1ACCELERATION OF DEMAGNETIZATION WHEN PWM IS APPLIED ON THE LOW SIDE SWITCH 29
7.2ACCELERATION OF DEMAGNETIZATION WHEN PWM IS APPLIED ON THE HIGH SIDE SWITCH 31
7.3 REGISTERS CONFIGURATION TO ACCELERATE THE DEMAGNETIZATION. . 34 8 CONFIGURATION EXAMPLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 9 CONCLUSION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 10 REVISION HISTORY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2/39
PWM MANAGEMENT FOR 3-PHASE BLDC MOTOR DRIVES USING THE ST7MC
Figure 1. ST7FMC Microcontroller with a three-phase bridge
|
|
HV |
|
|
|
T0 |
D0 |
T2 |
D2 |
T4 |
D4 |
|
|
|
B |
|
|
|
|
M |
|
|
C |
|
A |
|
|
|
|
T3 |
D3 T5 |
D5 T1 |
D1 |
||
|
|
|
|
|
Feedback |
|
|
|
|
|
5V |
|
Level |
Low |
|
||
|
Side |
|
|||
|
|
|
|
||
|
shifter |
outputs |
|
||
|
High |
|
|||
|
|
|
|
||
|
|
|
Side |
|
|
|
|
|
outputs |
|
Rotor position inputs
ST7FMC
Figure 2 below gives a detailed view of the motor control macrocell included in the ST7MC microcontroller. In bold are the parts of the macrocell that are going to be described in this application note and that have a role in the PWM management. The purpose of this document is to ease the understanding of the PWM management with the ST7MC to control a brushless 3- phase DC motor and to make this explanation easier, the schematic on the figure below can be taken as a reference of a global view of the mechanism. Besides the drawings of the functionalities, the names of the registers involved and often even the bits are written in this schematic. Anyhow, each time a register is discussed in this document, either a reference or an exact description will be made for that register.
3/39
PWM MANAGEMENT FOR 3-PHASE BLDC MOTOR DRIVES USING THE ST7MC
Figure 2. Detailed view of the MTC for PM BLDC motor control
Board+ Motor |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
x6 Reg MPWME x6
6 1
MOEbit
MPOLReg
OCVbit CLIbit CLIMbit
+ OAON
|
|
|
|
|
|
|
|
|
|
|
CFAV bit |
|
|
|
|
|
||||
- |
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ISn bit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ |
|
- |
|
|
|
|||||||||
|
|
|
|
|
|
D/Z Window filter |
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
D |
|
|
|
CP |
|
|
|
|
|
S,H |
|
|
Q |
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
S,H C |
|
|
|
|
|
|
||||||||
|
|
D |
|
|
|
|
|
|
||||||||
|
|
2 |
|
1 |
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
Z event generation |
|
|
|
D event generation |
|||||||
Microcontroller |
|
|
|
|
|
|
|
|
|
|
||||||
|
|
|
|
|
Z |
|
|
D |
||||||||
|
|
|
|
|
|
|
H |
|
|
|
H |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
REF |
|
|
|
VR2-0 |
|
||||
|
|
|
|
|
||||||
V |
|
S,H |
|
|
|
|
|
|||
S,H |
|
|
|
|
|
|
||||
C |
D |
|
|
|
|
V |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
I |
|
|
|
|
|
|
|
|
||||
|
|
|
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SPLG |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 / 4 |
|
|
|
||
|
|
|
|
|
|
|
|
|
|
periph |
|
|
|
|
|
||
|
|
|
|
|||||
|
|
|
|
|
||||
XT16:XT8bit |
F |
|
|
PRESCALER |
|
R |
||
|
|
|
|
|
|
|
+ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mtc |
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|||
|
|
|
F |
|
|
|
generatorPWM |
Reg |
|
HighFrequencyChopper |
|
8 |
|
6 |
+ |
- |
||||||
|
|
|
|
||||||||||||
|
|
|
|
|
|
|
|
||||||||
|
MREF |
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
||
|
|
|
|
Time |
Time |
|
|
Time |
|
|
|
|
|||
|
|
|
|
|
|
|
|
PCNbit=0 |
|
|
|||||
|
|
|
|
Dead |
Dead |
|
Dead |
|
|
|
|
||||
|
|
|
|
|
|
MDTGregister |
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
bit |
bits |
|
Ch0 |
Ch1 |
Ch2 |
|
Ch3 |
|
Ch4 |
Ch5 |
|
|
|
|
|
12- |
|
|
|
|
6 |
MPARReg |
|
|
|||||||
n |
3 |
|
|
|
|
|
|
|
|
|
|
|
|||
|
OS |
|
|
|
n |
|
|
|
|
|
|
|
CFW[2:0]bit |
|
|
|
|
|
|
|
egR |
TMPHS |
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|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||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
H |
|
|
S,H |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4/39
PWM MANAGEMENT FOR 3-PHASE BLDC MOTOR DRIVES USING THE ST7MC
2 SIX-STEP, 120° DRIVE AND PWM POWER CONTROL
To control a BLDC motor with the best efficiency, we have to know the rotor position at all times. To achieve this there are two modes. One is called the sensor mode, where the information read back from the motor is the one coming from Hall Effect sensors (1 per phase). The other one is the sensorless mode, where the Back Electromotive Force (BEMF) signal information is the one read back from the motor. The strength of the ST7FMC is that it is compatible with all the modes to control a BLDC motor, whether it is sensorless or not and it is even suitable with different variations within the sensorless or sensor modes which will be detailed later on in this application note.
In sensorless mode, in order to be able to read the BEMF information, the phase switching has to include a dead time during which no current flows in one of the motor windings.
As shown in Figure 4, in six-step, 120° drive, power is removed from each winding every three steps. During this dead-time phase, it is possible to detect the BEMF zero-crossing event on this non powered winding (see Figure 3 for an example).
In order to control the speed, the torque or the power applied to the motor, a PWM signal is usually logically ANDed with the switch control signals. This control is implemented by modifying the duty cycle of this logically ANDed PWM signal.
With this method, the BEMF voltage is referred to point M of the motor and not to ground. Because this point is at high voltage, the microcontroller cannot read its value directly.
Note: In sensor mode the six-step drive or the sinusoidal drive can be implemented as the feedback signal comes independently from the Hall Effect sensor in the dedicated input of the microcontroller. However, in six-step drive, the method will be exactly the same as the one detailed for the sensorless mode. For the sensor sinusoidal mode, the PWM management is the same as for the AC induction motor drive.
5/39
PWM MANAGEMENT FOR 3-PHASE BLDC MOTOR DRIVES USING THE ST7MC
Figure 3. Reading the BEMF (Step Σ4)
|
|
|
HV |
|
|
|
T0 |
D0 |
T2 |
|
D2 |
T4 |
D4 |
|
|
|
B |
|
|
|
|
|
|
|
|
|
Read BEMF |
|
|
|
|
|
|
on phase C |
|
|
|
M |
|
|
C |
|
|
|
|
|
|
|
|
|
|
B |
|
|
|
|
A |
|
E |
M |
|
|
|
|
|
|
F |
|
|
T3 |
D3 |
T5 |
|
D5 |
T1 |
D1 |
Figure 4. Six-step, 120° drive: control signal on the transistor gate
Step |
Σ1 Σ2 Σ3 Σ4 Σ5 Σ6 Σ1 Σ2 Σ3 |
Switch
ON
T0 OFF
T1
T2
T3
T4
T5
ON
OFF
ON
OFF
ON
OFF
ON
OFF
ON
OFF
Node
HV
A
0 |
|
HV |
|
B |
BEMF Voltage |
0 |
HV
C
0
Note: voltages are represented without any PWM or demagnetization effect.
6/39
PWM MANAGEMENT FOR 3-PHASE BLDC MOTOR DRIVES USING THE ST7MC
In order to make the BEMF signal readable by the microcontroller and to detect the zerocrossing voltage of this signal, there are two main methods which we will call the classic method for the first one and the ST method for the second. The ST7FMC microcontroller is suitable for both methods. Each method is declinable in sub-method and the ST7MC allows complete flexibility on which sub-method to use. Please refer to the Application Note AN1946 for a complete view and details on all the methods as this document briefly covers only the 2 main methods.
The classic method involves dividing and filtering the signal coming from the non-powered phase to make it readable by the 5V microcontroller as shown in Figure 5. A virtual ground is built and is used as the voltage reference to detect the zero-crossing event of the BEMF signal. With this method, the PWM signal which is logically ANDed with the switch control signal can be applied either on the high or on the low side switches as explained in the next section. The ST7MC is able to detect the BEMF zero-crossing signal during either the PWM signal ON time or OFF time.
7/39
PWM MANAGEMENT FOR 3-PHASE BLDC MOTOR DRIVES USING THE ST7MC
Figure 5. Classic sensorless control method
|
|
HV |
|
|
|
|
T0 |
D0 |
T2 |
D2 |
T4 |
D4 |
|
|
|
|
B |
|
|
|
|
|
M |
|
|
C |
|
|
A |
|
|
|
|
|
T3 |
D3 T5 |
D5 T1 |
D1 |
|
||
|
|
|
|
|
5V |
|
|
|
Level |
Low |
|
|
|
|
|
Side |
|
|
||
|
|
|
|
|
||
|
|
|
outputs |
|
|
|
|
|
shifter |
High |
|
|
|
|
|
Side |
|
Virtual |
||
|
|
|
outputs |
|
||
|
|
|
Rotor |
ground |
||
|
|
|
|
|
|
|
|
|
|
|
position |
|
|
|
|
|
|
|
inputs |
|
|
|
|
|
internal |
External |
|
|
|
|
ST7FMC |
Vref |
||
|
|
|
Vref |
Note: The digital filter of ST7MC allows use of the classical method wiring without an analog filter. In that case we can remove the virtual neutral network and replace this by just a voltage divider on the High VOLTAGE BUS. In this situation, sampling at PWM "OFF" is possible only for PWM applied on the high side switch. Please refer to Application Note AN1946 for more details on this method.
8/39
PWM MANAGEMENT FOR 3-PHASE BLDC MOTOR DRIVES USING THE ST7MC
With the ST Method, by using the free-wheeling diodes during the OFF time of the PWM signal, the M potential is put to ground and the ST7MC microcontroller samples the BEMF signal voltage during the OFF time of the PWM signal. This involves the fact that the PWM has to be applied on the high side and that an OFF time is needed as explained in the next section of this application note. However, fewer external components are required as it is no longer necessary to divide and filter the signal coming from the non-powered winding. As shown in Figure 6, only 3 external resistors are needed to limit the current input in the microcontroller pins.
Figure 6. ST sensorless control Method
|
|
HV |
|
|
|
T0 |
D0 |
T2 |
D2 |
T4 |
D4 |
|
|
|
B |
|
|
|
|
M |
|
|
C |
|
A |
|
|
|
|
T3 |
D3 T5 |
D5 T1 |
D1 |
||
|
|
|
|
|
5V |
|
|
|
Low |
|
|
|
|
Level |
Side |
|
|
|
|
|
outputs |
|
|
|
|
Shifter |
High |
|
|
|
|
|
|
||
|
|
|
Side |
|
|
|
|
|
outputs |
Rotor |
|
|
|
|
|
|
|
|
|
|
|
|
position |
inputs
internal External ST7FMC Vref Vref
9/39
PWM MANAGEMENT FOR 3-PHASE BLDC MOTOR DRIVES USING THE ST7MC
The PWM signal logically ANDed with the switch control signal is used to control the power applied to the motor. It can either control the voltage on the motor with a fixed PWM duty cycle or the current by means of an integrated current control circuitry.
When the PWM signal controls the voltage, the motor is driven in voltage mode. When it is controlling the current, the motor is driven in current mode.
Voltage mode allows you to control the speed easily by changing the motor reference voltage. It does not give you fine control of the current but you can limit the current and consequently the torque to a maximum value. The voltage control is done by the PWM duty cycle.
Current mode allows you to permanently control the torque by changing the motor reference current, because torque is proportional to current. The current in the windings is regulated in real time and there is a true DC current flowing through the DC Bus. Current mode also allows the current for each of the 6 steps to be finely controlled as the current control is done during the PWM cycle.
Depending on whether the motor is driven in current or voltage mode, the PWM signal does not have the same origin as shown in Figure 7.
10/39
PWM MANAGEMENT FOR 3-PHASE BLDC MOTOR DRIVES USING THE ST7MC
Figure 7. The PWM manager
|
|
|
|
|
|
MCO5 |
|
|
MEASUREMENT |
|
(I) |
|
|
|
MCO4 |
|
|
WINDOW |
|
CURRENT |
PHASE |
|
|
MCO3 |
|
|
GENERATOR |
|
|
|
|
|
|||
|
|
|
|
MCO2 |
|
|||
|
|
VOLTAGE |
|
|
|
|||
|
|
(V) |
|
|
|
MCO1 |
|
|
|
(I) |
(V) |
|
|
|
MCO0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
MODE |
|
U, V, W |
|
|
|
|
|
|
|
|
OAON bit |
NMCES |
|
||
|
|
|
|
Phases |
|
|||
|
|
|
|
|
+ |
OAP |
|
|
|
|
|
|
CFAV bit |
- |
OAN |
|
|
PWM MANAGER |
|
|
|
|
|
OAZ(MCCFI1) |
||
|
|
|
|
|
MCCFI0 |
|
||
|
|
|
|
|
|
|
||
|
|
|
|
|
ADC |
|
VDD |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MCCREF |
(V) |
R1 |
|
|
|
|
|
|
|
|||
|
|
Phase U |
|
|
CHANNEL |
|
(I) |
R2 |
|
|
|
|
|
C |
|||
|
|
|
|
|
|
|||
|
|
|
|
MANAGER |
|
|
|
|
|
|
|
|
12-bit THREE-PHASE |
|
R3 |
|
|
12-bit counter |
|
1 (V) |
PCN bit |
PWM GENERATOR |
|
|
||
|
|
|
|
|
|
|
|
|
Phase U |
|
|
|
|
|
MCPWMU |
|
|
Phase V |
|
|
|
|
|
MCPWMV |
|
|
|
|
|
|
|
|
|
||
Phase W |
|
|
|
|
|
MCPWMW |
The PWM manager manages two different integral parts of the way the ST7MC drives the motor:
–Current regulation or limitation
–Generation of the PWM signal applied on the switches
The PWM manager has two distinct motor driving modes: voltage mode and current mode. In both cases, the motor control 12-bit timer peripheral has an essential role.
In Figure 7, the PWM manager uses the paths indicated by the (I) symbol for current mode and by the (V) symbol for voltage mode.
11/39
PWM MANAGEMENT FOR 3-PHASE BLDC MOTOR DRIVES USING THE ST7MC
4.1 PWM MANAGER IN VOLTAGE MODE |
|
|
|||
4.1.1 Description |
|
|
|
|
|
Figure 8. Current limitation in voltage mode control |
|
||||
ST7MC |
|
|
|
|
|
PWM U output |
|
|
|
|
|
|
|
|
|
Max current |
|
ST7MC |
TIMER |
|
HV |
reference |
|
|
|
|
|||
Microcontroller |
|
|
|
|
|
|
|
set |
T1 |
I |
|
|
|
R |
t |
||
|
|
|
|
||
|
|
|
|
|
|
|
- + |
|
A |
|
|
|
|
|
|
|
|
|
|
|
|
Motor |
|
Vdd Rext |
|
|
|
Voltage |
t |
Rext |
|
|
|
|
|
|
|
|
step time |
step time |
|
|
|
|
T4 |
||
Max current |
|
|
T1-T4 |
T1-T6 |
|
|
|
|
|||
reference |
|
|
|
|
VR02139M |
|
|
|
|
|
In voltage mode, the PWM of the 12-bit timer (through the compare U register) gives the voltage which is supplied to the motor, it is the voltage control of the motor. This PWM signal is the one logically ANDed with the control switches signal in order to be able to detect the zero-crossing and demagnetization events.
In voltage control mode, we can set a limitation to the current. The current limitation can be set by the user with an external resistor divider as shown in Figure 7 (R1 and R2) and Figure 8 (Rext). Usually this current limitation is the one given by the motor manufacturer. When the current feedback reaches the maximum reference current at the comparator input, the transistor to which the PWM is applied is put in off state until the current feedback becomes less than the maximum current limit. So, one of the inputs of the internal comparator is the maximum current limitation, the other input is the current feedback from the motor (MCCFI0 pin or the output of the internal operational amplifier if used as shown in Figure 7).
This current limitation is for protection and should normally never be reached when running the motor correctly.
Figure 9 is a capture made with an oscilloscope of the different signals in Voltage mode:
We can see that the current feedback from the motor never reaches the current limitation and the increase and decrease of the current in the motor corresponds to the PWM signal on the waveform 2.
12/39