Share this

Design of a stepper motor control system based on TMC428

2026-04-06 05:44:50 · · #1

Abstract: This paper presents a high-performance, simple, and reliable motion control system designed using the TMC428 stepper motor controller and its drive circuit. By setting the values ​​of the TMC428's internal parameter registers and on-chip RAM, the TMC428 can simultaneously control three stepper motors, realizing a three-axis control system.

Keywords: TMC428; TMC236; three-axis control; SPI interface

Abstract: use TMC428 stepper motor controller together with driver circuit to design a motion control system which has simple structure and perfect characteristic, and it has high level security.To set the proper parameter of register and on-chip RAM of TMC428, it can make TMC428 control three stepper motor in the same time, and realize three-axis control system. Keyword: TMC428, TMC236, three-axis control, SPI interface.

introduction

Stepper motors are important actuators widely used in industrial control and various office equipment. The stable and reliable operation of stepper motors directly affects the precision of industrial control and the quality of equipment, especially in high-precision CNC systems where precise stepper motor operation is crucial. Achieving precise and reliable control of stepper motors has become a key technology in industrial control systems. Over the years, many experts and scholars have developed numerous high-performance stepper motor control systems. However, early stepper motor control systems were large and used many components, posing significant risks to reliable operation. With the development of electronic technology, many functional units have become modular and digital, offering advantages such as small size, light weight, high reliability, and low cost. Furthermore, they can achieve multi-axis control, greatly simplifying the design of stepper motor control systems. The TMC428, manufactured by TRINAMIC, is such a three-axis stepper motor motion control chip. This paper uses the TMC428 control chip to design a three-axis stepper motor control system, which can be used in economical three-axis CNC systems.

I. TMC428 Chip and its Functions

The TMC428 is a small, cost-effective two-phase stepper motor controller that includes commonly used stepper motor control functions such as position control, speed control, and microstepping control. It can control three two-phase stepper motors simultaneously. It has two independent SPI interfaces, which can be connected to a microprocessor and a stepper motor driver with an SPI interface, respectively. It can also be connected to three TMC236s in a daisy-chain configuration.

1. Structure

The TMC428 is packaged in a 16-pin package and consists of registers and on-chip RAM for each unit. Internally, it includes two external serial interfaces, a waveform generator and pulse generator, a microstepping unit, a multi-port RAM controller, and an interrupt controller, as shown in Figure 1. SPI serial communication uses a simple 32-bit data length protocol, achieving data transfer rates up to 1 Mbit/s when connected to a motor driver. It has a wide clock input range and a maximum clock frequency of 16 MHz, and is powered by 3.3V or 5V CMOS/TTL compatible levels.

Figure 1

2. Functions

The TMC428 has four different operating modes, allowing for individual programming of each stepper motor's control. Position control includes RAMP and SOFT modes, while speed control includes VELOCITY and HOLD modes. The TMC428 provides a set of functionally distinct register units and on-chip RAM. Control instructions are typically obtained from the microprocessor, which reads and writes to the TMC428 registers and RAM by sending and receiving fixed-length data packets. The registers and on-chip RAM of the TMC428 have different functions. Registers store overall motor configuration parameters and motion parameters, while the on-chip RAM stores the configuration of the driver serial interface and the microstepping table. Overall motor parameters refer to the configuration of the TMC236 in the driver daisy chain. Motion parameters include the current position, target position, maximum speed, maximum acceleration, current ratio, waveform generator and pulse generator parameters, and microstepping resolution for each motor. The on-chip RAM includes a 64-address data space, with each address storing 24 bits of data. The first 32 bits are the configuration of the driver daisy chain serial communication data packets, and the last 32 bits are the microstepping table.

After initialization, the TMC428 can automatically send data packets to each TMC236 in the daisy chain. This means the serial interface driver can operate automatically after initialization without microprocessor intervention. Simply writing the position and speed into the designated registers controls the motor. The TMC428's multi-port RAM controller manages the timing of data access. This allows the microprocessor to read and write data from registers and on-chip RAM at any time.

The waveform generator processes the motion parameters stored in the registers and calculates the motor speed curve. The pulse generator then generates step pulses based on the speed calculated by the waveform generator. When step pulses are generated, the TMC428's driver serial interface automatically sends data packets to the stepper motor driver daisy chain to drive the stepper motor. When microstepping control is used, the microstepping unit begins processing the step pulses generated by the pulse generator, and simultaneously generates full-step, half-step, and microstep pulses according to the selected microstepping resolution, sending them to the driver daisy chain via the driver serial port.

The driver serial interface is the communication interface between the TMC428 and the driver daisy chain. The length of the serial data packets between the TMC428 and the driver is configurable to accommodate SPI ring structures composed of circuits of different types and manufacturers, with a maximum data length of 64 bits. After initialization, communication between the TMC428 and the stepper motor driver is completed automatically. Different types of drivers with SPI interfaces can be mixed and matched to form a daisy chain structure and connect to the TMC428.

II. System Analysis

This system uses the MCS51 microcontroller as its microprocessor for system control and instruction issuance. This is the core of the entire control system, and all logic and quantitative calculations are performed by the microcontroller. Since the system uses SPI serial communication, and the MCS51 microcontroller itself does not have an SPI interface, a dedicated SPI interface module is required for data conversion between the microcontroller and the TMC428. Here, the MCP2510 SPI interface chip is used. After power-on, the microcontroller first initializes the TMC428, setting initial motion parameters such as position, velocity, and acceleration, and configuring daisy-chain serial communication data and the microstepping table. Because the motion parameters are configured in the TMC428's function registers, they can be changed online during operation to adapt to the actual motion process. However, the daisy-chain serial communication data and the microstepping table are stored in the on-chip RAM, and these parameters generally cannot be changed after power-on. Therefore, these parameters must be accurately calculated during initialization. A daisy-chain configuration of three TMC236 microcontrollers is used, with each TMC236 controlling one stepper motor. After initialization, the TMC428 can automatically send control data to the TMC236 independently of the microcontroller to control the motors. However, since the control signals emitted by the TMC236 are relatively weak and insufficient to drive the motors, the control signals emitted by the TMC236 must be amplified to drive the motors. The system structure is shown in Figure 2.

Figure 2

III. Hardware Design

The microcontroller used in this system is the AT89S52, with a system clock frequency of 16MHz. While the TMC428's maximum operating frequency can reach 16MHz, the TMC236's PWM operating frequency cannot exceed 100kHz. Therefore, for ease of design, a frequency divider circuit is used to divide the 16MHz clock frequency to 20kHz. Both the TMC428 and TMC236 use the same 20kHz clock frequency. To reduce power supply complexity, the system is powered by a single +5V DC power supply. Since the TMC428 does not use internal interrupts in this system, the three reference switch inputs must be grounded. Furthermore, since no 3.3V power supply is used, pin V33 must be grounded through a 470nF capacitor. The +5V input power supply must be filtered through a 100nF capacitor to ensure reliable operation of the TMC428. The SDI_S pin, which drives the SPI interface data input line, is pulled down through a 10K resistor. The TMC428's nscs_s pin is connected to the CSN pin as the enable signal for three TMC236 circuits. Control data is transmitted to the TMC236's SDI pin via the SDO_S pin. Since a daisy-chain configuration is used, the three TMC236 circuits are connected in series through their respective SDO and SDI pins. In the TMC236 circuit design, a 20kHz external clock is input from the OSC pin. Because the TMC236 integrates a dual full-bridge driver circuit composed of HVCMOSFETs, it uses a constant current chopper drive method to drive a bipolar two-phase stepper motor. The motor's power supply is input through the VS pin, but a 220pF and a 100uF capacitor must be connected to the VS pin for filtering. In this system, a +12V DC power supply is used as the excitation power for the two-phase windings of the motor. The TMC236's OA1 and OA2 pins are connected to the stepper motor's A-phase excitation winding, while OB1 and OB2 are connected to the stepper motor's B-phase excitation winding. In addition, to limit the maximum current of the motor, a current-limiting resistor Rs must be set for the TMC236 dual full-bridge drive circuit. The value of resistor Rs can be calculated using the following formula:

Where Imax is the maximum allowable current of the motor, in this case Imax = 1030mA, so the calculated resistance Rs = 0.33Ω. This system uses a pulse transformer as a power amplifier to directly power the stepper motor. The main circuit of the system is shown in Figure 3.

Figure 3

IV. Software Design

The control system software primarily handles the initialization of the TMC428 and the calculation and transmission of control parameters. Initialization involves setting the TMC428's operating modes: position control and speed control, as well as the number of stepper motors to be controlled. These parameters are set by the microprocessor writing data to the relevant registers of the TMC428. The address of the position and speed control mode register is 1010. In this system, position control uses RAMP mode, and speed control uses VELOCITY mode. Since this system is a three-axis control design, the TMC428 needs to control three stepper motors simultaneously. Therefore, in the stepper motor global configuration parameter register settings, the bottom two bits of the register must be set to 10, while the other bits use their default values. According to the TMC428's functional requirements, each motor has its own configuration register, and the initial position and initial speed of each motor must be set individually in its respective register. During initialization, the target speed, target position, actual speed and position, and the maximum and minimum values ​​of acceleration and speed of the motors are set. Address 00 represents motor 1, address 01 represents motor 2, and address 10 represents motor 3, with register address ranges from 0000 to 1110. After initialization, the microprocessor can modify the data in the registers and on-chip RAM at any time to adapt to actual control needs. The software operation process of this system is shown in Figure 4.

Figure 4

V. Summary

The system, composed of a dedicated stepper motor motion controller and drive circuit, boasts advantages such as simple peripheral circuitry, strong anti-interference capability, and high reliability, reducing the development cost of the control circuit. The entire system, excluding the power supply, comprises only five ICs, resulting in a small size and simple control, making it particularly suitable for driving 3-axis stepper motors. Experiments have demonstrated that the stepper motor controlled by this driver exhibits high positioning accuracy, excellent acceleration and deceleration performance, and superior start-stop and reverse performance.

References:

1 TMC428 datasheet

2 TMC236 datasheet

3 Wu Hongxing. *Dedicated Integrated Circuits for Motor Drive and Control and Their Applications*. Beijing: China Electric Power Press, 2006.

4. Yu Haisheng, Pan Songfeng, Yu Peiren, Wu Herong. *Microcomputer Control Technology*. Beijing: Tsinghua University Press, 1999.

5 Dong Guihua. Research on stepper motor control system. Agricultural Mechanization Research. Issue 3, 2003.

6. Zhou Mingde. *Principles and Technology of Single-Chip Microcomputers*. Beijing: Posts & Telecom Press, 2008.

Read next

CATDOLL 123CM Tina (TPE Body with Hard Silicone Head)

Height: 123cm Weight: 23kg Shoulder Width: 32cm Bust/Waist/Hip: 61/54/70cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22