CN113759806B - Control system of writing robot - Google Patents

Control system of writing robot Download PDF

Info

Publication number
CN113759806B
CN113759806B CN202111143592.9A CN202111143592A CN113759806B CN 113759806 B CN113759806 B CN 113759806B CN 202111143592 A CN202111143592 A CN 202111143592A CN 113759806 B CN113759806 B CN 113759806B
Authority
CN
China
Prior art keywords
control
motor
writing
matrix
module
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.)
Active
Application number
CN202111143592.9A
Other languages
Chinese (zh)
Other versions
CN113759806A (en
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.)
Guangxi Science and Technology Normal University
Original Assignee
Guangxi Science and Technology Normal 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 Guangxi Science and Technology Normal University filed Critical Guangxi Science and Technology Normal University
Priority to CN202111143592.9A priority Critical patent/CN113759806B/en
Publication of CN113759806A publication Critical patent/CN113759806A/en
Application granted granted Critical
Publication of CN113759806B publication Critical patent/CN113759806B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/21Pc I-O input output
    • G05B2219/21119Circuit for signal adaption, voltage level shift, filter noise
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Abstract

The invention discloses a control system of a writing robot, which comprises: the hardware control module is used for controlling hardware of the writing robot; the software control module is used for controlling the software of the writing robot; and the control algorithm module is used for controlling the algorithm of the writing robot. The control system of the writing robot has various input functions, and Chinese characters can be input through an input method; the input can be completed by writing or drawing a picture with a mouse in a writing area of a PC end software interface; the input can be completed by writing and drawing by externally connecting a writing board.

Description

Control system of writing robot
Technical Field
The invention relates to the robot technology, in particular to a writing robot control system.
Background
The stability of the existing writing robot control system is still to be further improved, and writing rules are still not perfect.
Disclosure of Invention
The invention mainly aims to provide a writing robot control system.
The technical scheme adopted by the invention is as follows: a writing robot control system, comprising:
the hardware control module is used for controlling hardware of the writing robot;
the software control module is used for controlling the software of the writing robot;
and the control algorithm module is used for controlling the algorithm of the writing robot.
Further, the hardware control module includes:
control mechanism adopts an English-flying-ice XMC4500 permanent magnet synchronous motor controller and XMC4500 micro-control
The device consists of an upper control board and a lower power board; the control board consists of an XMC4500 main control chip and peripheral auxiliary circuits, the power board is connected with the control board through a power signal interface, and the control board comprises a power input module, an auxiliary power generation module, a motor driving and current sampling module and has the functions of alarming and protecting overvoltage, undervoltage and overcurrent;
the actuating mechanism comprises a permanent magnet synchronous motor and an angle steering engine;
the two permanent magnet synchronous motors respectively control an X axis and a Y axis, and the two motors are mutually matched to complete tasks in the running process of the system;
the angle steering engine is used for controlling the lifting and falling of the writing pen;
and the communication circuit is used for realizing the communication between the upper computer and the lower computer.
Further, the software control module comprises a writing scheme module, an upper computer module and a lower computer module;
the writing scheme module comprises:
the Chinese character stroke mode design unit is used for combining strokes with an input mode realized by a handwriting board;
the character model design unit is used for completing the writing task by a binary lattice recognition method, wherein the lattice of a Chinese character is a 36×36 matrix, and the distance of each dot is 1mm, namely the width of a pen point;
the character picture mode design unit is used for converting characters to be written by a user into a picture format, binarizing the picture to obtain a binary matrix of the whole picture, transmitting the matrix to a lower computer for processing, and scanning the next motor control strategy line by line as the first mode;
the bit machine platform design module comprises:
the parameter setting unit is used for selecting correct serial ports, baud rates and data bits;
the control panel unit is used for setting the reset rotating speed of the motor, manually controlling the motor and controlling the real-time rotating speed of the motor;
the analysis panel unit is used for taking the operation of the matrix, then analyzing the matrix to generate a binary lattice, and finally sending the binary lattice to the lower computer; the method mainly comprises the steps of analyzing a word to be written, generating data which can be identified by a lower computer and sending the data to the lower computer;
the user input unit is used for inputting Chinese characters, inputting pictures and inputting tablets, and the three input modes are all processing of the characters and the pictures;
the lower computer module is used for mainly completing configuration of each register, initialization of peripheral equipment, configuration of a system clock, overcurrent detection of current, motor parameter initialization and system parameter initialization;
the function sub-module can realize coordinate transformation, SVPWM generation, position detection and speed calculation;
the interrupt program is triggered by a timer, and the control of the motor is realized through the timer in the main interrupt program;
the serial port interrupt program realizes the independent movement of the motor and the action of the steering engine by processing the instruction of the upper computer.
Further, the control algorithm module comprises an initializing population and a selecting variation probability;
initializing a population for determining an operation space of an algorithm;
the variation probability is selected to be used for optimizing the individuals in the space;
initializing the population includes:
the size of the population set in the algorithm is 30, then a group of random numbers A generated by a Monte Carlo sequence is a 30×1 matrix, in order to realize dimension expansion, the matrix A is transposed firstly, then the matrix A is multiplied by the transposed matrix A' to obtain a 30×30 matrix B as shown in the formula (4-6), and the matrix B is the initialized population;
Figure SMS_1
(4-6)
the selection of the mutation probability comprises the following steps:
dividing all fitness individuals into three parts according to the height by adopting a segmentation processing mode, and then selecting a mutation probability for each part to carry out mutation operation; this practice will largely preserve the good individuals in the population and may result in better individuals; the formula of mutation probability segmentation selection is shown as (4-7):
Figure SMS_2
(4-7)
wherein: pm1=0.6, pm2=0.05, pm3=0.001, bestfi is the fitness value of the best fitness individual in the population, fi is the fitness value of the individual to be mutated, and f31 and f32 are the fitness values of individuals with fitness values ranging from high to low at 1/3, 2/3, respectively.
The invention has the advantages that:
the control system of the writing robot has various input functions, and Chinese characters can be input through an input method; the input can be completed by writing or drawing a picture with a mouse in a writing area of a PC end software interface; the input can be completed by writing and drawing by externally connecting a writing board. The control software of the PC end can convert the input Chinese characters or pictures into 0 and transmit 1 codes to the lower computer, and finally writing of the Chinese characters is completed. The lower computer realizes two ways of writing Chinese characters: one is writing by progressive scanning with reference to a printer; and the other is to complete the writing of the Chinese characters according to the stroke order according to the set stroke rule.
In addition to the objects, features and advantages described above, the present invention has other objects, features and advantages. The present invention will be described in further detail with reference to the drawings.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention.
FIG. 1 is a block diagram of a controller of the present invention;
FIG. 2 is a schematic diagram of a system hardware interface of the present invention;
FIG. 3 is a control flow diagram of the present invention;
FIG. 4 is a tablet input diagram of the present invention;
FIG. 5 is a matrix interface diagram of the present invention;
fig. 6 is a flowchart of a main routine of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1 to 6, a writing robot control system includes:
the hardware control module is used for controlling hardware of the writing robot;
the software control module is used for controlling the software of the writing robot;
and the control algorithm module is used for controlling the algorithm of the writing robot.
The control system of the writing robot has various input functions, and Chinese characters can be input through an input method; the input can be completed by writing or drawing a picture with a mouse in a writing area of a PC end software interface; the input can be completed by writing and drawing by externally connecting a writing board. The control software of the PC end can convert the input Chinese characters or pictures into 0 and transmit 1 codes to the lower computer, and finally writing of the Chinese characters is completed. The lower computer realizes two ways of writing Chinese characters: one is writing by progressive scanning with reference to a printer; and the other is to complete the writing of the Chinese characters according to the stroke order according to the set stroke rule.
The hardware control module includes:
the control mechanism adopts an English-flying XMC4500 permanent magnet synchronous motor controller, and the XMC4500 microcontroller consists of an upper control board and a lower power board; the control board consists of an XMC4500 main control chip and peripheral auxiliary circuits, the power board is connected with the control board through a power signal interface, and the control board comprises a power input module, an auxiliary power generation module, a motor driving and current sampling module and has the functions of alarming and protecting overvoltage, undervoltage and overcurrent; a block diagram of the controller is shown in fig. 1.
The actuating mechanism comprises a permanent magnet synchronous motor and an angle steering engine;
the two permanent magnet synchronous motors respectively control an X axis and a Y axis, and the two motors are mutually matched to complete tasks in the running process of the system;
as an important actuating mechanism of the whole system, the running stability of the permanent magnet synchronous motor is the key of the whole system to finish tasks. The two permanent magnet synchronous motors respectively control the X axis and the Y axis, and in the running process of the system, the two motors are mutually matched to complete tasks. The permanent magnet synchronous motor is formed by connecting two wires with a value controller, wherein one wire is a power wire, and the other wire is a coding wire. The power line is connected with a power board of the controller and mainly transmits the output of the power board to the motor; the coding line is connected with the control board and mainly realizes signal transmission between the control board and the motor. When the motor receives the pulse signal sent by the control panel, the motor has a responsive motion state. If the pulse signal is continuous, the motor always rotates, and the rotating speed of the motor is different according to the different pulse signals; if the pulse signal is single, the motor can rotate different angles according to different pulse signals. Tests show that the motor used in the design operates at a minimum distance of 1mm when receiving a single pulse.
The angle steering engine is used for controlling the lifting and falling of the writing pen;
and the communication circuit is used for realizing the communication between the upper computer and the lower computer.
In the hardware structure, two controllers are independent from each other, and one controller is used for realizing the communication of two sets of equipment, and a communication circuit is required to be externally connected for realizing the communication. When the communication circuit is designed, only two MAX232 chips are selected, and the test shows that the load capacity of the receiving end of the XMC4500 control board as the U1C0 serial port is insufficient, so that the singlechip cannot normally identify low level, and the output waveform is always near high level, which leads to that normal data is not received.
Therefore, the level conversion is firstly carried out through MAX232, the output and input levels are ensured to be high +5v and low 0v, so that the chip pins are prevented from being burnt out, and the method has stability compared with the level of directly connecting the two control board pins in a cross way. Through improvement, an SN75179BD (differential driver and receiver) is added, so that the output level is compared with the output logic level of 0 or 1, and normal transmission of data is ensured. Finally, through an SN74LV245A chip, the 10 th pin and the 2 nd pin are grounded according to a logic function table, and then the DIR is connected with +3.3v, so that the signal output can only be output from the A end to the B end. With the SN74LV245A chip, it is also ensured that the output level is in the range between 0-3.3v acceptable to the control board. Normal communication can be accomplished by connecting the two MAX232 pairs and connecting the communication circuit to the two control boards. The motion controller can realize 2-axis closed-loop control. The timer can realize variable pulse output, and 3 signals for driving servo are respectively a direction + pulse signal, a two-way pulse signal and a one-way pulse signal which are different by 90 degrees. The motion controller can realize the above 3 pulse driving modes. The single-axis signal comprises a servo driving signal, a servo enabling signal, a braking signal and a zeroing signal. The system hardware interface is schematically shown in fig. 2.
The motion controller has perfect control function. The RS232 is used for realizing the communication between the upper computer and the lower computer, and the mutual transmission of data between the two boards is realized through a circuit of converting UART into RS 422. The two plates respectively realize the running and stopping of the motor according to the received instructions.
The software control module comprises a writing scheme module, an upper computer module and a lower computer module;
to facilitate programming, a 36 x 36 matrix is used for each chinese character to be stored. After the hardware system is built, the maximum stroke of the X axis of the designed system is 23cm, the maximum stroke of the Y axis is 21cm, the diameter of one point is 1mm, and the size of one Chinese character is 25mm multiplied by 25mm.
The writing scheme module comprises:
the Chinese character stroke mode design unit is used for combining strokes with an input mode realized by a handwriting board;
two main works exist in the design realized according to strokes, namely, the storage of the strokes, such as a 'Tian' word, is realized, when the first stroke is written, data can be stored in a buffer area, the time delay is 1ms, the interrupt calls the data in the buffer area, then the buffer area is emptied, and the data of the next stroke is continuously stored until the storage of all strokes is completed; and secondly, only three coordinate points are extracted when the points are taken, the written words have great distortion, and in order to process the data conveniently, the design does not extract excessive coordinate points.
The character model design unit is used for completing the writing task by a binary lattice recognition method, wherein the lattice of a Chinese character is a 36×36 matrix, and the distance of each dot is 1mm, namely the width of a pen point;
in the system, one motor drives X-axis scanning, one motor drives Y-axis scanning, and the steering engine Z drives the writing pen up and down. The method is to complete the writing task by identifying binary dot matrix, wherein the dot matrix of a Chinese character is 36×36 matrix, and each dot is 1mm in distance, namely the width of a pen point. The main flow is as follows: calling a matrix library in an upper computer to generate a matrix of a written word, analyzing and generating binary lattices, transmitting the lattices to a lower computer, and after recognizing the lattices transmitted by the upper computer, firstly controlling a steering engine of a Z axis to run downwards by a certain angle when an X axis scans one row to meet a point with 0 on the lattice in a progressive scanning mode, so that a writing pen falls down, and finishing writing of the point; after scanning one line, the next line is scanned, when the X axis finishes scanning one line, the Y axis moves down one line by 1mm, and then the X axis scans one line … … repeatedly until writing of one word is finished, and the control flow chart is shown in fig. 3. The control mode is relatively simple, only single character input can be realized, and realization is easy, but because MATLAB is troublesome in character matrix processing, a third party software is required to be called to replace the character matrix, so that more operation steps are required for a user, and the mode is mainly used in the debugging process.
The character picture mode design unit is used for converting characters to be written by a user into a picture format, binarizing the picture to obtain a binary matrix of the whole picture, transmitting the matrix to a lower computer for processing, and scanning the next motor control strategy line by line as the first mode;
firstly, converting characters to be written by a user into a picture format, then binarizing the picture to obtain a binary matrix of the whole picture, then sending the matrix to a lower computer for processing, and then scanning the motor control strategy line by line as in the first mode. The method is mainly simplified in terms of user input, the user only needs to input characters to be written, and the method supports the input of multiple characters, and the user can select a single-color picture as input on a human-computer interface because the method is a picture processing method. The user input of this kind of mode is more nimble, and user's easy operation, only need input characters and click send or select the picture click send can.
The user can also connect with the computer through the tablet, the tablet outputs a single-color picture, handwriting or drawing is carried out on the tablet, the written characters or the drawn pictures can be displayed in the upper computer in real time, and the written characters or the drawn pictures are used as input of the system. As shown in FIG. 4, (a) is a physical diagram of a tablet, which is connected to a computer through a data line, and can be used for inputting characters in a panel of the tablet of an upper computer, (b) is used for receiving characters input by the tablet in the upper computer, (b) is used for obtaining a large picture size, which is unfavorable for converting the picture size into data for storage and data transmission, so that the picture is required to be compressed, and (c) is used for processing the picture. In order to facilitate data transmission, the picture size of all the text-picture modes is processed into 36×36 dot matrix, which is also beneficial to receiving data with uniform size with a lower computer, and is convenient to process.
The bit machine platform design module comprises:
the parameter setting unit is used for selecting correct serial ports, baud rates and data bits;
the control panel unit is used for setting the reset rotating speed of the motor, manually controlling the motor and controlling the real-time rotating speed of the motor;
the analysis panel unit is used for taking the operation of the matrix, then analyzing the matrix to generate a binary lattice, and finally sending the binary lattice to the lower computer; the method mainly comprises the steps of analyzing a word to be written, generating data which can be identified by a lower computer and sending the data to the lower computer;
the user input unit is used for inputting Chinese characters, inputting pictures and inputting tablets, and the three input modes are all processing of the characters and the pictures;
1) Parameter setting
In the design, the communication between the computer and the writing robot is realized by using a serial port, so that the established communication between the upper computer and the lower computer needs to be ensured when the operation is started, and the correct serial port, baud rate, data bit and the like need to be selected. The baud rate of the signal received by the lower computer is 19200, so that the default value of the baud rate option is set to 19200 in the design process, if the baud rate of the lower computer changes, the baud rate can be modified in a pull-down menu, the commonly used baud rate value (300 600 1200 2400 4800 9600 38400 43000 56000 57600 115200) is all the same, and other settings are the default.
2) Control panel
The control panel is mainly provided with a button connected with a serial port, a button for setting the reset rotating speed of the motor, a button for manually controlling the motor, a display for displaying the real-time rotating speed of the motor and the like. The button < open serial port > is a main switch for connecting the upper computer with the lower computer, the color of the initial state is yellow, and the button is pressed to be green. The < set reset rotation speed > button is a rotation speed at which a manual zero point can be set, and is set in a display field behind it. And the motor rotation speed is a rotation speed display column fed back by the lower computer. < xstart > and < xstop > are control of the X-axis motor start and stop, and < ystart > and < ystop > are control of the Y-axis motor start and stop. The "nib action" button is a button that can manually control the up-and-down of the pen. The < start > button is a button for starting the motor. The < pause > button may pause the action of the motor. The < Y + > button is a counterclockwise control button of the Y-axis motor. The < Y- > button is a clockwise control button of the Y-axis motor. The < X + > button is a counterclockwise control button for the X-axis motor. The < X- > button is a clockwise control button for the X-axis motor. In this plate, the manual control of the motor and the zero-return operation are mainly realized.
3) Analysis panel
The analysis panel comprises the operation of taking the matrix, then analyzes the matrix to generate a binary lattice, and finally sends the binary lattice to the lower computer. The interface of figure 5 is shot by clicking the button to obtain the matrix of the Chinese character, which is then copied to the matrix display column of the upper computer, and the matrix is resolved into binary lattice by clicking the binary lattice button and displayed in the blank display column beside the button. And (3) clicking the button to send the binary lattice after analysis to the lower computer. The control panel mainly analyzes the word to be written, generates data recognized by the lower computer and sends the data to the lower computer.
4) User input
The user input panel comprises Chinese character input, picture input and tablet input, and the three input modes are all processing of the text and the picture.
In the Chinese character input panel, the user can input characters in the character input column, after inputting, the input characters are binarized and stored in the program buffer area, and after clicking the < send > button in the panel, the binarized information is sent to the lower computer in a matrix form.
In the picture input panel, a user can select a picture through a button for selecting the picture, and a path of the picture is displayed in a display column, so that the user can inquire whether the selected picture is correct or not, the upper computer can automatically binarize the picture and store the picture in a buffer area, and the user can send the binarized matrix to the lower computer by clicking the button for selecting the picture in the panel.
In the tablet input panel, the user can write a text or a picture in the connected tablet, if the user is not satisfied with the written or drawn text, the user can click the < clear tablet > button and then re-input the text or picture, if the user is satisfied with the input result, the user's input is saved by clicking the < save pattern > button, and when the user clicks the < send > button, the saved picture is sent to the lower computer in the form of a binary matrix. After the user's input confirms to finish, click the < start > button of the control panel, the lower computer will control the actuating mechanism to finish the task of writing.
The lower computer module is used for mainly completing configuration of each register, initialization of peripheral equipment, configuration of a system clock, overcurrent detection of current, motor parameter initialization and system parameter initialization;
the function sub-module can realize coordinate transformation, SVPWM generation, position detection and speed calculation;
the interrupt program is triggered by a timer, and the control of the motor is realized through the timer in the main interrupt program;
the serial port interrupt program realizes the independent movement of the motor and the action of the steering engine by processing the instruction of the upper computer. The main program flow chart is shown in fig. 6.
Further, the control algorithm module comprises an initializing population and a selecting variation probability;
initializing a population for determining an operation space of an algorithm;
the variation probability is selected to be used for optimizing the individuals in the space;
initializing the population includes:
the size of the population set in the algorithm is 30, then a group of random numbers A generated by a Monte Carlo sequence is a 30×1 matrix, in order to realize dimension expansion, the matrix A is transposed firstly, then the matrix A is multiplied by the transposed matrix A' to obtain a 30×30 matrix B as shown in the formula (4-6), and the matrix B is the initialized population;
Figure SMS_3
(4-6)
the selection of the mutation probability comprises the following steps:
dividing all fitness individuals into three parts according to the height by adopting a segmentation processing mode, and then selecting a mutation probability for each part to carry out mutation operation; this practice will largely preserve the good individuals in the population and may result in better individuals; the formula of mutation probability segmentation selection is shown as (4-7):
Figure SMS_4
(4-7)
wherein: pm1=0.6, pm2=0.05, pm3=0.001, bestfi is the fitness value of the best fitness individual in the population, fi is the fitness value of the individual to be mutated, and f31 and f32 are the fitness values of individuals with fitness values ranging from high to low at 1/3, 2/3, respectively.
Writing experiment design and analysis:
upper computer platform test
Aiming at the designed upper computer, the functions of all the modules contained in the upper computer are debugged, and whether the designed functions can be realized is checked.
(1) Communication between upper computer and lower computer
Firstly, ensuring that a lower computer is connected to a PC through a serial port line, then entering an upper computer, selecting a correct serial port number in a parameter setting panel, clicking a < serial port opening > button, inputting a reset rotating speed in a blank column on the right side of the < reset rotating speed setting > button, and clicking the < reset rotating speed setting > button.
The communication between the upper computer and the lower computer is the first step of realizing control, and is the most important step, and the subsequent transmission of all information is based on successful communication. Several processing modes for characters and pictures are arranged in the upper computer, then the characters and pictures are debugged one by one, and the output result is observed through serial port assistant software.
(2) Chinese character stroke input
In the Chinese character stroke input mode, a user can write any stroke in the stroke input range. By picture-saving the strokes in this range and storing the strokes in a 36 x 36 lattice. And then the coordinate values of the starting point, the middle point and the end point of each stroke are taken out. In the display column of the stroke coordinates, there are 12 bits of data, the first 6 bits are X-axis coordinate values of the start point, the middle point and the end point, and the last six bits are Y-axis coordinate values.
(3) Matrix parsing
The method comprises the steps of analyzing the matrix of the characters and displaying the binary matrix, wherein the method is to obtain decimal matrix data by calling external software, then realize conversion and display in an upper computer, the operation process is more complicated, only a single Chinese character can be input at a time, the input of a user is not facilitated, and the conversion process of the Chinese character is displayed in real time in the debugging process.
(4) Chinese character input module
In the input module, a user can input one or more characters, and input of one character and two characters is taken as an example in the debugging process. Input of a character, simulation of output by a form, and writing
The writing effect of the robot is compared.
Compared with the character input mode, the input mode has a certain improvement, mainly reflected in the number of Chinese characters input and the operation process, and the output of the input mode can be called by the picture input mode.
(5) Picture input module
The picture input module is a flexible input mode, can select any picture as input, and has the effect of processing complex pictures in an upper computer due to the insufficient capability of processing the pictures at present
It is not good, so that a monochrome picture is preferably selected.
In the input mode, the input mode can also call the output of other modes as input, and in the Chinese character input mode and the tablet input mode, after the input characters or pictures are processed, the processed results are stored in the form of pictures, and the stored pictures can be called as input. The mode of selecting pictures is also simpler to operate, and compared with a Chinese character input mode, the mode can not only input Chinese characters, but also input pictures.
(6) Tablet input module
In the input mode, a user can draw pictures or write in a tablet module of the upper computer according to own ideas, can directly operate by a mouse, and can also operate by externally connecting a tablet.
This input mode is more flexible than the above ones, which is that the user designs the pattern as input by himself. The corresponding bitmap can be generated only by the user performing any scribbling in the writing area. The mode is also the biggest bright spot of the design scheme, and standard characters or character and picture input is eliminated. However, the lattice generated by the tablet input mode is a result of compressing the picture through MATLAB programming, so that the larger the picture compression program is, the worse the generated lattice effect is.
And (3) testing a lower computer platform:
under the condition that motors of the X axis and the Y axis are started, the motors are sequentially keyed for one time, two times, one time, two times and one time, manual control and output are carried out, and the line shapes are basically the same.
Experimental results and analysis
The system is mainly used for experiments according to a writing implementation mode, namely an implementation mode of Chinese character stroke input, an actual output result and a simulated output result, wherein the simulated output is a direct storage result of a handwriting board, and the actual output is a result realized by a lower computer of the system.
As can be seen from the input result of the Chinese character stroke input, for the input according to the Chinese character strokes on the upper computer, the writing robot can write corresponding fonts according to the corresponding strokes, but for the left-falling strokes and the right-falling strokes, the design of the control strategy mode is not perfect enough, so the control strategy mode is not obtained
The desired font stroke radians.
Through experiments, the writing robot can be verified to be capable of basically completing writing of four-stroke Chinese characters, and from the aspect of effects, the main problems are as follows: firstly, the problem of hardware results, which can lead to the skew of Chinese characters, secondly, errors occur when the lower computer identifies the point positions, and the method for processing X, Y shaft motors is used by the lower computer.
From the output results, distortion is generated, and this problem is caused by insufficient accuracy of picture compression.
According to the experimental results, the writing robot can basically complete the designed task, the stroke mode of the Chinese character is far shorter than the line-by-line scanning mode required by writing a Chinese character, but the effect is not good due to the processing algorithm.
From the experimental result, the upper computer can basically realize the designed function, the improved genetic algorithm can also obtain obvious optimization effect, the control of the lower computer can also be basically realized, and the actual output result of the experiment can also be basically completed. The robot control system can basically achieve the effect of robot entrance education, but needs to be improved, and the output result is continuously optimized through subsequent study and research.
The foregoing description of the preferred embodiments of the invention is not intended to limit the invention to the precise form disclosed, and any such modifications, equivalents, and alternatives falling within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims (1)

1. A writing robot control system, comprising:
the hardware control module is used for controlling hardware of the writing robot;
the software control module is used for controlling the software of the writing robot;
the control algorithm module is used for controlling the algorithm of the writing robot;
the hardware control module includes:
the control mechanism adopts an English-flying XMC4500 permanent magnet synchronous motor controller, and the XMC4500 microcontroller consists of an upper control board and a lower power board; the control board consists of an XMC4500 main control chip and peripheral auxiliary circuits, the power board is connected with the control board through a power signal interface, and the control board comprises a power input module, an auxiliary power generation module, a motor driving and current sampling module and has the functions of alarming and protecting overvoltage, undervoltage and overcurrent;
the actuating mechanism comprises a permanent magnet synchronous motor and an angle steering engine;
the two permanent magnet synchronous motors respectively control an X axis and a Y axis, and the two motors are mutually matched to complete tasks in the running process of the system;
the two permanent magnet synchronous motors respectively control an X axis and a Y axis, and in the running process of the system, the two motors are mutually matched to finish tasks;
the permanent magnet synchronous motor is formed by connecting two wires with a value controller, wherein one wire is a power wire and the other wire is a coding wire; the power line is connected with a power board of the controller and mainly transmits the output of the power board to the motor; the coding line is connected with the control board and mainly realizes signal transmission between the control board and the motor;
when the motor receives the pulse signal sent by the control panel, the motor has a responsive motion state; if the pulse signal is continuous, the motor always rotates, and the rotating speed of the motor is different according to the different pulse signals; if the pulse signal is a single pulse signal, the motor can rotate different angles according to different pulse signals;
when the motor receives a single pulse, the minimum distance of running is 1mm;
the communication circuit firstly carries out level conversion through MAX232 to ensure that the output and input levels are high +5v and low 0v;
an SN75179BD differential driver and a receiver are added, so that the output level is compared with the output logic level of 0 or 1, and the normal transmission of data is ensured;
through a SN74LV245A chip, according to the logic function table, the 10 th pin and the 2 nd pin are grounded, and then through connecting the DIR with +3.3v, the signal output can only be ensured to be output from the A end to the B end;
through the SN74LV245A chip, the output level is ensured to be in the range of 0-3.3v acceptable by the control board;
normal communication is completed by correspondingly connecting the two MAX232 blocks and commonly grounding the communication circuit and the two control boards;
the signal of the first control board enters the MAX232 chip through the 231R_2 pin to be subjected to level conversion and then is output to the R_T pin of the other MAX232 chip, the signal is output to the SN75179BD chip through the 422R_1 pin, and the output of the signal is connected to the control chip of the second control board through the SN74LV245A chip to complete the signal transmission of the two control boards;
the motion controller realizes 2-axis closed-loop control, the timer realizes variable pulse output, and 3 signals for driving servo are respectively a direction plus pulse signal, a two-way pulse signal and a one-way pulse signal which are different by 90 degrees; the motion controller can realize the 3 pulse driving modes;
the single-axis signal comprises a servo driving signal, a servo enabling signal, a braking signal and a zeroing signal;
the RS232 is used for realizing the communication between the upper computer and the lower computer, and the mutual transmission of data between the two boards is realized through a circuit of converting UART into RS 422; the two plates respectively realize the running and stopping of the motor according to the received instructions;
the angle steering engine is used for controlling the lifting and falling of the writing pen;
the communication circuit is used for realizing the communication between the upper computer and the lower computer;
the software control module comprises a writing scheme module, an upper computer module and a lower computer module;
the writing scheme module comprises:
the Chinese character stroke mode design unit is used for combining strokes with an input mode realized by a handwriting board; the character model design unit is used for completing the writing task by a binary lattice recognition method, wherein the lattice of a Chinese character is a 36×36 matrix, and the distance of each dot is 1mm, namely the width of a pen point;
the character picture mode design unit is used for converting characters to be written by a user into a picture format, binarizing the picture to obtain a binary matrix of the whole picture, transmitting the matrix to a lower computer for processing, and scanning the next motor control strategy line by line as the first mode;
the upper computer platform design module comprises:
the parameter setting unit is used for selecting correct serial ports, baud rates and data bits;
the control panel unit is used for setting the reset rotating speed of the motor, manually controlling the motor and controlling the real-time rotating speed of the motor;
the analysis panel unit is used for taking the operation of the matrix, then analyzing the matrix to generate a binary lattice, and finally sending the binary lattice to the lower computer; the method mainly comprises the steps of analyzing a word to be written, generating data which can be identified by a lower computer and sending the data to the lower computer;
the user input unit is used for inputting Chinese characters, inputting pictures and inputting tablets, and the three input modes are all processing of the characters and the pictures;
the lower computer module is used for mainly completing configuration of each register, initialization of peripheral equipment, configuration of a system clock, overcurrent detection of current, motor parameter initialization and system parameter initialization;
the function sub-module can realize coordinate transformation, SVPWM generation, position detection and speed calculation;
the interrupt program is triggered by a timer, and the control of the motor is realized through the timer in the main interrupt program;
the serial port interrupt program realizes the independent movement of the motor and the action of the steering engine by processing the instruction of the upper computer;
the control algorithm module comprises an initializing population and a selecting variation probability;
initializing a population for determining an operation space of an algorithm;
the variation probability is selected to be used for optimizing the individuals in the space;
initializing the population includes:
the size of the population set in the algorithm is 30, then a group of random numbers A generated by a Monte Carlo sequence is a 30×1 matrix, in order to realize dimension expansion, the matrix A is transposed firstly, then the matrix A is multiplied by the transposed matrix A' to obtain a 30×30 matrix B as shown in the formula (4-6), and the matrix B is the initialized population;
Figure QLYQS_1
the selection of the mutation probability comprises the following steps:
dividing all fitness individuals into three parts according to the height by adopting a segmentation processing mode, and then selecting a mutation probability for each part to carry out mutation operation; this practice will largely preserve the good individuals in the population and may result in better individuals; the formula of mutation probability segmentation selection is shown as (4-7):
Figure QLYQS_2
wherein: pm1=0.6, pm2=0.05, pm3=0.001, bestfi is the fitness value of the best fitness individual in the population, fi is the fitness value of the individual to be mutated, and f31 and f32 are the fitness values of individuals with fitness values ranging from high to low at 1/3, 2/3, respectively.
CN202111143592.9A 2021-09-28 2021-09-28 Control system of writing robot Active CN113759806B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111143592.9A CN113759806B (en) 2021-09-28 2021-09-28 Control system of writing robot

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111143592.9A CN113759806B (en) 2021-09-28 2021-09-28 Control system of writing robot

Publications (2)

Publication Number Publication Date
CN113759806A CN113759806A (en) 2021-12-07
CN113759806B true CN113759806B (en) 2023-06-30

Family

ID=78797967

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111143592.9A Active CN113759806B (en) 2021-09-28 2021-09-28 Control system of writing robot

Country Status (1)

Country Link
CN (1) CN113759806B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112821813A (en) * 2021-01-27 2021-05-18 天津工业大学 Position-sensorless control device and method for double permanent magnet motors of five-bridge-arm inverter
CN113014152A (en) * 2021-04-08 2021-06-22 中国第一汽车股份有限公司 Dual-motor control system and method

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8664823B2 (en) * 2012-05-30 2014-03-04 GM Global Technology Operations LLC Magnetic barrier for minimizing demagnetization in bi-permanent magnet synchronous machines
CN103984327B (en) * 2014-05-29 2017-04-12 北京信息科技大学 Small digital actuator system based on fuzzy control
US9542037B2 (en) * 2015-03-08 2017-01-10 Apple Inc. Device, method, and user interface for processing intensity of touch contacts
CN105425979B (en) * 2015-10-30 2018-01-23 河南理工大学 The implementation method that robot humanoid writes
CN108595031A (en) * 2018-04-28 2018-09-28 北京奇禄管理咨询有限公司 A kind of processing method of dot matrix image data
CN110576439A (en) * 2019-09-04 2019-12-17 华南理工大学广州学院 Multi-control writing robot and control method thereof
CN110893621B (en) * 2019-12-16 2021-07-30 华南理工大学广州学院 Control method of control system of intelligent remote control writing robot
CN111475667A (en) * 2020-04-08 2020-07-31 西北农林科技大学 Mechanical arm regular script style calligraphy writing method based on handwritten Chinese characters
CN112925318A (en) * 2021-01-25 2021-06-08 西南交通大学 Calculation method applied to intelligent robot moving path

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112821813A (en) * 2021-01-27 2021-05-18 天津工业大学 Position-sensorless control device and method for double permanent magnet motors of five-bridge-arm inverter
CN113014152A (en) * 2021-04-08 2021-06-22 中国第一汽车股份有限公司 Dual-motor control system and method

Also Published As

Publication number Publication date
CN113759806A (en) 2021-12-07

Similar Documents

Publication Publication Date Title
EP0243925B1 (en) Instruction input system for electronic processor
EP0557320B1 (en) User interface having simulated devices
US6999061B2 (en) Electronic whiteboard system
EP0394614A2 (en) Advanced user interface
JPH07105316A (en) Handwritten-symbol recognition apparatus
WO2021013002A1 (en) Input method, apparatus, and program product
JP3353954B2 (en) Handwriting input display method and handwriting input display device
CN113759806B (en) Control system of writing robot
JP2001051787A (en) Method and device for selecting mark by using stroke on user interfacr
CN101763216A (en) Hand input method for Linux operational system
WO2014103775A1 (en) Information processing device, information processing method, and program storage medium
JPS6365151B2 (en)
JPS5935277A (en) Controlling method by real-time recognition of handwritten character pattern
JP4148867B2 (en) Handwriting processor
JPH08185545A (en) Method and device for generating image
JPH0782530B2 (en) Handwriting recognition device
JPH06231308A (en) Method and device for processing handwritten document
CN109271077B (en) Thermal infrared imager man-machine interaction method based on FPGA
JP2801593B2 (en) Handwriting input calculator
JPH07113951B2 (en) Character recognition result confirmation and correction processing method in drawing recognition processing
JPS61182185A (en) Device for recognizing hand-written character
JPH10320107A (en) Handwritten character input device having handwritten character recognizing function
JPS588343A (en) Data inputting method to cpu
JPH05143780A (en) Character recognizing device
JP2500418Y2 (en) Word processor

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
GR01 Patent grant
GR01 Patent grant