We take your privacy very seriously, please agree to all cookies used when you visit our website. More information about the processing of personal data could be found inPrivacy Policy
This article provides detailed case studies on NOVOSENSE micro-step stepper motor driver NSD8381. It explains the implementation process for stepper motor control and stall detection, helping engineers quickly build practical skills for using NSD8381 to control stepper motor operations and detect stalls.
1)Introduction of Micro-step Stepper Motor Driver NSD8381
NSD8381 is an automotive grade integrated driver for stepper motors capable of current controlled micro-stepping with programmable amplitude. It is widely used in automotive headlight step control (ADB/AFS), HUD position adjustment motors, and stepper or BDC motor driving in thermal management system valves.
NSD8381 supports a maximum full-scale current of 1.35A, including current chopping adjustment, an internal maximum 1/32 micro-step converter, and multiple decay mode options to ensure smooth stepper motor operation. NSD8381 supports VBat undervoltage lockout (VSUV), overcurrent protection (OCP), temperature warning (OTW/UTW), and overtemperature protection (OTSD). It also supports open-load diagnostics and overcurrent protection for output loads. Additionally, NSD8381 integrates a stall detection function, which can indicate stall faults if motor stalls.
2)NSD8381 Used for Stepper Motor Control Configuration and Test Cases
1. SPI Framework Structure of NSD8381
1.1 The input frame of SDI consists of 24 bits with the following structure:
- 2 bits for operation instructions C1/C0, where 00 represents a write operation, 01 represents a read operation, and 10 represents read-clear.
- 6 bits for the register address.
- 16 bits for data, including bits 15 to 1 for data and bit 0 for an odd parity check bit.
Table 1: SPI Input Frame Structure
1.2 The output frame of SDO consists of 24 bits with the following structure:
- 8 bits for the global status byte, displaying the returned global status. If there are faults or alarms, the corresponding bits will reflect the fault status.
- 16 bits for the returned data, including bits 15 to 1 for data and bit 0 for an odd parity check bit.
Table 2: SPI Output Frame Structure
2. NSD8381 Drive Stepper Motors Workflow Diagram
Figure 1: Stepper Motor Workflow Diagram
3. NSD8381 Drive Stepper Motor Test Setup: Hardware and Software Configuration
3.1 Hardware Equipment: NSD8381 Demo Board, Stepper motor, 12V DC power supply, USB to TTL converter connected to the host computer, Signal generator
3.2 SPI Register Configuration
CONFIG_6: 0x081013 - Configures the stepper motor current (HOLD: 50mA; full: 571mA)
CONFIG_4: 0x060841 - Configures current modulation frequency (20kHz), slew rate (10V/us), filter time (2us), and slow decay mode
Note: The default slew rate used here is 10V/us. It is recommended to increase the slew rate because increasing the slew rate reduces the dead time, provides significant benefits in terms of power consumption for the chip in working scenarios involving higher currents. For example, you can configure CONFIG_4: 0x060A40 — configuring current modulation frequency to 20k, slew rate to 70V/us, filter time to 2us, and slow decay mode.
CONFIG_1: 0x030428 - Configures CTRLx (default configuration to use CTRL1 pin as STEP input & CTRL2 pin as DIR input)
CONFIG_3: 0x058000 - Enables output and sets microstepping (1/16 microstep)
4. NSD8381 Drive Stepper Motor Test Waveforms
Test Conditions: 1/16 microstep, Full-scale current 571mA, Current modulation frequency 20kHz, Current modulation filter time 2us, STEP pulse 1kHz
4.1 Slow Decay Mode Test Waveform:
Figure 2: Stepper Motor Winding Current Waveform
Figure 3: Stepper Motor Winding Current-Decay Waveform
4.2 Mix Decay Mode Test Waveform:
Figure 4: Stepper motor winding current waveform
Figure 5: Stepper Motor Winding Current-Decay Waveform
4.3 Auto Decay Mode Test Waveform:
Figure 6: Stepper Motor Winding Current Waveform
Figure 7: Stepper Motor Winding Current-Decay Waveform
After comparison of the three group waveforms, the observed phenomena are summarized as follows:
In Slow Decay and Auto Decay modes, the spikes at the peaks of the sine wave is smaller, the motor runs with a quieter sound. In Mix Decay mode, the current waveform with larger spikes, results in louder motor operation noise. However, mixed decay can allow the current level to stay in regulation, especially motor in low coil current or running slow.
So in practical applications, the appropriate motor operating condition can be achieved by adjusting the decay mode.
3)NSD8381 Used for Stepper Motor Stalled Detection
1. Principle of Stalled Detection
Figure 8 shows the equivalent model of the stepper motor winding. When the motor is rotating normally, the voltage of the motor winding (Vmotor) can be obtained according to Equation 1. The back electromotive force (BEMF) of the motor can be obtained according to Equation 2, where N is the number of coil windings, B represents the magnetic field strength, A is the area enclosed by the motor magnetic field, and w is the angular velocity of the motor.
According to Equation 1, when the current flowing through the motor is zero, the voltage of the motor winding is BEMF, i.e., the back electromotive force voltage. According to Equation 2, the back electromotive force voltage is proportional to the angular velocity of the motor. When the motor is stalled, the speed is zero, and the back electromotive force is theoretically zero as well. Therefore, the back electromotive force can be detected by measuring the winding voltage when the winding current is zero.
Equation 1
Equation 2
Figure 8: Motor Winding Equivalent Model
2. Stalled Detection Steps
Figure 9: NSD8381 Stalled Detection Workflow
Notices during stalled detection:
a. If the motor application involves both forward and reverse rotation, perform steps 1-6 for both directions and record the high and low values. Set the CVLLA value to be greater than the stalled value for both forward and reverse rotation, but significantly less than the back electromotive force value during normal forward and reverse rotation.
b. CV_DELAY Setting: Using Figure 10 as an example, set the CV_DELAY time must be greater than △X shown in the figure. To ensure the back electromotive force sampling point is on the flat part of the curve (the section after △X where the coil current is zero), the sampled value will be accurate. Figure 10 shows △X = 108µs, and the internal PWM frequency is 20kHz (50µs), so the CV_DELAY value for this waveform needs to be greater than 3, i.e., greater than 3 × 50 = 150µs. Additionally, when the motor is rotating very fast, CV_DELAY can be set directly to 0, where the ADC sampling point will be at the end of the zero current period.
Figure 10: Back Electromotive Force Waveform During Normal Rotation
c. CVA, CVB, CVC, CVD as well as CVLLA & CVLLB, these register bits are designed as 10bit-width data with additional parity bit, therefore, shifting right by one bit is required to convert into voltage values.
3. Stepper Motor Stalled Detection Examples
Stepper Motor 1: 2kHz step frequency, 20kHz modulation frequency, The back electromotive force for OUTA1 and OUTA2 during normal rotation is 3.2V, as shown in Figure 11. The back electromotive force for OUTA1 and OUTA2 during a stall is 0.2V, as shown in Figure 12.
The CONFIG_5 register is set to 0x078E00 (CV_DELAY = 7), calculated to be 350µs from Figure 11, satisfying the CV_DELAY sampling point requirement.
CVLLA is configured to 0x0E0027 (0.52V). When the motor stalls, FUNCTION_ERR can be detected, and by reading back STA_1, the STALL bit is set to 1.
Figure 11: Waveform for OUTA1 and OUTA2 During Normal Rotation of Motor 1
Figure 12: Waveform for OUTA1 and OUTA2 During Stall of Motor 1
Stepper Motor 2: 1.65kHz step frequency, 20kHz modulation frequency, The back electromotive force for OUTA1 and OUTA2 during normal rotation is 11.5V, as shown in Figure 13. The back electromotive force for OUTA1 and OUTA2 during a stall is 1.9V, as shown in Figure 14.
The CONFIG_5 register is set to 0x078001 (CV_DELAY = 0) to sample at the end of zero current point. CVLLA is configured to 0x0E00DB (2.98V). When the motor stalls, FUNCTION_ERR can be detected, and by reading back STA_1, the STALL bit is set to 1.
Figure 13: Waveform for OUTA1 and OUTA2 during normal rotation of motor 2
Figure 14: Waveform for OUTA1 and OUTA2 during stall of motor 2
Thank you for your inquiry.
Please provide the following information and we will contact you as soon as possible, thank you.