CN111481888A - Muscle strength training power head control method and device - Google Patents

Muscle strength training power head control method and device Download PDF

Info

Publication number
CN111481888A
CN111481888A CN202010318857.3A CN202010318857A CN111481888A CN 111481888 A CN111481888 A CN 111481888A CN 202010318857 A CN202010318857 A CN 202010318857A CN 111481888 A CN111481888 A CN 111481888A
Authority
CN
China
Prior art keywords
data
mode
rotating speed
reading
analyzed data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010318857.3A
Other languages
Chinese (zh)
Inventor
李玉榕
林鑫
陈建国
杜民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fuzhou University
Original Assignee
Fuzhou University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuzhou University filed Critical Fuzhou University
Priority to CN202010318857.3A priority Critical patent/CN111481888A/en
Publication of CN111481888A publication Critical patent/CN111481888A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63BAPPARATUS FOR PHYSICAL TRAINING, GYMNASTICS, SWIMMING, CLIMBING, OR FENCING; BALL GAMES; TRAINING EQUIPMENT
    • A63B24/00Electric or electronic controls for exercising apparatus of preceding groups; Controlling or monitoring of exercises, sportive games, training or athletic performances
    • A63B24/0087Electric or electronic controls for exercising apparatus of groups A63B21/00 - A63B23/00, e.g. controlling load
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61HPHYSICAL THERAPY APPARATUS, e.g. DEVICES FOR LOCATING OR STIMULATING REFLEX POINTS IN THE BODY; ARTIFICIAL RESPIRATION; MASSAGE; BATHING DEVICES FOR SPECIAL THERAPEUTIC OR HYGIENIC PURPOSES OR SPECIFIC PARTS OF THE BODY
    • A61H1/00Apparatus for passive exercising; Vibrating apparatus ; Chiropractic devices, e.g. body impacting devices, external devices for briefly extending or aligning unbroken bones
    • A61H1/02Stretching or bending or torsioning apparatus for exercising
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63BAPPARATUS FOR PHYSICAL TRAINING, GYMNASTICS, SWIMMING, CLIMBING, OR FENCING; BALL GAMES; TRAINING EQUIPMENT
    • A63B21/00Exercising apparatus for developing or strengthening the muscles or joints of the body by working against a counterforce, with or without measuring devices
    • A63B21/00178Exercising apparatus for developing or strengthening the muscles or joints of the body by working against a counterforce, with or without measuring devices for active exercising, the apparatus being also usable for passive exercising
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61HPHYSICAL THERAPY APPARATUS, e.g. DEVICES FOR LOCATING OR STIMULATING REFLEX POINTS IN THE BODY; ARTIFICIAL RESPIRATION; MASSAGE; BATHING DEVICES FOR SPECIAL THERAPEUTIC OR HYGIENIC PURPOSES OR SPECIFIC PARTS OF THE BODY
    • A61H2201/00Characteristics of apparatus not provided for in the preceding codes
    • A61H2201/50Control means thereof
    • A61H2201/5007Control means thereof computer controlled
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63BAPPARATUS FOR PHYSICAL TRAINING, GYMNASTICS, SWIMMING, CLIMBING, OR FENCING; BALL GAMES; TRAINING EQUIPMENT
    • A63B2220/00Measuring of physical parameters relating to sporting activity
    • A63B2220/80Special sensors, transducers or devices therefor

Abstract

The invention discloses a control method of a muscle strength training power head. When instruction information sent by an upper computer is acquired, entering a serial port to interrupt and analyze data in the instruction information, and acquiring analyzed data; and executing the mode function corresponding to the analyzed data according to the analyzed data. The invention also discloses a muscle strength training power head control device. The invention can select a proper training mode according to the requirement, the adopted training scheme meets the requirement of clinical application, especially improves the control of the constant speed mode from the aspect of the safety of the clinical application, and the designed upper computer also has the functions of evaluation and test.

Description

Muscle strength training power head control method and device
Technical Field
The invention relates to the field of medical rehabilitation, in particular to a muscle strength training power head control method and device.
Background
Muscle strength is the strength of muscle contraction and is an important index reflecting the motor function of human body. Some patients with impaired musculoskeletal systems often experience reduced muscle strength, muscle dysfunction, and thus impaired limb motor function. Furthermore, with the aging population, more and more elderly people suffer from more or less limb dysfunction. The muscle strength training is to gradually strengthen the muscle strength by applying various training modes and improve the motion function of limbs.
The muscle strength training mode includes constant velocity mode, isometric mode, isotonic mode and passive mode. The isokinetic mode is where the limb is kept moving isokinetically at all times by the device. The speed of movement of the tester is kept constant regardless of the strength of the tester. Isometric mode is where the device allows the limb joint to be fixed in a given position and not be moved regardless of the amount of force used. The isotonic mode is trained by the device outputting a constant resisting moment. The passive mode is that the device drives the joint of the trainer to move in a specified range at a constant speed. These four modes were studied in the isokinetic mode, and were most widely used. The first isokinetic muscle strength training test instrument in the world was produced by Cybex corporation in the united states in the early 70 s by applying the principle of isokinetic exercise, and thereafter, the application and research of isokinetic techniques began in many countries in the world. After more than 40 years of development, Biodex representing the brand of the United states, Isomed of Germany and the like are compared abroad at present, and the muscle strength training devices are widely used.
In order to promote the localization of the muscle strength training device, control algorithms for realizing muscle strength training are also provided domestically and the device is developed. The core part of the muscle strength training device is the power head, and four modes of muscle strength training are also completed by the power head, so the key point for developing the muscle strength training device is the design and control of the power head. The multifunctional constant-speed muscle strength rehabilitation training system of the Chinese patent CN201621105501.7 designs a muscle strength training device, and various trainers are fixed in a bracket with a rectangular frame structure, so that the device occupies a smaller space. There are some disadvantages, however, firstly that the set of devices lacks a power head, and that there is no control system and no feedback means that allows the user to perform only a simple muscle training. Secondly, different training devices are required to be replaced for training at different parts, and the use is inconvenient. The device designed by the constant-speed muscle strength training system and the control method thereof in Chinese patent CN201810660563.1 introduces a power head, the control method is to detect the muscle strength direction and the muscle strength of limbs through a resistance strain gauge and then transmit the muscle strength direction and the muscle strength to a control board, and the control board controls a servo driver to drive a motor to output a large reverse acting force with the limbs and the like so as to maintain constant-speed movement. Although the method can achieve the aim of isokinetic training, data such as torque in the training process cannot be stored, and the method lacks the function of evaluation. Moreover, the device can only perform isokinetic training, and the mode is single. The multi-mode rehabilitation training device with the comprehensive evaluation function and the method thereof in the Chinese patent CN201811249597.8 also add a power head, design a set of low-cost multi-mode muscle strength training device, and connect the controller to the computer through a serial bus so that the device can display the training parameters for subsequent evaluation. The control strategy of the device is that a plurality of training parameters are set through a computer and then are sent to a controller to process the data and then are sent to a driver, and the driver controls the rotation of the motor. Although the function of the device is relatively perfect, the control scheme of the isokinetic training mode and the isotonic training mode of the device does not completely meet the medical training requirement. The constant speed mode control scheme of the patent is that the motor is enabled to keep rotating at a constant rotating speed when being started, so that the user still can be driven by the device to do constant rotating speed movement no matter whether the limb of the user exerts force or not, certain safety problems exist, and the constant speed mode control scheme is not in line with practical clinical application. The isotonic mode control scheme of this patent senses the applied force of the joint and if greater than a set resistive torque, the device begins to accelerate and operates at maximum speed if the speed reaches maximum speed. If the resistance torque is smaller than the set resistance torque, the rotating speed of the motor is set to be 0, and the motor stops moving. The requirement of the medical isotonic training is that the device can output constant resistance torque, namely the device keeps constant torque movement all the time during the training process, and the control method of the patent does not meet the requirement of the clinical isotonic training.
In summary, the foreign muscle training device is mature in technology, can perform multi-mode training and has an evaluation function, but is expensive in manufacturing cost and inconvenient to popularize. Furthermore, the development technology of the device is not completely disclosed, and the research on the muscle strength training is limited. Although a control algorithm for muscle strength training is also provided in China, and a device for muscle strength training is developed autonomously, the control algorithm has some defects such as single mode, inaccurate control scheme and the like.
Disclosure of Invention
The invention aims to provide a muscle strength training power head control method and device, and simultaneously designs a corresponding control algorithm based on the requirements of a muscle strength training mode in medicine, and designs an upper computer system for training evaluation. The muscle strength training device mainly solves the problems of single mode, inaccurate control, unsafe operation and the like of the existing muscle strength training device.
According to a first aspect of the invention, a muscle strength training power head control method is provided, which includes:
when instruction information sent by an upper computer is acquired, entering a serial port to interrupt and analyze data in the instruction information, and acquiring analyzed data;
and executing the mode function corresponding to the analyzed data according to the analyzed data.
Further, "entering the serial port to interrupt and analyze the data in the instruction information" includes:
reading the data, and determining the interface type according to the value of the first element in the data;
if the interface type is a set interface, reading the value of a second element to determine a mode type, acquiring each zone bit preset value of the mode type, and taking each zone bit preset value as analyzed data;
and if the interface type is a main interface, sequentially reading data elements starting from the second element and storing the data elements into variable data, and taking the variable data as analyzed data.
Further, "executing the analyzed data corresponding mode function according to the analyzed data" includes:
if the analyzed data is the data after the setting interface analysis, reading the analyzed data and sequentially setting the read data to a joint mark bit and a movable range mark bit;
and if the analyzed data is the data analyzed by the main interface, reading and directly calling the read data.
Further, reading the analyzed data and sequentially setting the read data to a joint zone bit and a movable range zone bit, the method further comprises the following steps:
if the analyzed data corresponding mode is a constant speed training mode, when the rotating speed of the device is detected to be larger than a preset maximum rotating speed value, the rotating speed of the motor is constantly set to be the preset maximum rotating speed value;
if the analyzed data corresponding mode is an isometric training mode, setting the driver to be a rotating speed mode and setting the rotating speed to be 0;
if the analyzed data corresponding mode is an isotonic training mode, setting the driver to be a torque mode, reading a torque value and writing the torque value into the driver;
and if the analyzed data corresponding mode is the passive training mode, setting the driver into a rotating speed mode, reading a rotating speed value and writing the rotating speed value into the driver.
According to a second aspect of the present invention, there is provided a muscle training power head control apparatus comprising:
an acquisition module: when instruction information sent by an upper computer is acquired, entering a serial port to interrupt and analyze data in the instruction information, and acquiring analyzed data;
a processing module: and executing the mode function corresponding to the analyzed data according to the analyzed data.
Further, "entering the serial port to interrupt and analyze the data in the instruction information" includes:
a reading module: reading the data, and determining the interface type according to the value of the first element in the data;
a judging module: if the interface type is a set interface, reading the value of a second element to determine a mode type, acquiring each zone bit preset value of the mode type, and taking each zone bit preset value as analyzed data;
and if the interface type is a main interface, sequentially reading data elements starting from the second element and storing the data elements into variable data, and taking the variable data as analyzed data.
Further, "executing the analyzed data corresponding mode function according to the analyzed data" includes:
a judging module: if the analyzed data is the data after the setting interface analysis, reading the analyzed data and sequentially setting the read data to a joint mark bit and a movable range mark bit;
and if the analyzed data is the data analyzed by the main interface, reading and directly calling the read data.
Further, reading the analyzed data and sequentially setting the read data to a joint zone bit and a movable range zone bit, the method further comprises the following steps:
a judging module: if the analyzed data corresponding mode is a constant speed training mode, when the rotating speed of the device is detected to be larger than a preset maximum rotating speed value, the rotating speed of the motor is constantly set to be the preset maximum rotating speed value;
if the analyzed data corresponding mode is an isometric training mode, setting the driver to be a rotating speed mode and setting the rotating speed to be 0;
if the analyzed data corresponding mode is an isotonic training mode, setting the driver to be a torque mode, reading a torque value and writing the torque value into the driver;
and if the analyzed data corresponding mode is the passive training mode, setting the driver into a rotating speed mode, reading a rotating speed value and writing the rotating speed value into the driver.
The invention has the beneficial effects that: 1. the method has the advantages that the proper training mode can be selected according to requirements, the adopted training scheme meets the requirements of clinical application, especially, the control of the constant speed mode is improved from the aspect of safety of clinical application, and the designed upper computer also has evaluation and test functions. 2. The hardware components constituting the device are moderate in price, so that the cost is low, and the device is easy to widely popularize.
Drawings
FIG. 1 is a flow chart of a muscle training power head control method according to an embodiment of the present invention;
FIG. 2 is a block diagram of a muscle training power head control apparatus according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a powerhead system in accordance with an embodiment of the present invention;
FIG. 4 is a signal connection diagram for a powerhead according to one embodiment of the present invention;
FIG. 5 is a schematic diagram of a host computer setup interface according to one embodiment of the present invention;
FIG. 6 is a host interface of a host computer according to one embodiment of the present invention;
FIG. 7 is a diagram of a controller program architecture according to one embodiment of the present invention;
FIG. 8 is a flow chart of controller serial port interrupt according to an embodiment of the present invention;
FIG. 9 is a functional diagram of a controller master function according to one embodiment of the present invention;
FIG. 10 is a basic block diagram of a servo system according to an embodiment of the present invention;
FIG. 11 is a diagram of a position mode control architecture according to one embodiment of the present invention;
FIG. 12 is a diagram of a speed mode control architecture, according to one embodiment of the present invention;
FIG. 13 is a diagram of a torque mode control architecture, in accordance with an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
Fig. 1 shows a flow of a muscle training power head control method according to an embodiment of the present invention, including:
and S11, when the instruction information sent by the upper computer is acquired, the serial port is accessed to interrupt the analysis of the data in the instruction information, and the analyzed data is acquired.
And S12, executing the mode function corresponding to the analyzed data according to the analyzed data.
Wherein, the step of 'entering the serial port to interrupt and analyze the data in the instruction information' comprises the following steps:
reading the data, and determining the interface type according to the value of the first element in the data;
if the interface type is a set interface, reading the value of a second element to determine a mode type, acquiring each zone bit preset value of the mode type, and taking each zone bit preset value as analyzed data;
and if the interface type is a main interface, sequentially reading data elements starting from the second element and storing the data elements into variable data, and taking the variable data as analyzed data.
Wherein, executing the analyzed data corresponding mode function according to the analyzed data includes:
if the analyzed data is the data after the setting interface analysis, reading the analyzed data and sequentially setting the read data to a joint mark bit and a movable range mark bit;
and if the analyzed data is the data analyzed by the main interface, reading and directly calling the read data.
Wherein, after reading the analyzed data and sequentially setting the read data to the joint zone bit and the moving range zone bit, the method further comprises the following steps:
if the analyzed data corresponding mode is a constant speed training mode, when the rotating speed of the device is detected to be larger than a preset maximum rotating speed value, the rotating speed of the motor is constantly set to be the preset maximum rotating speed value;
if the analyzed data corresponding mode is an isometric training mode, setting the driver to be a rotating speed mode and setting the rotating speed to be 0;
if the analyzed data corresponding mode is an isotonic training mode, setting the driver to be a torque mode, reading a torque value and writing the torque value into the driver;
and if the analyzed data corresponding mode is the passive training mode, setting the driver into a rotating speed mode, reading a rotating speed value and writing the rotating speed value into the driver.
The execution subject of the method may be an STM32F407 controller.
The main control scheme of the invention is that STM32F407 is used as a controller, and upper computer software based on JAVA is communicated with the controller STM32F407 to realize muscle strength training. The schematic diagram of the power head system is shown in fig. 3, a user sets some training parameters through a computer and then sends the parameters to a controller, the controller analyzes the parameters and then sends the parameters to a driver, and the driver controls the rotation of a servo motor to complete training. Meanwhile, the angle sensor and the torque sensor are used for detecting the servo motor, the data fed back by the sensors are read through the controller and transmitted to the upper computer for display.
The main components of the system are as follows: a computer, a controller, a servo driver, a servo motor, a torque sensor, an angle sensor, etc.
The controller adopts STM32F4 series chips, which is a high-performance microcontroller provided by ST company, not only has a plurality of peripheral interfaces, but also has a faster running speed, and has the characteristics of high performance, low cost and low power consumption.
The motor is an electronic commutation motor, and because the motor has no electric brush, no spark is generated or the service life of the motor is shortened due to the electric brush, and the motor adopts an electronic device to control the stator, so that the performance and controllability are better.
The servo driver selects Taida ASDA-B2, and the driver has multiple modes such as rotating speed mode, torque mode, mixing mode and the like. The use of a servo driver not only reduces the burden on the STM32, but also allows for more accurate and faster control. The upper computer only needs to send data to STM32, and STM32 outputs the instruction to the driver after handling just can realize the control of motor.
The torque sensor adopts the electrical measurement technology of a metal strain gauge, and a strain gauge is adhered to an elastic shaft to form a measuring bridge. When the elastic shaft is subjected to torque after being electrified and generates micro deformation, the resistance value of the bridge is changed, and the change of the resistance of the strain bridge is converted into the change of an electric signal and amplified by the amplifier, so that the torque measurement is realized.
The angle sensor is an integrated angle measuring system manufactured by ADI 16203, all functions are integrated in a compact package, data can be conveniently accessed by using a Serial Peripheral Interface (SPI), and a plurality of measuring results can be accessed, so that the development is more convenient.
The signal connection diagram of the power head is shown in fig. 4, an upper computer is connected to a serial port 1 of an STM32, a servo driver is connected to a serial port 2 of an STM32, an angle sensor and a controller adopt SPI communication, the SPI communication is a high-speed full-duplex communication mode, pins of a chip only need to occupy four wires and are simple and easy to use, and therefore the SPI communication mode is widely used for communication between devices such as an ADC (analog-to-digital converter) and a L CD (compact disc) and an MCU (micro controller unit).
The software design of the present invention can be divided into two modules: designing upper computer software and lower computer control. The upper computer software design mainly comprises component layout and parameter display, and the lower computer control design mainly comprises a training algorithm based on four modes of constant speed, equal length, equal tension and passivity and a communication algorithm of a controller, an upper computer, a servo driver and a sensor. The upper computer software design is a Java-based Swing component, which is a toolkit for developing Java graphical interface applications. It is based on an Abstract Window Toolkit (AWT) that contains various components that build a graphical interface, such as windows, tabs, text boxes, etc. Java is used as an object-oriented programming language, and the main constituent elements of a program are classes, objects and methods, wherein in the object-oriented concept, a class is a group of objects with the same properties and the same behaviors, and a method is a function in the class. Different classes contain different methods, and corresponding functions can be realized only by calling methods in various classes, which is also an advantage of Java. The programming idea is to divide the problem into a plurality of independent objects according to a certain rule and then solve the problem by calling the objects. The same is true for the overall idea of interface design, and since the Swing toolkit is written in the Java language, the same can run across platforms.
The design process of the program firstly calls a Container to create a Container, then clicks corresponding buttons, text boxes and the like to complete selection, an array Set is defined to store data, the array first element is initialized to be 1 to represent data of the Set interface, the design process of the program firstly calls a Container to create a Container, two types of windows and panels are selected, a Frame commonly used in windows is selected to create a Window, the Window is also selected to be the basis of the whole interface, a component is added into the Window, the creation of an object of the button class is completed by calling a method in the Swing toolkit, for example, the creation of a subclass of the button class is performed, the button object is Set to be a corresponding button source, a button source processing function is Set to be a corresponding button source, a button processing function, a button processing function is Set to be a button processing function, a button processing function is Set to be a button processing function, a button processing function is Set to be a button processing function, a button processing function, a button processing function is performed, a button processing function is performed, a button processing function, a button processing function is performed, a button processing function, a button processing function is performed, a button processing function is performed, a button processing function, a button processing function is performed, a button processing function is performed, a button processing function.
After the parameter setting of the setting interface is completed, the main interface is returned to carry out the setting of the next step of parameters. Therefore, a key is added to the setting interface, and event monitoring is added. The principle of the program is completed by switching the forms, when a key returning to the main interface is clicked, the setting interface is set to be not displayed by calling the method, and meanwhile, the main interface is set to be displayed by calling the method. The Main interface is as shown in fig. 6, the design process is similar to the setup interface, namely, a window is created first, then components are added in the window, an array Main [ ] is defined for storing the data of the Main interface, and the first element is initialized to 2 to represent that the data is the data of the Main interface. In contrast, the main interface has more components, such as text box input, data curve display, and the like. In the training process, parameters such as the rotating speed and the torque of the positive and negative rotation of the motor and the number and times of training are required to be given, so that the parameters are designed to be given through text input. The method comprises the steps of firstly creating an object Text of a Text box JTextField class, and then calling a Text method to realize the addition of the Text box. At the moment, only the input of the text is realized, the method is called to complete the acquisition of the input text, and the read text is only a character string and is converted into an integer number, so that the character string can be stored in an array. And finally clicking a start button to send the array Main [ ] to the controller through a serial port. The display function for the curve is to create a panel JPanel in this frame and then draw the curve in this panel. The panel functions like a window except that a plurality of panels may be provided and placed in the window, which makes it easier to divide the area. The drawing process of the curve firstly reads data such as torque transmitted by the controller, and the upper computer adds monitoring of a serial port, so that the data can be received immediately as long as the data is transmitted by the controller. And then, converting the data, converting the character string data into a shaping number and storing the shaping number in an array. And then drawing a coordinate system, reading the data in the array, and connecting by using a smooth curve to finish the display of the data.
The lower computer control design takes a controller as a core, the main functions of the lower computer control design are reading data of a sensor, receiving and processing instructions transmitted by an upper computer and sending the instructions to a servo driver, and the control algorithm design is based on four training modes of constant speed, equal length, equal tension and passivity.
The programming environment of the controller STM32 is MDK5, and since the number of registers of STM32 is large, firmware library development is adopted for more convenient programming and improving the readability of programs. The architecture diagram of the controller program is shown in fig. 7, and is divided into three layers: user layer User, HardWare layer HardWare, and bottom System. The user layer comprises files such as a main function and the like, and the main function realizes a control algorithm by calling an API function of the hardware layer. The hardware layer is a set of API functions, and these functions implement some specific functions by calling the underlying register operation function, for example, the interface of the pin, the communication protocol of the upper computer, and the interrupt function of the serial port 1 are configured in usart1.c, the communication configuration with the servo driver is completed by usart2.c, and the motor.c defines some control instructions of the motor. The bottom layer is a set of some operation instructions for the registers, and because of the API function of the hardware layer, the bottom layer register function does not need to be carefully known, so that the readability of the program is improved.
The controller and the angle sensor adopt SPI communication, so an spi.c is defined in a hardware layer to configure the parameters of an SPI port, data length and the like. The controller communicates with the torque sensor can and also defines a protocol for configuring the communication. As for the serial port communication adopted between the upper computer and the servo driver, two files are defined as usart1.c and usart2.c respectively. Firstly, enabling a clock of a serial port, setting a pin IO port as a serial port pin, then setting some serial port parameters such as baud rate, word length and the like, starting serial port interruption, and finally calling in a main function to finish serial port communication. Communication with the servo drive increases the data format requirements, since only specific data formats can be recognized by the servo drive and used for controlling the motor.
The servo driver ASDA-B2 can support the Modbus protocol, which has two working modes of ASCII mode and RTU mode, and the data format of the two modes is different, the ASCII mode transmits one byte of data to be converted into 2 ASCII codes which are more than the RTU data amount, but the expression of the data format is more intuitive and clear, in order to improve the readability of the program, the ASCII mode is adopted, according to the data format of the ModBus protocol of the servo driver ASDA-B2 in the ModBus mode, a sending array Send [27] with the length of 27 bits is defined in the motor.c, if two data are written into the station No. 1, then Send [0] is a character ': which is a starting character defined by the servo driver, Send [1] and Send [2] are used for storing the addresses of communication, since the communication with a station Send [1] is' 0', Send [2] is' 1 ': 3] and Send [4] is used for storing the addresses of communication, and since the sum of Send [ 3': Send [3] and Send [ 7] is used for storing the sum of the last byte of the sum of the Send [3] and the Send [25, and the sum of the Send [9] of the Send [9, and the Send [14, and the Send [9] of the sum of the last byte of the Send [19, and the Send [14, and the sum of the Send [14, and the sum of the Send [14] of the Send [19, and the sum of the Send [14, and the sum of the Send [19, and the sum of the Send [14 ', the Send 3' of the sum of the Send 3 'of the Send [19, and the Send 3' of the Send [19, and the sum of the Send of the sum of the Send of the.
The controller writes data to the set Send according to a conventional data format, for example, to start the motor, then set the set Send [27] to: "0110040E 00020400070000D 0". If the motor rotation speed is to be set to 100r/min, then the array Send [27] is set to: "0110011200020403E 80000 EB". And then the data are sent to a servo driver through a serial port, and the driver analyzes the data and controls the motor to rotate.
The serial port interrupt flow chart of the controller STM32 is shown in fig. 8, and the initialization of the program including the communication protocol, the pin configuration, and the like is performed first, and then the loop is entered to wait for the arrival of the upper computer instruction. After receiving the instruction of the upper computer, the data enters a serial port to be interrupted to analyze and process the data. A mode flag bit, a joint flag bit and a flag bit of a movable range are defined in serial port interruption, and the flag bits are used for representing information transmitted by an upper computer setting interface. Therefore, the instruction of the upper computer can be analyzed only by judging the zone bit in the main function, the running time of the main function is reduced, and the real-time performance of the program is improved. The process of serial port interrupt analysis is to distinguish the data of the main interface or the data of the setting interface according to a protocol agreed by the upper computer, if the first element is1, the data is the data of the setting interface, and the data is stored in an array 1. Reading the second element, wherein a value of 1 represents a passive mode, a value of 2 represents an equal-length mode, a value of 3 represents an equal-speed mode, a value of 4 represents an equal-tension mode, setting a mode flag bit as a corresponding value to complete the analysis of the training mode, and then sequentially reading the group of data and setting a joint flag bit and a movable range flag bit to complete the data analysis of the setting interface. If the first element is 2, the data is the data of the main interface, the group of data is stored in an array 2, the group of data elements are read in sequence, the rotating speed, the torque, the training group number and the training times are stored in defined variables, and then the variables are called in a main function to realize the transmission of the data of the main interface of the upper computer to the controller.
After the data is analyzed in the serial port interrupt, the main function cycle is returned, the function of the main function is as shown in fig. 9, the Switch statement is used to judge the value of the mode flag bit, and then the function of the corresponding mode is executed. For example, the constant speed training mode requires that the device be able to maintain a constant speed of rotation, where from a safety standpoint, the device allows the subject to accelerate to, but not exceed, the maximum rotational speed selected in each direction during actual training, and rotate at a constant speed when the subject is rotating at a speed greater than the set maximum rotational speed. Therefore, the rotational speed at which the motor rotates is always determined in the routine. And if the rotating speed of the motor is detected to be greater than the rotating speed set by the upper computer, setting the working mode of the driver to be a rotating speed mode, and writing the maximum rotating speed value set by the upper computer into the driver. If the rotation speed of the motor is detected to be less than the set value, the motor is not controlled. The isometric training mode requires that the training device be fixed in a designated position so the controller sets the operating mode of the driver to the speed mode and sets the speed to 0. The isotonic training mode requires that the training device can output a constant resisting moment, so the controller sets the working mode of the driver to be a torque mode and writes a moment value set by the upper computer into the driver. The passive training mode requires that the training device can move within a specified range at a constant speed, so the controller sets the working mode of the driver to be a rotating speed mode and writes the rotating speed value set by the upper computer into the driver. And meanwhile, the loop judgment is carried out in the main function all the time, if the motor rotates to the starting point or the end point, the steering is changed, and the rotating times and the group number are recorded.
After the commands of the controller are transmitted to the servo driver, the servo driver can analyze the commands. The servo driver and the servo motor constitute a servo system, and a block diagram of the servo system is shown in fig. 10. Three modes of operation of the drive: the position mode, the speed mode and the torque mode essentially correspond to a position loop, a speed loop and a current loop of the servo system respectively, so that the control of the motor can be realized by sending instructions to the servo driver to select the working mode.
The position mode determines the rotating speed through the pulse frequency input from the outside, and the number of the pulses determines the rotating angle. The control architecture is shown in fig. 11, with the position loop at the outermost loop, including the speed loop and the current loop. The received pulse is compared with a feedback instruction after passing through a position command processing unit, the difference value is used as input to a position controller, the output of the position controller is used as input of a speed loop, and then appropriate current is finally output to a motor through a current loop.
And a speed mode, wherein the rotating speed is constant by adopting speed closed-loop control. The control structure of the speed mode is shown in fig. 12, the command transmitted by the controller is compared with the feedback speed through the command processing unit, the difference value is used as input and transmitted to the speed control unit, the unit adopts PI control to manage the gain parameter of the driver, calculates the current supplied to the motor in real time, and outputs the current to the motor through the current loop.
The torque mode adopts current closed-loop control to ensure that the output torque of the motor is constant, the control architecture diagram is shown in fig. 13, a command transmitted by the controller is transmitted to the current control unit after passing through the torque command processing unit, and the unit manages the gain parameter of the driver and calculates the current supplied to the motor in real time. The current sensor is used for tracking the current, and the closed-loop control of the torque is completed.
Fig. 2 shows a structure of a muscle training power head control apparatus according to an embodiment of the present invention, including:
the acquisition module 21: when instruction information sent by an upper computer is acquired, entering a serial port to interrupt and analyze data in the instruction information, and acquiring analyzed data;
the processing module 22: and executing the mode function corresponding to the analyzed data according to the analyzed data.
Wherein, the step of 'entering the serial port to interrupt and analyze the data in the instruction information' comprises the following steps:
a reading module: reading the data, and determining the interface type according to the value of the first element in the data;
a judging module: if the interface type is a set interface, reading the value of a second element to determine a mode type, acquiring each zone bit preset value of the mode type, and taking each zone bit preset value as analyzed data;
and if the interface type is a main interface, sequentially reading data elements starting from the second element and storing the data elements into variable data, and taking the variable data as analyzed data.
Wherein, executing the analyzed data corresponding mode function according to the analyzed data includes:
a judging module: if the analyzed data is the data after the setting interface analysis, reading the analyzed data and sequentially setting the read data to a joint mark bit and a movable range mark bit;
and if the analyzed data is the data analyzed by the main interface, reading and directly calling the read data.
Wherein, after reading the analyzed data and sequentially setting the read data to the joint zone bit and the moving range zone bit, the method further comprises the following steps:
a judging module: if the analyzed data corresponding mode is a constant speed training mode, when the rotating speed of the device is detected to be larger than a preset maximum rotating speed value, the rotating speed of the motor is constantly set to be the preset maximum rotating speed value;
if the analyzed data corresponding mode is an isometric training mode, setting the driver to be a rotating speed mode and setting the rotating speed to be 0;
if the analyzed data corresponding mode is an isotonic training mode, setting the driver to be a torque mode, reading a torque value and writing the torque value into the driver;
and if the analyzed data corresponding mode is the passive training mode, setting the driver into a rotating speed mode, reading a rotating speed value and writing the rotating speed value into the driver.
When the device is used, the device comprises the following steps:
1) connecting the servo driver to a controller through a serial port line, connecting the controller to a computer through the serial port line, and then turning on a power supply; 2) opening upper computer software, and entering a setting interface to set a training mode, joints and a moving range; 3) entering a main interface, and inputting the rotating speed and the torque of the motor in the training process and the group number and the times of training; 4) clicking a start button to train, and simultaneously observing a curve display area, if a problem occurs in the training process, immediately pressing a stop button to check the condition; 5) after training, pressing a stop button, disconnecting the power supply and disconnecting the connection of the controller with the computer and the driver; 6) and analyzing and evaluating the trained data.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments may be used in any combination.
Those of ordinary skill in the art will understand that: the above embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same, although the present invention is described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it is possible to modify the solutions described in the above embodiments or to substitute some or all of the technical features of the embodiments, without departing from the scope of the present invention as defined in the claims.

Claims (8)

1. A muscle strength training power head control method is characterized by comprising the following steps:
when instruction information sent by an upper computer is acquired, entering a serial port to interrupt and analyze data in the instruction information, and acquiring analyzed data;
and executing the mode function corresponding to the analyzed data according to the analyzed data.
2. The method for controlling the muscle strength training power head according to claim 1, wherein the step of interrupting the analysis of the data in the command information after entering the serial port comprises the steps of:
reading the data, and determining the interface type according to the value of the first element in the data;
if the interface type is a set interface, reading the value of a second element to determine a mode type, acquiring each zone bit preset value of the mode type, and taking each zone bit preset value as analyzed data;
and if the interface type is a main interface, sequentially reading data elements starting from the second element and storing the data elements into variable data, and taking the variable data as analyzed data.
3. The method as claimed in claim 1, wherein the step of executing the function of the data corresponding mode after the analysis according to the data after the analysis comprises:
if the analyzed data is the data after the setting interface analysis, reading the analyzed data and sequentially setting the read data to a joint mark bit and a movable range mark bit;
and if the analyzed data is the data analyzed by the main interface, reading and directly calling the read data.
4. The method for controlling a muscle strength training power head according to claim 3, wherein the step of reading the analyzed data and sequentially setting the read data to a joint flag bit and a range of motion flag bit further comprises the step of:
if the analyzed data corresponding mode is a constant speed training mode, when the rotating speed of the device is detected to be larger than a preset maximum rotating speed value, the rotating speed of the motor is constantly set to be the preset maximum rotating speed value;
if the analyzed data corresponding mode is an isometric training mode, setting the driver to be a rotating speed mode and setting the rotating speed to be 0;
if the analyzed data corresponding mode is an isotonic training mode, setting the driver to be a torque mode, reading a torque value and writing the torque value into the driver;
and if the analyzed data corresponding mode is the passive training mode, setting the driver into a rotating speed mode, reading a rotating speed value and writing the rotating speed value into the driver.
5. A muscle training power head control apparatus, comprising:
an acquisition module: when instruction information sent by an upper computer is acquired, entering a serial port to interrupt and analyze data in the instruction information, and acquiring analyzed data;
a processing module: and executing the mode function corresponding to the analyzed data according to the analyzed data.
6. The muscle training power head control device of claim 5, wherein the obtaining module comprises:
a reading unit: reading the data, and determining the interface type according to the value of the first element in the data;
a first judgment unit: if the interface type is a set interface, reading the value of a second element to determine a mode type, acquiring each zone bit preset value of the mode type, and taking each zone bit preset value as analyzed data;
and if the interface type is a main interface, sequentially reading data elements starting from the second element and storing the data elements into variable data, and taking the variable data as analyzed data.
7. The muscle training powerhead control device of claim 5, wherein the processing module comprises:
a second judgment unit: if the analyzed data is the data after the setting interface analysis, reading the analyzed data and sequentially setting the read data to a joint mark bit and a movable range mark bit;
and if the analyzed data is the data analyzed by the main interface, reading and directly calling the read data.
8. The muscle training power head control device according to claim 7, wherein the second determination unit further comprises:
setting an element: if the analyzed data corresponding mode is a constant speed training mode, when the rotating speed of the device is detected to be larger than a preset maximum rotating speed value, the rotating speed of the motor is constantly set to be the preset maximum rotating speed value;
if the analyzed data corresponding mode is an isometric training mode, setting the driver to be a rotating speed mode and setting the rotating speed to be 0;
if the analyzed data corresponding mode is an isotonic training mode, setting the driver to be a torque mode, reading a torque value and writing the torque value into the driver;
and if the analyzed data corresponding mode is the passive training mode, setting the driver into a rotating speed mode, reading a rotating speed value and writing the rotating speed value into the driver.
CN202010318857.3A 2020-04-21 2020-04-21 Muscle strength training power head control method and device Pending CN111481888A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010318857.3A CN111481888A (en) 2020-04-21 2020-04-21 Muscle strength training power head control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010318857.3A CN111481888A (en) 2020-04-21 2020-04-21 Muscle strength training power head control method and device

Publications (1)

Publication Number Publication Date
CN111481888A true CN111481888A (en) 2020-08-04

Family

ID=71789787

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010318857.3A Pending CN111481888A (en) 2020-04-21 2020-04-21 Muscle strength training power head control method and device

Country Status (1)

Country Link
CN (1) CN111481888A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2808000A1 (en) * 2013-05-30 2014-12-03 Funai Electric Co., Ltd. Power assist device and ambulatory assist vehicle
CN107184361A (en) * 2017-04-25 2017-09-22 浙江洼赛智能科技有限公司 Hand rehabilitation ectoskeleton man-machine interactive system based on ARM and (SuSE) Linux OS
CN108113845A (en) * 2016-11-30 2018-06-05 中国科学院沈阳自动化研究所 A kind of rehabilitation of anklebone system
CN108524187A (en) * 2018-03-02 2018-09-14 哈工大机器人(合肥)国际创新研究院 A kind of upper limb rehabilitation robot control system of six degree of freedom

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2808000A1 (en) * 2013-05-30 2014-12-03 Funai Electric Co., Ltd. Power assist device and ambulatory assist vehicle
CN108113845A (en) * 2016-11-30 2018-06-05 中国科学院沈阳自动化研究所 A kind of rehabilitation of anklebone system
CN107184361A (en) * 2017-04-25 2017-09-22 浙江洼赛智能科技有限公司 Hand rehabilitation ectoskeleton man-machine interactive system based on ARM and (SuSE) Linux OS
CN108524187A (en) * 2018-03-02 2018-09-14 哈工大机器人(合肥)国际创新研究院 A kind of upper limb rehabilitation robot control system of six degree of freedom

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
江浩: "基于UCD的康复训练系统软件界面交互设计", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
魏明松: "等速肌力测试训练仪人机交互界面设计", 《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》 *

Similar Documents

Publication Publication Date Title
CN101458528B (en) On-line fault detection system based on CAN bus
CN102494604A (en) Detection instrument for characteristic of angular transducer
CN111481888A (en) Muscle strength training power head control method and device
CN103809000B (en) data processing method based on servo drive unit
CN201153018Y (en) Acupuncture manipulation simulating stimulator
CN100533424C (en) Single line transmission interface and single byte operational keyboard display module
CN205375086U (en) Multi -path temperature detection system
CN2798068Y (en) Torque measurer
CN1512464A (en) Intelligent teaching analogue system for acupuncture and moxibustion
CN106908643A (en) A kind of probe, oscillograph, movement recognition system and method
CN200972500Y (en) Integral automatic integrated tester
CN111001167A (en) TMS320VC 5509A-based voice control intelligent toy car system
CN106908642A (en) A kind of probe, oscillograph, movement recognition system and method
CN214586522U (en) Intelligent servo system integrating PLC (programmable logic controller) and vision or force feedback
CN204993137U (en) Step motor control system based on DSP
CN111427303B (en) Simulator measurement and control system based on multi-point measurement compensation method
CN204374226U (en) A kind of ultrasound electric machine automatic measuring and controlling system based on STM32
CN207593802U (en) Robot multi-sensor fusion drive system
CN211531028U (en) Multi-axis stepping motor control system based on STM32 control L640H driver
CN201731972U (en) Remote monitoring device of dynamic balance test of wheels
CN1554951A (en) Computer-aided housheold electric appliance auxiliary detector and its detecting method
CN103622768A (en) USB (universal serial bus) 3.0-based five-finger myoelectric artificial limb embedded measurement and control system and USB 3.0 data transmission method of system
CN115902387B (en) Test fixture and test method of load identification module
He et al. Design of DC motor PWM speed control system based on BT-04 and AVR MCU
CN115582842B (en) Manipulator gripping control system and method with flexible touch sensor

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination