SSZTDC5 February   2026 DRV8262

 

  1.   1
  2.   2
    1.     Abstract:
    2.     Traditional stepper motor open-loop control
    3.     MCU-based digital FOC algorithm implementation
    4.     Hardware-level FOC control architecture based on DRV8262 independent H-bridge mode
    5.     Conclusion

Abstract:

This document was translated from a simplified Chinese source. (ZHCTA09)

Stepper motors are widely used because of their low speed and high torque characteristics, but the noise and vibration problems caused by traditional open-loop control limit the application scenario of stepper motors. Although Field-Oriented Control (FOC) based on MCU sampling feedback can effectively address these challenges, its high demands on MCU processing power and ADC sampling bandwidth limit the system’s cost-effectiveness. In this article, we will delve into the evolution of stepper motor control technology: Starting from the basic open loop control principle, we will introduce the software current loop FOC implementation solution. Finally, this paper proposes an innovative control architecture based on TI’s stepper motor control chip. By decoupling the current loop from the speed loop, use the chip’s VREF analog interface to directly control the H-bridge current and implement a hardware current closed-loop solution. This significantly reduces the computational load on the MCU while delivering quietness and smoothness comparable to traditional FOC.

Traditional stepper motor open-loop control

Traditionally, stepper motors have been widely used in open-loop control, for example, TI’s classic DRV8818, using STEP/DIR (Pulse/Direction) interface mode with the MCU sending pulse signals to control the basic open-loop. To further improve the resolution and smoothness, a microstepping technology has been incorporated into the driver chip. When a STEP pulse is received, the two-phase current reference values are updated according to the built-in Microstepping Indexer, causing the two-phase currents to approximate a sine/cosine relationship. The DAC reference voltage is updated to control the H-bridge output through a current chopping loop:

IA = IFS⋅cos(θ)

IB = IFS⋅sin(θ)

 Diagram for micro-steppingFigure 1 Diagram for micro-stepping

Although microstepping technology makes the phase current waveform appear nearly sinusoidal in the time domain, it is essentially an open-loop control system that does not take the motor rotor position into account. Within each microstep, the phase of the current output by the driver remains constant and is not dynamically adjusted in response to load disturbances or the actual rotor position. These discontinuous magnetic field transitions generate torque ripple, which adversely affects the quietness and smoothness of the mechanical system.

Furthermore, during operation, the driver maintains the coil current at a preset peak value regardless of the motor load. Even when the motor is stationary under no-load conditions, the driver continues to supply full-rated current to the coils. A significant amount of electrical energy is unnecessarily converted into heat, reducing system energy efficiency and limiting the motor’s overload capacity and temperature rise performance.

In summary, while traditional open-loop stepper motor control significantly reduces the computational demands on the controller, its lack of position feedback prevents the achievement of optimal efficiency and drive performance. To achieve truly efficient and quiet control, a closed-loop mechanism must be introduced, leading to the development of Field-Oriented Control (FOC) for stepper motors.

MCU-based digital FOC algorithm implementation

The following figure shows the FOC control block diagram of the stepper motor. Essentially, the FOC control of stepper motors is very similar to that of common PMSM stepper motors. Viewing a typical 2-phase stepper motor as a PMSM motor with a higher number of pole pairs can help us better understand this concept.

 MCU-based digital stepper motor FOC control solutionFigure 2 MCU-based digital stepper motor FOC control solution

First, since the A-phase and B-phase coils of a stepper motor are physically arranged at a 90° angle to each other, the two-phase currents we sample already form a stationary Cartesian coordinate system (the α-β coordinate system). Therefore, in the control of stepper motors, we do not need to perform the Clark transformation to convert the three-phase coordinate system into a Cartesian coordinate system. In order to eliminate the non-linear time-varying effects of rotor rotation on the control system, a synchronously rotating coordinate system (d−q axis) must be introduced. Using the Park transform, the AC current vectors in the stationary coordinate system can be projected onto an orthogonal coordinate system that rotates synchronously with the rotor magnetic field:

Where θ is the rotor electrical angle obtained via the encoder.

  • Id (direct axis current): Generating flux along the rotor magnet pole. For stepper motors with Surface PMSM characteristics, this component is typically controlled to 0 to prevent the stator magnetic field from demagnetizing the rotor permanent magnets or causing unnecessary thermal losses.
  • Iq (transverse-axis current): Generating magnetic flux perpendicular to the direction of the rotor magnetic poles. This component is directly proportional to the electromagnetic torque Tem=kt⋅Iq

Through this transformation, the originally complex AC-coupled system is decoupled into two independent DC control loops. Since Iq is always perpendicular to the rotor magnetic field, the torque output is smooth and constant, significantly improving the torque ripple issue of the open-loop system mentioned earlier. This allows the control of AC motors to be as linear and efficient as controlling brushed DC motors. On this basis, we can add additional speed and position loops to the system to meet the system's needs, thus enabling complete closed-loop control of the stepper motor.

In MCU, the implementation of software FOC involves the following key steps:

  1. Analog sampling: The MCU acquires the voltage signal across the shunt resistor on the lower arm of the H-bridge via the ADC module, or directly samples the motor phase current using Hall sensors or a current-sampling operational amplifier. The position signal is typically captured using the MCU’s quadrature encoder peripheral to acquire the ABZ output signals from the magnetic encoder chip.
  2. Position speed loop calculation: Based on the current position, path planning and speed curve planning are performed to generate the target setpoint Iq, which is fed into the current inner loop for loop calculation.
  3. Coordinate transformation and error calculation: Combining the current rotor angle, the system performs a forward Park transformation to calculate the feedback values Id and Iq, and computes the difference between these and the target command values. The voltage commands Ud, Uq, are calculated in the d−q coordinate system using a proportional-integral (PI) controller to compensate for the current error. It is then converted back to UA, UB under the stationary coordinate system by inverse Park transformation.
  4. Space Vector Pulse Width Modulation (SVPWM): Using the SVPWM algorithm, the voltage commands are converted into duty cycle signals PWMA and PWMB for each power switch to drive the full-bridge circuit and generate the required sinusoidal drive current.

Although FOC technology offers significant advantages in suppressing low-frequency resonance, reducing noise, and improving energy efficiency, the MCU must perform floating-point operations, including trigonometric functions, matrix operations, and PID iterations within an extremely short PWM cycle. This places high demands on the main frequency of the MCU, the instruction set (such as FPU, TMU support), and the interrupt response latency, requiring the use of high-performance real-time control MCU from the C2000 series to achieve optimal control performance.

In summary, although the MCU-based soft FOC solution is currently ideal for precision stepper motor control, its high dependence on hardware and software resources limits its use in cost-sensitive systems.

Hardware-level FOC control architecture based on DRV8262 independent H-bridge mode

Given the high demands on MCU computing power and ADC sampling bandwidth of traditional software FOC solution, this paper proposes a hardware-level current loop architecture based on “semi-closed loop”. This solution aims to utilize the high-speed analog comparator and current regulation logic integrated within TI DRV8262 driver chip to replace the traditional software PID current control loop, thereby reducing the demands on MCU processing power.

 Semi-closed-loop FOC solution based on motor control chipsFigure 3 Semi-closed-loop FOC solution based on motor control chips

The key constraint for implementing vector control of a stepper motor lies in the need to completely decouple and independently regulate the currents in the stator’s A and B phase windings (i.e., satisfying the time-varying relationship IA = IB). Products such as the TI DRV8262 can be configured in independent H-bridge mode, allowing the reference current values for the two independent H-bridges to be set separately via the chip’s two independent Vref1 and Vref2 pins.

In this topology, the MCU only needs to calculate the target current command after applying the Park inversion and output two voltage signals via two independent DACs to drive the chip’s VREF1 and VREF2 pins. The driver chip uses its internal current modulation logic to control the current in the two phases of the stepper motor so that it approaches the values corresponding to VREF1 and VREF2. At this point, the driver chip can be equivalent to two voltage-controlled current sources (VCCS) with high-bandwidth response characteristics, performing closed-loop chopping control of the phase currents directly based on the analog voltage commands.

It is important to note that since the DRV8262’s reference voltage input only supports positive-polarity signals (VREF ≥ 0), while the two phase currents IA and IB output by the FOC algorithm are bipolar sinusoidal signals. Thus a specific signal modulation strategy must be implemented on the MCU side to perform “phase reversal” at the current zero-crossing points.

Specifically, the control algorithm first takes the absolute value of the target current command and outputs it via the DAC; simultaneously, it extracts the sign bit of the target current and uses the GPIO to control the driver’s phase pin (PH) to switch the current polarity. As the sine wave passes through the zero, the DAC output voltage drops to zero, and simultaneously, the PH pin level inverts. Through this hybrid modulation method of “DAC amplitude modulation and GPIO phase modulation,” a complete standard sine waveform is seamlessly reconstructed in the power output stage.

This hardware current loop architecture offers significant advantages in dynamic response versus resource utilization over the traditional all-digital software FOC solution:

  • Physical level improvement in loop bandwidth: The bandwidth of the software current loop is limited by the PWM switching frequency and ISR interrupt latency (typically in the kHz order), while the internal analog comparator of the DRV8262 responds faster. This means that the system tracks the current command with little phase lag, greatly improving the stability of the motor under high dynamic loads.
  • Deep release of computing resources: By omitting the high-frequency PARK transform, PID operation, and SVPWM modulation modules, the computational power requirements of the MCU have dropped significantly. This makes it possible to deploy high-precision FOC algorithms on resource-constrained and low-cost MCUs (such as the C2000 F28002x family or Cortex-M0 platform), significantly improving the cost-effectiveness of the system.

Conclusion

The hardware FOC architecture proposed in this paper, based on the DRV8262 standalone H-bridge mode, innovatively combines the flexibility of digital control with the high-bandwidth characteristics of analog circuits. By implementing current-loop modulation through a hardware solution, this approach significantly simplifies the software architecture while retaining the core advantages of vector control, such as quiet operation and smoothness. For electromechanical system designs pursuing high performance, low cost, and stringent requirements for quiet operation, this digital-analog hybrid control method offers significant engineering application value and reference significance.