A stepper motor control system consisting of a DSP and a PBL3717A
2026-04-06 07:29:53··#1
[Abstract]: This paper introduces a control system for a two-phase hybrid stepper motor, constructed using the TMS320LF2407A digital signal processor from Texas Instruments (TI) and the PBL3717A stepper motor driver chip from SGS. [Keywords]: PBL3717A, DSP, stepper motor control system Introduction Stepper motors are important actuators in digital control systems and are widely used in various control systems. They are control motors that convert electrical pulse signals into displacement or speed. Inputting a pulse signal causes the motor to rotate by an angle or move forward a step. Its mechanical angular displacement and speed are proportional to the number and frequency of pulses input to the motor windings, respectively. The speed can be adjusted over a wide range by changing the pulse frequency. They are easily interfaced with computers or other digital components and are suitable for digital control systems. With the rapid development of VLSI technology, the performance-price ratio of DSPs (Digital Signal Processors) has greatly improved, making their application in motor control increasingly widespread. This article introduces a control system for a two-phase hybrid stepper motor, consisting of a TMS320LF2407 digital signal processor from Texas Instruments (TI) and a PBL3717A stepper motor driver chip from SGS. 1. DSP Performance Overview The TMS320LF2407A from TI is a DSP specifically designed for motor control. It employs high-performance static CMOS technology, reducing the supply voltage to 3.3V and decreasing controller power consumption; its 40MIPS execution speed shortens the instruction cycle to 25ns (40MHz), thereby improving the controller's real-time control capabilities. It includes two event manager modules, EVA and EVB, each comprising: two 16-bit general-purpose timers; a CAN bus interface module; a 16-bit Serial Peripheral (SPI) interface module; a phase-locked loop-based clock generator; a built-in quadrature encoder pulse (QEP) circuit; three capture units; a 16-channel A/D converter; and eight 16-bit pulse width modulation (PWM) channels. They can achieve: three-phase inverter control; symmetrical and asymmetrical PWM waveforms; rapid shutdown of the PWM channel when the external pin PDPINTx goes low; programmable PWM dead-time control to prevent simultaneous output of trigger pulses from the upper and lower bridge arms; the event manager module is suitable for controlling AC induction motors, brushless DC motors, switched reluctance resistors, stepper resistors, multi-stage motors, and inverters. 2. PBL3717A Principle and Step Control Method 2.1 Introduction to the PBL3717A Principle The PBL3717A is a drive circuit for single-phase windings of stepper motors designed and manufactured by SGS. Internally, it uses an H-bridge pulse width modulation circuit. Signals are distributed using a logic distributor or microprocessor composed of external logic circuits. Several such circuits and a small number of passive components can form a complete multi-phase stepper motor driver program, enabling full-step (basic step), half-step, or micro-step control. The control method is bipolar, fixed OFF (off) time chopper current control. The functions of each pin of the PBL3717A are briefly introduced below. As shown in Figure 1, it uses a 16-pin dual in-line plastic package. Pins 1 (OUTPUT B) and 15 (OUTPUT A) are output terminals, connected to the two ends of one phase winding coil respectively; pin 2 (PULSE TIME) connects to an external RC timing element; pins 3 and 14 (Vs) are the winding coil power supply, selectable within the range of 10-46V; pins 4, 5, 12, and 13 (GND) are ground terminals, which can be connected to a hot plate; pin 6 (Vss) is the IC power supply connected to +5V; pins 7 and 9 (INPUT 1, INPUT 0) are used to select the winding coil current; pin 8 (Phase) is the phase input terminal, used to control the rotation direction; pin 16 (Sense Resistor) is an external winding current sampling resistor, the sampling signal is sent to pin 10 (Comparator Input) through an RC low-pass filter, and compared with the reference voltage of the internal voltage comparator; pin 11 (Reference) connects to an external reference voltage, changing the Reference can achieve micro-step control, for example, using one microcontroller and two DAC0808 8-bit chips. The D/A conversion circuit can achieve 256 microstepping control. In full-step, half-step, and 1/4-step operation modes, the REFERENCE is connected to a fixed +5V. This paper only discusses this case. 2.2 Step Control Method of PBL3717A This paper designs a control system for a two-component hybrid stepper motor, and the specific drive circuit is shown in the figure. PHASE, INPUT 1, and INPUT 0 (abbreviated as PH, I1, and I0 in the figure) are the input terminals, and OUTPUT A and OUTPUT B (represented as MA and MB in the figure) are the output terminals. Because this paper does not consider the microstepping case, the DAC (pin 11) in the figure can be directly connected to the +5V power supply. The function of PHASE is to control the direction of the current in the stator winding of the stepper motor. When PHASE=0, the current flows from MB to MA; when PHASE=1, the current flows from MA to MB. The PBL3717A controls the step distance by selecting different combinations of I1 and I0, thereby controlling the winding current and achieving the purpose of step distance control. The specific value of the current is determined by VR and RS. The calculation formula is as follows: Im=(Vr*0.083)/Rs[A], 100% level; Im=(Vr*0.050)/Rs[A], 60% level; Im=(VR*0.016)/Rs[A], 20% level. PBL3717A can realize three operating modes. In the following discussion, A and B represent the two-phase winding forward current operation and A and B represent the two-phase winding reverse current operation. (1) The basic step (full step) operation mode can be realized by two-phase excitation four-step mode, that is, AB→AB→AB→AB, or by single-phase excitation four-step mode, that is, A→B→A→B. (2) Half-step operation mode The half-step mode adopts a two-phase eight-step method with alternating two-phase and single-phase excitation, namely AB→B→AB→A→AB→B→AB→A. In this operation mode, two-phase excitation and single-phase excitation alternate, and the torque of each phase is not equal. The torque in two-phase excitation is 1.4 times that in single-phase excitation. This is because the torque in two-phase excitation is a vector synthesis of the torque in single-phase excitation. If I1I0=01 is used in two-phase excitation to reduce the current to 60%, due to the saturation effect of the magnetic circuit, the torque of each phase may increase to about 70%, and the torque synthesized by the two phases is close to 1. In this way, the motor can approximately achieve constant torque operation. (3) 1/4 step operation mode In order to achieve the 1/4 step operation mode, a 1/4 step state needs to be inserted between the full step and the half step. For example, in the 1/4 step state above, the A phase winding takes 100% current and the B phase winding takes 20% current. In the first quadrant, transitioning from half-step A to half-step B requires four steps: A→A0.2B→AB→0.2AB→B. Knowing the vector diagram of the first quadrant, it's easy to deduce the vector diagrams of the other three quadrants. One cycle requires six steps: AB→0.2AB→B→0.2AB→AB→A0.2B→A→A0.2B→AB→0.2AB→B→0.2AB→AB→A0.2B→A→A0.2B, where 0.2A and 0.2B represent 20% current draw from the A-phase and B-phase windings, respectively. 3. Hardware Section Because the DSP uses a 3.3V power supply, while the PBL3717A operates at +5V, the 3.3V and 5V level conversion must be considered. Figure 4 shows the conversion standard between 5V CMOS, 5V TTL, and 3.3V TTL levels. In this diagram, VOH represents the lowest output high level, VIH represents the lowest input high level, VIL represents the highest input low level, and VOL represents the highest output low level. As can be seen from the diagram, the level conversion standards for 5V CMOS and 3.3V TTL are different. Therefore, the pins of a 3.3V device (LVC) cannot be directly connected to the pins of a 5V CMOS device. In this case, a dual-voltage (3.3V power supply on one side, 5V power supply on the other) driver can be used, such as TI's SN74ALVC164245 and SN74LV4245. However, the level conversion standards for 5V TTL and 3.3V TTL are the same, so they can be directly connected. Because the PBL3717A is a TTL-compatible circuit, the DSP's I/O ports can be directly connected to the corresponding pins of the PBL3717. Here, we select IOPB0, IOPB1, IOPB2, IOPB3, IOPB4, and IOPB4 from port B of the DSP and connect them to I1B, I0B, I1A, I0A, PhaseA, and PhaseB of the PBL3717A, respectively. 4. Software Section This paper designs the DSP control software using a stepper motor operating at 1/4 step as an example. The DSP control software is written in C language. The control words from the first step to the sixteenth step are: 0x0000, 0x0004, 0x000c, 0x0014, 0x0010, 0x0011, 0x0013, 0x0031, 0x0030, 0x0034, 0x003C, 0x0024, 0x0020, 0x0021, 0x0023, and 0x0001. The above values are stored in the array Run_Table[]. A loop program can call the corresponding values from the array and assign them to the data and direction control register PBDATDIR at port B. This allows the DSP's port B to drive and control the corresponding pins of the PBL3717A, thus achieving stepper motor rotation. The motor speed can be changed by modifying the value of `count` in the `run_delay(int count)` delay subroutine. Below is a list of the control program for forward rotation of a two-phase stepper motor in 1/4-step mode. /*Filename:Step.c*/ /*IOPB0=I1B,IOPB1=I0B,IOPB2=I1A,IOPB3=10A,IOPB4=PhaseA,IOPB5=PhaseB*/ #include "f2407_c.h" static int Run_Table[]={0x0000,0x0004, 0x000C,0x0014,0x0010,0x0011,0x0013,0x0031,0x0030,0x0034,0x003C,0x0024,0x0020, 0x0021,0x0023,0x0001}; void main() {int i; InitCPU(); while(1) {for(i=0;i<=15;i++) { *PBDATDIR=Run_Table[i]|0xff00; run_delay(10); } } } Conclusion In summary, by using a DSP or other microprocessor, selecting two or more PBL3717A chips and a small number of passive components, a complete and stable multiphase stepper motor drive system can be formed, which can realize full-step, half-step, or micro-step control. This method is low-cost, easy to implement, and has stable performance, making it a good choice for stepper motor drive systems.