Brushless roller motor control method based on real-time operating system residency

By dividing the terminal software of the brushless roller motor into interrupt lines and task lines, and using a real-time operating system to divide it into multiple threads to handle different control tasks, the problem of insufficient stability and reliability of brushless roller motor control is solved, and flexible motor control and convenient maintenance and upgrades are realized.

CN114865953BActive Publication Date: 2026-03-10SUZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-13
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing brushless roller motor control methods cannot be effectively maintained and upgraded, resulting in reduced control stability and reliability.

Method used

The terminal software of the brushless roller motor is divided into interrupt lines and task lines. The interrupt lines are used to interact with the host computer for data and phase operation control. The real-time operating system is ported to the task lines and divided into main thread, PID thread, protection thread, communication thread and time mode thread to handle different motor control tasks, thereby achieving discrete control.

Benefits of technology

It improves the control stability and reliability of the brushless roller motor, facilitates later maintenance and upgrades, and enhances the flexibility and specialization of control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114865953B_ABST
    Figure CN114865953B_ABST
Patent Text Reader

Abstract

A control method for a brushless roller motor based on a real-time operating system (RTOS) is disclosed. This method divides the terminal software corresponding to the brushless roller motor into interrupt lines and task lines. Data interaction and phase operation of the brushless roller motor are achieved using the user software on the host computer connected to the brushless roller motor via the interrupt lines. Furthermore, after porting the ROS to the task lines, the task lines are divided into main threads, PID threads, protection threads, communication threads, time-mode threads, and position-mode threads. These threads then process different motor control tasks. This control method achieves discrete control of the brushless roller motor through interrupt lines and task lines, and utilizes the task lines to port different ROS to enable rapid control of the brushless roller motor. This facilitates targeted maintenance and upgrades of the motor, improving the control stability and reliability of the brushless roller motor.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This invention relates to the field of motor control and management, and in particular to a control method for a brushless roller motor based on a real-time operating system. [Background Technology]

[0002] With the increasing complexity of embedded applications and the improvement of microcontroller performance, real-time operating systems (RTOS) have gained widespread attention due to their excellent real-time performance and reliability. However, ROS are highly specialized and independent, and are closely related to both hardware and software platforms, making it difficult to port and reuse software from different systems. Existing brushless roller motors are controlled by a single operating system, which hinders effective maintenance and upgrades, thus reducing the control stability and reliability of the brushless roller motor. [Summary of the Invention]

[0003] The purpose of this invention is to provide a brushless roller motor control method based on a real-time operating system. This method divides the terminal software corresponding to the brushless roller motor into interrupt lines and task lines. Data interaction and phase operation of the brushless roller motor are achieved using the user software on the host computer connected to the brushless roller motor via the interrupt lines. Furthermore, after porting the task lines to the real-time operating system, the task lines are divided into main threads, PID threads, protection threads, communication threads, time-mode threads, and position-mode threads. These threads then process different motor control tasks. This control method achieves discrete control of the brushless roller motor through interrupt lines and task lines, and utilizes the task lines to port different real-time operating systems, enabling rapid control of the brushless roller motor. This facilitates targeted maintenance and upgrades of the motor, improving the control stability and reliability of the brushless roller motor.

[0004] The objective of this invention is achieved through the following technical solution:

[0005] A brushless roller motor control method based on a real-time operating system includes the following steps:

[0006] Step S1: Divide the terminal software corresponding to the brushless roller motor into interrupt lines and task lines;

[0007] Step S2: Use the user software corresponding to the host computer connected to the brushless roller motor via the interrupt line to perform data interaction and control the phase operation state of the brushless roller motor.

[0008] Step S3: After the task line is ported to the real-time operating system, the task line is divided into a main thread, a PID thread, a protection thread, a communication thread, a time-mode thread, and a position-mode thread; then, different motor control tasks are processed through the threads obtained from the above division.

[0009] Step S4: Based on the processing results of each thread for different motor control tasks, the processing status of the motor control tasks is displayed in real time on the host computer.

[0010] In one embodiment, in step S2, the process of using the interrupt line to interact with the user software corresponding to the host computer of the brushless roller motor to control the phase operation state of the brushless roller motor specifically includes:

[0011] The interrupt line is divided into a serial port interrupt thread and a timer interrupt thread;

[0012] The serial port interrupt thread is used to interact with the user software of the host computer, thereby receiving data information from the host computer;

[0013] Using the timer interrupt thread, the brushless roller motor is controlled to perform motor commutation operation based on the motor position signal included in the data information from the host computer.

[0014] In one embodiment, step S3, introducing a real-time operating system using the taskline porting specifically includes:

[0015] After building a real-time operating system (RTOS) resident framework on the chip corresponding to the task line, the RT-Thread real-time operating system is then ported and introduced using the RTOS resident framework. Building the RTOS resident framework includes modifying the chip's boot file, configuring the linker file, encapsulating driver components, and handling interrupt inheritance.

[0016] In one embodiment, step S3 further includes initializing the peripherals of the brushless roller motor using the main thread, the process of which is as follows:

[0017] The main thread is instructed to start working, the total interrupt of the brushless roller motor is turned off, and the GPIO component, UART component and ADC component of the chip corresponding to the task line are initialized.

[0018] The system initializes the brushless roller motor, interrupts the enabling of the brushless roller motor's peripherals, and then enables the brushless roller motor's total interrupt, thereby completing the initialization process of the brushless roller motor's peripherals.

[0019] In one embodiment, step S3 further includes using the PID thread to perform closed-loop control of the brushless roller motor, the process of which is as follows:

[0020] Instruct the PID thread to start working and initialize the parameters of the PID thread;

[0021] When the brushless roller motor switch is enabled, the PID thread is used to calculate the motor position and motor speed of the brushless roller motor.

[0022] Based on the calculated results of the motor position and motor speed, the PWM duty cycle of the brushless roller motor is adjusted to complete the closed-loop control of the brushless roller motor.

[0023] In one embodiment, step S3 further includes using the protection thread to protect the brushless roller motor during operation, the process of which is as follows:

[0024] The protection thread is instructed to start working. When the brushless roller motor switch is enabled, the operating current data, operating voltage data and operating temperature data of the brushless roller motor are collected.

[0025] The operating current data, the operating voltage data, and the operating temperature data are filtered.

[0026] The operating current data is analyzed and processed to determine whether the brushless roller motor is currently in an overcurrent operating state.

[0027] The operating voltage data is analyzed and processed to determine whether the brushless roller motor is currently in an overvoltage or undervoltage operating state.

[0028] The operating temperature data is analyzed and processed to determine whether the brushless roller motor is currently in an overheated operating state.

[0029] If the brushless roller motor is currently in an overcurrent, overvoltage, undervoltage, or overheating state, then the brushless roller motor should be turned off.

[0030] In one embodiment, step S3 further includes using the communication thread to realize information processing and interaction between the brushless roller motor and the host computer;

[0031] Furthermore, the time-mode thread and the position-mode thread are used to perform time-mode control and position-mode control on the brushless roller motor, respectively.

[0032] In one embodiment, in step S3, the brushless roller motor is controlled in a time-mode using the time-mode thread, the process of which is as follows:

[0033] Using the time-mode thread, the brushless roller motor is controlled to run continuously at a specified speed and direction until a preset running time position is reached;

[0034] And / or,

[0035] The time-mode thread is used to control the brushless roller motor to run at a specified cycle interval and total number of cycles.

[0036] In one embodiment, in step S3, the position mode thread is used to perform position mode control on the brushless roller motor, the process of which is as follows:

[0037] Using the position mode thread, the brushless roller motor is controlled to continuously run a predetermined distance at a specified speed and direction.

[0038] In one embodiment, step S4, specifically displaying the processing status of the motor control task in real time via the host computer based on the processing results of each thread for different motor control tasks, includes:

[0039] The interrupt line is used to feed back the processing progress results of the main thread, the PID thread, the protection thread, the communication thread, the time mode thread, and the position mode thread for the corresponding motor control task to the user software of the host computer, so that the host computer can display the processing status of the motor control task in real time.

[0040] Compared with the prior art, the present invention has the following beneficial effects:

[0041] The brushless roller motor control method based on a real-time operating system provided in this application divides the terminal software corresponding to the brushless roller motor into interrupt lines and task lines. Data interaction and phase operation of the brushless roller motor are achieved using the user software of the host computer connected to the brushless roller motor via the interrupt lines. Furthermore, after porting the task lines to the real-time operating system, the task lines are divided into main threads, PID threads, protection threads, communication threads, time-mode threads, and position-mode threads. Different motor control tasks are then processed through these threads. This control method achieves discrete control of the brushless roller motor through interrupt lines and task lines, and utilizes the task lines to port different real-time operating systems, enabling rapid control of the brushless roller motor. This facilitates targeted maintenance and upgrades of the motor, improving the control stability and reliability of the brushless roller motor. [Attached Image Description]

[0042] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:

[0043] Figure 1This is a flowchart illustrating the brushless roller motor control method based on a real-time operating system provided in this application.

Detailed Implementation Methods

[0044] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the specific embodiments of this application will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, it should be noted that, for ease of description, only the parts relevant to this application are shown in the accompanying drawings, not the entire structure. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of this application.

[0045] The terms “comprising” and “having”, and any variations thereof, used in this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.

[0046] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0047] Please see Figure 1 As shown, an embodiment of this application provides a brushless roller motor control method based on a real-time operating system. The brushless roller motor control method based on a real-time operating system includes the following steps:

[0048] Step S1: Divide the terminal software corresponding to the brushless roller motor into interrupt lines and task lines;

[0049] Step S2: Use the user software corresponding to the host computer connected to the brushless roller motor via the interrupt line to perform data interaction and control the phase operation status of the brushless roller motor.

[0050] Step S3: After introducing the real-time operating system using task line porting, the task line is divided into main thread, PID thread, protection thread, communication thread, time mode thread, and position mode thread; then, different motor control tasks are processed through the threads obtained from the above division.

[0051] Step S4: Based on the processing results of each thread for different motor control tasks, the processing status of the motor control tasks is displayed in real time on the host computer.

[0052] The above control method uses interrupt lines and task lines to separately control the brushless roller motor, which enables control of the brushless roller motor in different functions, improving the flexibility and specialization of brushless roller motor control. In addition, the task line can be used to port different real-time operating systems to achieve quick control of the brushless roller motor, which facilitates targeted maintenance and upgrades of the motor, and improves the control stability and reliability of the brushless roller motor.

[0053] Optionally, in step S2, data interaction is performed between the interrupt line and the user software corresponding to the host computer of the brushless roller motor to control the phase operation state of the brushless roller motor. This specifically includes:

[0054] The interrupt line is divided into a serial port interrupt thread and a timer interrupt thread;

[0055] The serial port interrupt thread is used to interact with the user software of the host computer, thereby receiving data information from the host computer;

[0056] By using a timer interrupt thread, the brushless roller motor is controlled to perform commutation operation based on the motor position signal contained in the data information from the host computer.

[0057] By dividing the interrupt lines into serial port interrupt threads and timer interrupt threads, the data interaction and communication functions between the brushless roller motor and the host computer, as well as the commutation operation switching functions, can be implemented separately using different threads, effectively avoiding data crosstalk between the host computer and the brushless roller motor during communication control.

[0058] Optionally, in step S3, the introduction of a real-time operating system using taskline porting specifically includes:

[0059] After building a real-time operating system (RTOS) resident framework on the chip corresponding to the task line, the RT-Thread real-time operating system is then ported and introduced using the RTOS resident framework. Building the RTOS resident framework includes modifying the chip's boot file, configuring the linker file, encapsulating driver components, and handling interrupt inheritance.

[0060] In practice, a real-time operating system (RTOS) resident framework can be built on the GD32F450ZIT6 chip corresponding to the task line, and then the RT-Thread real-time operating system can be ported and introduced based on the ROS resident framework. The process of building the ROS resident framework involves modifying the chip's boot files, such as adjusting or adding corresponding interrupt vector table entries and weak definitions of interrupt service functions according to the chip's interrupt vector number order, thus ensuring the compatibility of the chip's boot file assembly syntax. The chip's linker files are also configured, such as configuring the chip's memory space according to the linker files. Driver components are encapsulated on the chip, such as following embedded software design principles to complete the design of the chip's basic components, application components, and software components separately. Interrupt inheritance is handled on the chip, such as performing code erasure and rewriting operations on the chip's sectors. Through these operations, the RT-Thread real-time operating system can be quickly ported to the chip.

[0061] Optionally, step S3 further includes initializing the peripherals of the brushless roller motor using the main thread, the process of which is as follows:

[0062] Instruct the main thread to start working, disable the global interrupt for the brushless roller motor, and initialize the GPIO, UART, and ADC components of the chip corresponding to the task line;

[0063] The system initializes the brushless roller motor, interrupts the enabling of the brushless roller motor's peripherals, and then enables the brushless roller motor's total interrupt, thereby completing the initialization process of the brushless roller motor's peripherals.

[0064] By using the main thread to initialize the external devices of the brushless roller motor in the above manner, the initialization can be restarted when the external devices malfunction, ensuring the stability and reliability of the external devices.

[0065] Optionally, step S3 further includes using a PID thread to perform closed-loop control of the brushless roller motor, the process of which is as follows:

[0066] Instruct the PID thread to start working and initialize the parameters of the PID thread;

[0067] When the brushless roller motor switch is enabled, the PID thread is used to calculate the motor position and motor speed of the brushless roller motor.

[0068] Based on the calculation results of the motor position and motor speed, the PWM duty cycle of the brushless roller motor is adjusted to complete the closed-loop control of the brushless roller motor.

[0069] The brushless roller motor is stably controlled using a PID thread in the above manner. The PID algorithm of the PID thread only starts adjusting and controlling when the brushless roller motor is enabled. Furthermore, different control methods are selected according to different motor operating modes. In automatic and time-based modes, only a stable speed is required, so speed closed-loop control is implemented. The speed loop calculation is ultimately converted into an adjustable duty cycle value to achieve smooth motor operation.

[0070] Optionally, step S3 further includes using a protection thread to protect the brushless roller motor during operation, the process of which is as follows:

[0071] The protection thread is activated. When the brushless roller motor switch is enabled, the operating current, operating voltage, and operating temperature data of the brushless roller motor are collected.

[0072] Filter the operating current data, operating voltage data, and operating temperature data;

[0073] The operating current data is analyzed and processed to determine whether the brushless roller motor is currently in an overcurrent operating state.

[0074] The working voltage data is analyzed and processed to determine whether the brushless roller motor is currently in an overvoltage or undervoltage working state.

[0075] Analyze and process the operating temperature data to determine whether the brushless roller motor is currently in an overheated operating state;

[0076] If the brushless roller motor is currently in an overcurrent, overvoltage, undervoltage, or overheating state, then the brushless roller motor should be turned off.

[0077] By using the above method, the protection thread can monitor the operating current, operating voltage, and operating temperature of the brushless roller motor in real time, promptly detect motor malfunctions, prevent motor circuit burnout and damage to external equipment, and urgently shut down the motor to stop system operation when an abnormality is detected, and report the current fault information to the host computer to ensure the normal operation of the brushless roller motor.

[0078] Optionally, step S3 further includes using a communication thread to realize information processing and interaction between the brushless roller motor and the host computer;

[0079] Furthermore, time-mode threads and position-mode threads are used to perform time-mode control and position-mode control on the brushless roller motor, respectively.

[0080] The above method utilizes a communication thread to handle actual data interaction with the host computer, ensuring normal data communication for the brushless roller motor.

[0081] Optionally, in step S3, the brushless roller motor is controlled in a time-mode using a time-mode thread, the process of which is as follows:

[0082] Using a time-mode thread, the brushless roller motor is controlled to run continuously at a specified speed and direction until a preset running time position is reached;

[0083] And / or,

[0084] Using a time-mode thread, the brushless roller motor is controlled to run at specified cycle intervals and total number of cycles.

[0085] By using the above method, the running time of the brushless roller motor is controlled by a time-mode thread, ensuring that the brushless roller motor can work according to the predetermined time rules.

[0086] Optionally, in step S3, the brushless roller motor is controlled in position mode using a position mode thread, the process of which is as follows:

[0087] Using a position-mode thread, the brushless roller motor is controlled to continuously run a predetermined distance at a specified speed and in a specified direction.

[0088] By using the above method, the position mode thread is used to control the running position of the brushless roller motor, ensuring that the brushless roller motor can work according to the predetermined running distance rules.

[0089] Optionally, in step S4, based on the processing results of each thread for different motor control tasks, the processing status of the motor control tasks is displayed in real time by the host computer, specifically including:

[0090] The interrupt line is used to feed back the processing progress results of the main thread, PID thread, protection thread, communication thread, time mode thread and position mode thread for the corresponding motor control tasks to the user software of the host computer, so that the host computer can display the processing status of the motor control tasks in real time.

[0091] The interrupt line is used to feed back the processing progress of different motor control tasks to the user software on the host computer. This allows users to understand the processing status of different motor control tasks in real time and accurately through the host computer, ensuring the working reliability of the brushless roller motor.

[0092] The above is only one specific embodiment of the present invention, and any improvements made based on the concept of the present invention shall be considered within the scope of protection of the present invention.

Claims

1. A brushless drum motor control method based on a real-time operating system resident, characterized by, It comprises the following steps: Step S1, the brushless cylinder motor corresponding to the terminal software is divided into interrupt line and task line; Step S2, using the interrupt line and the user software corresponding to the host computer connected with the brushless cylinder motor for data interaction, and controlling the phase operation state of the brushless cylinder motor; Step S3, using the task line to transplant and introduce the real-time operating system, the task line is divided into main thread, PID thread, protection thread, communication thread, time mode thread and position mode thread; Then the thread obtained by the above segmentation processes different motor control tasks; Step S4, according to the processing result of each thread to different motor control task, the processing state of the motor control task is displayed in real time by the host computer; In the step S2, using the interrupt line and the user software corresponding to the host computer of the brushless cylinder motor for data interaction, thereby controlling the phase operation state of the brushless cylinder motor specifically includes: The interrupt line is divided into serial port interrupt thread and timer interrupt thread; Using the serial port interrupt thread and the user software of the host computer for interaction, so as to receive data information from the host computer; Using the timer interrupt thread, according to the motor position signal contained in the data information from the host computer, the brushless cylinder motor is controlled to operate in motor commutation; In the step S3, using the task line to transplant and introduce the real-time operating system specifically includes: After building the real-time operating system resident framework corresponding to the task line on the chip, the RT-Thread real-time operating system is transplanted and introduced by using the real-time operating system resident framework; Wherein, building the real-time operating system resident framework includes modifying the startup file of the chip, configuring the link file, packaging the driver component and interrupt inheritance processing; The step S3 further specifically includes using the PID thread to control the brushless cylinder motor in motor closed loop, the process is: Indicate the PID thread to start working, and initialize the parameters of the PID thread; When the brushless cylinder motor switch is enabled, the motor position and motor speed of the brushless cylinder motor are calculated by using the PID thread; According to the results of the motor position and motor speed calculation, the PWM duty cycle of the brushless cylinder motor is adjusted, so as to complete the motor closed loop control of the brushless cylinder motor; In the step S4, according to the processing result of each thread to different motor control task, the processing state of the motor control task is displayed in real time by the host computer specifically includes: Using the interrupt thread to feed back the processing progress result of the main thread, the PID thread, the protection thread, the communication thread, the time mode thread and the position mode thread to the user software of the host computer, so that the host computer displays the processing state of the motor control task in real time.

2. The brushless cylinder motor control method based on real-time operating system resident according to claim 1, wherein The step S3 further specifically includes using the main thread to initialize the peripheral of the brushless cylinder motor, the process is: Indicating the main thread to start working, closing the total interrupt of the brushless cylinder motor, and initializing the GPIO component, UART component and ADC component of the chip corresponding to the task thread; System initialization is performed on the brushless cylinder motor, the peripheral enable of the brushless cylinder motor is interrupted, and the total interrupt of the brushless cylinder motor is started again, so that the initialization processing of the peripheral of the brushless cylinder motor is completed.

3. The brushless cylinder motor control method based on the real-time operating system according to claim 1, characterized in that, The step S3 further comprises the following steps of: Indicating the protection thread to start working, collecting the working current data, working voltage data and working temperature data of the brushless cylinder motor after the brushless cylinder motor switch is enabled; Filtering the working current data, the working voltage data and the working temperature data; Analyzing the working current data to determine whether the brushless cylinder motor is currently in an overcurrent working state; Analyzing the working voltage data to determine whether the brushless cylinder motor is currently in an overvoltage working state or an undervoltage working state; Analyzing the working temperature data to determine whether the brushless cylinder motor is currently in an overheating working state; If the brushless cylinder motor is currently in an overcurrent working state, an overvoltage working state, an undervoltage working state or an overheating working state, the brushless cylinder motor is closed.

4. The brushless cylinder motor control method based on the real-time operating system according to claim 1, characterized in that, The step S3 further comprises the following steps of: The communication thread is used to realize the information processing and interaction between the brushless cylinder motor and the upper computer; and The time mode thread and the position mode thread are used to respectively control the brushless cylinder motor in a time mode and a position mode.

5. The brushless cylinder motor control method based on the real-time operating system according to claim 4, characterized in that, In the step S3, the time mode thread is used to control the brushless cylinder motor in a time mode, and the process is as follows: The brushless cylinder motor is controlled by the time mode thread to continuously run at a specified speed and direction until a pre-set running time position is reached. And / or, The brushless cylinder motor is controlled by the time mode thread to run at a specified periodic interval and total number of periods.

6. The brushless cylinder motor control method based on the real-time operating system according to claim 4, characterized in that, In the step S3, the position mode thread is used to control the brushless cylinder motor in a position mode, and the process is as follows: The brushless cylinder motor is controlled by the position mode thread to continuously run at a specified speed and direction for a predetermined distance.