Stepping motor control method
By adopting the LM3S615 minimum system and SG55M single-axis differential driver in the stepper motor control system, combining the bipolar steady-current pentagonal drive method and software modular design, the problems of low control accuracy and complex equipment in the existing stepper motor control technology are solved, and motor control is achieved with high accuracy and real-time performance.
Patent Information
- Application Number
- CN202411961024.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-05-06
AI Technical Summary
The existing stepper motor control technology has the disadvantages of low control accuracy, poor real-time performance, complex equipment, and large portability.
The stepper motor control component hardware and software based on the LM3S615 minimum system is adopted, combined with the SG55M single-axis differential driver, and the bipolar steady-current pentagonal drive method is adopted to achieve precise control of the stepper motor through the software modular design.
It improves the control accuracy and real-time of stepper motors, simplifies the equipment structure, reduces the portable volume, and achieves more efficient motor control.
Smart Images

Figure CN119945216A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of motor control and relates to a stepping motor control method. Background Art
[0002] The stepper motor is an open-loop control element that converts an electrical pulse signal into an angular displacement or a linear displacement. In the case of non-overload, the motor's speed and stop position depend only on the frequency and number of pulses of the pulse signal, and are not affected by load changes, that is, when a pulse signal is added to the motor, the motor rotates a step angle. The existence of this linear relationship, coupled with the characteristics of the stepper motor having only periodic errors and no cumulative errors, makes it more convenient to use stepper motors to control speed, position and other control fields. If an orderly pulse current is applied to the winding in sequence through a single-chip microcomputer, the rotation of the motor can be controlled, thereby realizing the conversion of digital angles. The angle of rotation is proportional to the number of pulses applied, the speed of rotation is proportional to the pulse frequency, and the direction of rotation is related to the order of the pulses. However, the current stepper motors have the disadvantages of low control accuracy, poor real-time performance, complex equipment, and large portable size. Summary of the invention
[0003] In order to overcome the deficiencies of the prior art, the present invention provides a stepper motor control method. In order to achieve the above purpose, the present invention adopts the following technical scheme: a stepper motor control method, including stepper motor control component hardware, including LM3S615 minimum system, JTAG process test interface, RS232 serial port, level conversion module, motor interface, onboard secondary power supply, TVS power protection circuit, RTC clock source, ADC circuit, LCD display screen and peripheral timing circuit, wherein the ARM minimum system is composed of LM3S615, crystal oscillator, FLASH circuit and SDRAM circuit, and the control component outputs the pulse required by the driving component;
[0004] The stepper motor drive assembly is used to drive a five-phase stepper motor;
[0005] The stepper motor control component software uses LM3S615 and includes a project manager, editor, C / C++ compiler and ARM assembler, connector XLINK and debugging tool C-SPY that supports RTOS.
[0006] Furthermore, the stepper motor drive assembly adopts SG55M, which is a single-axis differential driver.
[0007] Furthermore, the driving mode of the stepper motor driving component is a bipolar steady-current pentagonal driving mode.
[0008] Furthermore, the system structure of the stepper motor control component software consists of a clock management module, a serial transmission control module, a serial port module, an instruction parsing module, a time control module, a status acquisition module, a telemetry data packaging module, and a test interface module.
[0009] In summary, the present invention is beneficial in that:
[0010] 1) The present invention realizes the control of the stepping angle, angular displacement, rotation speed and acceleration of the stepper motor through the software design of the motor control component hardware and the assistance of the driving component. It has the advantages of high control accuracy, good real-time performance, relatively simple equipment and small portability. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 It is a schematic diagram of a stepper motor module of the present invention.
[0012] Figure 2 This is the software process of the present invention.
[0013] Figure 3 This is a timing diagram output by the stepper motor control component of the present invention. DETAILED DESCRIPTION
[0014] The following describes the embodiments of the present invention through specific examples, and users of the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0015] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0016] All directional indications in the embodiments of the present invention (such as up, down, left, right, front, back, horizontal, vertical...) are only used to explain the relative position relationship, movement status, etc. between the components in a certain specific posture. If the specific posture changes, the directional indication will also change accordingly.
[0017] Due to installation errors and other reasons, the parallel relationship referred to in the embodiments of the present invention may actually be an approximately parallel relationship, and the vertical relationship may actually be an approximately vertical relationship.
[0018] Embodiment 1:
[0019] like Figure 1-3 As shown, a stepper motor control method includes a stepper motor control component hardware, a stepper motor drive component and a stepper motor control component software.
[0020] The hardware of the stepper motor control component includes the LM3S615 minimum system, JTAG process test interface, RS232 serial port, level conversion module, motor interface, onboard secondary power supply, TVS power protection circuit, RTC clock source, ADC circuit, LCD display and peripheral timing circuit, etc. Among them, the ARM minimum system is composed of LM3S615, crystal oscillator, FLASH circuit and SDRAM circuit. The control component outputs the pulses required by the drive component, thereby controlling the step angle, angular displacement, rotation speed, acceleration and other parameter adjustments of the stepper motor.
[0021] The stepper motor drive component uses SG55M, which is a single-axis differential driver used to drive a five-phase stepper motor. The drive mode is a bipolar steady-current five-angle drive mode. The drive current (output current) is 0.5~1.6A / phase (selected by the switch). The input signal is a clockwise rotation command pulse input (or a pulse signal input in a single clock mode), a counterclockwise rotation command pulse input (or a rotation direction signal input in a single clock mode), and the locking input is a subdivision number selection input (digital switch or 4-bit binary signal). The pulse width is 0.5μs (min), the interval is 0.5μs (min), the rise / fall time is 1μs (max), the maximum pulse frequency is 500kpps, the voltage is 4~8V, [0] is The internal resistance of (HO, DS) mode is 390, and the internal resistance of (F, R) mode is 300. The output signal is an excitation output signal (mechanical origin excitation output signal), with automatic current reduction function, natural cooling, power supply DC 24 ~ 36V, maximum current 3,
[0022] The software of the stepper motor control component uses LM3S615. The integrated development environment selected for LM3S615 is IAR Embedded Workbench for ARM (hereinafter referred to as IAR EWARM). This software is an integrated development environment for ARM processors. It includes a project manager, editor, C / C++ compiler and ARM assembler, connector XLINK and debugging tool C-SPY that supports RTOS. In the EWARM environment, embedded applications can be easily developed using C / C++ and assembly language. The software changes the current on the motor winding by changing the duty cycle of PWM. The main program is mainly to initialize each functional module, including enabling the I / O port where the PWM output is located, enabling PWM interrupts, enabling total interrupts, etc. The interrupt program includes the direction of the motor, the micro-step subdivision of the motor, etc. The software adopts a modular design to facilitate subsequent parameter adjustment and function verification. The software system structure consists of a clock management module, a serial transmission control module, a serial port module, an instruction parsing module, a time control module, a state acquisition module, a telemetry data packaging module, and a test interface module.
[0023] Software process such as Figure 2 As shown. Every time the PWM interrupt function is entered, the PWM duty cycle changes once. The duty cycle corresponding to each microstep of the motor is made into a table. When the program is running, the motor winding is energized by looking up the table, and the forward and reverse rotation of the motor can be achieved by changing the order of the table lookup. The output timing diagram of the stepper motor control component is shown in Figure 3 shown.
[0024] The joint test of the stepper motor control component, drive component and stepper motor is as follows: 1) Connect the 5 pins of CN1 of the driver to the stepper motor through the MINI_CA_SG cable. The corresponding wiring colors are brown, red, orange, yellow, and green (1 to 5). 2) Set CN2. In the circuit design, the input ports (7, 8) of the CW and CCW pulse input interface circuits are CMOS level inputs, requiring a 3.3k pull-up resistor and connected to the port ground (1) through a 100pF ceramic capacitor; the input port (9) of the motor excitation OFF and step angle setting input interface circuits is a CMOS level input, connected to the I / O through a 1k resistor, and there are a 22k and a 220pF capacitor connected to the port ground (1) at the front and rear ends of the resistor, respectively. The series resistors act as dampers, consuming overvoltage energy and thus suppressing circuit oscillations, while the parallel resistors absorb the electrical energy of the capacitors, preventing the capacitors from discharging too much current and thus avoiding damage to the devices connected in parallel; the voltage of the output port (10) of the excitation timing signal output interface circuit is DC 30V (min) and the current is 15mA (min). Pin 1 F+ is connected to PD5, and the program production of the timer is triggered by a 32-bit cycle, and the timing pulse is received. PD5 is connected to the KEY2 button. The function of the button is to control the generation of pulses (reset function). In the initial stage of normal operation, after the program configuration is completed, a timing pulse is generated. The pulse is cycled according to the cycle, that is, the pulse waveform and the timing level are generated alternately. The global reset is generated by the reset button, and the default state is high level. Pin 2 F- is not used for the time being. Pin 3 R+ is connected to a high level, and R+ is connected to PB4. Pin 4 R- is not connected for the time being. Pin 5 H.O+ is connected to a low level, and pin 6 HO- is connected to a high level to activate the motor and operate normally. Pin 5 is connected to PE1, and pin 6 is connected to PB6. Pin 7 D.S+ is connected to a high level and connected to PB3. The M switch is not used for the time being. Pin 8 DS- is connected to a low level and connected to PE0 to realize the selection of the subdivision number. Pins 9 and 10 are output pins, which are fed back to the controller to determine the extreme position of the motor. Pin 9 is connected to a high level and connected to PB2, and pin 10 is connected to a low level and connected to PE2. 3) Set CN3. Pins 1, 2, 3, and 4 receive high and low levels so that they can change from 0000 to 1111 to determine the number of subdivisions. Therefore, a 4-bit DIP switch is used to control it. It is generated by the GPIO input and output program. KEY1 is connected to PD4, KEY5 is connected to PC7, KEY3 is connected to PB5, and KEY4 is connected to PA 4 to control the high and low level changes. The control effect is displayed by 4 LED lights. 4) Set CN4. Pin 1 is connected to an external 24V DC power supply, and pin 2 is grounded. At the same time, it is connected to the MINI_CA_SG cable. The corresponding wiring colors are purple (7) (connected to power, 24V) and gray (8) (grounded, power return line). 5) Set the switch and knob control. Switch 1 is set to OFF, switch 2 is set to ON, and single clock mode is selected. Switch 3 is selected to OFF, with current drop, and switch 4 is set to OFF.The M knob is not used, the RUN knob is set to F, the drive current is 1.6A / phase, the STOP knob is set to 5, and the stop current is 50% of the drive current. The five-way timing diagram required by the stepper motor in this experiment is generated by the control component, and the drive control of the stepper motor is realized through the drive component. The experimental results show that the step angle, angular displacement, rotation speed, acceleration and other parameters of the stepper motor can be controlled and adjusted, and the stepper motor operates normally.
[0025] Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technical users in the field without creative work should fall within the scope of protection of the present invention.
Claims
1. A stepper motor control method, characterized in that: include The stepper motor control component hardware includes the LM3S615 minimum system, JTAG process test interface, RS232 serial port, level conversion module, motor interface, onboard secondary power supply, TVS power protection circuit, RTC clock source, ADC circuit, LCD display and peripheral timing circuit. The ARM minimum system consists of LM3S615, crystal oscillator, FLASH circuit and SDRAM circuit, and the control component outputs the pulse required by the drive component. The stepper motor drive assembly is used to drive a five-phase stepper motor; The stepper motor control component software uses LM3S615 and includes a project manager, editor, C / C++ compiler and ARM assembler, connector XLINK and debugging tool C-SPY that supports RTOS.
2. A stepper motor control method according to claim 1, characterized in that: The stepper motor drive assembly adopts SG55M, which is a single-axis differential driver.
3. A stepper motor control method according to claim 1, characterized in that: The driving mode of the stepper motor driving component is a bipolar steady-current pentagonal driving mode.
4. A stepper motor control method according to claim 1, characterized in that: The system structure of the stepper motor control component software consists of a clock management module, a serial transmission control module, a serial port module, an instruction parsing module, a time control module, a state acquisition module, a telemetry data packaging module, and a test interface module.