[go: up one dir, main page]

CN110286652B - Control system method based on H-BOT structure - Google Patents

Control system method based on H-BOT structure Download PDF

Info

Publication number
CN110286652B
CN110286652B CN201910533800.2A CN201910533800A CN110286652B CN 110286652 B CN110286652 B CN 110286652B CN 201910533800 A CN201910533800 A CN 201910533800A CN 110286652 B CN110286652 B CN 110286652B
Authority
CN
China
Prior art keywords
quadrant
arc
axis
interpolation
reversed
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
CN201910533800.2A
Other languages
Chinese (zh)
Other versions
CN110286652A (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.)
Xi'an Mailang Automation Co ltd
Original Assignee
Sichuan University of Science and Engineering
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 Sichuan University of Science and Engineering filed Critical Sichuan University of Science and Engineering
Priority to CN201910533800.2A priority Critical patent/CN110286652B/en
Publication of CN110286652A publication Critical patent/CN110286652A/en
Application granted granted Critical
Publication of CN110286652B publication Critical patent/CN110286652B/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/18Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
    • G05B19/41Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form characterised by interpolation, e.g. the computation of intermediate points between programmed end points to define the path to be followed and the rate of travel along that path
    • G05B19/4103Digital interpolation
    • 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/30Nc systems
    • G05B2219/34Director, elements to supervisory
    • G05B2219/34092Polar interpolation

Landscapes

  • Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Manufacturing & Machinery (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Numerical Control (AREA)

Abstract

本发明提供一种基于H‑BOT结构的控制系统方法,其包括控制模块、OLED模块、独立按键、步进电机,其中控制模块具有串口异步通讯、数据解析、G代码解析功能单元;控制模块的STEP、DIR引脚通过输入不同脉冲信号频率以及配置不同的状态值控制步进电机的正反转;控制模块通过其串口异步通讯接口与OLED模块和独立按键模块信号连接。本发明由于采用四象限圆弧插补设计,解决了圆弧插补不能跨象限的问题。

Figure 201910533800

The invention provides a control system method based on an H-BOT structure, which includes a control module, an OLED module, an independent button, and a stepping motor, wherein the control module has serial asynchronous communication, data analysis, and G code analysis functional units; STEP and DIR pins control the forward and reverse rotation of the stepper motor by inputting different pulse signal frequencies and configuring different state values; the control module is connected to the OLED module and the independent button module signal through its serial asynchronous communication interface. Since the invention adopts the design of four-quadrant circular arc interpolation, the problem that the circular arc interpolation cannot cross quadrants is solved.

Figure 201910533800

Description

Control system method based on H-BOT structure
Technical Field
The invention belongs to the field of numerical control open-loop control systems, and particularly relates to a control system method based on an H-BOT structure.
Background
The H-BOT structure converts a Cartesian coordinate system, a synchronous belt moves along with the rotation of two stepping motors, when the rotating directions of the left stepping motor and the right stepping motor are the same, an actuating mechanism moves towards an X axis, and when the two motors rotate in opposite directions, the actuating mechanism moves towards a Y axis. When both motors are rotating simultaneously, the torque of the stepper motor is greater than the torque generated by a single motor, improving motion response, and also reducing the weight of the stepper motor above the XY stage.
As shown in fig. 1, the movement principle of the stepping motor is as follows:
a moves along the reverse direction of B and moves towards the + Y axis;
a moves along the reverse direction and the forward direction and the negative Y axis;
a moves along the positive X axis;
a moves to the-X axis against B.
ΔX=1/2(ΔA+ΔB),ΔY=1/2(ΔA-ΔB) (1-1)
ΔA=ΔX+ΔY,ΔB=ΔX-ΔY (1-2)
Ordinary circular interpolation is used in the H-BOT structure, because the conversion of coordinates cannot realize the normal work of the circular interpolation. When the circular arc is interpolated, the calculation formulas of the adjacent circular arc interpolation in two quadrants are different, and the feeding directions are different, so that the problem of over-quadrant needs to be considered when the circular arc is interpolated in over-quadrant, otherwise, an error occurs during interpolation.
The mark of the circular arc passing through the quadrant is a moving point coordinate xi0 or y i0. Therefore, when performing the arc interpolation, the destination point, i.e., the change of the interpolation calculation, is required for each coordinate axis advance. (see for details analysis of symbol discrimination when quadrant is interpolated by comparing circular arc traces point by point-Wudasu)).
In the documents of motion control algorithm of a planar H-BOT mechanism, Dingyunjun and Arduino-based sketch robot design, only algorithm research of linear interpolation in an H-BOT structure can be found, a corresponding circular interpolation algorithm is not found, and for a two-axis open source numerical control system GRBL (G code interpreter), circular interpolation adopts an arc to approach a circular arc, so that an interpolation algorithm of circular interpolation across quadrants is urgently needed.
Disclosure of Invention
The invention aims to overcome the defects in the prior art, and provides a control system method based on an H-BOT structure, which can adopt a four-quadrant circular interpolation design, reduces the judgment of quadrants, makes the calculation codes simpler and more efficient, and solves the problem that the circular interpolation of the original design cannot cross the quadrants.
The invention adopts the following technical scheme:
a control system method based on an H-BOT structure comprises the following steps:
step 1, initializing the system, pressing a key, inputting data from a serial port to a control module, and enabling the OLED to enter a main interface of the system.
Step 2, the control module analyzes the data, including extracting floating point numbers starting from specified characters in the character string, stopping when non-numeric characters are encountered, and assigning values to double-precision floating point numbers; the control module analyzes the G code.
Step 3, the control module judges motion control or steering engine control according to the input instruction;
if the motion control is adopted, calculating the pulse frequency;
if the interpolation is linear interpolation, the stepping motor is controlled to move to a designated position, and the control module, namely the lower computer returns data to the upper computer through a serial port.
If the interpolation is circular interpolation, the stepping motor is controlled to move to a designated position, and the control module, namely the lower computer returns data to the upper computer through a serial port.
The further technical scheme of the invention is that the control system of the H-BOT structure comprises: a control module, an OLED module, an independent key and a stepping motor,
the control module is provided with a serial port asynchronous communication, data analysis and G code analysis functional unit;
the STEP and DIR pins of the control module control the positive and negative rotation of the stepping motor by inputting different pulse signal frequencies and configuring different state values;
the control module is in signal connection with the OLED module and the independent key module through serial asynchronous communication interfaces of the control module.
The invention has the beneficial effects that:
the invention is suitable for control systems such as plotters, engraving machines, 3D printers and plotters. In particular to a set of control system which can normally realize interpolation motion in an XY plane coordinate system by adopting a mechanism with an H-BOT structure.
The control system ingeniously solves the embarrassing situation that the conventional H-BOT structure cannot directly adopt a circular interpolation algorithm, so that the algorithm is more optimized, the response time is prolonged, and the control system has a wide application prospect in the H-BOT structure control system.
Drawings
FIG. 1 background of the invention reference figure (schematic mechanical movement of H-BOT structure);
FIG. 2 is a control system flow diagram;
FIG. 3 is a linear interpolation plot in the first and second quadrants;
FIG. 4 is a pulse feed pattern for a linear interpolation;
FIG. 5 is a flowchart of a linear interpolation process;
FIG. 6 is an error analysis diagram of a linear interpolation;
FIG. 7 is a modified flow chart of linear interpolation;
FIG. 8 is a first quadrant down-the-arc pulse feed pattern;
FIG. 9 is a flow chart of a first quadrant forward and reverse circular arc interpolation pulse;
FIG. 10 is a flow chart of the first and second quadrant forward and reverse circular arc interpolation pulses;
FIG. 11 is a four-quadrant forward and reverse circular interpolation pulse feed pattern;
FIG. 12 is a flow chart of a general circular interpolation design;
FIG. 13 is a flow chart of modified circular interpolation;
FIG. 14 is a linear interpolation image of the first quadrant;
FIG. 15 is a linear interpolation image of the second quadrant;
FIG. 16 is a third quadrant linear interpolation image;
FIG. 17 is a fourth quadrant linear interpolation image;
FIG. 18 is a clockwise interpolation image spanning one and four quadrants;
FIG. 19 is a diagram of a counterclockwise interpolation image spanning one and two quadrants;
FIG. 20 is a clockwise interpolation image spanning two and three quadrants;
FIG. 21 is a circular interpolation image of a full circle;
fig. 22 is a circular interpolation image in the first quadrant.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention are described below clearly and completely, and it is obvious that the described embodiments are some, not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Notation and terminology interpretation:
H-BOT: the synchronous belt transmission mechanism is simplified after Corexy;
an OLED: organic Light-Emitting diodes (OLEDs);
g code: the G code is an instruction in the numerical control program. Commonly referred to as G instructions. The fast positioning, the inverse circle interpolation, the forward circle interpolation, the middle point circular arc interpolation, the radius programming and the skip processing can be realized by using the G code;
l Xe |: the total number of steps the cutter should travel in the X-axis direction;
i Ye i: the total number of steps the cutter should travel in the Y-axis direction;
f: a deviation value;
when the linear interpolation starts, F is equal to 0,
when the moving point passes through the coordinate axis, when Xc is 0 and Yc >0, the moving point passes through the positive half axis of the Y axis, and the rest is analogized in turn.
For convenience of description, some symbols are first defined as follows:
l: a straight line;
SR: following a circular arc;
NR: reverse circular arc;
number of subscript: quadrant of curve:
l1, L2, L3 and L4: quadrant 1, 2, 3, and 4 straight lines;
SR1, SR2, SR3, and SR 4: quadrants 1, 2, 3 and 4 follow the arc;
NR1, NR2, NR3 and NR 4: quadrants 1, 2, 3 and 4 are the inverse arcs.
Fi+1=Fi-2|Yi|+1
Fi+1=Fi+2|Xi|+1
Fi+1=Fi-2|Xi|+1
Fi+1=Fi+2|Yi|+1。
FiIs the interpolated deviation value, Xi,YiIs the coordinate of the moving point. Calculating deviation value to judge the next step Fi+1Direction of circular interpolation.
The system structure for implementing the invention needs to have the following functions:
the invention mainly realizes serial asynchronous communication, OLED display, independent key, serial data analysis, G code analysis, forward and reverse rotation of a stepping motor, linear interpolation and circular interpolation cross-quadrant.
(1) The serial port asynchronous communication is mainly used for completing real-time data transmission from the upper computer to the lower computer, the lower computer analyzes and executes movement by receiving the data of the upper computer, and specific parameters are returned after the movement is completed;
the USART serial communication is asynchronous communication configured through STM32, and data transmission between the upper computer and the lower computer is realized.
(2) The display module displays the current target position coordinate and the last state position coordinate, provides a human-computer interaction interface and can realize real-time monitoring on drawing;
the OLED display realizes a human-computer interaction interface on the singlechip through a 4-wire SPI communication interface.
(3) And independent keys are used for scanning whether the keys are pressed down or not, flag bits are set, if the conditions are met, the system is entered for drawing, and if not, the system exits from the drawing and waits for starting.
The independent key realizes the start-stop mode of the system through the selection of the key.
(4) And (3) data analysis, namely extracting floating point numbers starting from specified characters in the character string, stopping when non-numeric characters are encountered, and assigning values to double-precision floating point numbers.
The data analysis is to analyze the serial port data sent by the upper computer into corresponding specific numerical values.
(5) And G code analysis, wherein different state values are set according to the read G code, and the different state values are used for selecting the working modes of the following linear interpolation and circular interpolation.
(6) The normal operation of the stepping motor needs an annular distribution circuit and a pulse amplification circuit, but the driving module of the stepping motor adopted by the invention can automatically generate four paths of driving circuit signals only by inputting one pulse signal. Therefore, the purposes of forward and reverse rotation and speed regulation are achieved by configuring different state values of the DIR pin and the frequency of the pulse signals connected with the DIR of the A4988 module.
The stepping motor is controlled by setting the received G code into different state values, assigning coordinate values and selecting different motion modes.
(7) The invention adopts the optimization algorithm of the linear interpolation, and reduces the bytes occupied by the linear interpolation program in the singlechip.
(8) Circular interpolation, traditional circular interpolation can only accomplish circular interpolation in single quadrant, and this design adopts four-quadrant circular interpolation, has solved the problem that circular interpolation can not stride the quadrant.
A control system method based on an H-BOT structure is characterized by comprising the following steps:
step 1, initializing the system, pressing a key, inputting data from a serial port to a control module, and enabling the OLED to enter a main interface of the system.
Step 2, the control module analyzes the data, including extracting floating point numbers starting from specified characters in the character string, stopping when non-numeric characters are encountered, and assigning values to double-precision floating point numbers; the control module analyzes the G code.
Step 3, the control module judges motion control or steering engine control according to the input instruction;
if the linear interpolation is used in motion control, the pulse frequency is calculated, the stepping motor is controlled to move to a specified position, and the control module, namely the lower computer returns data to the upper computer through a serial port.
The linear interpolation algorithm is an interpolation method which adopts a small line segment to approach a large line segment. Any numerical control system has the capability of processing straight lines in different quadrants, firstly needs to determine four quadrants executed by interpolation, and then executes different interpolation schemes in different judged quadrants.
a. Optimization scheme of linear interpolation:
first, some symbols are defined as follows:
l: a straight line;
number of subscript: the quadrant where the curve is located;
l1, L2, L3 and L4: are quadrant 1, 2, 3 and 4 straight lines, respectively;
linear interpolation of the second quadrant
As shown in fig. 3, when the straight line is in quadrant 2, 3 or 4, the interpolation formula of the straight line in quadrant 1, which is symmetrical to the straight line, can be used for calculation, and only different feeding directions are used according to different quadrants.
That is, the interpolation problem of the 2 nd, 3 rd and 4 th quadrant straight lines can be reduced to the interpolation problem of the 1 st quadrant straight line symmetrical thereto.
The following table shows the interpolation feed direction and the interpolation calculation formula of four quadrant lines
Figure BDA0002100557690000061
Figure BDA0002100557690000071
Fig. 5 shows a flowchart of the linear interpolation process in the four quadrants, according to the table above and fig. 4.
The process of the point-by-point comparison linear interpolation mainly comprises four processes of deviation judgment, coordinate feeding, new deviation calculation and end point judgment. The flow shown in fig. 5 is to calculate the total steps Σ to be taken for X, Y coordinate axes. And feeding the X axis and the Y axis by judging the positive and negative of the deviation value F, wherein the negative value of the coordinate feeding is obtained by deviation calculation and table lookup, and finally when sigma is 0, the interpolation is finished.
As shown in fig. 6(a) and 6(b), fig. 6(a) and 6(b) illustrate that if the relative coordinates (Xe, Ye) are (0,4) and the first pass is uniformly determined in the X-axis feed direction, there is an error of root number 2 between (0,4) and (1,3) after the interpolation is completed, the Y-axis feed may be performed first after the determination of | Ye | > | Xe | is completed, and the same applies to (4, 0).
However, the above calculation concept has a disadvantage that if the cutting is performed in the X-axis direction uniformly when F is 0, the error ratio is large for the line of | Ye | > | Xe |, and the maximum error can be reached
Figure BDA0002100557690000072
Equivalent of one pulse. If we agree to feed uniformly in the Y-axis direction when F is 0, the error is also large for the line | Xe | > | Ye |, and the maximum can be reached similarly
Figure BDA0002100557690000073
Equivalent of one pulse.
In order to compensate for the above algorithm, assuming that the initial offset value F is 0, the error may be increased whether the first feed to the X axis or the Y axis is agreed.
In order to reduce the error, when F is 0, the process should be performed according to the specific situation of the straight line.
The method comprises the following steps that firstly, one step is appointed to be carried out in the Y-axis direction for a straight line of Ye | > | Xe |;
② for the straight line of | Xe | > | Ye |, one step is agreed to be taken in the X-axis direction.
The linear interpolation flow chart designed according to the improved algorithm is shown in fig. 7.
FIG. 7 is a process of determining the magnitude of | Ye | and | Xe | added to FIG. 5, wherein the total number of steps Σ taken by two coordinate axes is calculated X, Y, the magnitude of | Ye | and | Xe | is determined, and feeding of the X-axis and the Y-axis is performed by determining the positive and negative of the deviation value F, wherein the negative of the coordinate feeding is obtained by deviation calculation and table lookup;
in the case where F is 0, the following process should be performed according to the specific case of the straight line:
the method comprises the following steps that firstly, one step is appointed to be carried out in the Y-axis direction for a straight line of Ye | > | Xe |;
② for a straight line of | Xe | > | Ye |, it is agreed to go one step in the X-axis direction, and finally when Σ is 0, the interpolation is completed.
Simulation test
The simulation test environment is Matlab, linear interpolation of four quadrants is tested, F is 0, the initial state of the linear interpolation is obtained, and an initial feeding direction is given by comparing the X and Y feeding sizes of the absolute coordinates of the target.
As shown in fig. 14, in the first quadrant linear interpolation, the input end point abscissa X, Xe, the output end point coordinate Y, Ye, and h are 100, 30, and 4, respectively.
As shown in fig. 15, in the second quadrant linear interpolation, the input end point coordinate X, Xe, the input end point ordinate Y, Ye, and h are-30, 45, and 1, respectively.
As shown in fig. 16, in the third quadrant linear interpolation, the input end point abscissa X, Xe, the input end point ordinate Y, Ye, and the input step h are 90, 37, and 3, respectively.
As shown in fig. 17, in the fourth quadrant linear interpolation, the end point abscissa X is input, Xe is-39, the end point ordinate Y is input, Ye is-44, and the input step h is 1.
If the interpolation is circular interpolation, the stepping motor is controlled to move to a designated position, and the detection module returns data to the control module through the serial port.
Aiming at circular interpolation in four quadrants, firstly, analyzing the problem of circular arc trend of a first quadrant along a circular arc in the circular interpolation process except the quadrant problem.
A first quadrant is provided following the arc SE, as shown in fig. 8.
The deviation calculation formula is as follows:
Figure BDA0002100557690000081
the direction of movement of the tool is
Feeding one step to the-Y direction when the moving point is on the circular arc or in the area outside the circular arc;
and secondly, when the moving point is in the area inside the arc, feeding one step in the + X direction.
Discretizing the deviation value calculation formula to obtain the following calculation table:
Figure BDA0002100557690000082
summarizing the conditions of the forward arc and the reverse arc of the first quadrant as follows:
Figure BDA0002100557690000091
comparing these two cases, two features can be found:
(ii) when X, Y is reversed, the feeding direction of SR1 is changed to the feeding direction of NR 1; also the feed direction of NR1 is changed to the feed direction of SR 1.
X, Y is exchanged, the deviation calculation formula of SR1 is converted into a deviation calculation formula of NR 1; also the deviation calculation formula of NR1 is converted into a deviation calculation formula of SR 1.
The interpolation problem of the second, third and fourth quadrant forward circular arcs can be converted into the interpolation problem of the first quadrant reverse circular arc, and the conversion method comprises the following steps:
exchanging X, Y coordinates of the starting point of the circular arc to serve as the starting point of the inverse circular arc of the first quadrant;
the X, Y coordinates of the arc end point are exchanged to be used as the end point of the inverse arc of the first quadrant;
performing interpolation operation on the first quadrant inverse circular arc obtained by conversion:
when the calculation result is-X direction movement, an actual control signal in-Y direction is sent out;
when the calculation result is + Y direction movement, sending out an actual control signal in the + X direction;
symmetry of different quadrant circular interpolation
By analyzing arcs of different directions in other quadrants in a similar manner, the feed direction and deviation calculation formula is shown in fig. 11 and the following table:
(1) SR1 → NR2 (X-axis reversal);
SR1 → NR4 (Y-axis reversal);
SR1 → SR3(X and Y axes are reversed at the same time);
NR1 → SR2 (X-axis reversal);
NR1 → SR4 (Y-axis reversal);
NR1 → NR3 (X-axis, Y-axis are reversed at the same time);
(2) SR1 → NR1(X, Y for exchange);
NR1 → SR1(X, Y exchange);
Figure BDA0002100557690000101
its features can be summarized as follows:
(1) SR1 → NR2 (X-axis reversal);
SR1 → NR4 (Y-axis reversal);
SR1 → SR3(X and Y axes are reversed at the same time);
the deviation calculation formulas of the four line types of SR1, NR2, SR3 and NR4 are the same.
NR1 → SR2 (X-axis reversal);
SR1 → SR4 (Y-axis reversal);
SR1 → NR3 (X-axis, Y-axis are reversed at the same time);
the formulas for calculating the deviations of the four line types NR1, SR2, NR3 and SR4 are also the same.
(2) SR1 → NR1(X, Y for exchange);
NR1 → SR1(X, Y exchange);
it can be seen that by switching the X, Y signal and changing the feeding direction, the arc interpolation motion of different directions of each quadrant can be completed by performing the interpolation calculation of the arc following the first quadrant or the interpolation calculation of the arc reversing the first quadrant. The flow chart corresponding to the above table is shown in fig. 12.
Explanation of four-quadrant circular interpolation
Aiming at the phenomenon that the circular arc crosses a quadrant and enters and exits from the original four-quadrant interpolation, after the coordinate of an H-Bot structure is converted, the recorded position often has the characteristic of trans-quadrant, and the four-quadrant circular interpolation cannot meet the requirement.
The straight line can only be in one quadrant, so there is no over-quadrant problem. However, the arc may span several quadrants, and corresponding processing is required at the junction of two quadrants, which is the problem of the arc crossing the quadrants.
When the circular arc passes through the quadrant, the device has the following characteristics:
firstly, before and after passing through a quadrant, the sign of a moving point coordinate is changed;
and ② after passing through the quadrant, the trend of the arc is unchanged.
The sequence of the inverse circular arc passing through the quadrant is as follows: NR1 → NR2 → NR3 → NR4 → NR1 → ·
The sequence of passing through the quadrants along the circular arc is as follows: SR1 → SR4 → SR3 → SR2 → SR1 → · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · → SR's → SR4 → SR 3526 → SR2 → SR
And thirdly, the quadrant-passing circular arc and the coordinate axis have intersection points, and when the moving point is on the coordinate axis, a coordinate value is zero. This point may be used as a sign of over-quadrant.
And fourthly, judging the end point, wherein the three methods cannot be directly used simply, and otherwise, a part of circular arc outline is lost.
The three methods are respectively as follows:
1. determining the distance of the moving point from the centre of the circle, i.e.
Figure BDA0002100557690000111
2. In the ordinary circular interpolation of the judgment quadrant,
Fi+1=Fi-2Yi+1
Fi+1=Fi+2Xi+1
3. by using the novel circular interpolation of symmetry,
Fi+1=Fi-2|Yi|+1
Fi+1=Fi+2|Xi|+1
Fi+1=Fi-2|Xi|+1
Fi+1=Fi+2|Yi|+1
according to the idea of circular interpolation mentioned in the theory of linear and circular interpolation across arbitrary quadrants research and trajectory simulation-Wangweig, only the number of intersection points between the circular arc at the starting point of the circular interpolation and the circular arc at the end point needs to be judged for several times. The invention does not need to carry out the judgment, judges the quadrant where the moving point is positioned again after each interpolation is finished, and can skillfully avoid calculating the number of intersection points of the circular arc and the coordinate axis.
The process of the circular interpolation across quadrants can be completed only by continuously judging the quadrant of the moving point in the process of the circular interpolation and then carrying out the ordinary circular interpolation program. One of the difficulties is how to judge the coordinate system where the next movement trend of the moving point is when the moving point moves on the coordinate axis, and the following conclusions can be drawn because the movement trends of the forward and backward arcs are different. If it is on the coordinate axis, then,
clockwise arc:
if (Xc ═ 0& & Yc >0) motion trend is the first quadrant
if (Xc >0& & Yc ═ 0) motion trend is fourth quadrant
if (Xc ═ 0& & Yc <0) motion trend is the third quadrant
if (Xc <0& & Yc ═ 0) motion trend is the second quadrant
Counterclockwise arc:
if (Xc ═ 0& & Yc >0) motion trend is the second quadrant
if (Xc <0& & Yc ═ 0) motion trend is the third quadrant
if (Xc ═ 0& & Yc <0) motion trend is the fourth quadrant
if (Xc >0& & Yc ═ 0) motion trend is the first quadrant
The method avoids sacrificing the calculation time of the floating point number of the singlechip. Compared with the interpolation algorithm mentioned in the literature of 'any quadrant crossing linear and circular interpolation principle research and track simulation' adopted before, the method is simpler and faster.
The invention receives and analyzes a sentence of G code to execute, and executes an interpolation process after the sentence of G code is analyzed. The stm32 single chip microcomputer is a 32-bit microcontroller with ARM core-M3 as a carrier, is an MCU with the highest operation speed except a DSP in the same price, and can meet the normal working requirement.
Simulation environment Matlab, circular interpolation data content:
as shown in fig. 18, the input end point abscissa Xc, Xc is 70, the input end point ordinate Yc, Yc is 71, the input end point abscissa X, Xt is 56, the input end point ordinate Y, Yt is-82, the input bsiscw 0- > clockwise, 1- > counterclockwise, bsisccw is 0, and the step length is 227.
As shown in fig. 19, across the first and second quadrants, the input end abscissa Xc, Xc is 70, the input end ordinate Yc, Yc is 71, the input end abscissa X, Xt is-94, the input end ordinate Y, Yt is 34, the input bsicw 0- > clockwise 1- > counterclockwise, bsicw 1, and the step length is 259.
As shown in fig. 20, in the interpolation of the optimal arc, the end point abscissa Xc, Xc-59, the end point ordinate Yc, Yc-81, the end point abscissa X, Xt-94, the end point ordinate Y, Yt-34, the input bsiscw 0- > clockwise 1- > counterclockwise, bsiscw 1, and the step 644.
As shown in fig. 21, in the round interpolation, the input end point abscissa Xc, Xc equals 100, the input end point ordinate Yc, Yc equals 0, the input end point abscissa X, Xt equals 100, the input end point ordinate Y, Yt equals 0, the input bsiscw 0- > clockwise 1- > counterclockwise, bsiscw equals 0, and the step size equals 800.
As shown in fig. 22, 1/4 is interpolated by circular interpolation, where the input end point abscissa Xc, Xc is 100, the input end point ordinate Yc, Yc is 0, the input end point abscissa X, Xt is 0, the input end point ordinate Y, Yt is 100, the input bsicw 0- > clockwise 1- > counterclockwise, bsicw 1, and the step size is 200.
The further technical scheme of the invention is that the control system of the H-BOT structure comprises: the control module, the OLED module, the independent keys and the stepping motor;
the control module is provided with a serial port asynchronous communication, data analysis and G code analysis functional unit;
the DIR pin of the control module controls the positive and negative rotation of the stepping motor by inputting different pulse signal frequencies and configuring different state values;
the control module is in signal connection with the OLED module and the independent key module through serial asynchronous communication interfaces of the control module.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (1)

1.一种基于H-BOT结构的控制系统方法,其特征在于,包括以下步骤:1. a control system method based on H-BOT structure, is characterized in that, comprises the following steps: 步骤1.系统初始化设置,按下按键,从串口输入数据至控制模块,使OLED进入系统主界面;Step 1. System initialization settings, press the button, input data from the serial port to the control module, and make the OLED enter the main interface of the system; 步骤2.控制模块对数据进行解析,包括提取字符串内指定字符开始的浮点数字,遇到非数字字符停止,并赋值给双精度浮点数value;控制模块对G代码进行解析;Step 2. The control module parses the data, including extracting the floating-point number starting with the specified character in the string, stopping when it encounters a non-numeric character, and assigning it to the double-precision floating-point value; the control module parses the G code; 步骤3.控制模块根据输入的指令,判断运动控制或舵机控制;Step 3. The control module judges motion control or steering gear control according to the input command; 若为运动控制,则控制模块计算脉冲频率;If it is motion control, the control module calculates the pulse frequency; a.若为直线插补时,则控制步进电机运动到指定位置,并由控制模块即下位机通过串口返回数据至上位机;a. In the case of linear interpolation, the stepper motor is controlled to move to the specified position, and the control module, that is, the lower computer, returns the data to the upper computer through the serial port; 直线插补具体为:The linear interpolation is specifically: 控制模块确定起点坐标和终点坐标,再计算好X、Y两坐标轴所要走的总步数∑和判断|Ye|与|Xe|的大小,通过判断偏差值F的正负来进行X轴和Y轴的进给,其中通过偏差计算和查表得到坐标进给的方向;The control module determines the coordinates of the starting point and the ending point, and then calculates the total number of steps to be taken on the X and Y coordinate axes ∑ and judges the sizes of |Ye| and |Xe| The feed of the Y-axis, in which the direction of the coordinate feed is obtained through deviation calculation and table look-up; 对于F=0的情况,根据直线的具体情况,分别进行处理:For the case of F=0, according to the specific situation of the straight line, it is processed separately: ①对于|Ye|>|Xe|的直线,约定在Y轴方向走一步;①For the line of |Ye|>|Xe|, it is agreed to take one step in the Y-axis direction; ②对于|Xe|>|Ye|的直线,则约定在X轴方向走一步,最终当∑=0时,插补完成;②For the straight line of |Xe|>|Ye|, it is agreed to take one step in the X-axis direction, and when ∑=0, the interpolation is completed; b.若为圆弧插补,则控制步进电机运动至指定位置,并由控制模块即下位机通过串口返回数据至上位机;b. If it is circular interpolation, control the stepper motor to move to the specified position, and the control module, that is, the lower computer, returns the data to the upper computer through the serial port; 针对四个象限中的圆弧插补,首先分析第一象限顺圆弧在圆弧插补过程中,除象限问题外,还有圆弧走向问题;Aiming at the circular interpolation in the four quadrants, firstly analyzes that in the circular interpolation process of the first quadrant, in addition to the quadrant problem, there is also the circular arc direction problem; 设有第一象限顺圆弧SE:With the first quadrant arc SE: 偏差计算公式为:The formula for calculating the deviation is:
Figure FDA0003122752020000011
Figure FDA0003122752020000011
刀具移动方向为:The tool moving direction is: ①当动点在圆弧上或在圆弧外侧区域时,向-Y方向进给一步;① When the moving point is on the arc or in the outer area of the arc, feed one step in the -Y direction; ②当动点在圆弧内侧区域时,向+X方向进给一步;② When the moving point is in the inner area of the arc, feed one step in the +X direction; ③将偏差值计算公式离散化:③ Discretize the calculation formula of deviation value: 对比这两种情况,发现两个特点:Comparing these two cases, two characteristics are found: 将X、Y对调,则SR1的进给方向就转变为NR1的进给方向;同样NR1的进给方向转变为SR1的进给方向;Swap X and Y, then the feed direction of SR1 is changed to the feed direction of NR1; the same feed direction of NR1 is changed to the feed direction of SR1; 将X、Y对调,则SR1的偏差计算公式就转变为NR1的偏差计算公式;同样NR1的偏差计算公式转变为SR1的偏差计算公式;Swap X and Y, then the deviation calculation formula of SR1 will be transformed into the deviation calculation formula of NR1; the same deviation calculation formula of NR1 will be transformed into the deviation calculation formula of SR1; 第二、三、四象限顺圆弧的插补问题转换为第一象限逆圆弧的插补问题,转换方法如下:The interpolation problem of the second, third and fourth quadrant arcs is converted into the interpolation problem of the first quadrant inverse arc, and the conversion method is as follows: ③将圆弧起点的X、Y坐标对调,作为第一象限逆圆弧的起点;③ Swap the X and Y coordinates of the starting point of the arc as the starting point of the inverse arc in the first quadrant; 再将圆弧终点的X、Y坐标对调,作为第一象限逆圆弧的终点;Then swap the X and Y coordinates of the arc end point as the end point of the inverse arc in the first quadrant; ④对转换得到的第一象限逆圆弧进行插补运算:④ Interpolate the inverse arc of the first quadrant obtained by conversion: 当计算结果为-X方向运动时,发出-Y方向的实际控制信号;When the calculation result is movement in the -X direction, the actual control signal in the -Y direction is sent out; 当计算结果为+Y方向运动时,发出+X方向的实际控制信号;When the calculation result is movement in the +Y direction, the actual control signal in the +X direction is sent out; 采用不同象限圆弧插补的对称性方法对其它象限中不同走向的圆弧进行分析,则其进给方向和偏差计算公式的情况:Using the symmetry method of circular arc interpolation in different quadrants to analyze arcs with different directions in other quadrants, the feed direction and deviation calculation formulas are as follows: (1)SR1→NR2,X轴反向;(1) SR1→NR2, the X axis is reversed; SR1→NR4,Y轴反向;SR1→NR4, Y-axis is reversed; SR1→SR3,X轴、Y轴同时反向;SR1→SR3, X axis and Y axis are reversed at the same time; NR1→SR2,X轴反向;NR1→SR2, the X axis is reversed; NR1→SR4,Y轴反向;NR1→SR4, Y-axis is reversed; NR1→NR3,X轴、Y轴同时反向;NR1→NR3, X axis and Y axis are reversed at the same time; (2)SR1→NR1,X、Y对调;(2) SR1→NR1, X and Y are swapped; NR1→SR1,X、Y对调;NR1→SR1, X, Y swap; 其特点归结如下:Its characteristics are summarized as follows: (1)SR1→NR2,X轴反向;(1) SR1→NR2, the X axis is reversed; SR1→NR4,Y轴反向;SR1→NR4, Y-axis is reversed; SR1→SR3,X轴、Y轴同时反向;SR1→SR3, X axis and Y axis are reversed at the same time; SR1、NR2、SR3和NR4这四种线型的偏差计算公式都相同;The deviation calculation formulas of the four line types SR1, NR2, SR3 and NR4 are the same; NR1→SR2,X轴反向;NR1→SR2, the X axis is reversed; SR1→SR4,Y轴反向;SR1→SR4, Y-axis is reversed; SR1→NR3,X轴、Y轴同时反向;SR1→NR3, the X axis and the Y axis are reversed at the same time; NR1、SR2、NR3和SR4这四种线型的偏差计算公式也都相同;The deviation calculation formulas of the four line types NR1, SR2, NR3 and SR4 are also the same; (2)SR1→NR1,X、Y对调;(2) SR1→NR1, X and Y are swapped; NR1→SR1,X、Y对调;NR1→SR1, X, Y swap; 通过对调X、Y信号和改变进给方向,各个象限不同走向的圆弧插补运动都通过进行第一象限顺圆弧的插补计算或第一象限逆圆弧的插补计算来完成;针对圆弧过象限,与原有四象限插补具有出入,H-Bot结构在坐标转换后,记录的位置常常具有跨象限的特征,四象限圆弧插补不能满足要求;By reversing the X and Y signals and changing the feed direction, the circular interpolation movements of each quadrant with different directions are completed by performing the interpolation calculation of the first quadrant forward circular arc or the first quadrant reverse circular arc; The arc crosses the quadrants, which is different from the original four-quadrant interpolation. After the coordinate conversion of the H-Bot structure, the recorded position often has the characteristics of crossing the quadrants, and the four-quadrant arc interpolation cannot meet the requirements; 当圆弧过象限时,具有如下特点:When the arc passes through the quadrant, it has the following characteristics: ⑤在过象限前后,动点坐标的符号会发生改变;⑤ Before and after the quadrant, the symbol of the moving point coordinates will change; ⑥在过象限后,圆弧的走向不变;⑥After passing through the quadrant, the direction of the arc remains unchanged; 逆圆弧过象限的顺序为:NR1→NR2→NR3→NR4→NR1→···The sequence of inverse arc passing through the quadrants is: NR1→NR2→NR3→NR4→NR1→... 顺圆弧过象限的顺序为:SR1→SR4→SR3→SR2→SR1→···The sequence of passing the quadrant along the arc is: SR1→SR4→SR3→SR2→SR1→... ⑦过象限圆弧与坐标轴必有交点,当动点处在坐标轴上时必有一个坐标值为零,此点作为过象限的标志;⑦ There must be an intersection between the quadrant arc and the coordinate axis. When the moving point is on the coordinate axis, there must be a coordinate value of zero, and this point is used as the sign of the quadrant; ⑧终点判别不能简单地直接使用下述的三种方法,否则将丢失一部分圆弧轮廓;⑧ The following three methods cannot be simply used for end point discrimination, otherwise part of the arc outline will be lost; 三种方法分别为:The three methods are: a.判断动点与圆心的距离,即a. Determine the distance between the moving point and the center of the circle, namely
Figure FDA0003122752020000031
Figure FDA0003122752020000031
b.普通的判断象限的圆弧插补,b. Ordinary judging quadrant circular interpolation, Fi+1=Fi-2Yi+1F i+1 = F i -2Y i +1 Fi+1=Fi+2Xi+1F i+1 = F i +2X i +1 c.利用对称性的新型圆弧插补,c. New circular interpolation using symmetry, Fi+1=Fi-2|Yi|+1F i+1 =F i -2|Y i |+1 Fi+1=Fi+2|Xi|+1F i+1 = F i +2|X i |+1 Fi+1=Fi-2|Xi|+1F i+1 =F i -2|X i |+1 Fi+1=Fi+2|Yi|+1F i+1 = F i +2|Y i |+1 判断刀具移动方向,直到动点坐标与目标终点相同时终止;Judge the moving direction of the tool until the coordinates of the moving point are the same as the target end point; 若经过坐标轴,则If passing through the coordinate axis, then 顺时针圆弧时:For a clockwise arc: if(Xc==0&&Yc>0)运动趋势是第一象限,If (Xc==0&&Yc>0) the movement trend is the first quadrant, if(Xc>0&&Yc==0)运动趋势是第四象限,If (Xc>0&&Yc==0) the movement trend is the fourth quadrant, if(Xc==0&&Yc<0)运动趋势是第三象限,If (Xc==0&&Yc<0) the movement trend is the third quadrant, if(Xc<0&&Yc==0)运动趋势是第二象限,If (Xc<0&&Yc==0) the movement trend is the second quadrant, 直到∑=0终止;until ∑ = 0 terminates; 或逆时针圆弧:or a counterclockwise arc: if(Xc==0&&Yc>0)运动趋势是第二象限,If (Xc==0&&Yc>0) the movement trend is the second quadrant, if(Xc<0&&Yc==0)运动趋势是第三象限,If (Xc<0&&Yc==0) the movement trend is the third quadrant, if(Xc==0&&Yc<0)运动趋势是第四象限,If (Xc==0&&Yc<0) the movement trend is the fourth quadrant, if(Xc>0&&Yc==0)运动趋势是第一象限,If (Xc>0&&Yc==0) the movement trend is the first quadrant, 直到∑=0终止。until Σ=0 terminates.
CN201910533800.2A 2019-06-19 2019-06-19 Control system method based on H-BOT structure Active CN110286652B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910533800.2A CN110286652B (en) 2019-06-19 2019-06-19 Control system method based on H-BOT structure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910533800.2A CN110286652B (en) 2019-06-19 2019-06-19 Control system method based on H-BOT structure

Publications (2)

Publication Number Publication Date
CN110286652A CN110286652A (en) 2019-09-27
CN110286652B true CN110286652B (en) 2021-08-27

Family

ID=68004351

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910533800.2A Active CN110286652B (en) 2019-06-19 2019-06-19 Control system method based on H-BOT structure

Country Status (1)

Country Link
CN (1) CN110286652B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111190659B (en) * 2019-12-09 2023-05-30 航天信息股份有限公司 Communication method and device of upper computer and transmission mechanism, electronic equipment and medium
CN111338399A (en) * 2019-12-12 2020-06-26 珠海博杰电子股份有限公司 A multi-axis motion control structure and its control method
CN111176482A (en) * 2019-12-12 2020-05-19 珠海博杰电子股份有限公司 Circular arc track interpolation method
CN112925268B (en) * 2021-01-27 2022-05-31 浙江工业大学 A high-performance cutting machine motion control system based on FPGA

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5216344A (en) * 1989-01-30 1993-06-01 Fanuc Ltd. Involute interpolation speed control system
CN104133424A (en) * 2014-08-19 2014-11-05 福州大学 Industrial robot linear interpolation method based on programmable logic controller
CN108594765A (en) * 2018-04-08 2018-09-28 哈尔滨理工大学 A kind of point-to-point comparison method plane and straight line interpolation computational methods

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1025974C (en) * 1989-08-24 1994-09-21 朱怀义 Method and equipment for machining taper by numerical control linear cutting
US6570890B1 (en) * 1998-06-10 2003-05-27 Merlot Communications Method for the transmission and control of audio, video, and computer data over a single network fabric using ethernet packets
CN102147599B (en) * 2011-03-30 2013-09-18 华南理工大学 Elliptic arc interpolation method
CN102354151B (en) * 2011-08-04 2013-06-05 浙江工业大学 Tangential following interpolation method applied to multilayer shoe leather numerical control cutting machine tool
CN104155916B (en) * 2014-07-16 2016-12-07 北京航空航天大学 A kind of high accuracy quickly space circular arc interpolation method
CN104191428B (en) * 2014-08-27 2016-04-27 深圳科瑞技术股份有限公司 A kind of motion trail planning method based on SCARA manipulator and system
CN104597848A (en) * 2014-12-30 2015-05-06 浙江中控研究院有限公司 State machine principle-based interpolation control method
CN107786138B (en) * 2017-10-30 2020-06-12 山东理工大学 Linear Interpolation Control Method for Non-Orthogonal Axis Linkage Stepper Motor

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5216344A (en) * 1989-01-30 1993-06-01 Fanuc Ltd. Involute interpolation speed control system
CN104133424A (en) * 2014-08-19 2014-11-05 福州大学 Industrial robot linear interpolation method based on programmable logic controller
CN108594765A (en) * 2018-04-08 2018-09-28 哈尔滨理工大学 A kind of point-to-point comparison method plane and straight line interpolation computational methods

Also Published As

Publication number Publication date
CN110286652A (en) 2019-09-27

Similar Documents

Publication Publication Date Title
CN110286652B (en) Control system method based on H-BOT structure
CN102799145B (en) S-curve acceleration linear interpolation method adopting multi-period constant-acceleration transition for corner
CN106041928B (en) A kind of robot manipulating task task generation method based on part model
CN104678894B (en) Planing method, digital-control processing system and the method for Machining Path
CN107901039A (en) Python-based desktop-level robot offline programming simulation system
CN102722140A (en) Multi-period corner small straight-line segment interpolation method based on S curve acceleration/deceleration control
CN107908191A (en) The kinetic control system and method for a kind of series-parallel robot
CN102830658A (en) Embedded numerical control system for multi-shaft numerical control machine tool
CN104793568A (en) Multi-axle interpolation method
CN111722591A (en) A method of high-precision linkage interpolation for trademark die-cutting machine
CN112925268B (en) A high-performance cutting machine motion control system based on FPGA
CN115213898A (en) A Cartesian Space Trajectory Planning Method for Welding Robot Based on Inverse Solution Multi-objective Optimization
CN103394725B (en) A kind of drill carriage automatic punching method
CN102193530A (en) Numerical control system and control method based on dual-core architecture teamwork
CN103744354A (en) PLC control system for manufacturing robot, and control method thereof
CN103399515A (en) Point location motion controller
CN203872095U (en) Stepper motor control circuit in 3D printing
CN102880118A (en) Method for interpolating curve with variable interpolation cycle on basis of interpolation precision and limitation of accelerations
CN101477355A (en) Numerical control system used for miniature cutter
CN113946136B (en) Control method of numerical control system, numerical control system and device with storage function
JPS61160108A (en) Working control method of numerically controlled machine tool
CN117518995A (en) High-precision teaching reproduction method and system for five-axis machine tool
CN108267979A (en) A kind of control device and its control method for stewart platform
CN202608393U (en) Force sensing operation device for digital engraving machine
CN201645254U (en) A device for improving the feed motion accuracy of CNC machine tools in mass production through learning

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
TR01 Transfer of patent right

Effective date of registration: 20231121

Address after: Room 805, Building A, Yanxiang City Plaza, No. 56 Jinye 1st Road, High tech Zone, Xi'an City, Shaanxi Province, 710075

Patentee after: Xi'an Mailang Automation Co.,Ltd.

Address before: 643000 Room 415, Third Experimental Building, Sichuan University of Light Chemical Technology, No. 519 Huixing Road, Ziliujing District, Zigong City, Sichuan Province

Patentee before: Sichuan University of Science & Engineering

TR01 Transfer of patent right